' +
- 'Will update values for level and plugged when they change. If battery low and critical values are false, they will get updated in status box, but only once' +
- '' +
- '
Battery Low Tests
' +
- '
Will update value for battery low to true when battery is below 20%' +
- '' +
- '
Battery Critical Tests
' +
- ' Will update value for battery critical to true when battery is below 5%' +
- '';
-
- createActionButton('Add "batterystatus" listener', function () {
- addBattery();
- }, 'addBS');
- createActionButton('Remove "batterystatus" listener', function () {
- removeBattery();
- }, 'remBs');
- createActionButton('Add "batterylow" listener', function () {
- addLow();
- }, 'addBl');
- createActionButton('Remove "batterylow" listener', function () {
- removeLow();
- }, 'remBl');
- createActionButton('Add "batterycritical" listener', function () {
- addCritical();
- }, 'addBc');
- createActionButton('Remove "batterycritical" listener', function () {
- removeCritical();
- }, 'remBc');
-};
diff --git a/plugins/cordova-plugin-battery-status/www/battery.js b/plugins/cordova-plugin-battery-status/www/battery.js
deleted file mode 100644
index 242503d..0000000
--- a/plugins/cordova-plugin-battery-status/www/battery.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * This class contains information about the current battery status.
- * @constructor
- */
-var cordova = require('cordova'),
- exec = require('cordova/exec');
-
-var STATUS_CRITICAL = 5;
-var STATUS_LOW = 20;
-
-var Battery = function() {
- this._level = null;
- this._isPlugged = null;
- // Create new event handlers on the window (returns a channel instance)
- this.channels = {
- batterystatus:cordova.addWindowEventHandler("batterystatus"),
- batterylow:cordova.addWindowEventHandler("batterylow"),
- batterycritical:cordova.addWindowEventHandler("batterycritical")
- };
- for (var key in this.channels) {
- this.channels[key].onHasSubscribersChange = Battery.onHasSubscribersChange;
- }
-};
-
-function handlers() {
- return battery.channels.batterystatus.numHandlers +
- battery.channels.batterylow.numHandlers +
- battery.channels.batterycritical.numHandlers;
-}
-
-/**
- * Event handlers for when callbacks get registered for the battery.
- * Keep track of how many handlers we have so we can start and stop the native battery listener
- * appropriately (and hopefully save on battery life!).
- */
-Battery.onHasSubscribersChange = function() {
- // If we just registered the first handler, make sure native listener is started.
- if (this.numHandlers === 1 && handlers() === 1) {
- exec(battery._status, battery._error, "Battery", "start", []);
- } else if (handlers() === 0) {
- exec(null, null, "Battery", "stop", []);
- }
-};
-
-/**
- * Callback for battery status
- *
- * @param {Object} info keys: level, isPlugged
- */
-Battery.prototype._status = function (info) {
-
- if (info) {
- if (battery._level !== info.level || battery._isPlugged !== info.isPlugged) {
-
- if(info.level === null && battery._level !== null) {
- return; // special case where callback is called because we stopped listening to the native side.
- }
-
- // Something changed. Fire batterystatus event
- cordova.fireWindowEvent("batterystatus", info);
-
- if (!info.isPlugged) { // do not fire low/critical if we are charging. issue: CB-4520
- // note the following are NOT exact checks, as we want to catch a transition from
- // above the threshold to below. issue: CB-4519
- if (battery._level > STATUS_CRITICAL && info.level <= STATUS_CRITICAL) {
- // Fire critical battery event
- cordova.fireWindowEvent("batterycritical", info);
- }
- else if (battery._level > STATUS_LOW && info.level <= STATUS_LOW) {
- // Fire low battery event
- cordova.fireWindowEvent("batterylow", info);
- }
- }
- battery._level = info.level;
- battery._isPlugged = info.isPlugged;
- }
- }
-};
-
-/**
- * Error callback for battery start
- */
-Battery.prototype._error = function(e) {
- console.log("Error initializing Battery: " + e);
-};
-
-var battery = new Battery(); // jshint ignore:line
-
-module.exports = battery;
diff --git a/plugins/cordova-plugin-camera/CONTRIBUTING.md b/plugins/cordova-plugin-camera/CONTRIBUTING.md
deleted file mode 100644
index 4c8e6a5..0000000
--- a/plugins/cordova-plugin-camera/CONTRIBUTING.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-# Contributing to Apache Cordova
-
-Anyone can contribute to Cordova. And we need your contributions.
-
-There are multiple ways to contribute: report bugs, improve the docs, and
-contribute code.
-
-For instructions on this, start with the
-[contribution overview](http://cordova.apache.org/contribute/).
-
-The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
- - Run the tests so your patch doesn't break existing functionality.
-
-We look forward to your contributions!
diff --git a/plugins/cordova-plugin-camera/LICENSE b/plugins/cordova-plugin-camera/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/plugins/cordova-plugin-camera/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/NOTICE b/plugins/cordova-plugin-camera/NOTICE
deleted file mode 100644
index 8ec56a5..0000000
--- a/plugins/cordova-plugin-camera/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-camera/README.md b/plugins/cordova-plugin-camera/README.md
deleted file mode 100644
index e71e364..0000000
--- a/plugins/cordova-plugin-camera/README.md
+++ /dev/null
@@ -1,528 +0,0 @@
-
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-# cordova-plugin-camera
-
-This plugin defines a global `navigator.camera` object, which provides an API for taking pictures and for choosing images from
-the system's image library.
-
-Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Installation
-
-This requires cordova 5.0+
-
- cordova plugin add cordova-plugin-camera
-Older versions of cordova can still install via the __deprecated__ id
-
- cordova plugin add org.apache.cordova.camera
-It is also possible to install via repo url directly ( unstable )
-
- cordova plugin add https://github.com/apache/cordova-plugin-camera.git
-
-
-## How to Contribute
-
-Contributors are welcome! And we need your contributions to keep the project moving forward. You can [report bugs](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Camera%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC), improve the documentation, or [contribute code](https://github.com/apache/cordova-plugin-camera/pulls).
-
-There is a specific [contributor workflow](http://wiki.apache.org/cordova/ContributorWorkflow) we recommend. Start reading there. More information is available on [our wiki](http://wiki.apache.org/cordova).
-
-:warning: **Found an issue?** File it on [JIRA issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Camera%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC).
-
-**Have a solution?** Send a [Pull Request](https://github.com/apache/cordova-plugin-camera/pulls).
-
-In order for your changes to be accepted, you need to sign and submit an Apache [ICLA](http://www.apache.org/licenses/#clas) (Individual Contributor License Agreement). Then your name will appear on the list of CLAs signed by [non-committers](https://people.apache.org/committer-index.html#unlistedclas) or [Cordova committers](http://people.apache.org/committers-by-project.html#cordova).
-
-**And don't forget to test and document your code.**
-
-
-## This documentation is generated by a tool
-
-:warning: Run `npm install` in the plugin repo to enable automatic docs generation if you plan to send a PR.
-[jsdoc-to-markdown](https://www.npmjs.com/package/jsdoc-to-markdown) is used to generate the docs.
-Documentation consists of template and API docs produced from the plugin JS code and should be regenerated before each commit (done automatically via [husky](https://github.com/typicode/husky), running `npm run gen-docs` script as a `precommit` hook - see `package.json` for details).
-
-
----
-
-# API Reference
-
-
-* [camera](#module_camera)
- * [.getPicture(successCallback, errorCallback, options)](#module_camera.getPicture)
- * [.cleanup()](#module_camera.cleanup)
- * [.onError](#module_camera.onError) : function
- * [.onSuccess](#module_camera.onSuccess) : function
- * [.CameraOptions](#module_camera.CameraOptions) : Object
-
-
-* [Camera](#module_Camera)
- * [.DestinationType](#module_Camera.DestinationType) : enum
- * [.EncodingType](#module_Camera.EncodingType) : enum
- * [.MediaType](#module_Camera.MediaType) : enum
- * [.PictureSourceType](#module_Camera.PictureSourceType) : enum
- * [.PopoverArrowDirection](#module_Camera.PopoverArrowDirection) : enum
- * [.Direction](#module_Camera.Direction) : enum
-
-* [CameraPopoverHandle](#module_CameraPopoverHandle)
-* [CameraPopoverOptions](#module_CameraPopoverOptions)
-
----
-
-
-## camera
-
-### camera.getPicture(successCallback, errorCallback, options)
-Takes a photo using the camera, or retrieves a photo from the device's
-image gallery. The image is passed to the success callback as a
-Base64-encoded `String`, or as the URI for the image file.
-
-The `camera.getPicture` function opens the device's default camera
-application that allows users to snap pictures by default - this behavior occurs,
-when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`](#module_Camera.PictureSourceType).
-Once the user snaps the photo, the camera application closes and the application is restored.
-
-If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
-`Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
-that allows users to select an existing image. The
-`camera.getPicture` function returns a [`CameraPopoverHandle`](#module_CameraPopoverHandle) object,
-which can be used to reposition the image selection dialog, for
-example, when the device orientation changes.
-
-The return value is sent to the [`cameraSuccess`](#module_camera.onSuccess) callback function, in
-one of the following formats, depending on the specified
-`cameraOptions`:
-
-- A `String` containing the Base64-encoded photo image.
-
-- A `String` representing the image file location on local storage (default).
-
-You can do whatever you want with the encoded image or URI, for
-example:
-
-- Render the image in an `` tag, as in the example below
-
-- Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
-
-- Post the data to a remote server
-
-__NOTE__: Photo resolution on newer devices is quite good. Photos
-selected from the device's gallery are not downscaled to a lower
-quality, even if a `quality` parameter is specified. To avoid common
-memory problems, set `Camera.destinationType` to `FILE_URI` rather
-than `DATA_URL`.
-
-__Supported Platforms__
-
-- Android
-- BlackBerry
-- Browser
-- Firefox
-- FireOS
-- iOS
-- Windows
-- WP8
-- Ubuntu
-
-More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
-
-**Kind**: static method of [camera](#module_camera)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| successCallback | [onSuccess](#module_camera.onSuccess) | |
-| errorCallback | [onError](#module_camera.onError) | |
-| options | [CameraOptions](#module_camera.CameraOptions) | CameraOptions |
-
-**Example**
-```js
-navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-```
-
-### camera.cleanup()
-Removes intermediate image files that are kept in temporary storage
-after calling [`camera.getPicture`](#module_camera.getPicture). Applies only when the value of
-`Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
-`Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
-
-__Supported Platforms__
-
-- iOS
-
-**Kind**: static method of [camera](#module_camera)
-**Example**
-```js
-navigator.camera.cleanup(onSuccess, onFail);
-
-function onSuccess() {
- console.log("Camera cleanup success.")
-}
-
-function onFail(message) {
- alert('Failed because: ' + message);
-}
-```
-
-### camera.onError : function
-Callback function that provides an error message.
-
-**Kind**: static typedef of [camera](#module_camera)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| message | string | The message is provided by the device's native code. |
-
-
-### camera.onSuccess : function
-Callback function that provides the image data.
-
-**Kind**: static typedef of [camera](#module_camera)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| imageData | string | Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`](#module_camera.CameraOptions) in effect. |
-
-**Example**
-```js
-// Show image
-//
-function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
-}
-```
-
-### camera.CameraOptions : Object
-Optional parameters to customize the camera settings.
-* [Quirks](#CameraOptions-quirks)
-
-**Kind**: static typedef of [camera](#module_camera)
-**Properties**
-
-| Name | Type | Default | Description |
-| --- | --- | --- | --- |
-| quality | number | 50 | Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.) |
-| destinationType | [DestinationType](#module_Camera.DestinationType) | FILE_URI | Choose the format of the return value. |
-| sourceType | [PictureSourceType](#module_Camera.PictureSourceType) | CAMERA | Set the source of the picture. |
-| allowEdit | Boolean | true | Allow simple editing of image before selection. |
-| encodingType | [EncodingType](#module_Camera.EncodingType) | JPEG | Choose the returned image file's encoding. |
-| targetWidth | number | | Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant. |
-| targetHeight | number | | Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant. |
-| mediaType | [MediaType](#module_Camera.MediaType) | PICTURE | Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`. |
-| correctOrientation | Boolean | | Rotate the image to correct for the orientation of the device during capture. |
-| saveToPhotoAlbum | Boolean | | Save the image to the photo album on the device after capture. |
-| popoverOptions | [CameraPopoverOptions](#module_CameraPopoverOptions) | | iOS-only options that specify popover location in iPad. |
-| cameraDirection | [Direction](#module_Camera.Direction) | BACK | Choose the camera to use (front- or back-facing). |
-
----
-
-
-## Camera
-
-### Camera.DestinationType : enum
-**Kind**: static enum property of [Camera](#module_Camera)
-**Properties**
-
-| Name | Type | Default | Description |
-| --- | --- | --- | --- |
-| DATA_URL | number | 0 | Return base64 encoded string |
-| FILE_URI | number | 1 | Return file uri (content://media/external/images/media/2 for Android) |
-| NATIVE_URI | number | 2 | Return native uri (eg. asset-library://... for iOS) |
-
-
-### Camera.EncodingType : enum
-**Kind**: static enum property of [Camera](#module_Camera)
-**Properties**
-
-| Name | Type | Default | Description |
-| --- | --- | --- | --- |
-| JPEG | number | 0 | Return JPEG encoded image |
-| PNG | number | 1 | Return PNG encoded image |
-
-
-### Camera.MediaType : enum
-**Kind**: static enum property of [Camera](#module_Camera)
-**Properties**
-
-| Name | Type | Default | Description |
-| --- | --- | --- | --- |
-| PICTURE | number | 0 | Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType |
-| VIDEO | number | 1 | Allow selection of video only, ONLY RETURNS URL |
-| ALLMEDIA | number | 2 | Allow selection from all media types |
-
-
-### Camera.PictureSourceType : enum
-**Kind**: static enum property of [Camera](#module_Camera)
-**Properties**
-
-| Name | Type | Default | Description |
-| --- | --- | --- | --- |
-| PHOTOLIBRARY | number | 0 | Choose image from picture library (same as SAVEDPHOTOALBUM for Android) |
-| CAMERA | number | 1 | Take picture from camera |
-| SAVEDPHOTOALBUM | number | 2 | Choose image from picture library (same as PHOTOLIBRARY for Android) |
-
-
-### Camera.PopoverArrowDirection : enum
-Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
-
-**Kind**: static enum property of [Camera](#module_Camera)
-**Properties**
-
-| Name | Type | Default |
-| --- | --- | --- |
-| ARROW_UP | number | 1 |
-| ARROW_DOWN | number | 2 |
-| ARROW_LEFT | number | 4 |
-| ARROW_RIGHT | number | 8 |
-| ARROW_ANY | number | 15 |
-
-
-### Camera.Direction : enum
-**Kind**: static enum property of [Camera](#module_Camera)
-**Properties**
-
-| Name | Type | Default | Description |
-| --- | --- | --- | --- |
-| BACK | number | 0 | Use the back-facing camera |
-| FRONT | number | 1 | Use the front-facing camera |
-
----
-
-
-## CameraPopoverOptions
-iOS-only parameters that specify the anchor element location and arrow
-direction of the popover when selecting images from an iPad's library
-or album.
-Note that the size of the popover may change to adjust to the
-direction of the arrow and orientation of the screen. Make sure to
-account for orientation changes when specifying the anchor element
-location.
-
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| [x] | Number | 0 | x pixel coordinate of screen element onto which to anchor the popover. |
-| [y] | Number | 32 | y pixel coordinate of screen element onto which to anchor the popover. |
-| [width] | Number | 320 | width, in pixels, of the screen element onto which to anchor the popover. |
-| [height] | Number | 480 | height, in pixels, of the screen element onto which to anchor the popover. |
-| [arrowDir] | [PopoverArrowDirection](#module_Camera.PopoverArrowDirection) | ARROW_ANY | Direction the arrow on the popover should point. |
-
----
-
-
-## CameraPopoverHandle
-A handle to an image picker popover.
-
-__Supported Platforms__
-
-- iOS
-
-**Example**
-```js
-var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
-{
- destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
-});
-
-// Reposition the popover if the orientation changes.
-window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
-}
-```
----
-
-
-## `camera.getPicture` Errata
-
-#### Example
-
-Take a photo and retrieve it as a Base64-encoded image:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-Take a photo and retrieve the image's file location:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-#### Preferences (iOS)
-
-- __CameraUsesGeolocation__ (boolean, defaults to false). For capturing JPEGs, set to true to get geolocation data in the EXIF header. This will trigger a request for geolocation permissions if set to true.
-
-
-
-#### Amazon Fire OS Quirks
-
-Amazon Fire OS uses intents to launch the camera activity on the device to capture
-images, and on phones with low memory, the Cordova activity may be killed. In this
-scenario, the image may not appear when the Cordova activity is restored.
-
-#### Android Quirks
-
-Android uses intents to launch the camera activity on the device to capture
-images, and on phones with low memory, the Cordova activity may be killed. In this
-scenario, the result from the plugin call will be delivered via the resume event.
-See [the Android Lifecycle guide][android_lifecycle]
-for more information. The `pendingResult.result` value will contain the value that
-would be passed to the callbacks (either the URI/URL or an error message). Check
-the `pendingResult.pluginStatus` to determine whether or not the call was
-successful.
-
-#### Browser Quirks
-
-Can only return photos as Base64-encoded image.
-
-#### Firefox OS Quirks
-
-Camera plugin is currently implemented using [Web Activities][web_activities].
-
-#### iOS Quirks
-
-Including a JavaScript `alert()` in either of the callback functions
-can cause problems. Wrap the alert within a `setTimeout()` to allow
-the iOS image picker or popover to fully close before the alert
-displays:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-#### Windows Phone 7 Quirks
-
-Invoking the native camera application while the device is connected
-via Zune does not work, and triggers an error callback.
-
-#### Tizen Quirks
-
-Tizen only supports a `destinationType` of
-`Camera.DestinationType.FILE_URI` and a `sourceType` of
-`Camera.PictureSourceType.PHOTOLIBRARY`.
-
-
-## `CameraOptions` Errata
-
-#### Amazon Fire OS Quirks
-
-- Any `cameraDirection` value results in a back-facing photo.
-
-- Ignores the `allowEdit` parameter.
-
-- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
-
-#### Android Quirks
-
-- Any `cameraDirection` value results in a back-facing photo.
-
-- **`allowEdit` is unpredictable on Android and it should not be used!** The Android implementation of this plugin tries to find and use an application on the user's device to do image cropping. The plugin has no control over what application the user selects to perform the image cropping and it is very possible that the user could choose an incompatible option and cause the plugin to fail. This sometimes works because most devices come with an application that handles cropping in a way that is compatible with this plugin (Google Plus Photos), but it is unwise to rely on that being the case. If image editing is essential to your application, consider seeking a third party library or plugin that provides its own image editing utility for a more robust solution.
-
-- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
-
-- Ignores the `encodingType` parameter if the image is unedited (i.e. `quality` is 100, `correctOrientation` is false, and no `targetHeight` or `targetWidth` are specified). The `CAMERA` source will always return the JPEG file given by the native camera and the `PHOTOLIBRARY` and `SAVEDPHOTOALBUM` sources will return the selected file in its existing encoding.
-
-#### BlackBerry 10 Quirks
-
-- Ignores the `quality` parameter.
-
-- Ignores the `allowEdit` parameter.
-
-- `Camera.MediaType` is not supported.
-
-- Ignores the `correctOrientation` parameter.
-
-- Ignores the `cameraDirection` parameter.
-
-#### Firefox OS Quirks
-
-- Ignores the `quality` parameter.
-
-- `Camera.DestinationType` is ignored and equals `1` (image file URI)
-
-- Ignores the `allowEdit` parameter.
-
-- Ignores the `PictureSourceType` parameter (user chooses it in a dialog window)
-
-- Ignores the `encodingType`
-
-- Ignores the `targetWidth` and `targetHeight`
-
-- `Camera.MediaType` is not supported.
-
-- Ignores the `correctOrientation` parameter.
-
-- Ignores the `cameraDirection` parameter.
-
-#### iOS Quirks
-
-- When using `destinationType.FILE_URI`, photos are saved in the application's temporary directory. The contents of the application's temporary directory is deleted when the application ends.
-
-- When using `destinationType.NATIVE_URI` and `sourceType.CAMERA`, photos are saved in the saved photo album regardless on the value of `saveToPhotoAlbum` parameter.
-
-#### Tizen Quirks
-
-- options not supported
-
-- always returns a FILE URI
-
-#### Windows Phone 7 and 8 Quirks
-
-- Ignores the `allowEdit` parameter.
-
-- Ignores the `correctOrientation` parameter.
-
-- Ignores the `cameraDirection` parameter.
-
-- Ignores the `saveToPhotoAlbum` parameter. IMPORTANT: All images taken with the WP8/8 Cordova camera API are always copied to the phone's camera roll. Depending on the user's settings, this could also mean the image is auto-uploaded to their OneDrive. This could potentially mean the image is available to a wider audience than your app intended. If this is a blocker for your application, you will need to implement the CameraCaptureTask as [documented on MSDN][msdn_wp8_docs]. You may also comment or up-vote the related issue in the [issue tracker][wp8_bug].
-
-- Ignores the `mediaType` property of `cameraOptions` as the Windows Phone SDK does not provide a way to choose videos from PHOTOLIBRARY.
-
-[android_lifecycle]: http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html
-[web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-[wp8_bug]: https://issues.apache.org/jira/browse/CB-2083
-[msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx
diff --git a/plugins/cordova-plugin-camera/RELEASENOTES.md b/plugins/cordova-plugin-camera/RELEASENOTES.md
deleted file mode 100644
index 4924768..0000000
--- a/plugins/cordova-plugin-camera/RELEASENOTES.md
+++ /dev/null
@@ -1,282 +0,0 @@
-
-# Release Notes
-
-### 2.1.1 (Mar 09, 2016)
-* [CB-10825](https://issues.apache.org/jira/browse/CB-10825) android: Always request READ permission for gallery source
-* added apache license header to appium files
-* [CB-10720](https://issues.apache.org/jira/browse/CB-10720) Fixed spelling, capitalization, and other small issues.
-* [CB-10414](https://issues.apache.org/jira/browse/CB-10414) Adding focus handler to resume video when user comes back on leaving the app while preview was running
-* Appium tests: adjust swipe distance on ** Android **
-* [CB-10750](https://issues.apache.org/jira/browse/CB-10750) Appium tests: fail fast if session is irrecoverable
-* Adding missing semi colon
-* Adding focus handler to make sure filepicker gets launched when app is active on ** Windows **
-* [CB-10128](https://issues.apache.org/jira/browse/CB-10128) **iOS** Fixed how checks access authorization to camera & library. This closes #146
-* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
-* [CB-10639](https://issues.apache.org/jira/browse/CB-10639) Appium tests: Added some timeouts, Taking a screenshot on failure, Retry taking a picture up to 3 times, Try to restart the Appium session if it's lost
-* [CB-10552](https://issues.apache.org/jira/browse/CB-10552) Replacing images in README.md.
-* Added a lot of more cases to get the real path on ** Android **
-* [CB-10625](https://issues.apache.org/jira/browse/CB-10625) ** Android ** getPicture fails when getting a photo from the Photo Library - Google Photos
-* [CB-10619](https://issues.apache.org/jira/browse/CB-10619) Appium tests: Properly switch to webview on ** Android **
-* [CB-10397](https://issues.apache.org/jira/browse/CB-10397) Added Appium tests
-* [CB-10576](https://issues.apache.org/jira/browse/CB-10576) MobileSpec can't get results for **Windows**-Store 8.1 Builds
-* chore: edit package.json license to match SPDX id
-* [CB-10539](https://issues.apache.org/jira/browse/CB-10539) Commenting out the verySmallQvga maxResolution option on ** Windows **
-* [CB-10541](https://issues.apache.org/jira/browse/CB-10541) Changing default maxResoltion to be highestAvailable for CameraCaptureUI on ** Windows **
-* [CB-10113](https://issues.apache.org/jira/browse/CB-10113) ** Browser ** - Layer camera UI on top of all!
-* [CB-10502](https://issues.apache.org/jira/browse/CB-10502) ** Browser ** - Fix camera plugin exception in Chrome when click capture.
-* Adding comments
-* Camera tapping fix on ** Windows **
-
-### 2.1.0 (Jan 15, 2016)
-* added `.ratignore`
-* CB-10319 **Android** Adding reflective helper methods for permission requests
-* CB-9189 **Android** Implementing `save/restore` API to handle Activity destruction
-* CB-10241 App Crash cause by Camera Plugin **iOS 7**
-* CB-8940 Setting `z-index` values to maximum for UI buttons.
-
-### 2.0.0 (Nov 18, 2015)
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
-* [CB-8863](https://issues.apache.org/jira/browse/CB-8863) correct block usage for `async` calls
-* [CB-5479](https://issues.apache.org/jira/browse/CB-5479) changed `saveToPhotoAlbum` to save uncompressed images for **Android**
-* [CB-9169](https://issues.apache.org/jira/browse/CB-9169) Fixed `filetype` for uncompressed images and added quirk for **Android**
-* [CB-9446](https://issues.apache.org/jira/browse/CB-9446) Removing `CordovaResource` library code in favour of the code we're supposed to be deprecating because that at least works.
-* [CB-9942](https://issues.apache.org/jira/browse/CB-9942) Normalize line endings in Camera plugin docs
-* [CB-9910](https://issues.apache.org/jira/browse/CB-9910) Add permission request for some gallery requests for **Android**
-* [CB-7668](https://issues.apache.org/jira/browse/CB-7668) Adding a sterner warning for `allowedit` on **Android**
-* Fixing contribute link.
-* Using the `CordovaResourceApi` to fine paths of files in the background thread. If the file doesn't exist, return the content `URI`.
-* Add engine tag for **Cordova-Android 5.0.x**
-* [CB-9583](https://issues.apache.org/jira/browse/CB-9583): Added support for **Marshmallow** permissions (**Android 6.0**)
-* Try to use `realpath` filename instead of default `modified.jpg`
-* [CB-6190](https://issues.apache.org/jira/browse/CB-6190) **iOS** camera plugin ignores quality parameter
-* [CB-9633](https://issues.apache.org/jira/browse/CB-9633) **iOS** Taking a Picture With Option `destinationType:NATIVE_URI` doesn't show image
-* [CB-9745](https://issues.apache.org/jira/browse/CB-9745) Camera plugin docs should be generated from the source
-* [CB-9622](https://issues.apache.org/jira/browse/CB-9622) **WP8** Camera Option `destinationType:NATIVE_URI` is a `NO-OP`
-* [CB-9623](https://issues.apache.org/jira/browse/CB-9623) Fixes various issues when `encodingType` set to `png`
-* [CB-9591](https://issues.apache.org/jira/browse/CB-9591) Retaining aspect ratio when resizing
-* [CB-9443](https://issues.apache.org/jira/browse/CB-9443) Pick correct `maxResolution`
-* [CB-9151](https://issues.apache.org/jira/browse/CB-9151) Trigger `captureAction` only once
-* [CB-9413](https://issues.apache.org/jira/browse/CB-9413) Close `RandomAccessStream` once copied
-* [CB-5661](https://issues.apache.org/jira/browse/CB-5661) Remove outdated **iOS** quirks about memory
-* [CB-9349](https://issues.apache.org/jira/browse/CB-9349) Focus control and nice UI
-* [CB-9259](https://issues.apache.org/jira/browse/CB-9259) Forgot to add another check on which `URI` we're using when fixing this thing the first time
-* [CB-9247](https://issues.apache.org/jira/browse/CB-9247) Added macro to conditionally add `NSData+Base64.h`
-* [CB-9247](https://issues.apache.org/jira/browse/CB-9247) Fixes compilation errors with **cordova-ios 4.x**
-* Fix returning native url on **Windows**.
-
-### 1.2.0 (Jun 17, 2015)
-* Closing stale pull request: close #84
-* Closing stale pull request: close #66
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-camera documentation translation: cordova-plugin-camera
-* Update docs. This closes #100
-* attempt to fix npm markdown issue
-* [CB-8883](https://issues.apache.org/jira/browse/CB-8883) fix picture rotation issue
-* one more alias
-* Fixed some nit white-space issues, aliased a little more
-* major refactor : readability
-* Patch for [CB-8498](https://issues.apache.org/jira/browse/CB-8498), this closes #64
-* [CB-8879](https://issues.apache.org/jira/browse/CB-8879) fix stripe issue with correct aspect ratio
-* [CB-8601](https://issues.apache.org/jira/browse/CB-8601) - iOS camera unit tests broken
-* [CB-7667](https://issues.apache.org/jira/browse/CB-7667) iOS8: Handle case where camera is not authorized (closes #49)
-* add missing license header
-
-### 1.1.0 (May 06, 2015)
-* [CB-8943](https://issues.apache.org/jira/browse/CB-8943) fix `PickAndContinue` issue on *Win10Phone*
-* [CB-8253](https://issues.apache.org/jira/browse/CB-8253) Fix potential unreleased resources
-* [CB-8909](https://issues.apache.org/jira/browse/CB-8909): Remove unused import from File
-* [CB-8404](https://issues.apache.org/jira/browse/CB-8404) typo fix `cameraproxy.js`
-* [CB-8404](https://issues.apache.org/jira/browse/CB-8404) Rotate camera feed with device orientation
-* [CB-8054](https://issues.apache.org/jira/browse/CB-8054) Support taking pictures from file for *WP8*
-* [CB-8405](https://issues.apache.org/jira/browse/CB-8405) Use `z-index` instead of `z-order`
-
-### 1.0.0 (Apr 15, 2015)
-* [CB-8780](https://issues.apache.org/jira/browse/CB-8780) - Display popover using main thread. Fixes popover slowness (closes #81)
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) bumped version of file dependency
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
-* [CB-8707](https://issues.apache.org/jira/browse/CB-8707) refactoring windows code to improve readability
-* [CB-8706](https://issues.apache.org/jira/browse/CB-8706) use filePicker if saveToPhotoAlbum is true
-* [CB-8706](https://issues.apache.org/jira/browse/CB-8706) remove unnecessary capabilities from xml
-* [CB-8747](https://issues.apache.org/jira/browse/CB-8747) updated dependency, added peer dependency
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) updated blackberry specific references of org.apache.cordova.camera to cordova-plugin-camera
-* [CB-8782](https://issues.apache.org/jira/browse/CB-8782): Updated the docs to talk about the allowEdit quirks, it's not 100% working, but better than it was
-* [CB-8782](https://issues.apache.org/jira/browse/CB-8782): Fixed the flow so that we save the cropped image and use it, not the original non-cropped. Crop only supports G+ Photos Crop, other crops may not work, depending on the OEM
-* [CB-8740](https://issues.apache.org/jira/browse/CB-8740): Removing FileHelper call that was failing on Samsung Galaxy S3, now that we have a real path, we only need to update the MediaStore, not pull from it in this case
-* [CB-8740](https://issues.apache.org/jira/browse/CB-8740): Partial fix for Save Image to Gallery error found in MobileSpec
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Fix custom implementation of integerValueForKey (close #79)
-* Fix cordova-paramedic path change, build with TRAVIS_BUILD_DIR, use npm to install paramedic
-* docs: added 'Windows' to supported platforms
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of deprecated headers
-
-### 0.3.6 (Mar 10, 2015)
-* Fix localize key for Videos. This closes #58
-* [CB-8235](https://issues.apache.org/jira/browse/CB-8235) android: Fix crash when selecting images from DropBox with spaces in path (close #65)
-* add try ... catch for getting image orientation
-* [CB-8599](https://issues.apache.org/jira/browse/CB-8599) fix threading issue with cameraPicker (fixes #72)
-* [CB-8559](https://issues.apache.org/jira/browse/CB-8559) Integrate TravisCI
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-camera documentation translation: cordova-plugin-camera
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
-
-### 0.3.5 (Feb 04, 2015)
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using now-deprecated [NSData base64EncodedString]
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using now-deprecated integerValueForKey: class extension
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
-* [CB-8032](https://issues.apache.org/jira/browse/CB-8032) ios: Add nativeURL external method support for CDVFileSystem->makeEntryForPath:isDirectory:
-* [CB-7938](https://issues.apache.org/jira/browse/CB-7938) ios: Added XCTest unit tests project, with stubs (adapted from SplashScreen unit test setup)
-* [CB-7937](https://issues.apache.org/jira/browse/CB-7937) ios: Re-factor iOS Camera plugin so that it is testable
-
-### 0.3.4 (Dec 02, 2014)
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
-* [CB-7979](https://issues.apache.org/jira/browse/CB-7979) Each plugin doc should have a ## Installation section
-* Fix memory leak of image data in `imagePickerControllerReturnImageResult`
-* Pass uri to crop instead of pulling the low resolution image out of the intent return (close #43)
-* Add orientation support for PNG to Android (closes #45)
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-camera documentation translation: cordova-plugin-camera
-
-### 0.3.3 (Oct 03, 2014)
-* [CB-7600](https://issues.apache.org/jira/browse/CB-7600) Adds informative message to error callback in manual test.
-
-### 0.3.2 (Sep 17, 2014)
-* [CB-7551](https://issues.apache.org/jira/browse/CB-7551) [Camera][iOS 8] Scaled images show a white line
-* [CB-7558](https://issues.apache.org/jira/browse/CB-7558) hasPendingOperation flag in Camera plugin's takePicture should be reversed to fix memory errors
-* [CB-7557](https://issues.apache.org/jira/browse/CB-7557) Camera plugin tests is missing a File dependency
-* [CB-7423](https://issues.apache.org/jira/browse/CB-7423) do cleanup after copyImage manual test
-* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-camera documentation translation: cordova-plugin-camera
-* [CB-7413](https://issues.apache.org/jira/browse/CB-7413) Resolve 'ms-appdata' URIs with File plugin
-* Fixed minor bugs with the browser
-* [CB-7433](https://issues.apache.org/jira/browse/CB-7433) Adds missing window reference to prevent manual tests failure on Android and iOS
-* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-camera documentation translation: cordova-plugin-camera
-* [CB-4003](https://issues.apache.org/jira/browse/CB-4003) Add config option to not use location information in Camera plugin (and default to not use it)
-* [CB-7461](https://issues.apache.org/jira/browse/CB-7461) Geolocation fails in Camera plugin in iOS 8
-* [CB-7378](https://issues.apache.org/jira/browse/CB-7378) Use single Proxy for both windows8 and windows.
-* [CB-7378](https://issues.apache.org/jira/browse/CB-7378) Adds support for windows platform
-* [CB-7433](https://issues.apache.org/jira/browse/CB-7433) Fixes manual tests failure on windows
-* [CB-6958](https://issues.apache.org/jira/browse/CB-6958) Get the correct default for "quality" in the test
-* add documentation for manual tests
-* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-camera documentation translation: cordova-plugin-camera
-* [CB-4003](https://issues.apache.org/jira/browse/CB-4003) Add config option to not use location information in Camera plugin (and default to not use it)
-* [CB-7461](https://issues.apache.org/jira/browse/CB-7461) Geolocation fails in Camera plugin in iOS 8
-* [CB-7433](https://issues.apache.org/jira/browse/CB-7433) Fixes manual tests failure on windows
-* [CB-7378](https://issues.apache.org/jira/browse/CB-7378) Use single Proxy for both windows8 and windows.
-* [CB-7378](https://issues.apache.org/jira/browse/CB-7378) Adds support for windows platform
-* [CB-6958](https://issues.apache.org/jira/browse/CB-6958) Get the correct default for "quality" in the test
-* add documentation for manual tests
-* Updated docs for browser
-* Added support for the browser
-* [CB-7286](https://issues.apache.org/jira/browse/CB-7286) [BlackBerry10] Use getUserMedia if camera card is unavailable
-* [CB-7180](https://issues.apache.org/jira/browse/CB-7180) Update Camera plugin to support generic plugin webView UIView (which can be either a UIWebView or WKWebView)
-* Renamed test dir, added nested plugin.xml
-* [CB-6958](https://issues.apache.org/jira/browse/CB-6958) added manual tests
-* [CB-6958](https://issues.apache.org/jira/browse/CB-6958) Port camera tests to plugin-test-framework
-
-### 0.3.1 (Aug 06, 2014)
-* **FFOS** update CameraProxy.js
-* [CB-7187](https://issues.apache.org/jira/browse/CB-7187) ios: Add explicit dependency on CoreLocation.framework
-* [BlackBerry10] Doc correction - sourceType is supported
-* [CB-7071](https://issues.apache.org/jira/browse/CB-7071) android: Fix callback firing before CROP intent is sent when allowEdit=true
-* [CB-6875](https://issues.apache.org/jira/browse/CB-6875) android: Handle exception when SDCard is not mounted
-* ios: Delete postImage (dead code)
-* Prevent NPE on processResiultFromGallery when intent comes null
-* Remove iOS doc reference to non-existing navigator.fileMgr API
-* Docs updated with some default values
-* Removes File plugin dependency from windows8 code.
-* Use WinJS functionality to resize image instead of File plugin functionality
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
-
-### 0.3.0 (Jun 05, 2014)
-* [CB-5895](https://issues.apache.org/jira/browse/CB-5895) documented saveToPhotoAlbum quirk on WP8
-* Remove deprecated symbols for iOS < 6
-* documentation translation: cordova-plugin-camera
-* ubuntu: use application directory for images
-* [CB-6795](https://issues.apache.org/jira/browse/CB-6795) Add license
-* Little fix in code formatting
-* [CB-6613](https://issues.apache.org/jira/browse/CB-6613) Use WinJS functionality to get base64-encoded content of image instead of File plugin functionality
-* [CB-6612](https://issues.apache.org/jira/browse/CB-6612) camera.getPicture now always returns encoded JPEG image
-* Removed invalid note from [CB-5398](https://issues.apache.org/jira/browse/CB-5398)
-* [CB-6576](https://issues.apache.org/jira/browse/CB-6576) - Returns a specific error message when app has no access to library.
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
-* [CB-6546](https://issues.apache.org/jira/browse/CB-6546) android: Fix a couple bugs with allowEdit pull request
-* [CB-6546](https://issues.apache.org/jira/browse/CB-6546) android: Add support for allowEdit Camera option
-
-### 0.2.9 (Apr 17, 2014)
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
-* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
-* [WP8] When only targetWidth or targetHeight is provided, use it as the only bound
-* [CB-4027](https://issues.apache.org/jira/browse/CB-4027), [CB-5102](https://issues.apache.org/jira/browse/CB-5102), [CB-2737](https://issues.apache.org/jira/browse/CB-2737), [CB-2387](https://issues.apache.org/jira/browse/CB-2387): [WP] Fix camera issues, cropping, memory leaks
-* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
-* [BlackBerry10] Add rim xml namespaces declaration
-* Add NOTICE file
-
-### 0.2.8 (Feb 26, 2014)
-* [CB-1826](https://issues.apache.org/jira/browse/CB-1826) Catch OOM on gallery image resize
-
-### 0.2.7 (Feb 05, 2014)
-* [CB-4919](https://issues.apache.org/jira/browse/CB-4919) firefox os quirks added and supported platforms list is updated
-* getPicture via web activities
-* Documented quirk for [CB-5335](https://issues.apache.org/jira/browse/CB-5335) + [CB-5206](https://issues.apache.org/jira/browse/CB-5206) for WP7+8
-* reference the correct firefoxos implementation
-* [BlackBerry10] Add permission to access_shared
-
-### 0.2.6 (Jan 02, 2014)
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Camera plugin
-* [CB-2442](https://issues.apache.org/jira/browse/CB-2442) [CB-2419](https://issues.apache.org/jira/browse/CB-2419) Use Windows.Storage.ApplicationData.current.localFolder, instead of writing to app package.
-* [BlackBerry10] Adding platform level permissions
-* [CB-5599](https://issues.apache.org/jira/browse/CB-5599) Android: Catch and ignore OutOfMemoryError in getRotatedBitmap()
-
-### 0.2.5 (Dec 4, 2013)
-* fix camera for firefox os
-* getPicture via web activities
-* [ubuntu] specify policy_group
-* add ubuntu platform
-* 1. User Agent detection now detects AmazonWebView. 2. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'
-* Added amazon-fireos platform.
-
-### 0.2.4 (Oct 28, 2013)
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for camera plugin
-* [CB-4958](https://issues.apache.org/jira/browse/CB-4958) - iOS - Camera plugin should not show the status bar
-* [CB-4919](https://issues.apache.org/jira/browse/CB-4919) updated plugin.xml for FxOS
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
-
-### 0.2.3 (Sept 25, 2013)
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) forgot index.html
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming core inside cameraProxy
-* [Windows8] commandProxy has moved
-* [Windows8] commandProxy has moved
-* added Camera API for FirefoxOS
-* Rename CHANGELOG.md -> RELEASENOTES.md
-* [CB-4823](https://issues.apache.org/jira/browse/CB-4823) Fix XCode 5 camera plugin warnings
-* Fix compiler warnings
-* [CB-4765](https://issues.apache.org/jira/browse/CB-4765) Move ExifHelper.java into Camera Plugin
-* [CB-4764](https://issues.apache.org/jira/browse/CB-4764) Remove reference to DirectoryManager from CameraLauncher
-* [CB-4763](https://issues.apache.org/jira/browse/CB-4763) Use a copy of FileHelper.java within camera-plugin.
-* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
-* [CB-4633](https://issues.apache.org/jira/browse/CB-4633): We really should close cursors. It's just the right thing to do.
-* No longer causes a stack trace, but it doesn't cause the error to be called.
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.camera to org.apache.cordova.camera
-
-### 0.2.1 (Sept 5, 2013)
-* [CB-4656](https://issues.apache.org/jira/browse/CB-4656) Don't add line-breaks to base64-encoded images (Fixes type=DataURI)
-* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change
diff --git a/plugins/cordova-plugin-camera/appium-tests/android/android.spec.js b/plugins/cordova-plugin-camera/appium-tests/android/android.spec.js
deleted file mode 100644
index b3abf86..0000000
--- a/plugins/cordova-plugin-camera/appium-tests/android/android.spec.js
+++ /dev/null
@@ -1,592 +0,0 @@
-/*jshint node: true, jasmine: true */
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// these tests are meant to be executed by Cordova Medic Appium runner
-// you can find it here: https://github.com/apache/cordova-medic/
-// it is not necessary to do a full CI setup to run these tests
-// just run "node cordova-medic/medic/medic.js appium --platform android --plugins cordova-plugin-camera"
-
-'use strict';
-
-var wdHelper = require('../helpers/wdHelper');
-var wd = wdHelper.getWD();
-var cameraConstants = require('../../www/CameraConstants');
-var cameraHelper = require('../helpers/cameraHelper');
-var screenshotHelper = require('../helpers/screenshotHelper');
-
-var STARTING_MESSAGE = 'Ready for action!';
-var RETRY_COUNT = 3; // how many times to retry taking a picture before failing
-var MINUTE = 60 * 1000;
-var DEFAULT_SCREEN_WIDTH = 360;
-var DEFAULT_SCREEN_HEIGHT = 567;
-var DEFAULT_WEBVIEW_CONTEXT = 'WEBVIEW';
-
-describe('Camera tests Android.', function () {
- var driver;
- // the name of webview context, it will be changed to match needed context if there are named ones:
- var webviewContext = DEFAULT_WEBVIEW_CONTEXT;
- // this indicates that the device library has the test picture:
- var isTestPictureSaved = false;
- // this indicates that there was a critical error and we should try to recover:
- var errorFlag = false;
- // this indicates that we couldn't restore Appium session and should fail fast:
- var stopFlag = false;
- // we need to know the screen width and height to properly click on an image in the gallery:
- var screenWidth = DEFAULT_SCREEN_WIDTH;
- var screenHeight = DEFAULT_SCREEN_HEIGHT;
-
- function win() {
- expect(true).toBe(true);
- }
-
- function fail(error) {
- screenshotHelper.saveScreenshot(driver);
- if (error && error.message) {
- console.log('An error occured: ' + error.message);
- expect(true).toFailWithMessage(error.message);
- throw error.message;
- }
- if (error) {
- console.log('Failed expectation: ' + error);
- expect(true).toFailWithMessage(error);
- throw error;
- }
- // no message provided :(
- expect(true).toBe(false);
- throw 'An error without description occured';
- }
-
- // generates test specs by combining all the specified options
- // you can add more options to test more scenarios
- function generateSpecs() {
- var sourceTypes = [
- cameraConstants.PictureSourceType.CAMERA,
- cameraConstants.PictureSourceType.PHOTOLIBRARY
- ],
- destinationTypes = cameraConstants.DestinationType,
- encodingTypes = [
- cameraConstants.EncodingType.JPEG,
- cameraConstants.EncodingType.PNG
- ],
- allowEditOptions = [
- true,
- false
- ];
-
- return cameraHelper.generateSpecs(sourceTypes, destinationTypes, encodingTypes, allowEditOptions);
- }
-
- function getPicture(options, skipUiInteractions, retry) {
- if (!options) {
- options = {};
- }
- if (typeof retry === 'undefined') {
- retry = 1;
- }
-
- var command = "navigator.camera.getPicture(function (result) { document.getElementById('info').innerHTML = result.slice(0, 100); }, " +
- "function (err) { document.getElementById('info').innerHTML = 'ERROR: ' + err; }," + JSON.stringify(options) + ");";
- return driver
- .context(webviewContext)
- .execute(command)
- .sleep(7000)
- .context('NATIVE_APP')
- .sleep(5000)
- .then(function () {
- if (skipUiInteractions) {
- return;
- }
- if (options.hasOwnProperty('sourceType') &&
- (options.sourceType === cameraConstants.PictureSourceType.PHOTOLIBRARY ||
- options.sourceType === cameraConstants.PictureSourceType.SAVEDPHOTOALBUM)) {
- var touchTile = new wd.TouchAction(),
- swipeRight = new wd.TouchAction();
- touchTile.press({x: Math.round(screenWidth / 4), y: Math.round(screenHeight / 5)}).release();
- swipeRight.press({x: 10, y: Math.round(screenHeight * 0.8)})
- .wait(300)
- .moveTo({x: Math.round(screenWidth / 2), y: Math.round(screenHeight / 2)})
- .release();
- return driver
- .performTouchAction(swipeRight)
- .sleep(3000)
- .elementByXPath('//*[@text="Gallery"]')
- .then(function (element) {
- return element.click().sleep(5000);
- }, function () {
- // if the gallery is already opened, we'd just go on:
- return driver;
- })
- .performTouchAction(touchTile);
- }
- return driver
- .elementByXPath('//android.widget.ImageView[contains(@resource-id,\'shutter\')]')
- .click()
- .sleep(3000)
- .elementByXPath('//android.widget.ImageView[contains(@resource-id,\'done\')]')
- .click()
- .sleep(10000);
- })
- .then(function () {
- if (skipUiInteractions) {
- return;
- }
- if (options.hasOwnProperty('allowEdit') && options.allowEdit === true) {
- return driver
- .elementByXPath('//*[contains(@resource-id,\'save\')]')
- .click();
- }
- })
- .then(function () {
- if (!skipUiInteractions) {
- return driver.sleep(10000);
- }
- })
- .fail(function (error) {
- if (retry < RETRY_COUNT) {
- console.log('Failed to get a picture. Let\'s try it again... ');
- return getPicture(options, skipUiInteractions, ++retry);
- } else {
- console.log('Tried ' + RETRY_COUNT + ' times but couldn\'t get the picture. Failing...');
- fail(error);
- }
- });
- }
-
- function enterTest() {
- return driver
- // trying to determine where we are
- .context(webviewContext)
- .fail(function (error) {
- fail(error);
- })
- .elementById('info')
- .then(function () {
- return driver; //we're already on the test screen
- }, function () {
- return driver
- .elementById('middle')
- .then(function () {
- return driver
- // we're on autotests page, we should go to start page
- .execute('window.location = "../index.html"')
- .sleep(5000)
- .fail(function () {
- errorFlag = true;
- throw 'Couldn\'t find start page.';
- });
- }, function () {
- return; // no-op
- })
- // unknown starting page: no 'info' div
- // adding it manually
- .execute('var info = document.createElement("div"); ' +
- 'info.id = "info"; ' +
- 'document.body.appendChild(info);');
- })
- .sleep(5000);
- }
-
- function checkPicture(shouldLoad) {
- return driver
- .context(webviewContext)
- .elementById('info')
- .getAttribute('innerHTML')
- .then(function (html) {
- if (html.indexOf(STARTING_MESSAGE) >= 0) {
- expect(true).toFailWithMessage('No callback was fired');
- } else if (shouldLoad) {
- expect(html.length).toBeGreaterThan(0);
- if (html.indexOf('ERROR') >= 0) {
- fail(html);
- }
- } else {
- if (html.indexOf('ERROR') === -1) {
- fail('Unexpected success callback with result: ' + html);
- }
- expect(html.indexOf('ERROR')).toBe(0);
- }
- });
- }
-
- function runCombinedSpec(spec) {
- return enterTest()
- .then(function () {
- return getPicture(spec.options);
- })
- .then(function () {
- return checkPicture(true);
- })
- .then(win, fail);
- }
-
- function deleteImage() {
- var holdTile = new wd.TouchAction();
- holdTile.press({x: Math.round(screenWidth / 3), y: Math.round(screenHeight / 5)}).wait(1000).release();
- return driver
- .performTouchAction(holdTile)
- .elementByXPath('//android.widget.TextView[@text="Delete"]')
- .then(function (element) {
- return element
- .click()
- .elementByXPath('//android.widget.Button[@text="OK"]')
- .click();
- }, function () {
- // couldn't find Delete menu item. Possibly there is no image.
- return;
- });
- }
-
- function getDriver() {
- driver = wdHelper.getDriver('Android');
- return driver;
- }
-
- function checkStopFlag() {
- if (stopFlag) {
- fail('Something went wrong: the stopFlag is on. Please see the log for more details.');
- }
- return stopFlag;
- }
-
- beforeEach(function () {
- jasmine.addMatchers({
- toFailWithMessage : function () {
- return {
- compare: function (actual, msg) {
- console.log('Failing with message: ' + msg);
- var result = {
- pass: false,
- message: msg
- };
- // status 6 means that we've lost the session
- // status 7 means that Appium couldn't find an element
- // both these statuses mean that the test has failed but
- // we should try to recreate the session for the following tests
- if (msg.indexOf('Error response status: 6') >= 0 ||
- msg.indexOf('Error response status: 7') >= 0) {
- errorFlag = true;
- }
- return result;
- }
- };
- }
- });
- });
-
- it('camera.ui.util configuring driver and starting a session', function (done) {
- stopFlag = true; // just in case of timeout
- getDriver().then(function () {
- stopFlag = false;
- }, function (error) {
- fail(error);
- })
- .finally(done);
- }, 5 * MINUTE);
-
- it('camera.ui.util determine webview context name', function (done) {
- var i = 0;
- return driver
- .contexts(function (err, contexts) {
- if (err) {
- console.log(err);
- }
- for (i = 0; i < contexts.length; i++) {
- if (contexts[i].indexOf('mobilespec') >= 0) {
- webviewContext = contexts[i];
- }
- }
- done();
- });
- }, MINUTE);
-
- it('camera.ui.util determine screen dimensions', function (done) {
- return enterTest()
- .execute('document.getElementById(\'info\').innerHTML = window.innerWidth;')
- .sleep(5000)
- .elementById('info')
- .getAttribute('innerHTML')
- .then(function (html) {
- if (html !== STARTING_MESSAGE) {
- screenWidth = Number(html);
- }
- })
- .execute('document.getElementById(\'info\').innerHTML = \'' + STARTING_MESSAGE + '\';')
- .execute('document.getElementById(\'info\').innerHTML = window.innerHeight;')
- .sleep(5000)
- .elementById('info')
- .getAttribute('innerHTML')
- .then(function (html) {
- if (html !== STARTING_MESSAGE) {
- screenHeight = Number(html);
- }
- done();
- });
- }, MINUTE);
-
- describe('Specs.', function () {
- beforeEach(function (done) {
- // prepare the app for the test
- if (!stopFlag) {
- return driver
- .context(webviewContext)
- .then(function () {
- return driver; // no-op
- }, function (error) {
- expect(true).toFailWithMessage(error);
- })
- .execute('document.getElementById("info").innerHTML = "' + STARTING_MESSAGE + '";')
- .finally(done);
- }
- done();
- }, 3 * MINUTE);
-
- afterEach(function (done) {
- if (!errorFlag || stopFlag) {
- // either there's no error or we've failed irrecoverably
- // nothing to worry about!
- done();
- return;
- }
- // recreate the session if there was a critical error in a previous spec
- stopFlag = true; // we're going to set this to false if we're able to restore the session
- return driver
- .quit()
- .then(function () {
- return getDriver()
- .then(function () {
- errorFlag = false;
- stopFlag = false;
- }, function (error) {
- fail(error);
- stopFlag = true;
- });
- }, function (error) {
- fail(error);
- stopFlag = true;
- })
- .finally(done);
- }, 3 * MINUTE);
-
- // getPicture() with saveToPhotoLibrary = true
- it('camera.ui.spec.1 Saving the picture to photo library', function (done) {
- var options = {
- quality: 50,
- allowEdit: false,
- sourceType: cameraConstants.PictureSourceType.CAMERA,
- saveToPhotoAlbum: true
- };
- enterTest()
- .context(webviewContext)
- .then(function () {
- return getPicture(options);
- })
- .then(function () {
- isTestPictureSaved = true;
- return checkPicture(true);
- })
- .then(win, fail)
- .finally(done);
- }, 3 * MINUTE);
-
- // getPicture() with mediaType: VIDEO, sourceType: PHOTOLIBRARY
- it('camera.ui.spec.2 Selecting only videos', function (done) {
- if (checkStopFlag()) {
- done();
- return;
- }
- var options = { sourceType: cameraConstants.PictureSourceType.PHOTOLIBRARY,
- mediaType: cameraConstants.MediaType.VIDEO };
- enterTest()
- .then(function () {
- return getPicture(options, true);
- })
- .sleep(5000)
- .context(webviewContext)
- .elementById('info')
- .getAttribute('innerHTML')
- .then(function (html) {
- if (html.indexOf('ERROR') >= 0) {
- throw html;
- }
- })
- .context('NATIVE_APP')
- .sleep(5000)
- .then(function () {
- // try to find "Gallery" menu item
- // if there's none, the gallery should be already opened
- return driver
- .elementByXPath('//*[@text="Gallery"]')
- .then(function (element) {
- return element.click().sleep(2000);
- }, function () {
- return driver;
- });
- })
- .then(function () {
- // if the gallery is opened on the videos page,
- // there should be a "Choose video" caption
- return driver
- .elementByXPath('//*[@text="Choose video"]')
- .fail(function () {
- throw 'Couldn\'t find "Choose video" element.';
- });
- })
- .then(win, fail)
- .deviceKeyEvent(4)
- .sleep(2000)
- .deviceKeyEvent(4)
- .sleep(2000)
- .elementById('action_bar_title')
- .then(function () {
- // success means we're still in native app
- return driver
- .deviceKeyEvent(4)
- .sleep(2000);
- }, function () {
- // error means we're already in webview
- return driver;
- })
- .finally(done);
- }, 3 * MINUTE);
-
- // getPicture(), then dismiss
- // wait for the error callback to bee called
- it('camera.ui.spec.3 Dismissing the camera', function (done) {
- if (checkStopFlag()) {
- done();
- return;
- }
- var options = { quality: 50,
- allowEdit: true,
- sourceType: cameraConstants.PictureSourceType.CAMERA,
- destinationType: cameraConstants.DestinationType.FILE_URI };
- enterTest()
- .context(webviewContext)
- .then(function () {
- return getPicture(options, true);
- })
- .sleep(5000)
- .context("NATIVE_APP")
- .elementByXPath('//android.widget.ImageView[contains(@resource-id,\'cancel\')]')
- .click()
- .context(webviewContext)
- .then(function () {
- return driver
- .elementByXPath('//*[contains(text(),"Camera cancelled")]')
- .then(function () {
- return checkPicture(false);
- }, function () {
- throw 'Couldn\'t find "Camera cancelled" message.';
- });
- })
- .then(win, fail)
- .finally(done);
- }, 3 * MINUTE);
-
- // getPicture(), then take picture but dismiss the edit
- // wait for the error cllback to be called
- it('camera.ui.spec.4 Dismissing the edit', function (done) {
- if (checkStopFlag()) {
- done();
- return;
- }
- var options = { quality: 50,
- allowEdit: true,
- sourceType: cameraConstants.PictureSourceType.CAMERA,
- destinationType: cameraConstants.DestinationType.FILE_URI };
- enterTest()
- .context(webviewContext)
- .then(function () {
- return getPicture(options, true);
- })
- .sleep(5000)
- .context('NATIVE_APP')
- .elementByXPath('//android.widget.ImageView[contains(@resource-id,\'shutter\')]')
- .click()
- .elementByXPath('//android.widget.ImageView[contains(@resource-id,\'done\')]')
- .click()
- .elementByXPath('//*[contains(@resource-id,\'discard\')]')
- .click()
- .sleep(5000)
- .context(webviewContext)
- .then(function () {
- return driver
- .elementByXPath('//*[contains(text(),"Camera cancelled")]')
- .then(function () {
- return checkPicture(false);
- }, function () {
- throw 'Couldn\'t find "Camera cancelled" message.';
- });
- })
- .then(win, fail)
- .finally(done);
- }, 3 * MINUTE);
-
- // combine various options for getPicture()
- generateSpecs().forEach(function (spec) {
- it('camera.ui.spec.5.' + spec.id + ' Combining options', function (done) {
- if (checkStopFlag()) {
- done();
- return;
- }
- runCombinedSpec(spec).then(done);
- }, 3 * MINUTE);
- });
-
-
- it('camera.ui.util Delete test image from device library', function (done) {
- if (checkStopFlag()) {
- done();
- return;
- }
- if (isTestPictureSaved) {
- // delete exactly one last picture
- // this should be the picture we've taken in the first spec
- return driver
- .context('NATIVE_APP')
- .deviceKeyEvent(3)
- .sleep(5000)
- .elementByName('Apps')
- .click()
- .elementByXPath('//android.widget.TextView[@text="Gallery"]')
- .click()
- .elementByXPath('//android.widget.TextView[contains(@text,"Pictures")]')
- .then(function (element) {
- return element
- .click()
- .sleep(3000)
- .then(deleteImage)
- .then(function () { done(); }, function () { done(); });
- }, function () {
- done();
- });
- }
- // couldn't save test picture earlier, so nothing to delete here
- done();
- }, 3 * MINUTE);
-
- });
-
- it('camera.ui.util Destroy the session', function (done) {
- return driver.quit(done);
- }, 10000);
-});
diff --git a/plugins/cordova-plugin-camera/appium-tests/helpers/cameraHelper.js b/plugins/cordova-plugin-camera/appium-tests/helpers/cameraHelper.js
deleted file mode 100644
index 9342a30..0000000
--- a/plugins/cordova-plugin-camera/appium-tests/helpers/cameraHelper.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*jshint node: true */
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-'use strict';
-
-var cameraConstants = require('../../www/CameraConstants');
-
-module.exports.generateSpecs = function (sourceTypes, destinationTypes, encodingTypes, allowEditOptions) {
- var destinationType,
- sourceType,
- encodingType,
- allowEdit,
- specs = [],
- id = 1;
- for (destinationType in destinationTypes) {
- if (destinationTypes.hasOwnProperty(destinationType)) {
- for (sourceType in sourceTypes) {
- if (sourceTypes.hasOwnProperty(sourceType)) {
- for (encodingType in encodingTypes) {
- if (encodingTypes.hasOwnProperty(encodingType)) {
- for (allowEdit in allowEditOptions) {
- if (allowEditOptions.hasOwnProperty(allowEdit)) {
- // if taking picture from photolibrary, don't vary 'correctOrientation' option
- if (sourceTypes[sourceType] === cameraConstants.PictureSourceType.PHOTOLIBRARY) {
- specs.push({
- 'id': id++,
- 'options': {
- 'destinationType': destinationTypes[destinationType],
- 'sourceType': sourceTypes[sourceType],
- 'encodingType': encodingTypes[encodingType],
- 'allowEdit': allowEditOptions[allowEdit],
- 'saveToPhotoAlbum': false,
- }
- });
- } else {
- specs.push({
- 'id': id++,
- 'options': {
- 'destinationType': destinationTypes[destinationType],
- 'sourceType': sourceTypes[sourceType],
- 'encodingType': encodingTypes[encodingType],
- 'correctOrientation': true,
- 'allowEdit': allowEditOptions[allowEdit],
- 'saveToPhotoAlbum': false,
- }
- }, {
- 'id': id++,
- 'options': {
- 'destinationType': destinationTypes[destinationType],
- 'sourceType': sourceTypes[sourceType],
- 'encodingType': encodingTypes[encodingType],
- 'correctOrientation': false,
- 'allowEdit': allowEditOptions[allowEdit],
- 'saveToPhotoAlbum': false,
- }
- });
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return specs;
-};
diff --git a/plugins/cordova-plugin-camera/appium-tests/helpers/screenshotHelper.js b/plugins/cordova-plugin-camera/appium-tests/helpers/screenshotHelper.js
deleted file mode 100644
index 2082105..0000000
--- a/plugins/cordova-plugin-camera/appium-tests/helpers/screenshotHelper.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* jshint node: true */
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-'use strict';
-
-var path = require('path');
-var screenshotPath = global.SCREENSHOT_PATH || path.join(__dirname, '../../appium_screenshots/');
-
-function generateScreenshotName() {
- var date = new Date();
-
- var month = date.getMonth() + 1;
- var day = date.getDate();
- var hour = date.getHours();
- var min = date.getMinutes();
- var sec = date.getSeconds();
-
- month = (month < 10 ? "0" : "") + month;
- day = (day < 10 ? "0" : "") + day;
- hour = (hour < 10 ? "0" : "") + hour;
- min = (min < 10 ? "0" : "") + min;
- sec = (sec < 10 ? "0" : "") + sec;
-
- return date.getFullYear() + '-' + month + '-' + day + '_' + hour + '.' + min + '.' + sec + '.png';
-}
-
-module.exports.saveScreenshot = function (driver) {
- var oldContext;
- return driver
- .currentContext()
- .then(function (cc) {
- oldContext = cc;
- })
- .context('NATIVE_APP')
- .saveScreenshot(screenshotPath + generateScreenshotName())
- .then(function () {
- return driver.context(oldContext);
- });
-};
diff --git a/plugins/cordova-plugin-camera/appium-tests/helpers/wdHelper.js b/plugins/cordova-plugin-camera/appium-tests/helpers/wdHelper.js
deleted file mode 100644
index f14c933..0000000
--- a/plugins/cordova-plugin-camera/appium-tests/helpers/wdHelper.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* jshint node: true */
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-'use strict';
-
-var wd = global.WD || require('wd');
-var driver;
-
-module.exports.getDriver = function (platform, callback) {
- var serverConfig = {
- host: 'localhost',
- port: 4723
- },
- driverConfig = {
- browserName: '',
- 'appium-version': '1.5',
- platformName: platform,
- platformVersion: global.PLATFORM_VERSION || '',
- deviceName: global.DEVICE_NAME || '',
- app: global.PACKAGE_PATH,
- autoAcceptAlerts: true,
- };
-
- if (process.env.CHROMEDRIVER_EXECUTABLE) {
- driverConfig.chromedriverExecutable = process.env.CHROMEDRIVER_EXECUTABLE;
- }
- driver = wd.promiseChainRemote(serverConfig);
- module.exports.configureLogging(driver);
-
- return driver.init(driverConfig).setImplicitWaitTimeout(10000)
- .sleep(20000) // wait for the app to load
- .then(callback);
-};
-
-module.exports.getWD = function () {
- return wd;
-};
-
-module.exports.configureLogging = function (driver) {
- driver.on('status', function (info) {
- console.log(info);
- });
- driver.on('command', function (meth, path, data) {
- console.log(' > ' + meth, path, data || '');
- });
- driver.on('http', function (meth, path, data) {
- console.log(' > ' + meth, path, data || '');
- });
-};
diff --git a/plugins/cordova-plugin-camera/appium-tests/ios/ios.spec.js b/plugins/cordova-plugin-camera/appium-tests/ios/ios.spec.js
deleted file mode 100644
index 0232357..0000000
--- a/plugins/cordova-plugin-camera/appium-tests/ios/ios.spec.js
+++ /dev/null
@@ -1,288 +0,0 @@
-/*jshint node: true, jasmine: true */
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// these tests are meant to be executed by Cordova Medic Appium runner
-// you can find it here: https://github.com/apache/cordova-medic/
-// it is not necessary to do a full CI setup to run these tests
-// just run "node cordova-medic/medic/medic.js appium --platform android --plugins cordova-plugin-camera"
-
-'use strict';
-
-var wdHelper = require('../helpers/wdHelper');
-var wd = wdHelper.getWD();
-var isDevice = global.DEVICE;
-var cameraConstants = require('../../www/CameraConstants');
-var cameraHelper = require('../helpers/cameraHelper');
-var screenshotHelper = require('../helpers/screenshotHelper');
-
-var MINUTE = 60 * 1000;
-var DEFAULT_WEBVIEW_CONTEXT = 'WEBVIEW_1';
-
-describe('Camera tests iOS.', function () {
-
- var driver;
- var webviewContext = DEFAULT_WEBVIEW_CONTEXT;
- var startingMessage = 'Ready for action!';
-
- function win() {
- expect(true).toBe(true);
- }
-
- function fail(error) {
- screenshotHelper.saveScreenshot(driver);
- if (error && error.message) {
- console.log('An error occured: ' + error.message);
- expect(true).toFailWithMessage(error.message);
- throw error.message;
- }
- if (error) {
- console.log('Failed expectation: ' + error);
- expect(true).toFailWithMessage(error);
- throw error;
- }
- // no message provided :(
- expect(true).toBe(false);
- throw 'An error without description occured';
- }
-
- // generates test specs by combining all the specified options
- // you can add more options to test more scenarios
- function generateSpecs() {
- var sourceTypes = [
- cameraConstants.PictureSourceType.CAMERA,
- cameraConstants.PictureSourceType.PHOTOLIBRARY
- ],
- destinationTypes = cameraConstants.DestinationType,
- encodingTypes = [
- cameraConstants.EncodingType.JPEG,
- cameraConstants.EncodingType.PNG
- ],
- allowEditOptions = [
- true,
- false
- ];
-
- return cameraHelper.generateSpecs(sourceTypes, destinationTypes, encodingTypes, allowEditOptions);
- }
-
- function getPicture(options, cancelCamera, skipUiInteractions) {
- if (!options) {
- options = {};
- }
- var command = "navigator.camera.getPicture(function (result) { document.getElementById('info').innerHTML = 'Success: ' + result.slice(0, 100); }, " +
- "function (err) { document.getElementById('info').innerHTML = 'ERROR: ' + err; }," + JSON.stringify(options) + ");";
- return driver
- .sleep(2000)
- .context(webviewContext)
- .execute(command)
- .sleep(5000)
- .context('NATIVE_APP')
- .then(function () {
- if (skipUiInteractions) {
- return;
- }
- if (options.hasOwnProperty('sourceType') && options.sourceType === cameraConstants.PictureSourceType.PHOTOLIBRARY) {
- return driver
- .elementByName('Camera Roll')
- .click()
- .elementByXPath('//UIACollectionCell')
- .click()
- .then(function () {
- if (options.hasOwnProperty('allowEdit') && options.allowEdit === true) {
- return driver
- .elementByName('Use')
- .click();
- }
- return driver;
- });
- }
- if (options.hasOwnProperty('sourceType') && options.sourceType === cameraConstants.PictureSourceType.SAVEDPHOTOALBUM) {
- return driver
- .elementByXPath('//UIACollectionCell')
- .click()
- .then(function () {
- if (options.hasOwnProperty('allowEdit') && options.allowEdit === true) {
- return driver
- .elementByName('Use')
- .click();
- }
- return driver;
- });
- }
- if (cancelCamera) {
- return driver
- .elementByName('Cancel')
- .click();
- }
- return driver
- .elementByName('PhotoCapture')
- .click()
- .elementByName('Use Photo')
- .click();
- })
- .sleep(3000);
- }
-
- function enterTest() {
- return driver
- .contexts(function (err, contexts) {
- if (err) {
- fail(err);
- } else {
- // if WEBVIEW context is available, use it
- // if not, use NATIVE_APP
- webviewContext = contexts[contexts.length - 1];
- }
- })
- .then(function () {
- return driver
- .context(webviewContext);
- })
- .fail(fail)
- .elementById('info')
- .fail(function () {
- // unknown starting page: no 'info' div
- // adding it manually
- return driver
- .execute('var info = document.createElement("div"); ' +
- 'info.id = "info"' +
- 'document.body.appendChild(info);')
- .fail(fail);
- })
- .execute('document.getElementById("info").innerHTML = "' + startingMessage + '";')
- .fail(fail);
- }
-
- function checkPicture(shouldLoad) {
- return driver
- .contexts(function (err, contexts) {
- // if WEBVIEW context is available, use it
- // if not, use NATIVE_APP
- webviewContext = contexts[contexts.length - 1];
- })
- .context(webviewContext)
- .elementById('info')
- .getAttribute('innerHTML')
- .then(function (html) {
- if (html.indexOf(startingMessage) >= 0) {
- expect(true).toFailWithMessage('No callback was fired');
- } else if (shouldLoad) {
- expect(html.length).toBeGreaterThan(0);
- if (html.indexOf('ERROR') >= 0) {
- expect(true).toFailWithMessage(html);
- }
- } else {
- if (html.indexOf('ERROR') === -1) {
- expect(true).toFailWithMessage('Unexpected success callback with result: ' + html);
- }
- expect(html.indexOf('ERROR')).toBe(0);
- }
- })
- .context('NATIVE_APP');
- }
-
- function runCombinedSpec(spec) {
- return enterTest()
- .then(function () {
- return getPicture(spec.options);
- })
- .then(function () {
- return checkPicture(true);
- })
- .then(win, fail);
- }
-
- beforeEach(function () {
- jasmine.addMatchers({
- toFailWithMessage : function () {
- return {
- compare: function (actual, msg) {
- console.log('Failing with message: ' + msg);
- var result = {
- pass: false,
- message: msg
- };
- return result;
- }
- };
- }
- });
- });
-
- it('camera.ui.util Configuring driver and starting a session', function (done) {
- driver = wdHelper.getDriver('iOS', done);
- }, 3 * MINUTE);
-
- describe('Specs.', function () {
- // getPicture() with mediaType: VIDEO, sourceType: PHOTOLIBRARY
- it('camera.ui.spec.1 Selecting only videos', function (done) {
- var options = { sourceType: cameraConstants.PictureSourceType.PHOTOLIBRARY,
- mediaType: cameraConstants.MediaType.VIDEO };
- enterTest()
- .then(function () { return getPicture(options, false, true); }) // skip ui unteractions
- .sleep(5000)
- .elementByName('Videos')
- .then(win, fail)
- .elementByName('Cancel')
- .click()
- .finally(done);
- }, 3 * MINUTE);
-
- // getPicture(), then dismiss
- // wait for the error callback to bee called
- it('camera.ui.spec.2 Dismissing the camera', function (done) {
- // camera is not available on iOS simulator
- if (!isDevice) {
- pending();
- }
- var options = { sourceType: cameraConstants.PictureSourceType.CAMERA };
- enterTest()
- .then(function () {
- return getPicture(options, true);
- })
- .then(function () {
- return checkPicture(false);
- })
- .elementByXPath('//UIAStaticText[contains(@label,"no image selected")]')
- .then(function () {
- return checkPicture(false);
- }, fail)
- .finally(done);
- }, 3 * MINUTE);
-
- // combine various options for getPicture()
- generateSpecs().forEach(function (spec) {
- it('camera.ui.spec.3.' + spec.id + ' Combining options', function (done) {
- // camera is not available on iOS simulator
- if (!isDevice) {
- pending();
- }
- runCombinedSpec(spec).then(done);
- }, 3 * MINUTE);
- });
-
- });
-
- it('camera.ui.util.4 Destroy the session', function (done) {
- driver.quit(done);
- }, 10000);
-});
diff --git a/plugins/cordova-plugin-camera/doc/de/README.md b/plugins/cordova-plugin-camera/doc/de/README.md
deleted file mode 100644
index 97e6526..0000000
--- a/plugins/cordova-plugin-camera/doc/de/README.md
+++ /dev/null
@@ -1,421 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-Dieses Plugin definiert eine globale `navigator.camera`-Objekt, das eine API für Aufnahmen und für die Auswahl der Bilder aus dem System-Image-Library bietet.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * Kamera
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * navigator.camera.cleanup
-
-## navigator.camera.getPicture
-
-Nimmt ein Foto mit der Kamera, oder ein Foto aus dem Gerät Bildergalerie abgerufen. Das Bild wird an den Erfolg-Rückruf als base64-codierte `String` oder als URI für die Image-Datei übergeben. Die Methode selbst gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Datei-Auswahl-Popover neu zu positionieren.
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### Beschreibung
-
-Die `camera.getPicture`-Funktion öffnet das Gerät Standard-Kamera-Anwendung, die Benutzern ermöglicht, Bilder ausrichten. Dieses Verhalten tritt in der Standardeinstellung, wenn `Camera.sourceType` `Camera.PictureSourceType.CAMERA` entspricht. Sobald der Benutzer die Fotoschnäpper, die Kameraanwendung geschlossen wird und die Anwendung wird wiederhergestellt.
-
-Wenn `Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` oder `Camera.PictureSourceType.SAVEDPHOTOALBUM` ist, dann wird ein Dialogfeld angezeigt, das Benutzern ermöglicht, ein vorhandenes Bild auszuwählen. Die `camera.getPicture`-Funktion gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Bild-Auswahl-Dialog, z. B. beim ändert sich der Orientierung des Geräts neu positionieren.
-
-Der Rückgabewert wird an die `cameraSuccess`-Callback-Funktion in einem der folgenden Formate, je nach dem angegebenen `cameraOptions` gesendet:
-
- * A `String` mit dem base64-codierte Foto-Bild.
-
- * A `String` , die die Bild-Datei-Stelle auf lokalem Speicher (Standard).
-
-Sie können tun, was Sie wollen, mit dem codierten Bildes oder URI, zum Beispiel:
-
- * Rendern Sie das Bild in ein `` Tag, wie im folgenden Beispiel
-
- * Die Daten lokal zu speichern ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/), etc..)
-
- * Post die Daten an einen entfernten server
-
-**Hinweis**: Fotoauflösung auf neueren Geräten ist ganz gut. Fotos aus dem Gerät Galerie ausgewählt sind nicht zu einer niedrigeren Qualität herunterskaliert, selbst wenn ein `Qualität`-Parameter angegeben wird. Um Speicherprobleme zu vermeiden, legen Sie `Camera.destinationType` auf `FILE_URI` statt `DATA_URL`.
-
-#### Unterstützte Plattformen
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### Beispiel
-
-Nehmen Sie ein Foto und rufen Sie sie als base64-codierte Bild:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Nehmen Sie ein Foto und rufen Sie das Bild-Datei-Speicherort:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### "Einstellungen" (iOS)
-
- * **CameraUsesGeolocation** (Boolean, Standardwert ist False). Zur Erfassung von JPEGs, auf true festgelegt, um Geolocation-Daten im EXIF-Header zu erhalten. Dies löst einen Antrag auf Geolocation-Berechtigungen, wenn auf True festgelegt.
-
-
-
-
-#### Amazon Fire OS Macken
-
-Amazon Fire OS verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird.
-
-#### Android Eigenarten
-
-Android verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird.
-
-#### Browser-Eigenheiten
-
-Fotos können nur als base64-codierte Bild zurückgeben werden.
-
-#### Firefox OS Macken
-
-Kamera-Plugin ist derzeit implementiert mithilfe von [Web-Aktivitäten](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
-
-#### iOS Macken
-
-Einschließlich einer JavaScript-`alert()` entweder Rückruffunktionen kann Probleme verursachen. Wickeln Sie die Warnung innerhalb eine `setTimeout()` erlauben die iOS-Bild-Picker oder Popover vollständig zu schließen, bevor die Warnung angezeigt:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Windows Phone 7 Macken
-
-Die native Kameraanwendung aufrufen, während das Gerät via Zune angeschlossen ist funktioniert nicht und löst eine Fehler-Callback.
-
-#### Tizen Macken
-
-Tizen unterstützt nur ein `DestinationType` von `Camera.DestinationType.FILE_URI` und ein `SourceType` von `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-## CameraOptions
-
-Optionale Parameter die Kameraeinstellungen anpassen.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
- * **Qualität**: Qualität des gespeicherten Bildes, ausgedrückt als ein Bereich von 0-100, wo 100 in der Regel voller Auflösung ohne Verlust aus der Dateikomprimierung ist. Der Standardwert ist 50. *(Anzahl)* (Beachten Sie, dass Informationen über die Kamera Auflösung nicht verfügbar ist.)
-
- * **DestinationType**: Wählen Sie das Format des Rückgabewerts. Der Standardwert ist FILE_URI. Im Sinne `navigator.camera.DestinationType` *(Anzahl)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **SourceType**: Legen Sie die Quelle des Bildes. Der Standardwert ist die Kamera. Im Sinne `navigator.camera.PictureSourceType` *(Anzahl)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **AllowEdit**: einfache Bearbeitung des Bildes vor Auswahl zu ermöglichen. *(Boolesch)*
-
- * **EncodingType**: die zurückgegebene Image-Datei ist Codierung auswählen. Standardwert ist JPEG. Im Sinne `navigator.camera.EncodingType` *(Anzahl)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **TargetWidth**: Breite in Pixel zum Bild skalieren. Muss mit **TargetHeight**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)*
-
- * **TargetHeight**: Höhe in Pixel zum Bild skalieren. Muss mit **TargetWidth**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)*
-
- * **MediaType**: Legen Sie den Typ der Medien zur Auswahl. Funktioniert nur, wenn `PictureSourceType` ist `PHOTOLIBRARY` oder `SAVEDPHOTOALBUM` . Im Sinne `nagivator.camera.MediaType` *(Anzahl)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. STANDARD. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **CorrectOrientation**: Drehen Sie das Bild um die Ausrichtung des Geräts während der Aufnahme zu korrigieren. *(Boolesch)*
-
- * **SaveToPhotoAlbum**: das Bild auf das Fotoalbum auf dem Gerät zu speichern, nach Einnahme. *(Boolesch)*
-
- * **PopoverOptions**: iOS-nur Optionen, die Popover Lage in iPad angeben. In definierten`CameraPopoverOptions`.
-
- * **CameraDirection**: Wählen Sie die Kamera (vorn oder hinten-gerichtete) verwenden. Der Standardwert ist zurück. Im Sinne `navigator.camera.Direction` *(Anzahl)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### Amazon Fire OS Macken
-
- * `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert.
-
- * Ignoriert die `allowEdit` Parameter.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen.
-
-#### Android Eigenarten
-
- * `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert.
-
- * Android verwendet auch die Ernte-Aktivität für AllowEdit, obwohl Ernte sollte arbeiten und das zugeschnittene Bild zurück zu Cordova, das einzige, dass Werke konsequent die gebündelt mit der Google-Plus-Fotos-Anwendung ist tatsächlich zu übergeben. Andere Kulturen funktioniert möglicherweise nicht.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen.
-
-#### BlackBerry 10 Macken
-
- * Ignoriert die `quality` Parameter.
-
- * Ignoriert die `allowEdit` Parameter.
-
- * `Camera.MediaType`wird nicht unterstützt.
-
- * Ignoriert die `correctOrientation` Parameter.
-
- * Ignoriert die `cameraDirection` Parameter.
-
-#### Firefox OS Macken
-
- * Ignoriert die `quality` Parameter.
-
- * `Camera.DestinationType`wird ignoriert, und gleich `1` (Bilddatei-URI)
-
- * Ignoriert die `allowEdit` Parameter.
-
- * Ignoriert die `PictureSourceType` Parameter (Benutzer wählt es in einem Dialogfenster)
-
- * Ignoriert die`encodingType`
-
- * Ignoriert die `targetWidth` und`targetHeight`
-
- * `Camera.MediaType`wird nicht unterstützt.
-
- * Ignoriert die `correctOrientation` Parameter.
-
- * Ignoriert die `cameraDirection` Parameter.
-
-#### iOS Macken
-
- * Legen Sie `quality` unter 50 Speicherfehler auf einigen Geräten zu vermeiden.
-
- * Bei der Verwendung `destinationType.FILE_URI` , Fotos werden im temporären Verzeichnis der Anwendung gespeichert. Den Inhalt des temporären Verzeichnis der Anwendung wird gelöscht, wenn die Anwendung beendet.
-
-#### Tizen Macken
-
- * nicht unterstützte Optionen
-
- * gibt immer einen Datei-URI
-
-#### Windows Phone 7 und 8 Eigenarten
-
- * Ignoriert die `allowEdit` Parameter.
-
- * Ignoriert die `correctOrientation` Parameter.
-
- * Ignoriert die `cameraDirection` Parameter.
-
- * Ignoriert die `saveToPhotoAlbum` Parameter. WICHTIG: Alle Aufnahmen die wp7/8 Cordova-Kamera-API werden immer in Kamerarolle des Telefons kopiert. Abhängig von den Einstellungen des Benutzers könnte dies auch bedeuten, dass das Bild in ihre OneDrive automatisch hochgeladen ist. Dies könnte möglicherweise bedeuten, dass das Bild für ein breiteres Publikum als Ihre Anwendung vorgesehen ist. Wenn diese einen Blocker für Ihre Anwendung, Sie müssen die CameraCaptureTask zu implementieren, wie im Msdn dokumentiert: Sie können kommentieren oder Up-Abstimmung das Beiträge zu diesem Thema im [Bugtracker](https://issues.apache.org/jira/browse/CB-2083)
-
- * Ignoriert die `mediaType` -Eigenschaft des `cameraOptions` wie das Windows Phone SDK keine Möglichkeit, Fotothek Videos wählen.
-
-## CameraError
-
-onError-Callback-Funktion, die eine Fehlermeldung bereitstellt.
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### Beschreibung
-
- * **Meldung**: die Nachricht wird durch das Gerät systemeigenen Code bereitgestellt. *(String)*
-
-## cameraSuccess
-
-onSuccess Callback-Funktion, die die Bilddaten bereitstellt.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### Beschreibung
-
- * **CMYK**: Base64-Codierung der Bilddaten, *oder* die Image-Datei-URI, je nach `cameraOptions` in Kraft. *(String)*
-
-#### Beispiel
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Ein Handle für das Dialogfeld "Popover" erstellt von `navigator.camera.getPicture`.
-
-#### Beschreibung
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### Unterstützte Plattformen
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Beispiel
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-nur iOS-Parametern, die Anker-Element Lage und Pfeil Richtung der Popover angeben, bei der Auswahl von Bildern aus einem iPad Bibliothek oder Album.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### Beschreibung
-
- * **X**: x Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
- * **y**: y Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
- * **width**: Breite in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
- * **height**: Höhe in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
- * **arrowDir**: Richtung der Pfeil auf der Popover zeigen sollte. Im Sinne `Camera.PopoverArrowDirection` *(Anzahl)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Beachten Sie, dass die Größe der Popover ändern kann, um die Richtung des Pfeils und Ausrichtung des Bildschirms anzupassen. Achten Sie darauf, um Orientierung zu berücksichtigen, wenn Sie den Anker-Element-Speicherort angeben.
-
-## navigator.camera.cleanup
-
-Entfernt Mittelstufe Fotos von der Kamera aus der vorübergehenden Verwahrung genommen.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-#### Beschreibung
-
-Fortgeschrittene Image-Dateien, die in vorübergehender Verwahrung gehalten werden, nach dem Aufruf von `camera.getPicture` entfernt. Gilt nur wenn der Wert von `Camera.sourceType` gleich `Camera.PictureSourceType.CAMERA` und `Camera.destinationType` gleich `Camera.DestinationType.FILE_URI`.
-
-#### Unterstützte Plattformen
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Beispiel
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/de/index.md b/plugins/cordova-plugin-camera/doc/de/index.md
deleted file mode 100644
index 1c7486c..0000000
--- a/plugins/cordova-plugin-camera/doc/de/index.md
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-# cordova-plugin-camera
-
-Dieses Plugin definiert eine globale `navigator.camera`-Objekt, das eine API für Aufnahmen und für die Auswahl der Bilder aus dem System-Image-Library bietet.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-Nimmt ein Foto mit der Kamera, oder ein Foto aus dem Gerät Bildergalerie abgerufen. Das Bild wird an den Erfolg-Rückruf als base64-codierte `String` oder als URI für die Image-Datei übergeben. Die Methode selbst gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Datei-Auswahl-Popover neu zu positionieren.
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### Beschreibung
-
-Die `camera.getPicture`-Funktion öffnet das Gerät Standard-Kamera-Anwendung, die Benutzern ermöglicht, Bilder ausrichten. Dieses Verhalten tritt in der Standardeinstellung, wenn `Camera.sourceType` `Camera.PictureSourceType.CAMERA` entspricht. Sobald der Benutzer die Fotoschnäpper, die Kameraanwendung geschlossen wird und die Anwendung wird wiederhergestellt.
-
-Wenn `Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` oder `Camera.PictureSourceType.SAVEDPHOTOALBUM` ist, dann wird ein Dialogfeld angezeigt, das Benutzern ermöglicht, ein vorhandenes Bild auszuwählen. Die `camera.getPicture`-Funktion gibt ein `CameraPopoverHandle`-Objekt, das verwendet werden kann, um die Bild-Auswahl-Dialog, z. B. beim ändert sich der Orientierung des Geräts neu positionieren.
-
-Der Rückgabewert wird an die `cameraSuccess`-Callback-Funktion in einem der folgenden Formate, je nach dem angegebenen `cameraOptions` gesendet:
-
-* A `String` mit dem base64-codierte Foto-Bild.
-
-* A `String` , die die Bild-Datei-Stelle auf lokalem Speicher (Standard).
-
-Sie können tun, was Sie wollen, mit dem codierten Bildes oder URI, zum Beispiel:
-
-* Rendern Sie das Bild in ein `` Tag, wie im folgenden Beispiel
-
-* Die Daten lokal zu speichern ( `LocalStorage` , [Lawnchair][1], etc..)
-
-* Post die Daten an einen entfernten server
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**Hinweis**: Fotoauflösung auf neueren Geräten ist ganz gut. Fotos aus dem Gerät Galerie ausgewählt sind nicht zu einer niedrigeren Qualität herunterskaliert, selbst wenn ein `Qualität`-Parameter angegeben wird. Um Speicherprobleme zu vermeiden, legen Sie `Camera.destinationType` auf `FILE_URI` statt `DATA_URL`.
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Browser
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 und 8
-* Windows 8
-
-### "Einstellungen" (iOS)
-
-* **CameraUsesGeolocation** (Boolean, Standardwert ist False). Zur Erfassung von JPEGs, auf true festgelegt, um Geolocation-Daten im EXIF-Header zu erhalten. Dies löst einen Antrag auf Geolocation-Berechtigungen, wenn auf True festgelegt.
-
-
-
-
-### Amazon Fire OS Macken
-
-Amazon Fire OS verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird.
-
-### Android Eigenarten
-
-Android verwendet Absichten zum Starten von der Kamera-Aktivität auf dem Gerät, um Bilder zu erfassen und auf Handys mit wenig Speicher, Cordova Tätigkeit getötet werden kann. In diesem Szenario kann das Bild nicht angezeigt, wenn die Aktivität von Cordova wiederhergestellt wird.
-
-### Browser-Eigenheiten
-
-Fotos können nur als base64-codierte Bild zurückgeben werden.
-
-### Firefox OS Macken
-
-Kamera-Plugin ist derzeit implementiert mithilfe von [Web-Aktivitäten][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS Macken
-
-Einschließlich einer JavaScript-`alert()` entweder Rückruffunktionen kann Probleme verursachen. Wickeln Sie die Warnung innerhalb eine `setTimeout()` erlauben die iOS-Bild-Picker oder Popover vollständig zu schließen, bevor die Warnung angezeigt:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-### Windows Phone 7 Macken
-
-Die native Kameraanwendung aufrufen, während das Gerät via Zune angeschlossen ist funktioniert nicht und löst eine Fehler-Callback.
-
-### Tizen Macken
-
-Tizen unterstützt nur ein `DestinationType` von `Camera.DestinationType.FILE_URI` und ein `SourceType` von `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-### Beispiel
-
-Nehmen Sie ein Foto und rufen Sie sie als base64-codierte Bild:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Nehmen Sie ein Foto und rufen Sie das Bild-Datei-Speicherort:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-Optionale Parameter die Kameraeinstellungen anpassen.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### Optionen
-
-* **Qualität**: Qualität des gespeicherten Bildes, ausgedrückt als ein Bereich von 0-100, wo 100 in der Regel voller Auflösung ohne Verlust aus der Dateikomprimierung ist. Der Standardwert ist 50. *(Anzahl)* (Beachten Sie, dass Informationen über die Kamera Auflösung nicht verfügbar ist.)
-
-* **DestinationType**: Wählen Sie das Format des Rückgabewerts. Der Standardwert ist FILE_URI. Im Sinne `navigator.camera.DestinationType` *(Anzahl)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **SourceType**: Legen Sie die Quelle des Bildes. Der Standardwert ist die Kamera. Im Sinne `navigator.camera.PictureSourceType` *(Anzahl)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **AllowEdit**: einfache Bearbeitung des Bildes vor Auswahl zu ermöglichen. *(Boolesch)*
-
-* **EncodingType**: die zurückgegebene Image-Datei ist Codierung auswählen. Standardwert ist JPEG. Im Sinne `navigator.camera.EncodingType` *(Anzahl)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **TargetWidth**: Breite in Pixel zum Bild skalieren. Muss mit **TargetHeight**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)*
-
-* **TargetHeight**: Höhe in Pixel zum Bild skalieren. Muss mit **TargetWidth**verwendet werden. Seitenverhältnis bleibt konstant. *(Anzahl)*
-
-* **MediaType**: Legen Sie den Typ der Medien zur Auswahl. Funktioniert nur, wenn `PictureSourceType` ist `PHOTOLIBRARY` oder `SAVEDPHOTOALBUM` . Im Sinne `nagivator.camera.MediaType` *(Anzahl)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. STANDARD. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **CorrectOrientation**: Drehen Sie das Bild um die Ausrichtung des Geräts während der Aufnahme zu korrigieren. *(Boolesch)*
-
-* **SaveToPhotoAlbum**: das Bild auf das Fotoalbum auf dem Gerät zu speichern, nach Einnahme. *(Boolesch)*
-
-* **PopoverOptions**: iOS-nur Optionen, die Popover Lage in iPad angeben. In definierten`CameraPopoverOptions`.
-
-* **CameraDirection**: Wählen Sie die Kamera (vorn oder hinten-gerichtete) verwenden. Der Standardwert ist zurück. Im Sinne `navigator.camera.Direction` *(Anzahl)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### Amazon Fire OS Macken
-
-* `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert.
-
-* Ignoriert die `allowEdit` Parameter.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen.
-
-### Android Eigenarten
-
-* `cameraDirection`Ergebnisse in einem hinten gerichteter Foto Wert.
-
-* Ignoriert die `allowEdit` Parameter.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`und `Camera.PictureSourceType.SAVEDPHOTOALBUM` beide das gleiche Fotoalbum anzuzeigen.
-
-### BlackBerry 10 Macken
-
-* Ignoriert die `quality` Parameter.
-
-* Ignoriert die `allowEdit` Parameter.
-
-* `Camera.MediaType`wird nicht unterstützt.
-
-* Ignoriert die `correctOrientation` Parameter.
-
-* Ignoriert die `cameraDirection` Parameter.
-
-### Firefox OS Macken
-
-* Ignoriert die `quality` Parameter.
-
-* `Camera.DestinationType`wird ignoriert, und gleich `1` (Bilddatei-URI)
-
-* Ignoriert die `allowEdit` Parameter.
-
-* Ignoriert die `PictureSourceType` Parameter (Benutzer wählt es in einem Dialogfenster)
-
-* Ignoriert die`encodingType`
-
-* Ignoriert die `targetWidth` und`targetHeight`
-
-* `Camera.MediaType`wird nicht unterstützt.
-
-* Ignoriert die `correctOrientation` Parameter.
-
-* Ignoriert die `cameraDirection` Parameter.
-
-### iOS Macken
-
-* Legen Sie `quality` unter 50 Speicherfehler auf einigen Geräten zu vermeiden.
-
-* Bei der Verwendung `destinationType.FILE_URI` , Fotos werden im temporären Verzeichnis der Anwendung gespeichert. Den Inhalt des temporären Verzeichnis der Anwendung wird gelöscht, wenn die Anwendung beendet.
-
-### Tizen Macken
-
-* nicht unterstützte Optionen
-
-* gibt immer einen Datei-URI
-
-### Windows Phone 7 und 8 Eigenarten
-
-* Ignoriert die `allowEdit` Parameter.
-
-* Ignoriert die `correctOrientation` Parameter.
-
-* Ignoriert die `cameraDirection` Parameter.
-
-* Ignoriert die `saveToPhotoAlbum` Parameter. WICHTIG: Alle Aufnahmen die wp7/8 Cordova-Kamera-API werden immer in Kamerarolle des Telefons kopiert. Abhängig von den Einstellungen des Benutzers könnte dies auch bedeuten, dass das Bild in ihre OneDrive automatisch hochgeladen ist. Dies könnte möglicherweise bedeuten, dass das Bild für ein breiteres Publikum als Ihre Anwendung vorgesehen ist. Wenn diese einen Blocker für Ihre Anwendung, Sie müssen die CameraCaptureTask zu implementieren, wie im Msdn dokumentiert: Sie können kommentieren oder Up-Abstimmung das Beiträge zu diesem Thema im [Bugtracker][3]
-
-* Ignoriert die `mediaType` -Eigenschaft des `cameraOptions` wie das Windows Phone SDK keine Möglichkeit, Fotothek Videos wählen.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-onError-Callback-Funktion, die eine Fehlermeldung bereitstellt.
-
- function(message) {
- // Show a helpful message
- }
-
-
-### Parameter
-
-* **Meldung**: die Nachricht wird durch das Gerät systemeigenen Code bereitgestellt. *(String)*
-
-## cameraSuccess
-
-onSuccess Callback-Funktion, die die Bilddaten bereitstellt.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### Parameter
-
-* **CMYK**: Base64-Codierung der Bilddaten, *oder* die Image-Datei-URI, je nach `cameraOptions` in Kraft. *(String)*
-
-### Beispiel
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Ein Handle für das Dialogfeld "Popover" erstellt von `navigator.camera.getPicture`.
-
-### Methoden
-
-* **SetPosition**: Legen Sie die Position der Popover.
-
-### Unterstützte Plattformen
-
-* iOS
-
-### setPosition
-
-Legen Sie die Position von der Popover.
-
-**Parameter**:
-
-* `cameraPopoverOptions`: die `CameraPopoverOptions` angeben, dass die neue Position
-
-### Beispiel
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-nur iOS-Parametern, die Anker-Element Lage und Pfeil Richtung der Popover angeben, bei der Auswahl von Bildern aus einem iPad Bibliothek oder Album.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-### CameraPopoverOptions
-
-* **X**: x Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
-* **y**: y Pixelkoordinate des Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
-* **width**: Breite in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
-* **height**: Höhe in Pixeln, das Bildschirmelement auf dem der Popover zu verankern. *(Anzahl)*
-
-* **arrowDir**: Richtung der Pfeil auf der Popover zeigen sollte. Im Sinne `Camera.PopoverArrowDirection` *(Anzahl)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Beachten Sie, dass die Größe der Popover ändern kann, um die Richtung des Pfeils und Ausrichtung des Bildschirms anzupassen. Achten Sie darauf, um Orientierung zu berücksichtigen, wenn Sie den Anker-Element-Speicherort angeben.
-
-## navigator.camera.cleanup
-
-Entfernt Mittelstufe Fotos von der Kamera aus der vorübergehenden Verwahrung genommen.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### Beschreibung
-
-Fortgeschrittene Image-Dateien, die in vorübergehender Verwahrung gehalten werden, nach dem Aufruf von `camera.getPicture` entfernt. Gilt nur wenn der Wert von `Camera.sourceType` gleich `Camera.PictureSourceType.CAMERA` und `Camera.destinationType` gleich `Camera.DestinationType.FILE_URI`.
-
-### Unterstützte Plattformen
-
-* iOS
-
-### Beispiel
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/doc/es/README.md b/plugins/cordova-plugin-camera/doc/es/README.md
deleted file mode 100644
index 76af164..0000000
--- a/plugins/cordova-plugin-camera/doc/es/README.md
+++ /dev/null
@@ -1,411 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-Este plugin define un global `navigator.camera` objeto que proporciona una API para tomar fotografías y por elegir imágenes de biblioteca de imágenes del sistema.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log(navigator.camera)};
-
-
-## Instalación
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * Cámara
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * Navigator.Camera.Cleanup
-
-## navigator.camera.getPicture
-
-Toma una foto con la cámara, o recupera una foto de Galería de imágenes del dispositivo. La imagen se pasa a la devolución de llamada de éxito como un codificado en base64 `String` , o como el URI para el archivo de imagen. El método se devuelve un `CameraPopoverHandle` objeto que puede utilizarse para volver a colocar el popover de selección de archivo.
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### Descripción
-
-El `camera.getPicture` función abre la aplicación de cámara predeterminada del dispositivo que permite a los usuarios ajustar imágenes. Este comportamiento se produce de forma predeterminada, cuando `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` . Una vez que el usuario ajusta la foto, una aplicación de cámara se cierra y se restablecerá la aplicación.
-
-Si `Camera.sourceType` es `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM` , entonces una muestra de diálogo que permite a los usuarios seleccionar una imagen existente. El `camera.getPicture` función devuelve un `CameraPopoverHandle` objeto, que puede utilizarse para volver a colocar el diálogo de selección de imagen, por ejemplo, cuando cambia la orientación del dispositivo.
-
-El valor devuelto es enviado a la `cameraSuccess` función de callback, en uno de los formatos siguientes, dependiendo del objeto `cameraOptions` :
-
- * Una `String` que contiene la imagen codificada en base64.
-
- * Una `String` que representa la ubicación del archivo de imagen en almacenamiento local (por defecto).
-
-Puedes hacer lo que quieras con la imagen codificada o URI, por ejemplo:
-
- * Representar la imagen en una etiqueta de ``, como en el ejemplo siguiente
-
- * Guardar los datos localmente (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
-
- * Enviar los datos a un servidor remoto
-
-**Nota**: resolución de la foto en los nuevos dispositivos es bastante bueno. Fotos seleccionadas de la Galería del dispositivo no son degradadas a una calidad más baja, incluso si un `quality` se especifica el parámetro. Para evitar problemas con la memoria común, establezca `Camera.destinationType` a `FILE_URI` en lugar de`DATA_URL`.
-
-#### Plataformas soportadas
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### Ejemplo
-
-Tomar una foto y recuperarlo como una imagen codificada en base64:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Tomar una foto y recuperar la ubicación del archivo de la imagen:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### Preferencias (iOS)
-
- * **CameraUsesGeolocation** (booleano, el valor predeterminado de false). Para la captura de imágenes JPEG, establecido en true para obtener datos de geolocalización en la cabecera EXIF. Esto activará la solicitud de permisos de geolocalización si establecido en true.
-
-
-
-
-#### Amazon fuego OS rarezas
-
-Amazon fuego OS utiliza los intentos para poner en marcha la actividad de la cámara del dispositivo para capturar imágenes y en teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad cordova.
-
-#### Rarezas Android
-
-Android utiliza los intentos para iniciar la actividad de la cámara del dispositivo para capturar imágenes, y en los teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad Cordova.
-
-#### Navegador rarezas
-
-Sólo puede devolver fotos como imagen codificada en base64.
-
-#### Firefox OS rarezas
-
-Cámara plugin actualmente se implementa mediante [Actividades Web](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
-
-#### iOS rarezas
-
-Incluyendo un JavaScript `alert()` en cualquiera de la devolución de llamada funciones pueden causar problemas. Envuelva la alerta dentro de un `setTimeout()` para permitir que el selector de imagen iOS o popover cerrar completamente antes de la alerta se muestra:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Windows Phone 7 rarezas
-
-Invocando la aplicación de cámara nativa mientras el dispositivo está conectado vía Zune no funciona y desencadena un callback de error.
-
-#### Rarezas Tizen
-
-Tizen sólo es compatible con un `destinationType` de `Camera.DestinationType.FILE_URI` y un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`.
-
-## CameraOptions
-
-Parámetros opcionales para personalizar la configuración de la cámara.
-
- {calidad: destinationType 75,: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, targetWidth: 100, targetHeight: 100, popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: falsa};
-
-
- * **calidad**: calidad de la imagen guardada, expresada en un rango de 0-100, donde 100 es típicamente resolución sin pérdida de compresión del archivo. El valor predeterminado es 50. *(Número)* (Tenga en cuenta que no está disponible información sobre resolución de la cámara).
-
- * **destinationType**: elegir el formato del valor devuelto. El valor predeterminado es FILE_URI. Definido en `navigator.camera.DestinationType` *(número)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **sourceType**: establecer el origen de la imagen. El valor predeterminado es cámara. Definido en `navigator.camera.PictureSourceType` *(número)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **allowEdit**: permite edición sencilla de imagen antes de la selección. *(Booleano)*
-
- * **encodingType**: elegir la codificación del archivo de imagen devuelta. Por defecto es JPEG. Definido en `navigator.camera.EncodingType` *(número)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: ancho en píxeles a escala de la imagen. Debe usarse con **targetHeight**. Proporción se mantiene constante. *(Número)*
-
- * **targetHeight**: altura en píxeles a escala de la imagen. Debe usarse con **targetWidth**. Proporción se mantiene constante. *(Número)*
-
- * **mediaType**: definir el tipo de medios para seleccionar. Sólo funciona cuando `PictureSourceType` es `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definido en `nagivator.camera.MediaType` *(número)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. DE FORMA PREDETERMINADA. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: rotar la imagen para corregir la orientación del dispositivo durante la captura. *(Booleano)*
-
- * **saveToPhotoAlbum**: guardar la imagen en el álbum de fotos en el dispositivo después de su captura. *(Booleano)*
-
- * **popoverOptions**: opciones sólo iOS que especifican popover ubicación en iPad. Definido en`CameraPopoverOptions`.
-
- * **cameraDirection**: elegir la cámara para usar (o parte posterior-frontal). El valor predeterminado es atrás. Definido en `navigator.camera.Direction` *(número)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### Amazon fuego OS rarezas
-
- * Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás.
-
- * Ignora el `allowEdit` parámetro.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos.
-
-#### Rarezas Android
-
- * Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás.
-
- * Android también utiliza la actividad de cultivo de allowEdit, aunque cultivo debe trabajar y realmente pasar la imagen recortada a Córdoba, el único que funciona constantemente es el integrado con la aplicación de Google Plus fotos. Otros cultivos pueden no funcionar.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos.
-
-#### BlackBerry 10 rarezas
-
- * Ignora el `quality` parámetro.
-
- * Ignora el `allowEdit` parámetro.
-
- * `Camera.MediaType`No se admite.
-
- * Ignora el `correctOrientation` parámetro.
-
- * Ignora el `cameraDirection` parámetro.
-
-#### Firefox OS rarezas
-
- * Ignora el `quality` parámetro.
-
- * `Camera.DestinationType`se ignora y es igual a `1` (URI del archivo de imagen)
-
- * Ignora el `allowEdit` parámetro.
-
- * Ignora el `PictureSourceType` parámetro (el usuario lo elige en una ventana de diálogo)
-
- * Ignora el`encodingType`
-
- * Ignora el `targetWidth` y`targetHeight`
-
- * `Camera.MediaType`No se admite.
-
- * Ignora el `correctOrientation` parámetro.
-
- * Ignora el `cameraDirection` parámetro.
-
-#### iOS rarezas
-
- * Establecer `quality` por debajo de 50 para evitar errores de memoria en algunos dispositivos.
-
- * Cuando se utiliza `destinationType.FILE_URI` , fotos se guardan en el directorio temporal de la aplicación. El contenido del directorio temporal de la aplicación se eliminará cuando finalice la aplicación.
-
-#### Rarezas Tizen
-
- * opciones no compatibles
-
- * siempre devuelve un identificador URI de archivo
-
-#### Windows Phone 7 y 8 rarezas
-
- * Ignora el `allowEdit` parámetro.
-
- * Ignora el `correctOrientation` parámetro.
-
- * Ignora el `cameraDirection` parámetro.
-
- * Ignora el `saveToPhotoAlbum` parámetro. IMPORTANTE: Todas las imágenes tomadas con la cámara wp7/8 cordova API siempre se copian en rollo de cámara del teléfono. Dependiendo de la configuración del usuario, esto podría significar también que la imagen es auto-subido a su OneDrive. Esto potencialmente podría significar que la imagen está disponible a una audiencia más amplia que su aplicación previsto. Si un bloqueador para su aplicación, usted necesitará aplicar el CameraCaptureTask como se documenta en msdn: también puede comentar o votar hasta el tema relacionado en el [issue tracker de](https://issues.apache.org/jira/browse/CB-2083)
-
- * Ignora el `mediaType` propiedad de `cameraOptions` como el SDK de Windows Phone no proporciona una manera para elegir vídeos fototeca.
-
-## CameraError
-
-onError función callback que proporciona un mensaje de error.
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### Descripción
-
- * **mensaje**: el mensaje es proporcionado por código nativo del dispositivo. *(String)*
-
-## cameraSuccess
-
-onSuccess función callback que proporciona los datos de imagen.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### Descripción
-
- * **imageData**: codificación en Base64 de los datos de imagen, *o* el archivo de imagen URI, dependiendo de `cameraOptions` en vigor. *(String)*
-
-#### Ejemplo
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Un identificador para el cuadro de diálogo popover creado por`navigator.camera.getPicture`.
-
-#### Descripción
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### Plataformas soportadas
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Ejemplo
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-Sólo iOS parámetros que especifican la dirección ancla elemento ubicación y la flecha de la popover al seleccionar imágenes de biblioteca o álbum de un iPad.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### Descripción
-
- * **x**: coordenadas de píxeles del elemento de la pantalla en la que anclar el popover x. *(Número)*
-
- * **y**: coordenada píxeles del elemento de la pantalla en la que anclar el popover. *(Número)*
-
- * **anchura**: anchura, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)*
-
- * **altura**: alto, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)*
-
- * **arrowDir**: dirección de la flecha en el popover debe apuntar. Definido en `Camera.PopoverArrowDirection` *(número)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Tenga en cuenta que puede cambiar el tamaño de la popover para ajustar la dirección de la flecha y orientación de la pantalla. Asegúrese de que para tener en cuenta los cambios de orientación cuando se especifica la ubicación del elemento de anclaje.
-
-## Navigator.Camera.Cleanup
-
-Elimina intermedio fotos tomadas por la cámara de almacenamiento temporal.
-
- Navigator.Camera.cleanup (cameraSuccess, cameraError);
-
-
-#### Descripción
-
-Elimina intermedio archivos de imagen que se mantienen en depósito temporal después de llamar `camera.getPicture` . Se aplica sólo cuando el valor de `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` y el `Camera.destinationType` es igual a`Camera.DestinationType.FILE_URI`.
-
-#### Plataformas soportadas
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Ejemplo
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/es/index.md b/plugins/cordova-plugin-camera/doc/es/index.md
deleted file mode 100644
index dfd0970..0000000
--- a/plugins/cordova-plugin-camera/doc/es/index.md
+++ /dev/null
@@ -1,391 +0,0 @@
-
-
-# cordova-plugin-camera
-
-Este plugin define un global `navigator.camera` objeto que proporciona una API para tomar fotografías y por elegir imágenes de biblioteca de imágenes del sistema.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log(navigator.camera)};
-
-
-## Instalación
-
- Cordova plugin agregar cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-Toma una foto con la cámara, o recupera una foto de Galería de imágenes del dispositivo. La imagen se pasa a la devolución de llamada de éxito como un codificado en base64 `String` , o como el URI para el archivo de imagen. El método se devuelve un `CameraPopoverHandle` objeto que puede utilizarse para volver a colocar el popover de selección de archivo.
-
- navigator.camera.getPicture (cameraSuccess, cameraError, cameraOptions);
-
-
-### Descripción
-
-El `camera.getPicture` función abre la aplicación de cámara predeterminada del dispositivo que permite a los usuarios ajustar imágenes. Este comportamiento se produce de forma predeterminada, cuando `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` . Una vez que el usuario ajusta la foto, una aplicación de cámara se cierra y se restablecerá la aplicación.
-
-Si `Camera.sourceType` es `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM` , entonces una muestra de diálogo que permite a los usuarios seleccionar una imagen existente. El `camera.getPicture` función devuelve un `CameraPopoverHandle` objeto, que puede utilizarse para volver a colocar el diálogo de selección de imagen, por ejemplo, cuando cambia la orientación del dispositivo.
-
-El valor devuelto es enviado a la `cameraSuccess` función de callback, en uno de los formatos siguientes, dependiendo del objeto `cameraOptions` :
-
-* Una `String` que contiene la imagen codificada en base64.
-
-* Una `String` que representa la ubicación del archivo de imagen en almacenamiento local (por defecto).
-
-Puedes hacer lo que quieras con la imagen codificada o URI, por ejemplo:
-
-* Representar la imagen en una etiqueta de ``, como en el ejemplo siguiente
-
-* Guardar los datos localmente (`LocalStorage`, [Lawnchair][1], etc.)
-
-* Enviar los datos a un servidor remoto
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**Nota**: resolución de la foto en los nuevos dispositivos es bastante bueno. Fotos seleccionadas de la Galería del dispositivo no son degradadas a una calidad más baja, incluso si un `quality` se especifica el parámetro. Para evitar problemas con la memoria común, establezca `Camera.destinationType` a `FILE_URI` en lugar de`DATA_URL`.
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Explorador
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 y 8
-* Windows 8
-
-### Preferencias (iOS)
-
-* **CameraUsesGeolocation** (booleano, el valor predeterminado de false). Para la captura de imágenes JPEG, establecido en true para obtener datos de geolocalización en la cabecera EXIF. Esto activará la solicitud de permisos de geolocalización si establecido en true.
-
-
-
-
-### Amazon fuego OS rarezas
-
-Amazon fuego OS utiliza los intentos para poner en marcha la actividad de la cámara del dispositivo para capturar imágenes y en teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad cordova.
-
-### Rarezas Android
-
-Android utiliza los intentos para iniciar la actividad de la cámara del dispositivo para capturar imágenes, y en los teléfonos con poca memoria, puede matar la actividad Cordova. En este escenario, la imagen no aparezca cuando se restaura la actividad Cordova.
-
-### Navegador rarezas
-
-Sólo puede devolver fotos como imagen codificada en base64.
-
-### Firefox OS rarezas
-
-Cámara plugin actualmente se implementa mediante [Actividades Web][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS rarezas
-
-Incluyendo un JavaScript `alert()` en cualquiera de la devolución de llamada funciones pueden causar problemas. Envuelva la alerta dentro de un `setTimeout()` para permitir que el selector de imagen iOS o popover cerrar completamente antes de la alerta se muestra:
-
- setTimeout(function() {/ / Haz lo tuyo aquí!}, 0);
-
-
-### Windows Phone 7 rarezas
-
-Invocando la aplicación de cámara nativa mientras el dispositivo está conectado vía Zune no funciona y desencadena un callback de error.
-
-### Rarezas Tizen
-
-Tizen sólo es compatible con un `destinationType` de `Camera.DestinationType.FILE_URI` y un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`.
-
-### Ejemplo
-
-Tomar una foto y recuperarlo como una imagen codificada en base64:
-
- navigator.camera.getPicture (onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {var imagen = document.getElementById('myImage');
- Image.src = "datos: image / jpeg; base64," + imageData;}
-
- function onFail(message) {alert (' falló porque: ' + mensaje);}
-
-
-Tomar una foto y recuperar la ubicación del archivo de la imagen:
-
- navigator.camera.getPicture (onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {var imagen = document.getElementById('myImage');
- Image.src = imageURI;
- } function onFail(message) {alert (' falló porque: ' + mensaje);}
-
-
-## CameraOptions
-
-Parámetros opcionales para personalizar la configuración de la cámara.
-
- {calidad: destinationType 75,: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, targetWidth: 100, targetHeight: 100, popoverOptions: CameraPopoverOptions, saveToPhotoAlbum: falsa};
-
-
-### Opciones
-
-* **calidad**: calidad de la imagen guardada, expresada en un rango de 0-100, donde 100 es típicamente resolución sin pérdida de compresión del archivo. El valor predeterminado es 50. *(Número)* (Tenga en cuenta que no está disponible información sobre resolución de la cámara).
-
-* **destinationType**: elegir el formato del valor devuelto. El valor predeterminado es FILE_URI. Definido en `navigator.camera.DestinationType` *(número)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **sourceType**: establecer el origen de la imagen. El valor predeterminado es cámara. Definido en `navigator.camera.PictureSourceType` *(número)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **allowEdit**: permite edición sencilla de imagen antes de la selección. *(Booleano)*
-
-* **encodingType**: elegir la codificación del archivo de imagen devuelta. Por defecto es JPEG. Definido en `navigator.camera.EncodingType` *(número)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: ancho en píxeles a escala de la imagen. Debe usarse con **targetHeight**. Proporción se mantiene constante. *(Número)*
-
-* **targetHeight**: altura en píxeles a escala de la imagen. Debe usarse con **targetWidth**. Proporción se mantiene constante. *(Número)*
-
-* **mediaType**: definir el tipo de medios para seleccionar. Sólo funciona cuando `PictureSourceType` es `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definido en `nagivator.camera.MediaType` *(número)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. DE FORMA PREDETERMINADA. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: rotar la imagen para corregir la orientación del dispositivo durante la captura. *(Booleano)*
-
-* **saveToPhotoAlbum**: guardar la imagen en el álbum de fotos en el dispositivo después de su captura. *(Booleano)*
-
-* **popoverOptions**: opciones sólo iOS que especifican popover ubicación en iPad. Definido en`CameraPopoverOptions`.
-
-* **cameraDirection**: elegir la cámara para usar (o parte posterior-frontal). El valor predeterminado es atrás. Definido en `navigator.camera.Direction` *(número)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### Amazon fuego OS rarezas
-
-* Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás.
-
-* Ignora el `allowEdit` parámetro.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos.
-
-### Rarezas Android
-
-* Cualquier valor de `cameraDirection` da como resultado una foto orientada hacia atrás.
-
-* Ignora el `allowEdit` parámetro.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY` y `Camera.PictureSourceType.SAVEDPHOTOALBUM` Mostrar el mismo álbum de fotos.
-
-### BlackBerry 10 rarezas
-
-* Ignora el `quality` parámetro.
-
-* Ignora el `allowEdit` parámetro.
-
-* `Camera.MediaType`No se admite.
-
-* Ignora el `correctOrientation` parámetro.
-
-* Ignora el `cameraDirection` parámetro.
-
-### Firefox OS rarezas
-
-* Ignora el `quality` parámetro.
-
-* `Camera.DestinationType`se ignora y es igual a `1` (URI del archivo de imagen)
-
-* Ignora el `allowEdit` parámetro.
-
-* Ignora el `PictureSourceType` parámetro (el usuario lo elige en una ventana de diálogo)
-
-* Ignora el`encodingType`
-
-* Ignora el `targetWidth` y`targetHeight`
-
-* `Camera.MediaType`No se admite.
-
-* Ignora el `correctOrientation` parámetro.
-
-* Ignora el `cameraDirection` parámetro.
-
-### iOS rarezas
-
-* Establecer `quality` por debajo de 50 para evitar errores de memoria en algunos dispositivos.
-
-* Cuando se utiliza `destinationType.FILE_URI` , fotos se guardan en el directorio temporal de la aplicación. El contenido del directorio temporal de la aplicación se eliminará cuando finalice la aplicación.
-
-### Rarezas Tizen
-
-* opciones no compatibles
-
-* siempre devuelve un identificador URI de archivo
-
-### Windows Phone 7 y 8 rarezas
-
-* Ignora el `allowEdit` parámetro.
-
-* Ignora el `correctOrientation` parámetro.
-
-* Ignora el `cameraDirection` parámetro.
-
-* Ignora el `saveToPhotoAlbum` parámetro. IMPORTANTE: Todas las imágenes tomadas con la cámara wp7/8 cordova API siempre se copian en rollo de cámara del teléfono. Dependiendo de la configuración del usuario, esto podría significar también que la imagen es auto-subido a su OneDrive. Esto potencialmente podría significar que la imagen está disponible a una audiencia más amplia que su aplicación previsto. Si un bloqueador para su aplicación, usted necesitará aplicar el CameraCaptureTask como se documenta en msdn: también puede comentar o votar hasta el tema relacionado en el [issue tracker de][3]
-
-* Ignora el `mediaType` propiedad de `cameraOptions` como el SDK de Windows Phone no proporciona una manera para elegir vídeos fototeca.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-onError función callback que proporciona un mensaje de error.
-
- function(Message) {/ / Mostrar un mensaje útil}
-
-
-### Parámetros
-
-* **mensaje**: el mensaje es proporcionado por código nativo del dispositivo. *(String)*
-
-## cameraSuccess
-
-onSuccess función callback que proporciona los datos de imagen.
-
- function(ImageData) {/ / hacer algo con la imagen}
-
-
-### Parámetros
-
-* **imageData**: codificación en Base64 de los datos de imagen, *o* el archivo de imagen URI, dependiendo de `cameraOptions` en vigor. *(String)*
-
-### Ejemplo
-
- Mostrar imagen / / function cameraCallback(imageData) {var imagen = document.getElementById('myImage');
- Image.src = "datos: image / jpeg; base64," + imageData;}
-
-
-## CameraPopoverHandle
-
-Un identificador para el cuadro de diálogo popover creado por`navigator.camera.getPicture`.
-
-### Métodos
-
-* **setPosition**: establecer la posición de la popover.
-
-### Plataformas soportadas
-
-* iOS
-
-### setPosition
-
-Establecer la posición de la popover.
-
-**Parámetros**:
-
-* `cameraPopoverOptions`: el `CameraPopoverOptions` que especifican la nueva posición
-
-### Ejemplo
-
- var cameraPopoverHandle = navigator.camera.getPicture (onSuccess, onFail, {destinationType: Camera.DestinationType.FILE_URI, sourceType: Camera.PictureSourceType.PHOTOLIBRARY, popoverOptions: CameraPopoverOptions nuevo (300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)});
-
- Vuelva a colocar el popover si cambia la orientación.
- Window.onorientationchange = function() {var cameraPopoverOptions = new CameraPopoverOptions (0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-Sólo iOS parámetros que especifican la dirección ancla elemento ubicación y la flecha de la popover al seleccionar imágenes de biblioteca o álbum de un iPad.
-
- {x: 0, y: 32, ancho: 320, altura: 480, arrowDir: Camera.PopoverArrowDirection.ARROW_ANY};
-
-
-### CameraPopoverOptions
-
-* **x**: coordenadas de píxeles del elemento de la pantalla en la que anclar el popover x. *(Número)*
-
-* **y**: coordenada píxeles del elemento de la pantalla en la que anclar el popover. *(Número)*
-
-* **anchura**: anchura, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)*
-
-* **altura**: alto, en píxeles, del elemento sobre el que anclar el popover pantalla. *(Número)*
-
-* **arrowDir**: dirección de la flecha en el popover debe apuntar. Definido en `Camera.PopoverArrowDirection` *(número)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Tenga en cuenta que puede cambiar el tamaño de la popover para ajustar la dirección de la flecha y orientación de la pantalla. Asegúrese de que para tener en cuenta los cambios de orientación cuando se especifica la ubicación del elemento de anclaje.
-
-## Navigator.Camera.Cleanup
-
-Elimina intermedio fotos tomadas por la cámara de almacenamiento temporal.
-
- Navigator.Camera.cleanup (cameraSuccess, cameraError);
-
-
-### Descripción
-
-Elimina intermedio archivos de imagen que se mantienen en depósito temporal después de llamar `camera.getPicture` . Se aplica sólo cuando el valor de `Camera.sourceType` es igual a `Camera.PictureSourceType.CAMERA` y el `Camera.destinationType` es igual a`Camera.DestinationType.FILE_URI`.
-
-### Plataformas soportadas
-
-* iOS
-
-### Ejemplo
-
- Navigator.Camera.cleanup (onSuccess, onFail);
-
- function onSuccess() {console.log ("cámara limpieza éxito.")}
-
- function onFail(message) {alert (' falló porque: ' + mensaje);}
diff --git a/plugins/cordova-plugin-camera/doc/fr/README.md b/plugins/cordova-plugin-camera/doc/fr/README.md
deleted file mode 100644
index 091dd23..0000000
--- a/plugins/cordova-plugin-camera/doc/fr/README.md
+++ /dev/null
@@ -1,378 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-Ce plugin définit un global `navigator.camera` objet qui fournit une API pour la prise de photos et de choisir des images de la bibliothèque d'images du système.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.camera);}
-
-
-## Installation
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * Appareil photo
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * Navigator.Camera.Cleanup
-
-## navigator.camera.getPicture
-
-Prend une photo à l'aide de la caméra, ou récupère une photo de la Galerie d'images de l'appareil. L'image est passé au rappel succès comme un codage base64 `String` , ou comme l'URI du fichier de l'image. La méthode elle-même retourne un `CameraPopoverHandle` objet qui permet de repositionner le kangourou de sélection de fichier.
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### Description
-
-Le `camera.getPicture` fonction ouvre l'application de caméra par défaut de l'appareil qui permet aux utilisateurs de prendre des photos. Ce comportement se produit par défaut, lorsque `Camera.sourceType` est égal à `Camera.PictureSourceType.CAMERA` . Une fois que l'utilisateur s'enclenche la photo, l'application appareil photo se ferme et l'application est restaurée.
-
-Si `Camera.sourceType` est `Camera.PictureSourceType.PHOTOLIBRARY` ou `Camera.PictureSourceType.SAVEDPHOTOALBUM` , puis un dialogue affiche qui permet aux utilisateurs de sélectionner une image existante. Le `camera.getPicture` retourne un `CameraPopoverHandle` objet, ce qui permet de repositionner le dialogue de sélection d'image, par exemple, lorsque l'orientation de l'appareil change.
-
-La valeur de retour est envoyée à la `cameraSuccess` la fonction de rappel, dans l'un des formats suivants, selon les `cameraOptions` :
-
- * A `String` contenant l'image photo codée en base64.
-
- * A `String` qui représente l'emplacement du fichier image sur le stockage local (par défaut).
-
-Vous pouvez faire ce que vous voulez avec l'image codée ou URI, par exemple :
-
- * Afficher l'image dans un `` tag, comme dans l'exemple ci-dessous
-
- * Enregistrer les données localement ( `LocalStorage` , [poids](http://brianleroux.github.com/lawnchair/), etc..)
-
- * Publier les données sur un serveur distant
-
-**NOTE**: la résolution de Photo sur les nouveaux appareils est assez bonne. Photos sélectionnées de la Galerie de l'appareil ne sont pas réduites à une baisse de la qualité, même si un `quality` paramètre est spécifié. Pour éviter les problèmes de mémoire commun, définissez `Camera.destinationType` à `FILE_URI` au lieu de`DATA_URL`.
-
-#### Plates-formes supportées
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### Exemple
-
-Prendre une photo, puis extrayez-la comme une image codée en base64 :
-
- navigator.camera.getPicture (onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- }) ;
-
- function onSuccess(imageData) {var image = document.getElementById('myImage') ;
- image.src = "données : image / jpeg ; base64," + imageData;}
-
- function onFail(message) {alert (' a échoué car: "+ message);}
-
-
-Prendre une photo et récupérer l'emplacement du fichier de l'image :
-
- navigator.camera.getPicture (onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI }) ;
-
- function onSuccess(imageURI) {var image = document.getElementById('myImage') ;
- image.SRC = imageURI ;
- } function onFail(message) {alert (' a échoué car: "+ message);}
-
-
-#### Préférences (iOS)
-
- * **CameraUsesGeolocation** (boolean, par défaut, false). Pour capturer des images JPEG, true pour obtenir des données de géolocalisation dans l'en-tête EXIF. Cela va déclencher une demande d'autorisations de géolocalisation si défini à true.
-
-
-
-
-#### Amazon Fire OS Quirks
-
-Amazon Fire OS utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de cordova est restaurée.
-
-#### Quirks Android
-
-Android utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de Cordova est restaurée.
-
-#### Bizarreries navigateur
-
-Peut retourner uniquement les photos comme image codée en base64.
-
-#### Firefox OS Quirks
-
-Appareil photo plugin est actuellement mis en œuvre à l'aide [d'Activités sur le Web](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
-
-#### Notes au sujet d'iOS
-
-Y compris un JavaScript `alert()` dans les deux le rappel fonctions peuvent causer des problèmes. Envelopper l'alerte dans un `setTimeout()` pour permettre le sélecteur d'image iOS ou kangourou pour fermer entièrement avant que l'alerte s'affiche :
-
- setTimeout(function() {/ / faire votre truc ici!}, 0) ;
-
-
-#### Windows Phone 7 Quirks
-
-Invoquant l'application native caméra alors que l'appareil est connecté via Zune ne fonctionne pas et déclenche un rappel de l'erreur.
-
-#### Bizarreries de paciarelli
-
-Paciarelli prend uniquement en charge un `destinationType` de `Camera.DestinationType.FILE_URI` et un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`.
-
-## CameraOptions
-
-Paramètres optionnels pour personnaliser les réglages de l'appareil.
-
- {qualité : destinationType 75,: Camera.DestinationType.DATA_URL, TypeSource : Camera.PictureSourceType.CAMERA, allowEdit : encodingType vrai,: Camera.EncodingType.JPEG, targetWidth : 100, targetHeight : 100, popoverOptions : CameraPopoverOptions, saveToPhotoAlbum : false} ;
-
-
- * **qualité**: qualité de l'image enregistrée, exprimée en une gamme de 0 à 100, 100 étant généralement pleine résolution sans perte de compression de fichiers. La valeur par défaut est 50. *(Nombre)* (Notez que les informations sur la résolution de la caméra sont indisponibles).
-
- * **destinationType**: choisissez le format de la valeur de retour. La valeur par défaut est FILE_URI. Définies dans `navigator.camera.DestinationType` *(nombre)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **sourceType**: définissez la source de l'image. La valeur par défaut est la caméra. Définies dans `navigator.camera.PictureSourceType` *(nombre)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **allowEdit**: permettre un montage simple d'image avant la sélection. *(Booléen)*
-
- * **encodingType**: choisir le fichier image retournée de codage. Valeur par défaut est JPEG. Définies dans `navigator.camera.EncodingType` *(nombre)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: largeur en pixels de l'image de l'échelle. Doit être utilisé avec **targetHeight**. Aspect ratio reste constant. *(Nombre)*
-
- * **targetHeight**: hauteur en pixels de l'image de l'échelle. Doit être utilisé avec **targetWidth**. Aspect ratio reste constant. *(Nombre)*
-
- * **mediaType**: définir le type de média pour choisir de. Ne fonctionne que quand `PictureSourceType` est `PHOTOLIBRARY` ou `SAVEDPHOTOALBUM` . Définies dans `nagivator.camera.MediaType` *(nombre)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. PAR DÉFAUT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: faire pivoter l'image afin de corriger l'orientation de l'appareil lors de la capture. *(Booléen)*
-
- * **saveToPhotoAlbum**: enregistrer l'image sur l'album photo sur l'appareil après la capture. *(Booléen)*
-
- * **popoverOptions**: iOS uniquement des options qui spécifient l'emplacement de kangourou dans iPad. Défini dans`CameraPopoverOptions`.
-
- * **cameraDirection**: choisissez la caméra à utiliser (ou dos-face). La valeur par défaut est de retour. Définies dans `navigator.camera.Direction` *(nombre)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### Amazon Fire OS Quirks
-
- * Tout `cameraDirection` résultats dans le back-face photo de valeur.
-
- * Ignore la `allowEdit` paramètre.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo.
-
-#### Quirks Android
-
- * Tout `cameraDirection` résultats dans le back-face photo de valeur.
-
- * Android utilise également l'activité de récolte pour allowEdit, même si la récolte doit travailler et transmet en réalité l'image recadrée à Cordoue, le seul que les œuvres sont toujours celui livré avec l'application Google Plus Photos. Autres cultures peuvent ne pas fonctionner.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo.
-
-#### BlackBerry 10 Quirks
-
- * Ignore la `quality` paramètre.
-
- * Ignore la `allowEdit` paramètre.
-
- * `Camera.MediaType`n'est pas pris en charge.
-
- * Ignore la `correctOrientation` paramètre.
-
- * Ignore la `cameraDirection` paramètre.
-
-#### Firefox OS Quirks
-
- * Ignore la `quality` paramètre.
-
- * `Camera.DestinationType`est ignorée et est égal à `1` (URI du fichier image)
-
- * Ignore la `allowEdit` paramètre.
-
- * Ignore la `PictureSourceType` paramètre (utilisateur il choisit dans une fenêtre de dialogue)
-
- * Ignore le`encodingType`
-
- * Ignore la `targetWidth` et`targetHeight`
-
- * `Camera.MediaType`n'est pas pris en charge.
-
- * Ignore la `correctOrientation` paramètre.
-
- * Ignore la `cameraDirection` paramètre.
-
-#### Notes au sujet d'iOS
-
- * La valeur `quality` inférieur à 50 pour éviter les erreurs de mémoire sur certains appareils.
-
- * Lorsque vous utilisez `destinationType.FILE_URI` , les photos sont sauvegardées dans le répertoire temporaire de l'application. Le contenu du répertoire temporaire de l'application est supprimé lorsque l'application se termine.
-
-#### Bizarreries de paciarelli
-
- * options non prises en charge
-
- * retourne toujours un URI de fichier
-
-#### Notes au sujet de Windows Phone 7 et 8
-
- * Ignore la `allowEdit` paramètre.
-
- * Ignore la `correctOrientation` paramètre.
-
- * Ignore la `cameraDirection` paramètre.
-
- * Ignore la `saveToPhotoAlbum` paramètre. IMPORTANT : Toutes les images prises avec la caméra de cordova wp7/8 API sont toujours copiés au rôle d'appareil photo du téléphone. Selon les paramètres de l'utilisateur, cela pourrait également signifier que l'image est auto-téléchargées à leur OneDrive. Potentiellement, cela pourrait signifier que l'image est disponible à un public plus large que votre application destinée. Si ce un bloqueur pour votre application, vous devrez implémenter le CameraCaptureTask tel que documenté sur msdn : vous pouvez aussi commenter ou haut-vote la question connexe dans le [gestionnaire d'incidents](https://issues.apache.org/jira/browse/CB-2083)
-
- * Ignore la `mediaType` propriété de `cameraOptions` comme le kit de développement Windows Phone ne fournit pas un moyen de choisir les vidéos de PHOTOLIBRARY.
-
-## CameraError
-
-fonction de rappel onError qui fournit un message d'erreur.
-
- function(message) {/ / afficher un message utile}
-
-
-#### Description
-
- * **message**: le message est fourni par du code natif de l'appareil. *(String)*
-
-## cameraSuccess
-
-fonction de rappel onSuccess qui fournit les données d'image.
-
- function(ImageData) {/ / faire quelque chose avec l'image}
-
-
-#### Description
-
- * **imageData**: codage Base64 de l'image, *ou* le fichier image URI, selon `cameraOptions` en vigueur. *(String)*
-
-#### Exemple
-
- Afficher image / / function cameraCallback(imageData) {var image = document.getElementById('myImage') ;
- image.src = "données : image / jpeg ; base64," + imageData;}
-
-
-## CameraPopoverHandle
-
-Un handle vers la boîte de dialogue de kangourou créé par`navigator.camera.getPicture`.
-
-#### Description
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### Plates-formes supportées
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Exemple
-
- var cameraPopoverHandle = navigator.camera.getPicture (onSuccess, onFail, {destinationType : Camera.DestinationType.FILE_URI, TypeSource : Camera.PictureSourceType.PHOTOLIBRARY, popoverOptions : nouvelle CameraPopoverOptions (300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)}) ;
-
- Repositionner le kangourou si l'orientation change.
- Window.onorientationchange = function() {var cameraPopoverOptions = new CameraPopoverOptions (0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) ;
- cameraPopoverHandle.setPosition(cameraPopoverOptions) ;
- }
-
-
-## CameraPopoverOptions
-
-iOS uniquement les paramètres qui spécifient la direction ancre élément emplacement et de la flèche de la kangourou lors de la sélection des images de la bibliothèque de l'iPad ou l'album.
-
- {x: 0, y: 32, largeur : 320, hauteur : 480, arrowDir : Camera.PopoverArrowDirection.ARROW_ANY} ;
-
-
-#### Description
-
- * **x**: coordonnée de pixel de l'élément de l'écran sur lequel ancrer le kangourou x. *(Nombre)*
-
- * **y**: coordonnée de y pixels de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
-
- * **largeur**: largeur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
-
- * **hauteur**: hauteur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
-
- * **arrowDir**: Direction de la flèche sur le kangourou doit pointer. Définies dans `Camera.PopoverArrowDirection` *(nombre)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Notez que la taille de la kangourou peut changer pour s'adapter à la direction de la flèche et l'orientation de l'écran. Assurez-vous que tenir compte des changements d'orientation lors de la spécification de l'emplacement d'élément d'ancrage.
-
-## Navigator.Camera.Cleanup
-
-Supprime les intermédiaires photos prises par la caméra de stockage temporaire.
-
- Navigator.Camera.Cleanup (cameraSuccess, cameraError) ;
-
-
-#### Description
-
-Supprime les intermédiaires les fichiers image qui sont gardées en dépôt temporaire après avoir appelé `camera.getPicture` . S'applique uniquement lorsque la valeur de `Camera.sourceType` est égale à `Camera.PictureSourceType.CAMERA` et le `Camera.destinationType` est égal à`Camera.DestinationType.FILE_URI`.
-
-#### Plates-formes supportées
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Exemple
-
- Navigator.Camera.Cleanup (onSuccess, onFail) ;
-
- fonction onSuccess() {console.log ("succès de caméra nettoyage.")}
-
- function onFail(message) {alert (' a échoué car: "+ message);}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/fr/index.md b/plugins/cordova-plugin-camera/doc/fr/index.md
deleted file mode 100644
index ec005f0..0000000
--- a/plugins/cordova-plugin-camera/doc/fr/index.md
+++ /dev/null
@@ -1,391 +0,0 @@
-
-
-# cordova-plugin-camera
-
-Ce plugin définit un global `navigator.camera` objet qui fournit une API pour la prise de photos et de choisir des images de la bibliothèque d'images du système.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.camera);}
-
-
-## Installation
-
- Cordova plugin ajouter cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-Prend une photo à l'aide de la caméra, ou récupère une photo de la Galerie d'images de l'appareil. L'image est passé au rappel succès comme un codage base64 `String` , ou comme l'URI du fichier de l'image. La méthode elle-même retourne un `CameraPopoverHandle` objet qui permet de repositionner le kangourou de sélection de fichier.
-
- navigator.camera.getPicture (cameraSuccess, cameraError, cameraOptions) ;
-
-
-### Description
-
-Le `camera.getPicture` fonction ouvre l'application de caméra par défaut de l'appareil qui permet aux utilisateurs de prendre des photos. Ce comportement se produit par défaut, lorsque `Camera.sourceType` est égal à `Camera.PictureSourceType.CAMERA` . Une fois que l'utilisateur s'enclenche la photo, l'application appareil photo se ferme et l'application est restaurée.
-
-Si `Camera.sourceType` est `Camera.PictureSourceType.PHOTOLIBRARY` ou `Camera.PictureSourceType.SAVEDPHOTOALBUM` , puis un dialogue affiche qui permet aux utilisateurs de sélectionner une image existante. Le `camera.getPicture` retourne un `CameraPopoverHandle` objet, ce qui permet de repositionner le dialogue de sélection d'image, par exemple, lorsque l'orientation de l'appareil change.
-
-La valeur de retour est envoyée à la `cameraSuccess` la fonction de rappel, dans l'un des formats suivants, selon les `cameraOptions` :
-
-* A `String` contenant l'image photo codée en base64.
-
-* A `String` qui représente l'emplacement du fichier image sur le stockage local (par défaut).
-
-Vous pouvez faire ce que vous voulez avec l'image codée ou URI, par exemple :
-
-* Afficher l'image dans un `` tag, comme dans l'exemple ci-dessous
-
-* Enregistrer les données localement ( `LocalStorage` , [poids][1], etc..)
-
-* Publier les données sur un serveur distant
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**NOTE**: la résolution de Photo sur les nouveaux appareils est assez bonne. Photos sélectionnées de la Galerie de l'appareil ne sont pas réduites à une baisse de la qualité, même si un `quality` paramètre est spécifié. Pour éviter les problèmes de mémoire commun, définissez `Camera.destinationType` à `FILE_URI` au lieu de`DATA_URL`.
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Navigateur
-* Firefox OS
-* iOS
-* Paciarelli
-* Windows Phone 7 et 8
-* Windows 8
-
-### Préférences (iOS)
-
-* **CameraUsesGeolocation** (boolean, par défaut, false). Pour capturer des images JPEG, true pour obtenir des données de géolocalisation dans l'en-tête EXIF. Cela va déclencher une demande d'autorisations de géolocalisation si défini à true.
-
-
-
-
-### Amazon Fire OS Quirks
-
-Amazon Fire OS utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de cordova est restaurée.
-
-### Quirks Android
-
-Android utilise des intentions pour lancer l'activité de l'appareil photo sur l'appareil pour capturer des images et sur les téléphones avec peu de mémoire, l'activité de Cordova peut être tuée. Dans ce scénario, l'image peut ne pas apparaître lorsque l'activité de Cordova est restaurée.
-
-### Bizarreries navigateur
-
-Peut retourner uniquement les photos comme image codée en base64.
-
-### Firefox OS Quirks
-
-Appareil photo plugin est actuellement mis en œuvre à l'aide [d'Activités sur le Web][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS Quirks
-
-Y compris un JavaScript `alert()` dans les deux le rappel fonctions peuvent causer des problèmes. Envelopper l'alerte dans un `setTimeout()` pour permettre le sélecteur d'image iOS ou kangourou pour fermer entièrement avant que l'alerte s'affiche :
-
- setTimeout(function() {/ / faire votre truc ici!}, 0) ;
-
-
-### Windows Phone 7 Quirks
-
-Invoquant l'application native caméra alors que l'appareil est connecté via Zune ne fonctionne pas et déclenche un rappel de l'erreur.
-
-### Bizarreries de paciarelli
-
-Paciarelli prend uniquement en charge un `destinationType` de `Camera.DestinationType.FILE_URI` et un `sourceType` de`Camera.PictureSourceType.PHOTOLIBRARY`.
-
-### Exemple
-
-Prendre une photo, puis extrayez-la comme une image codée en base64 :
-
- navigator.camera.getPicture (onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- }) ;
-
- function onSuccess(imageData) {var image = document.getElementById('myImage') ;
- image.src = "données : image / jpeg ; base64," + imageData;}
-
- function onFail(message) {alert (' a échoué car: "+ message);}
-
-
-Prendre une photo et récupérer l'emplacement du fichier de l'image :
-
- navigator.camera.getPicture (onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI }) ;
-
- function onSuccess(imageURI) {var image = document.getElementById('myImage') ;
- image.SRC = imageURI ;
- } function onFail(message) {alert (' a échoué car: "+ message);}
-
-
-## CameraOptions
-
-Paramètres optionnels pour personnaliser les réglages de l'appareil.
-
- {qualité : destinationType 75,: Camera.DestinationType.DATA_URL, TypeSource : Camera.PictureSourceType.CAMERA, allowEdit : encodingType vrai,: Camera.EncodingType.JPEG, targetWidth : 100, targetHeight : 100, popoverOptions : CameraPopoverOptions, saveToPhotoAlbum : false} ;
-
-
-### Options
-
-* **qualité**: qualité de l'image enregistrée, exprimée en une gamme de 0 à 100, 100 étant généralement pleine résolution sans perte de compression de fichiers. La valeur par défaut est 50. *(Nombre)* (Notez que les informations sur la résolution de la caméra sont indisponibles).
-
-* **destinationType**: choisissez le format de la valeur de retour. La valeur par défaut est FILE_URI. Définies dans `navigator.camera.DestinationType` *(nombre)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **sourceType**: définissez la source de l'image. La valeur par défaut est la caméra. Définies dans `navigator.camera.PictureSourceType` *(nombre)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **allowEdit**: permettre un montage simple d'image avant la sélection. *(Booléen)*
-
-* **encodingType**: choisir le fichier image retournée de codage. Valeur par défaut est JPEG. Définies dans `navigator.camera.EncodingType` *(nombre)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: largeur en pixels de l'image de l'échelle. Doit être utilisé avec **targetHeight**. Aspect ratio reste constant. *(Nombre)*
-
-* **targetHeight**: hauteur en pixels de l'image de l'échelle. Doit être utilisé avec **targetWidth**. Aspect ratio reste constant. *(Nombre)*
-
-* **mediaType**: définir le type de média pour choisir de. Ne fonctionne que quand `PictureSourceType` est `PHOTOLIBRARY` ou `SAVEDPHOTOALBUM` . Définies dans `nagivator.camera.MediaType` *(nombre)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. PAR DÉFAUT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: faire pivoter l'image afin de corriger l'orientation de l'appareil lors de la capture. *(Booléen)*
-
-* **saveToPhotoAlbum**: enregistrer l'image sur l'album photo sur l'appareil après la capture. *(Booléen)*
-
-* **popoverOptions**: iOS uniquement des options qui spécifient l'emplacement de kangourou dans iPad. Défini dans`CameraPopoverOptions`.
-
-* **cameraDirection**: choisissez la caméra à utiliser (ou dos-face). La valeur par défaut est de retour. Définies dans `navigator.camera.Direction` *(nombre)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### Amazon Fire OS Quirks
-
-* Tout `cameraDirection` résultats dans le back-face photo de valeur.
-
-* Ignore la `allowEdit` paramètre.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo.
-
-### Quirks Android
-
-* Tout `cameraDirection` résultats dans le back-face photo de valeur.
-
-* Ignore la `allowEdit` paramètre.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`et `Camera.PictureSourceType.SAVEDPHOTOALBUM` les deux affichent le même album photo.
-
-### BlackBerry 10 Quirks
-
-* Ignore la `quality` paramètre.
-
-* Ignore la `allowEdit` paramètre.
-
-* `Camera.MediaType`n'est pas pris en charge.
-
-* Ignore la `correctOrientation` paramètre.
-
-* Ignore la `cameraDirection` paramètre.
-
-### Firefox OS Quirks
-
-* Ignore la `quality` paramètre.
-
-* `Camera.DestinationType`est ignorée et est égal à `1` (URI du fichier image)
-
-* Ignore la `allowEdit` paramètre.
-
-* Ignore la `PictureSourceType` paramètre (utilisateur il choisit dans une fenêtre de dialogue)
-
-* Ignore le`encodingType`
-
-* Ignore la `targetWidth` et`targetHeight`
-
-* `Camera.MediaType`n'est pas pris en charge.
-
-* Ignore la `correctOrientation` paramètre.
-
-* Ignore la `cameraDirection` paramètre.
-
-### iOS Quirks
-
-* La valeur `quality` inférieur à 50 pour éviter les erreurs de mémoire sur certains appareils.
-
-* Lorsque vous utilisez `destinationType.FILE_URI` , les photos sont sauvegardées dans le répertoire temporaire de l'application. Le contenu du répertoire temporaire de l'application est supprimé lorsque l'application se termine.
-
-### Bizarreries de paciarelli
-
-* options non prises en charge
-
-* retourne toujours un URI de fichier
-
-### Windows Phone 7 et 8 Quirks
-
-* Ignore la `allowEdit` paramètre.
-
-* Ignore la `correctOrientation` paramètre.
-
-* Ignore la `cameraDirection` paramètre.
-
-* Ignore la `saveToPhotoAlbum` paramètre. IMPORTANT : Toutes les images prises avec la caméra de cordova wp7/8 API sont toujours copiés au rôle d'appareil photo du téléphone. Selon les paramètres de l'utilisateur, cela pourrait également signifier que l'image est auto-téléchargées à leur OneDrive. Potentiellement, cela pourrait signifier que l'image est disponible à un public plus large que votre application destinée. Si ce un bloqueur pour votre application, vous devrez implémenter le CameraCaptureTask tel que documenté sur msdn : vous pouvez aussi commenter ou haut-vote la question connexe dans le [gestionnaire d'incidents][3]
-
-* Ignore la `mediaType` propriété de `cameraOptions` comme le kit de développement Windows Phone ne fournit pas un moyen de choisir les vidéos de PHOTOLIBRARY.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-fonction de rappel onError qui fournit un message d'erreur.
-
- function(message) {/ / afficher un message utile}
-
-
-### Paramètres
-
-* **message**: le message est fourni par du code natif de l'appareil. *(String)*
-
-## cameraSuccess
-
-fonction de rappel onSuccess qui fournit les données d'image.
-
- function(ImageData) {/ / faire quelque chose avec l'image}
-
-
-### Paramètres
-
-* **imageData**: codage Base64 de l'image, *ou* le fichier image URI, selon `cameraOptions` en vigueur. *(String)*
-
-### Exemple
-
- Afficher image / / function cameraCallback(imageData) {var image = document.getElementById('myImage') ;
- image.src = "données : image / jpeg ; base64," + imageData;}
-
-
-## CameraPopoverHandle
-
-Un handle vers la boîte de dialogue de kangourou créé par`navigator.camera.getPicture`.
-
-### Méthodes
-
-* **setPosition**: définir la position de la kangourou.
-
-### Plates-formes prises en charge
-
-* iOS
-
-### setPosition
-
-Définir la position de la kangourou.
-
-**Paramètres**:
-
-* `cameraPopoverOptions`: la `CameraPopoverOptions` qui spécifie la nouvelle position
-
-### Exemple
-
- var cameraPopoverHandle = navigator.camera.getPicture (onSuccess, onFail, {destinationType : Camera.DestinationType.FILE_URI, TypeSource : Camera.PictureSourceType.PHOTOLIBRARY, popoverOptions : nouvelle CameraPopoverOptions (300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)}) ;
-
- Repositionner le kangourou si l'orientation change.
- Window.onorientationchange = function() {var cameraPopoverOptions = new CameraPopoverOptions (0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY) ;
- cameraPopoverHandle.setPosition(cameraPopoverOptions) ;
- }
-
-
-## CameraPopoverOptions
-
-iOS uniquement les paramètres qui spécifient la direction ancre élément emplacement et de la flèche de la kangourou lors de la sélection des images de la bibliothèque de l'iPad ou l'album.
-
- {x: 0, y: 32, largeur : 320, hauteur : 480, arrowDir : Camera.PopoverArrowDirection.ARROW_ANY} ;
-
-
-### CameraPopoverOptions
-
-* **x**: coordonnée de pixel de l'élément de l'écran sur lequel ancrer le kangourou x. *(Nombre)*
-
-* **y**: coordonnée de y pixels de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
-
-* **largeur**: largeur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
-
-* **hauteur**: hauteur, en pixels, de l'élément de l'écran sur lequel ancrer le kangourou. *(Nombre)*
-
-* **arrowDir**: Direction de la flèche sur le kangourou doit pointer. Définies dans `Camera.PopoverArrowDirection` *(nombre)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Notez que la taille de la kangourou peut changer pour s'adapter à la direction de la flèche et l'orientation de l'écran. Assurez-vous que tenir compte des changements d'orientation lors de la spécification de l'emplacement d'élément d'ancrage.
-
-## Navigator.Camera.Cleanup
-
-Supprime les intermédiaires photos prises par la caméra de stockage temporaire.
-
- Navigator.Camera.Cleanup (cameraSuccess, cameraError) ;
-
-
-### Description
-
-Supprime les intermédiaires les fichiers image qui sont gardées en dépôt temporaire après avoir appelé `camera.getPicture` . S'applique uniquement lorsque la valeur de `Camera.sourceType` est égale à `Camera.PictureSourceType.CAMERA` et le `Camera.destinationType` est égal à`Camera.DestinationType.FILE_URI`.
-
-### Plates-formes prises en charge
-
-* iOS
-
-### Exemple
-
- Navigator.Camera.Cleanup (onSuccess, onFail) ;
-
- fonction onSuccess() {console.log ("succès de caméra nettoyage.")}
-
- function onFail(message) {alert (' a échoué car: "+ message);}
diff --git a/plugins/cordova-plugin-camera/doc/img/android-fail.png b/plugins/cordova-plugin-camera/doc/img/android-fail.png
deleted file mode 100644
index f9e4e86..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/android-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/android-success.png b/plugins/cordova-plugin-camera/doc/img/android-success.png
deleted file mode 100644
index 0bb9abd..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/android-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/blackberry-fail.png b/plugins/cordova-plugin-camera/doc/img/blackberry-fail.png
deleted file mode 100644
index b89efaf..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/blackberry-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/blackberry-success.png b/plugins/cordova-plugin-camera/doc/img/blackberry-success.png
deleted file mode 100644
index 286d0b9..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/blackberry-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/browser-fail.png b/plugins/cordova-plugin-camera/doc/img/browser-fail.png
deleted file mode 100644
index 3894be6..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/browser-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/browser-success.png b/plugins/cordova-plugin-camera/doc/img/browser-success.png
deleted file mode 100644
index 6c2c000..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/browser-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/firefox-fail.png b/plugins/cordova-plugin-camera/doc/img/firefox-fail.png
deleted file mode 100644
index 2c6cbd1..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/firefox-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/firefox-success.png b/plugins/cordova-plugin-camera/doc/img/firefox-success.png
deleted file mode 100644
index deb9d24..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/firefox-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/fireos-fail.png b/plugins/cordova-plugin-camera/doc/img/fireos-fail.png
deleted file mode 100644
index b1e7b9b..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/fireos-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/fireos-success.png b/plugins/cordova-plugin-camera/doc/img/fireos-success.png
deleted file mode 100644
index 7b6289e..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/fireos-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/ios-fail.png b/plugins/cordova-plugin-camera/doc/img/ios-fail.png
deleted file mode 100644
index 2d8caf8..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/ios-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/ios-success.png b/plugins/cordova-plugin-camera/doc/img/ios-success.png
deleted file mode 100644
index 3bf3b5a..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/ios-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/ubuntu-fail.png b/plugins/cordova-plugin-camera/doc/img/ubuntu-fail.png
deleted file mode 100644
index ca82c79..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/ubuntu-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/ubuntu-success.png b/plugins/cordova-plugin-camera/doc/img/ubuntu-success.png
deleted file mode 100644
index b15227d..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/ubuntu-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/windows-fail.png b/plugins/cordova-plugin-camera/doc/img/windows-fail.png
deleted file mode 100644
index 982a8cf..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/windows-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/windows-success.png b/plugins/cordova-plugin-camera/doc/img/windows-success.png
deleted file mode 100644
index b8ae79b..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/windows-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/wp8-fail.png b/plugins/cordova-plugin-camera/doc/img/wp8-fail.png
deleted file mode 100644
index 28c4588..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/wp8-fail.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/img/wp8-success.png b/plugins/cordova-plugin-camera/doc/img/wp8-success.png
deleted file mode 100644
index a37cad6..0000000
Binary files a/plugins/cordova-plugin-camera/doc/img/wp8-success.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/doc/it/README.md b/plugins/cordova-plugin-camera/doc/it/README.md
deleted file mode 100644
index 601f6f1..0000000
--- a/plugins/cordova-plugin-camera/doc/it/README.md
+++ /dev/null
@@ -1,421 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-Questo plugin definisce un oggetto globale `navigator.camera`, che fornisce un'API per scattare foto e per aver scelto immagini dalla libreria di immagini del sistema.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * Fotocamera
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * navigator.camera.cleanup
-
-## navigator.camera.getPicture
-
-Prende una foto utilizzando la fotocamera, o recupera una foto dalla galleria di immagini del dispositivo. L'immagine è passata al callback di successo come `String` con codifica base64, o come l'URI per il file di immagine. Lo stesso metodo restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare il Muffin di selezione file.
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### Descrizione
-
-La funzione `camera.getPicture` apre predefinito fotocamera applicazione il dispositivo che consente agli utenti di scattare foto. Questo comportamento si verifica per impostazione predefinita, quando `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA`. Una volta che l'utente scatta la foto, si chiude l'applicazione fotocamera e l'applicazione viene ripristinato.
-
-Se `Camera.sourceType` è `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM`, una finestra di dialogo Visualizza che permette agli utenti di selezionare un'immagine esistente. La funzione `camera.getPicture` restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare la finestra di selezione immagine, ad esempio, quando l'orientamento del dispositivo.
-
-Il valore restituito viene inviato alla funzione di callback `cameraSuccess`, in uno dei seguenti formati, a seconda il `cameraOptions` specificato:
-
- * A `String` contenente l'immagine della foto con codifica base64.
-
- * A `String` che rappresenta il percorso del file di immagine su archiviazione locale (predefinito).
-
-Si può fare quello che vuoi con l'immagine codificata o URI, ad esempio:
-
- * Il rendering dell'immagine in un `` tag, come nell'esempio qui sotto
-
- * Salvare i dati localmente ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/), ecc.)
-
- * Inviare i dati a un server remoto
-
-**Nota**: risoluzione foto sui più recenti dispositivi è abbastanza buona. Foto selezionate dalla galleria del dispositivo non è percepiranno di qualità inferiore, anche se viene specificato un parametro di `quality`. Per evitare problemi di memoria comune, impostare `Camera.destinationType` `FILE_URI` piuttosto che `DATA_URL`.
-
-#### Piattaforme supportate
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### Esempio
-
-Scattare una foto e recuperarla come un'immagine con codifica base64:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Scattare una foto e recuperare il percorso del file dell'immagine:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### Preferenze (iOS)
-
- * **CameraUsesGeolocation** (boolean, default è false). Per l'acquisizione di immagini JPEG, impostato su true per ottenere dati di geolocalizzazione nell'intestazione EXIF. Questo innescherà una richiesta per le autorizzazioni di geolocalizzazione, se impostato su true.
-
-
-
-
-#### Amazon fuoco OS stranezze
-
-Amazon fuoco OS utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di cordova.
-
-#### Stranezze Android
-
-Android utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di Cordova.
-
-#### Stranezze browser
-
-Può restituire solo la foto come immagine con codifica base64.
-
-#### Firefox OS stranezze
-
-Fotocamera plugin è attualmente implementato mediante [Web Activities](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
-
-#### iOS stranezze
-
-Compreso un JavaScript `alert()` in una delle funzioni di callback può causare problemi. Avvolgere l'avviso all'interno di un `setTimeout()` per consentire la selezione immagine iOS o muffin per chiudere completamente la prima che viene visualizzato l'avviso:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Windows Phone 7 capricci
-
-Richiamando l'applicazione nativa fotocamera mentre il dispositivo è collegato tramite Zune non funziona e innesca un callback di errore.
-
-#### Tizen stranezze
-
-Tizen supporta solo a `destinationType` di `Camera.DestinationType.FILE_URI` e un `sourceType` di `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-## CameraOptions
-
-Parametri opzionali per personalizzare le impostazioni della fotocamera.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
- * **quality**: qualità dell'immagine salvata, espressa come un intervallo di 0-100, dove 100 è tipicamente piena risoluzione senza perdita di compressione file. Il valore predefinito è 50. *(Numero)* (Si noti che informazioni sulla risoluzione della fotocamera non sono disponibile).
-
- * **destinationType**: Scegli il formato del valore restituito. Il valore predefinito è FILE_URI. Definito in `navigator.camera.DestinationType` *(numero)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **sourceType**: impostare l'origine dell'immagine. Il valore predefinito è la fotocamera. Definito in `navigator.camera.PictureSourceType` *(numero)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **Proprietà allowEdit**: consentire la semplice modifica dell'immagine prima di selezione. *(Booleano)*
-
- * **encodingType**: scegliere il file immagine restituita di codifica. Predefinito è JPEG. Definito in `navigator.camera.EncodingType` *(numero)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: larghezza in pixel all'immagine della scala. Deve essere usato con **targetHeight**. Proporzioni rimane costante. *(Numero)*
-
- * **targetHeight**: altezza in pixel all'immagine della scala. Deve essere usato con **targetWidth**. Proporzioni rimane costante. *(Numero)*
-
- * **mediaType**: impostare il tipo di supporto per scegliere da. Funziona solo quando `PictureSourceType` è `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definito in `nagivator.camera.MediaType` *(numero)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. PER IMPOSTAZIONE PREDEFINITA. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: ruotare l'immagine per correggere l'orientamento del dispositivo durante l'acquisizione. *(Booleano)*
-
- * **saveToPhotoAlbum**: salvare l'immagine nell'album di foto sul dispositivo dopo la cattura. *(Booleano)*
-
- * **popoverOptions**: solo iOS opzioni che specificano la posizione di muffin in iPad. Definito in`CameraPopoverOptions`.
-
- * **cameraDirection**: scegliere la telecamera da utilizzare (o retro-frontale). Il valore predefinito è tornato. Definito in `navigator.camera.Direction` *(numero)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### Amazon fuoco OS stranezze
-
- * Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura.
-
- * Ignora il `allowEdit` parametro.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso.
-
-#### Stranezze Android
-
- * Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura.
-
- * Android utilizza anche l'attività di ritaglio per allowEdit, anche se raccolto dovrebbe funzionare ed effettivamente passare l'immagine ritagliata a Cordova, l'unico che funziona è sempre quello in bundle con l'applicazione di Google Plus foto. Altre colture potrebbero non funzionare.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso.
-
-#### BlackBerry 10 capricci
-
- * Ignora il `quality` parametro.
-
- * Ignora il `allowEdit` parametro.
-
- * `Camera.MediaType`non è supportato.
-
- * Ignora il `correctOrientation` parametro.
-
- * Ignora il `cameraDirection` parametro.
-
-#### Firefox OS stranezze
-
- * Ignora il `quality` parametro.
-
- * `Camera.DestinationType`viene ignorato e corrisponde a `1` (URI del file di immagine)
-
- * Ignora il `allowEdit` parametro.
-
- * Ignora il `PictureSourceType` parametro (utente ne sceglie in una finestra di dialogo)
-
- * Ignora il`encodingType`
-
- * Ignora le `targetWidth` e`targetHeight`
-
- * `Camera.MediaType`non è supportato.
-
- * Ignora il `correctOrientation` parametro.
-
- * Ignora il `cameraDirection` parametro.
-
-#### iOS stranezze
-
- * Impostare `quality` inferiore al 50 per evitare errori di memoria su alcuni dispositivi.
-
- * Quando si utilizza `destinationType.FILE_URI` , foto vengono salvati nella directory temporanea dell'applicazione. Il contenuto della directory temporanea dell'applicazione viene eliminato quando l'applicazione termina.
-
-#### Tizen stranezze
-
- * opzioni non supportate
-
- * restituisce sempre un URI del FILE
-
-#### Windows Phone 7 e 8 stranezze
-
- * Ignora il `allowEdit` parametro.
-
- * Ignora il `correctOrientation` parametro.
-
- * Ignora il `cameraDirection` parametro.
-
- * Ignora il `saveToPhotoAlbum` parametro. IMPORTANTE: Tutte le immagini scattate con la fotocamera di cordova wp7/8 API vengono sempre copiate rotolo fotocamera del telefono cellulare. A seconda delle impostazioni dell'utente, questo potrebbe anche significare che l'immagine viene caricato in automatico a loro OneDrive. Questo potenzialmente potrebbe significare che l'immagine è disponibile a un pubblico più ampio di app destinate. Se questo un blocco dell'applicazione, sarà necessario implementare il CameraCaptureTask come documentato su msdn: si può anche commentare o up-voto la questione correlata nel [tracciatore di problemi](https://issues.apache.org/jira/browse/CB-2083)
-
- * Ignora la `mediaType` proprietà di `cameraOptions` come il SDK di Windows Phone non fornisce un modo per scegliere il video da PHOTOLIBRARY.
-
-## CameraError
-
-funzione di callback onError che fornisce un messaggio di errore.
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### Descrizione
-
- * **message**: il messaggio è fornito dal codice nativo del dispositivo. *(String)*
-
-## cameraSuccess
-
-funzione di callback onSuccess che fornisce i dati di immagine.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### Descrizione
-
- * **imageData**: Base64 codifica dei dati immagine, *o* il file di immagine URI, a seconda `cameraOptions` in vigore. *(String)*
-
-#### Esempio
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Un handle per la finestra di dialogo di muffin creato da `navigator.camera.getPicture`.
-
-#### Descrizione
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### Piattaforme supportate
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Esempio
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS solo parametri che specificano l'ancoraggio elemento posizione e freccia direzione il Muffin quando si selezionano le immagini dalla libreria un iPad o un album.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### Descrizione
-
- * **x**: pixel coordinata x dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
- * **y**: coordinata y di pixel dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
- * **width**: larghezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
- * **height**: altezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
- * **arrowDir**: direzione dovrebbe puntare la freccia il muffin. Definito in `Camera.PopoverArrowDirection` *(numero)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Si noti che la dimensione del muffin possa cambiare per regolare la direzione della freccia e l'orientamento dello schermo. Assicurarsi che tenere conto di modifiche di orientamento quando si specifica la posizione di elemento di ancoraggio.
-
-## navigator.camera.cleanup
-
-Rimuove intermedio foto scattate con la fotocamera da deposito temporaneo.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-#### Descrizione
-
-Rimuove i file di immagine intermedia che vengono tenuti in custodia temporanea dopo la chiamata a `camera.getPicture`. Si applica solo quando il valore di `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA` e il `Camera.destinationType` è uguale a `Camera.DestinationType.FILE_URI`.
-
-#### Piattaforme supportate
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Esempio
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/it/index.md b/plugins/cordova-plugin-camera/doc/it/index.md
deleted file mode 100644
index da0b919..0000000
--- a/plugins/cordova-plugin-camera/doc/it/index.md
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-# cordova-plugin-camera
-
-Questo plugin definisce un oggetto globale `navigator.camera`, che fornisce un'API per scattare foto e per aver scelto immagini dalla libreria di immagini del sistema.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-Prende una foto utilizzando la fotocamera, o recupera una foto dalla galleria di immagini del dispositivo. L'immagine è passata al callback di successo come `String` con codifica base64, o come l'URI per il file di immagine. Lo stesso metodo restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare il Muffin di selezione file.
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### Descrizione
-
-La funzione `camera.getPicture` apre predefinito fotocamera applicazione il dispositivo che consente agli utenti di scattare foto. Questo comportamento si verifica per impostazione predefinita, quando `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA`. Una volta che l'utente scatta la foto, si chiude l'applicazione fotocamera e l'applicazione viene ripristinato.
-
-Se `Camera.sourceType` è `Camera.PictureSourceType.PHOTOLIBRARY` o `Camera.PictureSourceType.SAVEDPHOTOALBUM`, una finestra di dialogo Visualizza che permette agli utenti di selezionare un'immagine esistente. La funzione `camera.getPicture` restituisce un oggetto `CameraPopoverHandle` che può essere utilizzato per riposizionare la finestra di selezione immagine, ad esempio, quando l'orientamento del dispositivo.
-
-Il valore restituito viene inviato alla funzione di callback `cameraSuccess`, in uno dei seguenti formati, a seconda il `cameraOptions` specificato:
-
-* A `String` contenente l'immagine della foto con codifica base64.
-
-* A `String` che rappresenta il percorso del file di immagine su archiviazione locale (predefinito).
-
-Si può fare quello che vuoi con l'immagine codificata o URI, ad esempio:
-
-* Il rendering dell'immagine in un `` tag, come nell'esempio qui sotto
-
-* Salvare i dati localmente ( `LocalStorage` , [Lawnchair][1], ecc.)
-
-* Inviare i dati a un server remoto
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**Nota**: risoluzione foto sui più recenti dispositivi è abbastanza buona. Foto selezionate dalla galleria del dispositivo non è percepiranno di qualità inferiore, anche se viene specificato un parametro di `quality`. Per evitare problemi di memoria comune, impostare `Camera.destinationType` `FILE_URI` piuttosto che `DATA_URL`.
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Browser
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 e 8
-* Windows 8
-
-### Preferenze (iOS)
-
-* **CameraUsesGeolocation** (boolean, default è false). Per l'acquisizione di immagini JPEG, impostato su true per ottenere dati di geolocalizzazione nell'intestazione EXIF. Questo innescherà una richiesta per le autorizzazioni di geolocalizzazione, se impostato su true.
-
-
-
-
-### Amazon fuoco OS stranezze
-
-Amazon fuoco OS utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di cordova.
-
-### Stranezze Android
-
-Android utilizza intenti a lanciare l'attività della fotocamera sul dispositivo per catturare immagini e sui telefoni con poca memoria, l'attività di Cordova può essere ucciso. In questo scenario, l'immagine potrebbe non apparire quando viene ripristinata l'attività di Cordova.
-
-### Stranezze browser
-
-Può restituire solo la foto come immagine con codifica base64.
-
-### Firefox OS stranezze
-
-Fotocamera plugin è attualmente implementato mediante [Web Activities][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS stranezze
-
-Compreso un JavaScript `alert()` in una delle funzioni di callback può causare problemi. Avvolgere l'avviso all'interno di un `setTimeout()` per consentire la selezione immagine iOS o muffin per chiudere completamente la prima che viene visualizzato l'avviso:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-### Windows Phone 7 stranezze
-
-Richiamando l'applicazione nativa fotocamera mentre il dispositivo è collegato tramite Zune non funziona e innesca un callback di errore.
-
-### Tizen stranezze
-
-Tizen supporta solo a `destinationType` di `Camera.DestinationType.FILE_URI` e un `sourceType` di `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-### Esempio
-
-Scattare una foto e recuperarla come un'immagine con codifica base64:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Scattare una foto e recuperare il percorso del file dell'immagine:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-Parametri opzionali per personalizzare le impostazioni della fotocamera.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### Opzioni
-
-* **quality**: qualità dell'immagine salvata, espressa come un intervallo di 0-100, dove 100 è tipicamente piena risoluzione senza perdita di compressione file. Il valore predefinito è 50. *(Numero)* (Si noti che informazioni sulla risoluzione della fotocamera non sono disponibile).
-
-* **destinationType**: Scegli il formato del valore restituito. Il valore predefinito è FILE_URI. Definito in `navigator.camera.DestinationType` *(numero)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **sourceType**: impostare l'origine dell'immagine. Il valore predefinito è la fotocamera. Definito in `navigator.camera.PictureSourceType` *(numero)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **Proprietà allowEdit**: consentire la semplice modifica dell'immagine prima di selezione. *(Booleano)*
-
-* **encodingType**: scegliere il file immagine restituita di codifica. Predefinito è JPEG. Definito in `navigator.camera.EncodingType` *(numero)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: larghezza in pixel all'immagine della scala. Deve essere usato con **targetHeight**. Proporzioni rimane costante. *(Numero)*
-
-* **targetHeight**: altezza in pixel all'immagine della scala. Deve essere usato con **targetWidth**. Proporzioni rimane costante. *(Numero)*
-
-* **mediaType**: impostare il tipo di supporto per scegliere da. Funziona solo quando `PictureSourceType` è `PHOTOLIBRARY` o `SAVEDPHOTOALBUM` . Definito in `nagivator.camera.MediaType` *(numero)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. PER IMPOSTAZIONE PREDEFINITA. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: ruotare l'immagine per correggere l'orientamento del dispositivo durante l'acquisizione. *(Booleano)*
-
-* **saveToPhotoAlbum**: salvare l'immagine nell'album di foto sul dispositivo dopo la cattura. *(Booleano)*
-
-* **popoverOptions**: solo iOS opzioni che specificano la posizione di muffin in iPad. Definito in`CameraPopoverOptions`.
-
-* **cameraDirection**: scegliere la telecamera da utilizzare (o retro-frontale). Il valore predefinito è tornato. Definito in `navigator.camera.Direction` *(numero)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### Amazon fuoco OS stranezze
-
-* Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura.
-
-* Ignora il `allowEdit` parametro.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso.
-
-### Stranezze Android
-
-* Qualsiasi `cameraDirection` valore i risultati in una foto di lamatura.
-
-* Ignora il `allowEdit` parametro.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`e `Camera.PictureSourceType.SAVEDPHOTOALBUM` entrambi visualizzare l'album fotografico stesso.
-
-### BlackBerry 10 capricci
-
-* Ignora il `quality` parametro.
-
-* Ignora il `allowEdit` parametro.
-
-* `Camera.MediaType`non è supportato.
-
-* Ignora il `correctOrientation` parametro.
-
-* Ignora il `cameraDirection` parametro.
-
-### Firefox OS stranezze
-
-* Ignora il `quality` parametro.
-
-* `Camera.DestinationType`viene ignorato e corrisponde a `1` (URI del file di immagine)
-
-* Ignora il `allowEdit` parametro.
-
-* Ignora il `PictureSourceType` parametro (utente ne sceglie in una finestra di dialogo)
-
-* Ignora il`encodingType`
-
-* Ignora le `targetWidth` e`targetHeight`
-
-* `Camera.MediaType`non è supportato.
-
-* Ignora il `correctOrientation` parametro.
-
-* Ignora il `cameraDirection` parametro.
-
-### iOS stranezze
-
-* Impostare `quality` inferiore al 50 per evitare errori di memoria su alcuni dispositivi.
-
-* Quando si utilizza `destinationType.FILE_URI` , foto vengono salvati nella directory temporanea dell'applicazione. Il contenuto della directory temporanea dell'applicazione viene eliminato quando l'applicazione termina.
-
-### Tizen stranezze
-
-* opzioni non supportate
-
-* restituisce sempre un URI del FILE
-
-### Windows Phone 7 e 8 stranezze
-
-* Ignora il `allowEdit` parametro.
-
-* Ignora il `correctOrientation` parametro.
-
-* Ignora il `cameraDirection` parametro.
-
-* Ignora il `saveToPhotoAlbum` parametro. IMPORTANTE: Tutte le immagini scattate con la fotocamera di cordova wp7/8 API vengono sempre copiate rotolo fotocamera del telefono cellulare. A seconda delle impostazioni dell'utente, questo potrebbe anche significare che l'immagine viene caricato in automatico a loro OneDrive. Questo potenzialmente potrebbe significare che l'immagine è disponibile a un pubblico più ampio di app destinate. Se questo un blocco dell'applicazione, sarà necessario implementare il CameraCaptureTask come documentato su msdn: si può anche commentare o up-voto la questione correlata nel [tracciatore di problemi][3]
-
-* Ignora la `mediaType` proprietà di `cameraOptions` come il SDK di Windows Phone non fornisce un modo per scegliere il video da PHOTOLIBRARY.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-funzione di callback onError che fornisce un messaggio di errore.
-
- function(message) {
- // Show a helpful message
- }
-
-
-### Parametri
-
-* **message**: il messaggio è fornito dal codice nativo del dispositivo. *(String)*
-
-## cameraSuccess
-
-funzione di callback onSuccess che fornisce i dati di immagine.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### Parametri
-
-* **imageData**: Base64 codifica dei dati immagine, *o* il file di immagine URI, a seconda `cameraOptions` in vigore. *(String)*
-
-### Esempio
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Un handle per la finestra di dialogo di muffin creato da `navigator.camera.getPicture`.
-
-### Metodi
-
-* **setPosition**: impostare la posizione dei muffin.
-
-### Piattaforme supportate
-
-* iOS
-
-### setPosition
-
-Impostare la posizione dei muffin.
-
-**Parametri**:
-
-* `cameraPopoverOptions`: il `CameraPopoverOptions` che specificare la nuova posizione
-
-### Esempio
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS solo parametri che specificano l'ancoraggio elemento posizione e freccia direzione il Muffin quando si selezionano le immagini dalla libreria un iPad o un album.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-### CameraPopoverOptions
-
-* **x**: pixel coordinata x dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
-* **y**: coordinata y di pixel dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
-* **width**: larghezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
-* **height**: altezza, in pixel, dell'elemento dello schermo su cui ancorare il muffin. *(Numero)*
-
-* **arrowDir**: direzione dovrebbe puntare la freccia il muffin. Definito in `Camera.PopoverArrowDirection` *(numero)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Si noti che la dimensione del muffin possa cambiare per regolare la direzione della freccia e l'orientamento dello schermo. Assicurarsi che tenere conto di modifiche di orientamento quando si specifica la posizione di elemento di ancoraggio.
-
-## navigator.camera.cleanup
-
-Rimuove intermedio foto scattate con la fotocamera da deposito temporaneo.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### Descrizione
-
-Rimuove i file di immagine intermedia che vengono tenuti in custodia temporanea dopo la chiamata a `camera.getPicture`. Si applica solo quando il valore di `Camera.sourceType` è uguale a `Camera.PictureSourceType.CAMERA` e il `Camera.destinationType` è uguale a `Camera.DestinationType.FILE_URI`.
-
-### Piattaforme supportate
-
-* iOS
-
-### Esempio
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/doc/ja/README.md b/plugins/cordova-plugin-camera/doc/ja/README.md
deleted file mode 100644
index a50c185..0000000
--- a/plugins/cordova-plugin-camera/doc/ja/README.md
+++ /dev/null
@@ -1,421 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-このプラグインは、写真を撮るため、システムのイメージ ライブラリからイメージを選択するために API を提供します、グローバル `navigator.camera` オブジェクトを定義します。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * カメラ
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * navigator.camera.cleanup
-
-## navigator.camera.getPicture
-
-カメラを使用して写真を取るか、デバイスの画像ギャラリーから写真を取得します。 イメージが渡されます成功時のコールバックを base64 エンコードされた `文字列`、または、URI としてイメージ ファイル。 メソッド自体はファイル選択ポップ オーバーの位置を変更するために使用できる `CameraPopoverHandle` オブジェクトを返します。
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### 解説
-
-`camera.getPicture` 関数は、ユーザーの写真をスナップすることができますデバイスのデフォルト カメラ アプリケーションを開きます。 `Camera.sourceType` が `Camera.PictureSourceType.CAMERA` と等しい場合既定では、この現象が発生します。 ユーザーは写真をスナップ、カメラ アプリケーションを閉じるし、アプリケーションが復元されます。
-
-`Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` または `Camera.PictureSourceType.SAVEDPHOTOALBUM` の場合、ダイアログ ボックスはユーザーを既存のイメージを選択することができますが表示されます。 `camera.getPicture` 関数は、デバイスの向きが変更されたとき、たとえば、イメージの選択ダイアログには、位置を変更するために使用することができます、`CameraPopoverHandle` オブジェクトを返します。
-
-戻り値が `cameraSuccess` コールバック関数の指定 `cameraOptions` に応じて、次の形式のいずれかに送信されます。
-
- * A `String` 写真の base64 でエンコードされたイメージを含んでいます。
-
- * A `String` (既定値) のローカル記憶域上のイメージ ファイルの場所を表します。
-
-自由に変更、エンコードされたイメージ、または URI などを行うことができます。
-
- * イメージをレンダリングする `` 以下の例のように、タグ
-
- * ローカル データの保存 ( `LocalStorage` 、 [Lawnchair](http://brianleroux.github.com/lawnchair/)など)。
-
- * リモート サーバーにデータを投稿します。
-
-**注**: 新しいデバイス上の写真の解像度はかなり良いです。 デバイスのギャラリーから選択した写真は `quality` パラメーターが指定されて場合でも下方の品質に縮小されません。 一般的なメモリの問題を避けるために `DATA_URL` ではなく `FILE_URI` に `Camera.destinationType` を設定します。.
-
-#### サポートされているプラットフォーム
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### 例
-
-写真を撮るし、base64 エンコード イメージとして取得します。
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-写真を撮るし、イメージのファイルの場所を取得します。
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### 環境設定 (iOS)
-
- * **CameraUsesGeolocation**(ブール値、デフォルトは false)。 Jpeg 画像をキャプチャするため EXIF ヘッダーで地理位置情報データを取得する場合は true に設定します。 これは、場合地理位置情報のアクセス許可に対する要求をトリガーする true に設定します。
-
-
-
-
-#### アマゾン火 OS 癖
-
-アマゾン火 OS イメージをキャプチャするデバイス上のカメラの活動を開始する意図を使用して、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。
-
-#### Android の癖
-
-アンドロイド、イメージをキャプチャするデバイス上でカメラのアクティビティを開始する意図を使用し、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。
-
-#### ブラウザーの癖
-
-Base64 エンコード イメージとして写真を返すのみことができます。
-
-#### Firefox OS 癖
-
-カメラのプラグインは現在、[Web アクティビティ](https://hacks.mozilla.org/2013/01/introducing-web-activities/) を使用して実装されていた.
-
-#### iOS の癖
-
-コールバック関数のいずれかの JavaScript `alert()` を含む問題が発生することができます。 IOS イメージ ピッカーまたは完全が終了するまで、警告が表示されますポップ オーバーを許可する `setTimeout()` 内でアラートをラップします。
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Windows Phone 7 の癖
-
-ネイティブ カメラ アプリケーションを呼び出すと、デバイスが Zune を介して接続されている動作しませんし、エラー コールバックをトリガーします。
-
-#### Tizen の癖
-
-Tizen のみ `Camera.DestinationType.FILE_URI` の `destinationType` と `Camera.PictureSourceType.PHOTOLIBRARY` の `sourceType` をサポートしています.
-
-## CameraOptions
-
-カメラの設定をカスタマイズするオプションのパラメーター。
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
- * **quality**: 0-100、100 がファイルの圧縮から損失なしで通常のフル解像度の範囲で表される、保存されたイメージの品質。 既定値は 50 です。 *(数)*(カメラの解像度についての情報が利用できないことに注意してください)。
-
- * **destinationType**: 戻り値の形式を選択します。既定値は FILE_URI です。定義されている `navigator.camera.DestinationType` *(番号)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **sourceType**: 画像のソースを設定します。既定値は、カメラです。定義されている `navigator.camera.PictureSourceType` *(番号)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **allowEdit**: 単純な選択の前に画像の編集を許可します。*(ブール値)*
-
- * **encodingType**: 返されるイメージ ファイルのエンコーディングを選択します。デフォルトは JPEG です。定義されている `navigator.camera.EncodingType` *(番号)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: スケール イメージにピクセル単位の幅。**TargetHeight**を使用する必要があります。縦横比は変わりません。*(数)*
-
- * **targetHeight**: スケール イメージにピクセル単位の高さ。**TargetWidth**を使用する必要があります。縦横比は変わりません。*(数)*
-
- * **mediaType**: から選択するメディアの種類を設定します。 場合にのみ働きます `PictureSourceType` は `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` 。 定義されている `nagivator.camera.MediaType` *(番号)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: キャプチャ中に、デバイスの向きを修正する画像を回転させます。*(ブール値)*
-
- * **saveToPhotoAlbum**: キャプチャ後、デバイス上のフォト アルバムに画像を保存します。*(ブール値)*
-
- * **popoverOptions**: iPad のポップ オーバーの場所を指定する iOS のみのオプションです。定義されています。`CameraPopoverOptions`.
-
- * **cameraDirection**: (前面または背面側) を使用するカメラを選択します。既定値は戻るです。定義されている `navigator.camera.Direction` *(番号)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### アマゾン火 OS 癖
-
- * 任意 `cameraDirection` 背面写真で結果の値します。
-
- * 無視、 `allowEdit` パラメーター。
-
- * `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。
-
-#### Android の癖
-
- * 任意 `cameraDirection` 背面写真で結果の値します。
-
- * アンドロイドも使用しています作物活性、allowEdit もトリミングする必要があります動作し、実際にトリミングされた画像をコルドバで 1 つだけの作品一貫して Google プラス写真アプリケーションにバンドルされているものであることに渡します。 他の作物が機能しません。
-
- * `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。
-
-#### ブラックベリー 10 癖
-
- * 無視、 `quality` パラメーター。
-
- * 無視、 `allowEdit` パラメーター。
-
- * `Camera.MediaType`サポートされていません。
-
- * 無視、 `correctOrientation` パラメーター。
-
- * 無視、 `cameraDirection` パラメーター。
-
-#### Firefox OS 癖
-
- * 無視、 `quality` パラメーター。
-
- * `Camera.DestinationType`無視され、等しい `1` (イメージ ファイル URI)
-
- * 無視、 `allowEdit` パラメーター。
-
- * 無視、 `PictureSourceType` パラメーター (ユーザーが選択ダイアログ ウィンドウに)
-
- * 無視します、`encodingType`
-
- * 無視、 `targetWidth` と`targetHeight`
-
- * `Camera.MediaType`サポートされていません。
-
- * 無視、 `correctOrientation` パラメーター。
-
- * 無視、 `cameraDirection` パラメーター。
-
-#### iOS の癖
-
- * 設定 `quality` 一部のデバイスでメモリ不足エラーを避けるために 50 の下。
-
- * 使用する場合 `destinationType.FILE_URI` 、写真、アプリケーションの一時ディレクトリに保存されます。アプリケーションの一時ディレクトリの内容は、アプリケーションの終了時に削除されます。
-
-#### Tizen の癖
-
- * サポートされていないオプション
-
- * 常にファイルの URI を返す
-
-#### Windows Phone 7 と 8 癖
-
- * 無視、 `allowEdit` パラメーター。
-
- * 無視、 `correctOrientation` パラメーター。
-
- * 無視、 `cameraDirection` パラメーター。
-
- * 無視、 `saveToPhotoAlbum` パラメーター。 重要: wp7/8 コルドバ カメラ API で撮影したすべての画像は携帯電話のカメラ巻き物に常にコピーします。 ユーザーの設定に応じて、これも、画像はその OneDrive に自動アップロードを意味できます。 イメージは意図したアプリより広い聴衆に利用できる可能性があります可能性があります。 場合は、このアプリケーションのブロッカー、msdn で説明されているように、CameraCaptureTask を実装する必要があります: コメントにすることがありますもかアップ投票関連の問題を[課題追跡システム](https://issues.apache.org/jira/browse/CB-2083)で
-
- * 無視、 `mediaType` のプロパティ `cameraOptions` として Windows Phone SDK には、フォト ライブラリからビデオを選択する方法は行いません。
-
-## CameraError
-
-エラー メッセージを提供する onError コールバック関数。
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### 解説
-
- * **message**: メッセージは、デバイスのネイティブ コードによって提供されます。*(文字列)*
-
-## cameraSuccess
-
-画像データを提供する onSuccess コールバック関数。
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### 解説
-
- * **imagedata を扱う**: Base64 エンコード イメージのデータ、*または*画像ファイルによって URI の `cameraOptions` 効果。*(文字列)*
-
-#### 例
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-`Navigator.camera.getPicture` によって作成されたポップオーバーパン ダイアログ ボックスへのハンドル.
-
-#### 解説
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### サポートされているプラットフォーム
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### 例
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS だけ指定パラメーターをポップ オーバーのアンカー要素の場所および矢印方向計算されたライブラリまたはアルバムから画像を選択するとき。
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### 解説
-
- * **x**: ピクセルの x 座標画面要素にポップ オーバーのアンカーになります。*(数)*
-
- * **y**: y ピクセル座標の画面要素にポップ オーバーのアンカーになります。*(数)*
-
- * **width**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の幅。*(数)*
-
- * **height**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の高さ。*(数)*
-
- * **arrowDir**: 方向のポップ オーバーで矢印をポイントする必要があります。定義されている `Camera.PopoverArrowDirection` *(番号)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-矢印の方向と、画面の向きを調整するポップ オーバーのサイズを変更可能性がありますに注意してください。 アンカー要素の位置を指定するときの方向の変化を考慮することを確認します。
-
-## navigator.camera.cleanup
-
-削除中間一時ストレージからカメラで撮影した写真。
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-#### 解説
-
-`camera.getPicture` を呼び出した後一時記憶域に保存されている中間画像ファイルを削除します。 `Camera.sourceType` の値が `Camera.PictureSourceType.CAMERA` に等しい、`Camera.destinationType` が `Camera.DestinationType.FILE_URI` と等しいの場合にのみ適用されます。.
-
-#### サポートされているプラットフォーム
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### 例
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/ja/index.md b/plugins/cordova-plugin-camera/doc/ja/index.md
deleted file mode 100644
index 5bdb3e1..0000000
--- a/plugins/cordova-plugin-camera/doc/ja/index.md
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-# cordova-plugin-camera
-
-このプラグインは、写真を撮るため、システムのイメージ ライブラリからイメージを選択するために API を提供します、グローバル `navigator.camera` オブジェクトを定義します。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-カメラを使用して写真を取るか、デバイスの画像ギャラリーから写真を取得します。 イメージが渡されます成功時のコールバックを base64 エンコードされた `文字列`、または、URI としてイメージ ファイル。 メソッド自体はファイル選択ポップ オーバーの位置を変更するために使用できる `CameraPopoverHandle` オブジェクトを返します。
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### 解説
-
-`camera.getPicture` 関数は、ユーザーの写真をスナップすることができますデバイスのデフォルト カメラ アプリケーションを開きます。 `Camera.sourceType` が `Camera.PictureSourceType.CAMERA` と等しい場合既定では、この現象が発生します。 ユーザーは写真をスナップ、カメラ アプリケーションを閉じるし、アプリケーションが復元されます。
-
-`Camera.sourceType` `Camera.PictureSourceType.PHOTOLIBRARY` または `Camera.PictureSourceType.SAVEDPHOTOALBUM` の場合、ダイアログ ボックスはユーザーを既存のイメージを選択することができますが表示されます。 `camera.getPicture` 関数は、デバイスの向きが変更されたとき、たとえば、イメージの選択ダイアログには、位置を変更するために使用することができます、`CameraPopoverHandle` オブジェクトを返します。
-
-戻り値が `cameraSuccess` コールバック関数の指定 `cameraOptions` に応じて、次の形式のいずれかに送信されます。
-
-* A `String` 写真の base64 でエンコードされたイメージを含んでいます。
-
-* A `String` (既定値) のローカル記憶域上のイメージ ファイルの場所を表します。
-
-自由に変更、エンコードされたイメージ、または URI などを行うことができます。
-
-* イメージをレンダリングする `` 以下の例のように、タグ
-
-* ローカル データの保存 ( `LocalStorage` 、 [Lawnchair][1]など)。
-
-* リモート サーバーにデータを投稿します。
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**注**: 新しいデバイス上の写真の解像度はかなり良いです。 デバイスのギャラリーから選択した写真は `quality` パラメーターが指定されて場合でも下方の品質に縮小されません。 一般的なメモリの問題を避けるために `DATA_URL` ではなく `FILE_URI` に `Camera.destinationType` を設定します。.
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* ブラウザー
-* Firefox の OS
-* iOS
-* Tizen
-* Windows Phone 7 と 8
-* Windows 8
-
-### 環境設定 (iOS)
-
-* **CameraUsesGeolocation**(ブール値、デフォルトは false)。 Jpeg 画像をキャプチャするため EXIF ヘッダーで地理位置情報データを取得する場合は true に設定します。 これは、場合地理位置情報のアクセス許可に対する要求をトリガーする true に設定します。
-
-
-
-
-### アマゾン火 OS 癖
-
-アマゾン火 OS イメージをキャプチャするデバイス上のカメラの活動を開始する意図を使用して、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。
-
-### Android の癖
-
-アンドロイド、イメージをキャプチャするデバイス上でカメラのアクティビティを開始する意図を使用し、メモリの少ない携帯電話、コルドバ活動が殺されるかもしれない。 このシナリオではコルドバ活動が復元されると、イメージが表示されません。
-
-### ブラウザーの癖
-
-Base64 エンコード イメージとして写真を返すのみことができます。
-
-### Firefox OS 癖
-
-カメラのプラグインは現在、[Web アクティビティ][2] を使用して実装されていた.
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS の癖
-
-コールバック関数のいずれかの JavaScript `alert()` を含む問題が発生することができます。 IOS イメージ ピッカーまたは完全が終了するまで、警告が表示されますポップ オーバーを許可する `setTimeout()` 内でアラートをラップします。
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-### Windows Phone 7 の癖
-
-ネイティブ カメラ アプリケーションを呼び出すと、デバイスが Zune を介して接続されている動作しませんし、エラー コールバックをトリガーします。
-
-### Tizen の癖
-
-Tizen のみ `Camera.DestinationType.FILE_URI` の `destinationType` と `Camera.PictureSourceType.PHOTOLIBRARY` の `sourceType` をサポートしています.
-
-### 例
-
-写真を撮るし、base64 エンコード イメージとして取得します。
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-写真を撮るし、イメージのファイルの場所を取得します。
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-カメラの設定をカスタマイズするオプションのパラメーター。
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### オプション
-
-* **quality**: 0-100、100 がファイルの圧縮から損失なしで通常のフル解像度の範囲で表される、保存されたイメージの品質。 既定値は 50 です。 *(数)*(カメラの解像度についての情報が利用できないことに注意してください)。
-
-* **destinationType**: 戻り値の形式を選択します。既定値は FILE_URI です。定義されている `navigator.camera.DestinationType` *(番号)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **sourceType**: 画像のソースを設定します。既定値は、カメラです。定義されている `navigator.camera.PictureSourceType` *(番号)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **allowEdit**: 単純な選択の前に画像の編集を許可します。*(ブール値)*
-
-* **encodingType**: 返されるイメージ ファイルのエンコーディングを選択します。デフォルトは JPEG です。定義されている `navigator.camera.EncodingType` *(番号)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: スケール イメージにピクセル単位の幅。**TargetHeight**を使用する必要があります。縦横比は変わりません。*(数)*
-
-* **targetHeight**: スケール イメージにピクセル単位の高さ。**TargetWidth**を使用する必要があります。縦横比は変わりません。*(数)*
-
-* **mediaType**: から選択するメディアの種類を設定します。 場合にのみ働きます `PictureSourceType` は `PHOTOLIBRARY` または `SAVEDPHOTOALBUM` 。 定義されている `nagivator.camera.MediaType` *(番号)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: キャプチャ中に、デバイスの向きを修正する画像を回転させます。*(ブール値)*
-
-* **saveToPhotoAlbum**: キャプチャ後、デバイス上のフォト アルバムに画像を保存します。*(ブール値)*
-
-* **popoverOptions**: iPad のポップ オーバーの場所を指定する iOS のみのオプションです。定義されています。`CameraPopoverOptions`.
-
-* **cameraDirection**: (前面または背面側) を使用するカメラを選択します。既定値は戻るです。定義されている `navigator.camera.Direction` *(番号)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### アマゾン火 OS 癖
-
-* 任意 `cameraDirection` 背面写真で結果の値します。
-
-* 無視、 `allowEdit` パラメーター。
-
-* `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。
-
-### Android の癖
-
-* 任意 `cameraDirection` 背面写真で結果の値します。
-
-* 無視、 `allowEdit` パラメーター。
-
-* `Camera.PictureSourceType.PHOTOLIBRARY``Camera.PictureSourceType.SAVEDPHOTOALBUM`両方のアルバムが表示されます同じ写真。
-
-### ブラックベリー 10 癖
-
-* 無視、 `quality` パラメーター。
-
-* 無視、 `allowEdit` パラメーター。
-
-* `Camera.MediaType`サポートされていません。
-
-* 無視、 `correctOrientation` パラメーター。
-
-* 無視、 `cameraDirection` パラメーター。
-
-### Firefox OS 癖
-
-* 無視、 `quality` パラメーター。
-
-* `Camera.DestinationType`無視され、等しい `1` (イメージ ファイル URI)
-
-* 無視、 `allowEdit` パラメーター。
-
-* 無視、 `PictureSourceType` パラメーター (ユーザーが選択ダイアログ ウィンドウに)
-
-* 無視します、`encodingType`
-
-* 無視、 `targetWidth` と`targetHeight`
-
-* `Camera.MediaType`サポートされていません。
-
-* 無視、 `correctOrientation` パラメーター。
-
-* 無視、 `cameraDirection` パラメーター。
-
-### iOS の癖
-
-* 設定 `quality` 一部のデバイスでメモリ不足エラーを避けるために 50 の下。
-
-* 使用する場合 `destinationType.FILE_URI` 、写真、アプリケーションの一時ディレクトリに保存されます。アプリケーションの一時ディレクトリの内容は、アプリケーションの終了時に削除されます。
-
-### Tizen の癖
-
-* サポートされていないオプション
-
-* 常にファイルの URI を返す
-
-### Windows Phone 7 と 8 癖
-
-* 無視、 `allowEdit` パラメーター。
-
-* 無視、 `correctOrientation` パラメーター。
-
-* 無視、 `cameraDirection` パラメーター。
-
-* 無視、 `saveToPhotoAlbum` パラメーター。 重要: wp7/8 コルドバ カメラ API で撮影したすべての画像は携帯電話のカメラ巻き物に常にコピーします。 ユーザーの設定に応じて、これも、画像はその OneDrive に自動アップロードを意味できます。 イメージは意図したアプリより広い聴衆に利用できる可能性があります可能性があります。 場合は、このアプリケーションのブロッカー、msdn で説明されているように、CameraCaptureTask を実装する必要があります: コメントにすることがありますもかアップ投票関連の問題を[課題追跡システム][3]で
-
-* 無視、 `mediaType` のプロパティ `cameraOptions` として Windows Phone SDK には、フォト ライブラリからビデオを選択する方法は行いません。
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-エラー メッセージを提供する onError コールバック関数。
-
- function(message) {
- // Show a helpful message
- }
-
-
-### パラメーター
-
-* **message**: メッセージは、デバイスのネイティブ コードによって提供されます。*(文字列)*
-
-## cameraSuccess
-
-画像データを提供する onSuccess コールバック関数。
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### パラメーター
-
-* **imagedata を扱う**: Base64 エンコード イメージのデータ、*または*画像ファイルによって URI の `cameraOptions` 効果。*(文字列)*
-
-### 例
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-`Navigator.camera.getPicture` によって作成されたポップオーバーパン ダイアログ ボックスへのハンドル.
-
-### メソッド
-
-* **setPosition**: ポップ オーバーの位置を設定します。
-
-### サポートされているプラットフォーム
-
-* iOS
-
-### setPosition
-
-ポップ オーバーの位置を設定します。
-
-**パラメーター**:
-
-* `cameraPopoverOptions`:、 `CameraPopoverOptions` の新しい位置を指定します。
-
-### 例
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS だけ指定パラメーターをポップ オーバーのアンカー要素の場所および矢印方向計算されたライブラリまたはアルバムから画像を選択するとき。
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-### CameraPopoverOptions
-
-* **x**: ピクセルの x 座標画面要素にポップ オーバーのアンカーになります。*(数)*
-
-* **y**: y ピクセル座標の画面要素にポップ オーバーのアンカーになります。*(数)*
-
-* **width**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の幅。*(数)*
-
-* **height**: ポップ オーバーのアンカーになる上の画面要素のピクセル単位の高さ。*(数)*
-
-* **arrowDir**: 方向のポップ オーバーで矢印をポイントする必要があります。定義されている `Camera.PopoverArrowDirection` *(番号)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-矢印の方向と、画面の向きを調整するポップ オーバーのサイズを変更可能性がありますに注意してください。 アンカー要素の位置を指定するときの方向の変化を考慮することを確認します。
-
-## navigator.camera.cleanup
-
-削除中間一時ストレージからカメラで撮影した写真。
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### 説明
-
-`camera.getPicture` を呼び出した後一時記憶域に保存されている中間画像ファイルを削除します。 `Camera.sourceType` の値が `Camera.PictureSourceType.CAMERA` に等しい、`Camera.destinationType` が `Camera.DestinationType.FILE_URI` と等しいの場合にのみ適用されます。.
-
-### サポートされているプラットフォーム
-
-* iOS
-
-### 例
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/doc/ko/README.md b/plugins/cordova-plugin-camera/doc/ko/README.md
deleted file mode 100644
index 7b7c215..0000000
--- a/plugins/cordova-plugin-camera/doc/ko/README.md
+++ /dev/null
@@ -1,421 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-이 플러그인 시스템의 이미지 라이브러리에서 이미지를 선택 및 사진 촬영을 위한 API를 제공 하는 글로벌 `navigator.camera` 개체를 정의 합니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * 카메라
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * navigator.camera.cleanup
-
-## navigator.camera.getPicture
-
-카메라를 사용 하 여 사진을 걸립니다 또는 소자의 이미지 갤러리에서 사진을 검색 합니다. 이미지는 성공 콜백에 전달 base64 인코딩된 `문자열` 또는 URI로 이미지 파일에 대 한. 방법 자체는 파일 선택 popover 위치를 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다.
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### 설명
-
-`Camera.getPicture` 함수 스냅 사진을 사용자가 소자의 기본 카메라 응용 프로그램을 엽니다. 이 문제는 `Camera.sourceType` `Camera.PictureSourceType.CAMERA` 경우 기본적으로 발생 합니다. 일단 사용자 스냅 사진, 카메라 응용 프로그램 종료 하 고 응용 프로그램 복원 됩니다.
-
-`Camera.sourceType`은 `Camera.PictureSourceType.PHOTOLIBRARY` 또는 `Camera.PictureSourceType.SAVEDPHOTOALBUM`, 대화 상자가 사용자가 기존 이미지를 선택할 수 있도록 표시 됩니다. `camera.getPicture` 함수는 장치 방향 변경 될 때 이미지 선택 대화 상자, 예를 들어, 위치를 변경 하려면 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다.
-
-반환 값은 `cameraSuccess` 콜백 함수 지정된 `cameraOptions`에 따라 다음 형식 중 하나에 전송 됩니다.
-
- * A `String` base64 인코딩된 사진 이미지를 포함 합니다.
-
- * A `String` 로컬 저장소 (기본값)의 이미지 파일 위치를 나타내는.
-
-할 수 있는 당신이 원하는대로 인코딩된 이미지 또는 URI, 예를 들면:
-
- * 렌더링 이미지는 `` 아래 예제와 같이 태그
-
- * 로컬로 데이터를 저장 ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/), 등.)
-
- * 원격 서버에 데이터 게시
-
-**참고**: 더 새로운 장치에 사진 해상도 아주 좋은. 소자의 갤러리에서 선택 된 사진 `품질` 매개 변수를 지정 하는 경우에 낮은 품질에 관하여 하지는. 일반적인 메모리 문제를 피하기 위해 `DATA_URL` 보다 `FILE_URI` `Camera.destinationType` 설정.
-
-#### 지원 되는 플랫폼
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### 예를 들어
-
-촬영 및 base64 인코딩 이미지로 검색:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-촬영 하 고 이미지의 파일 위치를 검색:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### 환경 설정 (iOS)
-
- * **CameraUsesGeolocation** (boolean, 기본값: false)입니다. 캡처 Jpeg, EXIF 헤더에 지리적 데이터를 true로 설정 합니다. 이 경우 위치 정보 사용 권한에 대 한 요청을 일으킬 것 이다 true로 설정 합니다.
-
-
-
-
-#### 아마존 화재 OS 단점
-
-아마존 화재 OS 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다.
-
-#### 안 드 로이드 단점
-
-안 드 로이드 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다.
-
-#### 브라우저 만지면
-
-수 base64 인코딩 이미지로 사진을 반환 합니다.
-
-#### 파이어 폭스 OS 단점
-
-카메라 플러그인은 현재 [웹 활동](https://hacks.mozilla.org/2013/01/introducing-web-activities/)를 사용 하 여 구현.
-
-#### iOS 단점
-
-자바 `alert()`를 포함 하 여 콜백 함수 중 하나에 문제가 발생할 수 있습니다. 포장 허용 iOS 이미지 피커 또는 popover를 완벽 하 게 경고를 표시 하기 전에 닫습니다 `setTimeout()` 내에서 경고:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Windows Phone 7 단점
-
-장치 Zune 통해 연결 된 동안 네이티브 카메라 응용 프로그램을 호출 하면 작동 하지 않습니다 하 고 오류 콜백 트리거합니다.
-
-#### Tizen 특수
-
-`Camera.DestinationType.FILE_URI`의 `destinationType`와 `Camera.PictureSourceType.PHOTOLIBRARY`의 `sourceType` Tizen 지원.
-
-## CameraOptions
-
-카메라 설정을 사용자 지정 하는 선택적 매개 변수.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
- * **품질**: 범위 0-100, 100은 파일 압축에서 손실 없이 일반적으로 전체 해상도 저장된 된 이미지의 품질. 기본값은 50입니다. *(수)* (Note 카메라의 해상도 대 한 정보는 사용할 수 없습니다.)
-
- * **destinationType**: 반환 값의 형식을 선택 합니다. 기본값은 FILE_URI입니다. 에 정의 된 `navigator.camera.DestinationType` *(수)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **sourceType**: 그림의 소스를 설정 합니다. 기본값은 카메라입니다. 에 정의 된 `navigator.camera.PictureSourceType` *(수)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **allowEdit**: 선택 하기 전에 이미지의 간단한 편집을 허용 합니다. *(부울)*
-
- * **encodingType**: 반환 된 이미지 파일의 인코딩을 선택 합니다. 기본값은 JPEG입니다. 에 정의 된 `navigator.camera.EncodingType` *(수)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: 스케일 이미지를 픽셀 너비. **TargetHeight**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)*
-
- * **targetHeight**: 스케일 이미지를 픽셀 단위로 높이. **TargetWidth**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)*
-
- * **mediaType**:에서 선택 미디어 유형을 설정 합니다. 때에 작동 `PictureSourceType` 는 `PHOTOLIBRARY` 또는 `SAVEDPHOTOALBUM` . 에 정의 된 `nagivator.camera.MediaType` *(수)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. 기본입니다. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: 캡처 도중 장치의 방향에 대 한 해결 하기 위해 이미지를 회전 합니다. *(부울)*
-
- * **saveToPhotoAlbum**: 캡처 후 장치에서 사진 앨범에 이미지를 저장 합니다. *(부울)*
-
- * **popoverOptions**: iPad에 popover 위치를 지정 하는 iOS 전용 옵션. 에 정의 된`CameraPopoverOptions`.
-
- * **cameraDirection**: (앞 이나 뒤로-연결)를 사용 하 여 카메라를 선택 하십시오. 기본값은 다시. 에 정의 된 `navigator.camera.Direction` *(수)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### 아마존 화재 OS 단점
-
- * 어떤 `cameraDirection` 다시 연결 사진에 결과 값.
-
- * 무시는 `allowEdit` 매개 변수.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다.
-
-#### 안 드 로이드 단점
-
- * 어떤 `cameraDirection` 다시 연결 사진에 결과 값.
-
- * 안 드 로이드도 사용 자르기 활동 allowEdit, 비록 작물 작업과 실제로 코르도바, 유일 하 게 작품 지속적으로 구글 플러스 사진 응용 프로그램과 함께 번들로 제공 하는 것은 등을 맞댄 자른된 이미지를 전달 해야 합니다. 다른 작물은 작동 하지 않을 수 있습니다.
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다.
-
-#### 블랙베리 10 단점
-
- * 무시는 `quality` 매개 변수.
-
- * 무시는 `allowEdit` 매개 변수.
-
- * `Camera.MediaType`지원 되지 않습니다.
-
- * 무시는 `correctOrientation` 매개 변수.
-
- * 무시는 `cameraDirection` 매개 변수.
-
-#### 파이어 폭스 OS 단점
-
- * 무시는 `quality` 매개 변수.
-
- * `Camera.DestinationType`무시 되 고 `1` (이미지 파일 URI)
-
- * 무시는 `allowEdit` 매개 변수.
-
- * 무시는 `PictureSourceType` 매개 변수 (사용자가 선택 그것 대화 창에서)
-
- * 무시 하는`encodingType`
-
- * 무시는 `targetWidth` 와`targetHeight`
-
- * `Camera.MediaType`지원 되지 않습니다.
-
- * 무시는 `correctOrientation` 매개 변수.
-
- * 무시는 `cameraDirection` 매개 변수.
-
-#### iOS 단점
-
- * 설정 `quality` 일부 장치 메모리 오류를 피하기 위해 50 아래.
-
- * 사용 하는 경우 `destinationType.FILE_URI` , 사진 응용 프로그램의 임시 디렉터리에 저장 됩니다. 응용 프로그램이 종료 될 때 응용 프로그램의 임시 디렉터리의 내용은 삭제 됩니다.
-
-#### Tizen 특수
-
- * 지원 되지 않는 옵션
-
- * 항상 파일 URI를 반환 합니다.
-
-#### Windows Phone 7, 8 특수
-
- * 무시는 `allowEdit` 매개 변수.
-
- * 무시는 `correctOrientation` 매개 변수.
-
- * 무시는 `cameraDirection` 매개 변수.
-
- * 무시는 `saveToPhotoAlbum` 매개 변수. 중요: 모든 이미지 API wp7/8 코르도바 카메라로 촬영 항상 복사 됩니다 휴대 전화의 카메라 롤에. 사용자의 설정에 따라이 또한 그들의 OneDrive에 자동 업로드 이미지는 의미. 이 잠재적으로 이미지는 당신의 애플 리 케이 션을 위한 보다 넓은 청중에 게 사용할 수 있는 의미. 이 경우 응용 프로그램에 대 한 차단, 당신은 msdn에 설명 대로 단말기를 구현 해야 합니다: 수 있습니다 또한 의견 또는 [이슈 트래커](https://issues.apache.org/jira/browse/CB-2083) 에서 업-투표 관련된 문제
-
- * 무시는 `mediaType` 속성을 `cameraOptions` 으로 Windows Phone SDK PHOTOLIBRARY에서 비디오를 선택 하는 방법을 제공 하지 않습니다.
-
-## CameraError
-
-오류 메시지를 제공 하는 onError 콜백 함수.
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### 설명
-
- * **메시지**: 메시지는 장치의 네이티브 코드에 의해 제공 됩니다. *(문자열)*
-
-## cameraSuccess
-
-이미지 데이터를 제공 하는 onSuccess 콜백 함수.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### 설명
-
- * **imageData**: Base64 인코딩은 이미지 데이터, *또는* 이미지 파일에 따라 URI의 `cameraOptions` 적용. *(문자열)*
-
-#### 예를 들어
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-`navigator.camera.getPicture`에 의해 만들어진 popover 대화에 대 한 핸들.
-
-#### 설명
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### 지원 되는 플랫폼
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### 예를 들어
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS 전용 매개 변수 iPad의 보관 함 또는 앨범에서 이미지를 선택 하면 앵커 요소 위치와 화살표의 방향으로 popover 지정 하는.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### 설명
-
- * **x**: x는 popover 앵커는 화면 요소의 픽셀 좌표. *(수)*
-
- * **y**: y 픽셀 좌표는 popover 앵커는 화면 요소입니다. *(수)*
-
- * **폭**: 폭 (픽셀)는 popover 앵커는 화면 요소. *(수)*
-
- * **높이**: 높이 (픽셀)는 popover 앵커는 화면 요소. *(수)*
-
- * **arrowDir**: 방향 화살표는 popover 가리켜야 합니다. 에 정의 된 `Camera.PopoverArrowDirection` *(수)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-참고는 popover의 크기 조정 화살표 방향 및 화면 방향 변경 될 수 있습니다. 앵커 요소 위치를 지정 하는 경우 방향 변경에 대 한 계정에 있는지 확인 합니다.
-
-## navigator.camera.cleanup
-
-제거 임시 저장소에서 카메라로 찍은 사진을 중간.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-#### 설명
-
-`camera.getPicture`를 호출한 후 임시 저장소에 보관 됩니다 중간 이미지 파일을 제거 합니다. `Camera.sourceType` 값은 `Camera.PictureSourceType.CAMERA` 및 `Camera.destinationType`와 `Camera.DestinationType.FILE_URI` 때만 적용 됩니다..
-
-#### 지원 되는 플랫폼
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### 예를 들어
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/ko/index.md b/plugins/cordova-plugin-camera/doc/ko/index.md
deleted file mode 100644
index 794aa97..0000000
--- a/plugins/cordova-plugin-camera/doc/ko/index.md
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-# cordova-plugin-camera
-
-이 플러그인 시스템의 이미지 라이브러리에서 이미지를 선택 및 사진 촬영을 위한 API를 제공 하는 글로벌 `navigator.camera` 개체를 정의 합니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-카메라를 사용 하 여 사진을 걸립니다 또는 소자의 이미지 갤러리에서 사진을 검색 합니다. 이미지는 성공 콜백에 전달 base64 인코딩된 `문자열` 또는 URI로 이미지 파일에 대 한. 방법 자체는 파일 선택 popover 위치를 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다.
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### 설명
-
-`Camera.getPicture` 함수 스냅 사진을 사용자가 소자의 기본 카메라 응용 프로그램을 엽니다. 이 문제는 `Camera.sourceType` `Camera.PictureSourceType.CAMERA` 경우 기본적으로 발생 합니다. 일단 사용자 스냅 사진, 카메라 응용 프로그램 종료 하 고 응용 프로그램 복원 됩니다.
-
-`Camera.sourceType`은 `Camera.PictureSourceType.PHOTOLIBRARY` 또는 `Camera.PictureSourceType.SAVEDPHOTOALBUM`, 대화 상자가 사용자가 기존 이미지를 선택할 수 있도록 표시 됩니다. `camera.getPicture` 함수는 장치 방향 변경 될 때 이미지 선택 대화 상자, 예를 들어, 위치를 변경 하려면 사용할 수 있는 `CameraPopoverHandle` 개체를 반환 합니다.
-
-반환 값은 `cameraSuccess` 콜백 함수 지정된 `cameraOptions`에 따라 다음 형식 중 하나에 전송 됩니다.
-
-* A `String` base64 인코딩된 사진 이미지를 포함 합니다.
-
-* A `String` 로컬 저장소 (기본값)의 이미지 파일 위치를 나타내는.
-
-할 수 있는 당신이 원하는대로 인코딩된 이미지 또는 URI, 예를 들면:
-
-* 렌더링 이미지는 `` 아래 예제와 같이 태그
-
-* 로컬로 데이터를 저장 ( `LocalStorage` , [Lawnchair][1], 등.)
-
-* 원격 서버에 데이터 게시
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**참고**: 더 새로운 장치에 사진 해상도 아주 좋은. 소자의 갤러리에서 선택 된 사진 `품질` 매개 변수를 지정 하는 경우에 낮은 품질에 관하여 하지는. 일반적인 메모리 문제를 피하기 위해 `DATA_URL` 보다 `FILE_URI` `Camera.destinationType` 설정.
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* 브라우저
-* Firefox 운영 체제
-* iOS
-* Tizen
-* Windows Phone 7과 8
-* 윈도우 8
-
-### 환경 설정 (iOS)
-
-* **CameraUsesGeolocation** (boolean, 기본값: false)입니다. 캡처 Jpeg, EXIF 헤더에 지리적 데이터를 true로 설정 합니다. 이 경우 위치 정보 사용 권한에 대 한 요청을 일으킬 것 이다 true로 설정 합니다.
-
-
-
-
-### 아마존 화재 OS 단점
-
-아마존 화재 OS 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다.
-
-### 안 드 로이드 단점
-
-안 드 로이드 의도 사용 하 여 이미지 캡처 장치에서 카메라 활동을 시작 하 고 낮은 메모리와 휴대 전화에 코르 도우 바 활동 살해 수 있습니다. 코르도바 활동 복원 되 면이 시나리오에서는 이미지가 나타나지 않을 수 있습니다.
-
-### 브라우저 만지면
-
-수 base64 인코딩 이미지로 사진을 반환 합니다.
-
-### 파이어 폭스 OS 단점
-
-카메라 플러그인은 현재 [웹 활동][2]를 사용 하 여 구현.
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS 단점
-
-자바 `alert()`를 포함 하 여 콜백 함수 중 하나에 문제가 발생할 수 있습니다. 포장 허용 iOS 이미지 피커 또는 popover를 완벽 하 게 경고를 표시 하기 전에 닫습니다 `setTimeout()` 내에서 경고:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-### Windows Phone 7 단점
-
-장치 Zune 통해 연결 된 동안 네이티브 카메라 응용 프로그램을 호출 하면 작동 하지 않습니다 하 고 오류 콜백 트리거합니다.
-
-### Tizen 특수
-
-`Camera.DestinationType.FILE_URI`의 `destinationType`와 `Camera.PictureSourceType.PHOTOLIBRARY`의 `sourceType` Tizen 지원.
-
-### 예를 들어
-
-촬영 및 base64 인코딩 이미지로 검색:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-촬영 하 고 이미지의 파일 위치를 검색:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-카메라 설정을 사용자 지정 하는 선택적 매개 변수.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### 옵션
-
-* **품질**: 범위 0-100, 100은 파일 압축에서 손실 없이 일반적으로 전체 해상도 저장된 된 이미지의 품질. 기본값은 50입니다. *(수)* (Note 카메라의 해상도 대 한 정보는 사용할 수 없습니다.)
-
-* **destinationType**: 반환 값의 형식을 선택 합니다. 기본값은 FILE_URI입니다. 에 정의 된 `navigator.camera.DestinationType` *(수)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **sourceType**: 그림의 소스를 설정 합니다. 기본값은 카메라입니다. 에 정의 된 `navigator.camera.PictureSourceType` *(수)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **allowEdit**: 선택 하기 전에 이미지의 간단한 편집을 허용 합니다. *(부울)*
-
-* **encodingType**: 반환 된 이미지 파일의 인코딩을 선택 합니다. 기본값은 JPEG입니다. 에 정의 된 `navigator.camera.EncodingType` *(수)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: 스케일 이미지를 픽셀 너비. **TargetHeight**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)*
-
-* **targetHeight**: 스케일 이미지를 픽셀 단위로 높이. **TargetWidth**와 함께 사용 해야 합니다. 가로 세로 비율이 일정 하 게 유지 합니다. *(수)*
-
-* **mediaType**:에서 선택 미디어 유형을 설정 합니다. 때에 작동 `PictureSourceType` 는 `PHOTOLIBRARY` 또는 `SAVEDPHOTOALBUM` . 에 정의 된 `nagivator.camera.MediaType` *(수)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. 기본입니다. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: 캡처 도중 장치의 방향에 대 한 해결 하기 위해 이미지를 회전 합니다. *(부울)*
-
-* **saveToPhotoAlbum**: 캡처 후 장치에서 사진 앨범에 이미지를 저장 합니다. *(부울)*
-
-* **popoverOptions**: iPad에 popover 위치를 지정 하는 iOS 전용 옵션. 에 정의 된`CameraPopoverOptions`.
-
-* **cameraDirection**: (앞 이나 뒤로-연결)를 사용 하 여 카메라를 선택 하십시오. 기본값은 다시. 에 정의 된 `navigator.camera.Direction` *(수)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### 아마존 화재 OS 단점
-
-* 어떤 `cameraDirection` 다시 연결 사진에 결과 값.
-
-* 무시는 `allowEdit` 매개 변수.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다.
-
-### 안 드 로이드 단점
-
-* 어떤 `cameraDirection` 다시 연결 사진에 결과 값.
-
-* 무시는 `allowEdit` 매개 변수.
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`그리고 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 둘 다 동일한 사진 앨범을 표시 합니다.
-
-### 블랙베리 10 단점
-
-* 무시는 `quality` 매개 변수.
-
-* 무시는 `allowEdit` 매개 변수.
-
-* `Camera.MediaType`지원 되지 않습니다.
-
-* 무시는 `correctOrientation` 매개 변수.
-
-* 무시는 `cameraDirection` 매개 변수.
-
-### 파이어 폭스 OS 단점
-
-* 무시는 `quality` 매개 변수.
-
-* `Camera.DestinationType`무시 되 고 `1` (이미지 파일 URI)
-
-* 무시는 `allowEdit` 매개 변수.
-
-* 무시는 `PictureSourceType` 매개 변수 (사용자가 선택 그것 대화 창에서)
-
-* 무시 하는`encodingType`
-
-* 무시는 `targetWidth` 와`targetHeight`
-
-* `Camera.MediaType`지원 되지 않습니다.
-
-* 무시는 `correctOrientation` 매개 변수.
-
-* 무시는 `cameraDirection` 매개 변수.
-
-### iOS 단점
-
-* 설정 `quality` 일부 장치 메모리 오류를 피하기 위해 50 아래.
-
-* 사용 하는 경우 `destinationType.FILE_URI` , 사진 응용 프로그램의 임시 디렉터리에 저장 됩니다. 응용 프로그램이 종료 될 때 응용 프로그램의 임시 디렉터리의 내용은 삭제 됩니다.
-
-### Tizen 특수
-
-* 지원 되지 않는 옵션
-
-* 항상 파일 URI를 반환 합니다.
-
-### Windows Phone 7, 8 특수
-
-* 무시는 `allowEdit` 매개 변수.
-
-* 무시는 `correctOrientation` 매개 변수.
-
-* 무시는 `cameraDirection` 매개 변수.
-
-* 무시는 `saveToPhotoAlbum` 매개 변수. 중요: 모든 이미지 API wp7/8 코르도바 카메라로 촬영 항상 복사 됩니다 휴대 전화의 카메라 롤에. 사용자의 설정에 따라이 또한 그들의 OneDrive에 자동 업로드 이미지는 의미. 이 잠재적으로 이미지는 당신의 애플 리 케이 션을 위한 보다 넓은 청중에 게 사용할 수 있는 의미. 이 경우 응용 프로그램에 대 한 차단, 당신은 msdn에 설명 대로 단말기를 구현 해야 합니다: 수 있습니다 또한 의견 또는 [이슈 트래커][3] 에서 업-투표 관련된 문제
-
-* 무시는 `mediaType` 속성을 `cameraOptions` 으로 Windows Phone SDK PHOTOLIBRARY에서 비디오를 선택 하는 방법을 제공 하지 않습니다.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-오류 메시지를 제공 하는 onError 콜백 함수.
-
- function(message) {
- // Show a helpful message
- }
-
-
-### 매개 변수
-
-* **메시지**: 메시지는 장치의 네이티브 코드에 의해 제공 됩니다. *(문자열)*
-
-## cameraSuccess
-
-이미지 데이터를 제공 하는 onSuccess 콜백 함수.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### 매개 변수
-
-* **imageData**: Base64 인코딩은 이미지 데이터, *또는* 이미지 파일에 따라 URI의 `cameraOptions` 적용. *(문자열)*
-
-### 예를 들어
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-`navigator.camera.getPicture`에 의해 만들어진 popover 대화에 대 한 핸들.
-
-### 메서드
-
-* **setPosition**:는 popover의 위치를 설정 합니다.
-
-### 지원 되는 플랫폼
-
-* iOS
-
-### setPosition
-
-popover의 위치를 설정 합니다.
-
-**매개 변수**:
-
-* `cameraPopoverOptions`:는 `CameraPopoverOptions` 새 위치를 지정 하는
-
-### 예를 들어
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS 전용 매개 변수 iPad의 보관 함 또는 앨범에서 이미지를 선택 하면 앵커 요소 위치와 화살표의 방향으로 popover 지정 하는.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-### CameraPopoverOptions
-
-* **x**: x는 popover 앵커는 화면 요소의 픽셀 좌표. *(수)*
-
-* **y**: y 픽셀 좌표는 popover 앵커는 화면 요소입니다. *(수)*
-
-* **폭**: 폭 (픽셀)는 popover 앵커는 화면 요소. *(수)*
-
-* **높이**: 높이 (픽셀)는 popover 앵커는 화면 요소. *(수)*
-
-* **arrowDir**: 방향 화살표는 popover 가리켜야 합니다. 에 정의 된 `Camera.PopoverArrowDirection` *(수)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-참고는 popover의 크기 조정 화살표 방향 및 화면 방향 변경 될 수 있습니다. 앵커 요소 위치를 지정 하는 경우 방향 변경에 대 한 계정에 있는지 확인 합니다.
-
-## navigator.camera.cleanup
-
-제거 임시 저장소에서 카메라로 찍은 사진을 중간.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### 설명
-
-`camera.getPicture`를 호출한 후 임시 저장소에 보관 됩니다 중간 이미지 파일을 제거 합니다. `Camera.sourceType` 값은 `Camera.PictureSourceType.CAMERA` 및 `Camera.destinationType`와 `Camera.DestinationType.FILE_URI` 때만 적용 됩니다..
-
-### 지원 되는 플랫폼
-
-* iOS
-
-### 예를 들어
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/doc/pl/README.md b/plugins/cordova-plugin-camera/doc/pl/README.md
deleted file mode 100644
index e7b9d44..0000000
--- a/plugins/cordova-plugin-camera/doc/pl/README.md
+++ /dev/null
@@ -1,421 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-Ten plugin definiuje obiekt globalny `navigator.camera`, który dostarcza API do robienia zdjęć i wybór zdjęć z biblioteki obrazów systemu.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * Aparat
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * navigator.camera.cleanup
-
-## navigator.camera.getPicture
-
-Ma zdjęcia za pomocą aparatu, lub pobiera zdjęcia z urządzenia Galeria zdjęć. Obraz jest przekazywany do wywołania zwrotnego sukces jako kodowane algorytmem base64 `ciąg`, lub identyfikator URI dla pliku obrazu. Sama metoda zwraca obiekt `CameraPopoverHandle`, który może służyć do zmiany położenia pliku wyboru popover.
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### Opis
-
-Funkcja `camera.getPicture` otwiera urządzenia domyślnej aplikacji aparat fotograficzny ów pozwala użytkownik wobec chwycić zębami kino. To zachowanie występuje domyślnie, gdy `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA`. Gdy użytkownik zaskoczy zdjęcie, ten aparat fotograficzny applicationâ zamyka i aplikacji jest przywracany.
-
-Jeśli `Camera.sourceType` jest równe `Camera.PictureSourceType.PHOTOLIBRARY` lub `Camera.PictureSourceType.SAVEDPHOTOALBUM`, wtedy zostanie wyświetlone okno dialogowe pozwalające użytkownikowi na wybór istniejącego obrazu. Funkcja `camera.getPicture` zwraca obiekt `CameraPopoverHandle`, który obsługuje zmianę położenia okna wyboru obrazu, np. po zmianie orientacji urządzenia.
-
-Zwracana wartość jest wysyłany do funkcji wywołania zwrotnego `cameraSuccess`, w jednym z następujących formatów, w zależności od określonego `cameraOptions`:
-
- * `String` zawierający obraz zakodowany przy pomocy base64.
-
- * `String` reprezentujący lokalizację pliku obrazu w lokalnym magazynie (domyślnie).
-
-Może rób, co chcesz z zakodowany obraz lub identyfikatora URI, na przykład:
-
- * Przedstawić obraz w tagu ``, jak w przykładzie poniżej
-
- * Zapisać lokalnie dane (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
-
- * Wysłać dane na zdalny serwer
-
-**Uwaga**: zdjęcie rozdzielczości na nowsze urządzenia jest bardzo dobry. Zdjęcia wybrane z galerii urządzenia są nie przeskalowanych w dół do niższej jakości, nawet jeśli określono parametr `quality`. Aby uniknąć typowych problemów z pamięci, zestaw `Camera.destinationType` `FILE_URI` zamiast `DATA_URL`.
-
-#### Obsługiwane platformy
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### Przykład
-
-Zrób zdjęcie i pobrać go jako kodowane algorytmem base64 obrazu:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Zrób zdjęcie i pobrać lokalizacji pliku obrazu:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### Preferencje (iOS)
-
- * **CameraUsesGeolocation** (boolean, wartość domyślna to false). Do przechwytywania JPEG, zestaw do true, aby uzyskać danych geolokalizacyjnych w nagłówku EXIF. To spowoduje wniosek o geolokalizacji uprawnienia, jeśli zestaw na wartość true.
-
-
-
-
-#### Amazon ogień OS dziwactwa
-
-Amazon ogień OS używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności cordova.
-
-#### Dziwactwa Androida
-
-Android używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności Cordova.
-
-#### Quirks przeglądarki
-
-Może zwracać tylko zdjęcia jako obraz w formacie algorytmem base64.
-
-#### Firefox OS dziwactwa
-
-Aparat plugin jest obecnie implementowane za pomocą [Działania sieci Web](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
-
-#### Dziwactwa iOS
-
-W jednej z funkcji wywołania zwrotnego w tym JavaScript `alert()` może powodować problemy. Owinąć w `setTimeout()` umożliwia wybór obrazu iOS lub popover całkowicie zamknąć zanim wyświetli alert alert:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Dziwactwa Windows Phone 7
-
-Wywoływanie aparat native aplikacji, podczas gdy urządzenie jest podłączone przez Zune nie działa i powoduje błąd wywołania zwrotnego.
-
-#### Dziwactwa Tizen
-
-Tizen obsługuje tylko `destinationType` z `Camera.DestinationType.FILE_URI` i `sourceType` z `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-## CameraOptions
-
-Opcjonalne parametry, aby dostosować ustawienia aparatu.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
- * **quality**: Jakość zapisywanego obrazu, wyrażona w przedziale 0-100, gdzie 100 zazwyczaj jest maksymalną rozdzielczością bez strat w czasie kompresji pliku. Wartością domyślną jest 50. *(Liczba)* (Pamiętaj, że informacja o rozdzielczości aparatu jest niedostępna.)
-
- * **destinationType**: Wybierz format zwracanej wartości. Wartością domyślną jest FILE_URI. Zdefiniowane w `navigator.camera.DestinationType` *(numer)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **sourceType**: Ustaw źródło obrazu. Wartością domyślną jest aparat fotograficzny. Zdefiniowane w `navigator.camera.PictureSourceType` *(numer)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **allowEdit**: Pozwala na prostą edycję obrazu przed zaznaczeniem. *(Boolean)*
-
- * **encodingType**: Wybierz plik obrazu zwracany jest kodowanie. Domyślnie jest JPEG. Zdefiniowane w `navigator.camera.EncodingType` *(numer)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: Szerokość w pikselach skalowanego obrazu. Musi być użyte z **targetHeight**. Współczynnik proporcji pozostaje stały. *(Liczba)*
-
- * **targetHeight**: Wysokość w pikselach skalowanego obrazu. Musi być użyte z **targetWidth**. Współczynnik proporcji pozostaje stały. *(Liczba)*
-
- * **mediaType**: Ustawia typ nośnika, z którego będzie wybrany. Działa tylko wtedy, gdy `PictureSourceType` jest `PHOTOLIBRARY` lub `SAVEDPHOTOALBUM`. Zdefiniowane w `nagivator.camera.MediaType` *(Liczba)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: Obraca obraz aby skorygować orientację urządzenia podczas przechwytywania. *(Boolean)*
-
- * **saveToPhotoAlbum**: Po przechwyceniu zapisuje na urządzeniu obraz w albumie na zdjęcia. *(Boolean)*
-
- * **popoverOptions**: Opcja tylko dla platformy iOS, która określa położenie wyskakującego okna na iPadzie. Zdefiniowane w `CameraPopoverOptions`.
-
- * **cameraDirection**: Wybierz aparat do korzystania (lub z powrotem przodem). Wartością domyślną jest z powrotem. Zdefiniowane w `navigator.camera.Direction` *(numer)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### Amazon ogień OS dziwactwa
-
- * Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery.
-
- * Parametr `allowEdit` jest ignorowany.
-
- * Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami.
-
-#### Dziwactwa Androida
-
- * Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery.
-
- * Android również używa aktywność upraw dla allowEdit, choć upraw powinien pracować i faktycznie przejść przycięte zdjęcie Wróć do Cordova, ten tylko jeden który działa konsekwentnie jest ten, wiązany z aplikacji Google Plus zdjęcia. Inne rośliny mogą nie działać.
-
- * Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami.
-
-#### Jeżyna 10 dziwactwa
-
- * Parametr `quality` jest ignorowany.
-
- * Parametr `allowEdit` jest ignorowany.
-
- * Nie jest wspierane `Camera.MediaType`.
-
- * Parametr `correctOrientation` jest ignorowany.
-
- * Parametr `cameraDirection` jest ignorowany.
-
-#### Firefox OS dziwactwa
-
- * Parametr `quality` jest ignorowany.
-
- * `Camera.DestinationType`jest ignorowane i jest równa `1` (plik obrazu URI)
-
- * Parametr `allowEdit` jest ignorowany.
-
- * Ignoruje `PictureSourceType` parametr (użytkownik wybiera go w oknie dialogowym)
-
- * Ignoruje`encodingType`
-
- * Ignoruje `targetWidth` i`targetHeight`
-
- * Nie jest wspierane `Camera.MediaType`.
-
- * Parametr `correctOrientation` jest ignorowany.
-
- * Parametr `cameraDirection` jest ignorowany.
-
-#### Dziwactwa iOS
-
- * Ustaw `quality` poniżej 50 aby uniknąć błędów pamięci na niektórych urządzeniach.
-
- * Podczas korzystania z `destinationType.FILE_URI` , zdjęcia są zapisywane w katalogu tymczasowego stosowania. Zawartość katalogu tymczasowego stosowania jest usuwany po zakończeniu aplikacji.
-
-#### Dziwactwa Tizen
-
- * opcje nie są obsługiwane
-
- * zawsze zwraca FILE URI
-
-#### Windows Phone 7 i 8 dziwactwa
-
- * Parametr `allowEdit` jest ignorowany.
-
- * Parametr `correctOrientation` jest ignorowany.
-
- * Parametr `cameraDirection` jest ignorowany.
-
- * Ignoruje `saveToPhotoAlbum` parametr. Ważne: Wszystkie zdjęcia zrobione aparatem wp7/8 cordova API są zawsze kopiowane do telefonu w kamerze. W zależności od ustawień użytkownika może to też oznaczać że obraz jest automatycznie przesłane do ich OneDrive. Potencjalnie może to oznaczać, że obraz jest dostępne dla szerszego grona odbiorców niż Twoja aplikacja przeznaczona. Jeśli ten bloker aplikacji, trzeba będzie wdrożenie CameraCaptureTask, opisane na msdn: można także komentarz lub górę głosowanie powiązanych kwestii w [śledzenia błędów](https://issues.apache.org/jira/browse/CB-2083)
-
- * Ignoruje `mediaType` Właściwość `cameraOptions` jako SDK Windows Phone nie umożliwiają wybór filmów z PHOTOLIBRARY.
-
-## CameraError
-
-funkcja wywołania zwrotnego PrzyBłędzie, która zawiera komunikat o błędzie.
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### Opis
-
- * **message**: Natywny kod komunikatu zapewniany przez urządzenie. *(Ciąg znaków)*
-
-## cameraSuccess
-
-onSuccess funkcji wywołania zwrotnego, który dostarcza dane obrazu.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### Opis
-
- * **imageData**: Dane obrazu kodowane przy pomocy Base64 *lub* URI pliku obrazu, w zależności od użycia `cameraOptions`. *(Ciąg znaków)*
-
-#### Przykład
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Uchwyt do okna dialogowego popover, stworzony przez `navigator.camera.getPicture`.
-
-#### Opis
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### Obsługiwane platformy
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Przykład
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-tylko do iOS parametrami, które określić kotwicy element lokalizacji i strzałka kierunku popover, przy wyborze zdjęć z iPad biblioteki lub album.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### Opis
-
- * **x**: współrzędna piksela x elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
- * **y**: współrzędna piksela y elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
- * **width**: szerokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
- * **height**: wysokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
- * **arrowDir**: Kierunek, który powinna wskazywać strzałka na wyskakującym oknie. Zdefiniowane w `Camera.PopoverArrowDirection` *(Liczba)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Należy pamiętać, że rozmiar popover może zmienić aby zmienić kierunek strzałki i orientacji ekranu. Upewnij się uwzględnić zmiany orientacji podczas określania położenia elementu kotwicy.
-
-## navigator.camera.cleanup
-
-Usuwa pośrednie zdjęcia zrobione przez aparat z czasowego składowania.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-#### Opis
-
-Usuwa pliki obrazów pośrednich, które są przechowywane w pamięci tymczasowej po wywołaniu `camera.getPicture`. Ma zastosowanie tylko, gdy wartość `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA` i `Camera.destinationType` jest równa `Camera.DestinationType.FILE_URI`.
-
-#### Obsługiwane platformy
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### Przykład
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/pl/index.md b/plugins/cordova-plugin-camera/doc/pl/index.md
deleted file mode 100644
index f226698..0000000
--- a/plugins/cordova-plugin-camera/doc/pl/index.md
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-# cordova-plugin-camera
-
-Ten plugin definiuje obiekt globalny `navigator.camera`, który dostarcza API do robienia zdjęć i wybór zdjęć z biblioteki obrazów systemu.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-Ma zdjęcia za pomocą aparatu, lub pobiera zdjęcia z urządzenia Galeria zdjęć. Obraz jest przekazywany do wywołania zwrotnego sukces jako kodowane algorytmem base64 `ciąg`, lub identyfikator URI dla pliku obrazu. Sama metoda zwraca obiekt `CameraPopoverHandle`, który może służyć do zmiany położenia pliku wyboru popover.
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### Opis
-
-Funkcja `camera.getPicture` otwiera urządzenia domyślnej aplikacji aparat fotograficzny ów pozwala użytkownik wobec chwycić zębami kino. To zachowanie występuje domyślnie, gdy `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA`. Gdy użytkownik zaskoczy zdjęcie, ten aparat fotograficzny applicationâ zamyka i aplikacji jest przywracany.
-
-Jeśli `Camera.sourceType` jest równe `Camera.PictureSourceType.PHOTOLIBRARY` lub `Camera.PictureSourceType.SAVEDPHOTOALBUM`, wtedy zostanie wyświetlone okno dialogowe pozwalające użytkownikowi na wybór istniejącego obrazu. Funkcja `camera.getPicture` zwraca obiekt `CameraPopoverHandle`, który obsługuje zmianę położenia okna wyboru obrazu, np. po zmianie orientacji urządzenia.
-
-Zwracana wartość jest wysyłany do funkcji wywołania zwrotnego `cameraSuccess`, w jednym z następujących formatów, w zależności od określonego `cameraOptions`:
-
-* `String` zawierający obraz zakodowany przy pomocy base64.
-
-* `String` reprezentujący lokalizację pliku obrazu w lokalnym magazynie (domyślnie).
-
-Może rób, co chcesz z zakodowany obraz lub identyfikatora URI, na przykład:
-
-* Przedstawić obraz w tagu ``, jak w przykładzie poniżej
-
-* Zapisać lokalnie dane (`LocalStorage`, [Lawnchair][1], etc.)
-
-* Wysłać dane na zdalny serwer
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**Uwaga**: zdjęcie rozdzielczości na nowsze urządzenia jest bardzo dobry. Zdjęcia wybrane z galerii urządzenia są nie przeskalowanych w dół do niższej jakości, nawet jeśli określono parametr `quality`. Aby uniknąć typowych problemów z pamięci, zestaw `Camera.destinationType` `FILE_URI` zamiast `DATA_URL`.
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Przeglądarka
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 i 8
-* Windows 8
-
-### Preferencje (iOS)
-
-* **CameraUsesGeolocation** (boolean, wartość domyślna to false). Do przechwytywania JPEG, zestaw do true, aby uzyskać danych geolokalizacyjnych w nagłówku EXIF. To spowoduje wniosek o geolokalizacji uprawnienia, jeśli zestaw na wartość true.
-
-
-
-
-### Amazon ogień OS dziwactwa
-
-Amazon ogień OS używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności cordova.
-
-### Dziwactwa Androida
-
-Android używa intencje do rozpoczęcia działalności aparatu na urządzenie do przechwytywania obrazów, i na telefony z pamięci, Cordova aktywność może zostać zabity. W tym scenariuszu obraz mogą nie być wyświetlane po przywróceniu aktywności Cordova.
-
-### Quirks przeglądarki
-
-Może zwracać tylko zdjęcia jako obraz w formacie algorytmem base64.
-
-### Firefox OS dziwactwa
-
-Aparat plugin jest obecnie implementowane za pomocą [Działania sieci Web][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### Dziwactwa iOS
-
-W jednej z funkcji wywołania zwrotnego w tym JavaScript `alert()` może powodować problemy. Owinąć w `setTimeout()` umożliwia wybór obrazu iOS lub popover całkowicie zamknąć zanim wyświetli alert alert:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-### Dziwactwa Windows Phone 7
-
-Wywoływanie aparat native aplikacji, podczas gdy urządzenie jest podłączone przez Zune nie działa i powoduje błąd wywołania zwrotnego.
-
-### Dziwactwa Tizen
-
-Tizen obsługuje tylko `destinationType` z `Camera.DestinationType.FILE_URI` i `sourceType` z `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-### Przykład
-
-Zrób zdjęcie i pobrać go jako kodowane algorytmem base64 obrazu:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Zrób zdjęcie i pobrać lokalizacji pliku obrazu:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-Opcjonalne parametry, aby dostosować ustawienia aparatu.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### Opcje
-
-* **quality**: Jakość zapisywanego obrazu, wyrażona w przedziale 0-100, gdzie 100 zazwyczaj jest maksymalną rozdzielczością bez strat w czasie kompresji pliku. Wartością domyślną jest 50. *(Liczba)* (Pamiętaj, że informacja o rozdzielczości aparatu jest niedostępna.)
-
-* **destinationType**: Wybierz format zwracanej wartości. Wartością domyślną jest FILE_URI. Zdefiniowane w `navigator.camera.DestinationType` *(numer)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **sourceType**: Ustaw źródło obrazu. Wartością domyślną jest aparat fotograficzny. Zdefiniowane w `navigator.camera.PictureSourceType` *(numer)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **allowEdit**: Pozwala na prostą edycję obrazu przed zaznaczeniem. *(Boolean)*
-
-* **encodingType**: Wybierz plik obrazu zwracany jest kodowanie. Domyślnie jest JPEG. Zdefiniowane w `navigator.camera.EncodingType` *(numer)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: Szerokość w pikselach skalowanego obrazu. Musi być użyte z **targetHeight**. Współczynnik proporcji pozostaje stały. *(Liczba)*
-
-* **targetHeight**: Wysokość w pikselach skalowanego obrazu. Musi być użyte z **targetWidth**. Współczynnik proporcji pozostaje stały. *(Liczba)*
-
-* **mediaType**: Ustawia typ nośnika, z którego będzie wybrany. Działa tylko wtedy, gdy `PictureSourceType` jest `PHOTOLIBRARY` lub `SAVEDPHOTOALBUM`. Zdefiniowane w `nagivator.camera.MediaType` *(Liczba)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: Obraca obraz aby skorygować orientację urządzenia podczas przechwytywania. *(Boolean)*
-
-* **saveToPhotoAlbum**: Po przechwyceniu zapisuje na urządzeniu obraz w albumie na zdjęcia. *(Boolean)*
-
-* **popoverOptions**: Opcja tylko dla platformy iOS, która określa położenie wyskakującego okna na iPadzie. Zdefiniowane w `CameraPopoverOptions`.
-
-* **cameraDirection**: Wybierz aparat do korzystania (lub z powrotem przodem). Wartością domyślną jest z powrotem. Zdefiniowane w `navigator.camera.Direction` *(numer)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### Amazon ogień OS dziwactwa
-
-* Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery.
-
-* Parametr `allowEdit` jest ignorowany.
-
-* Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami.
-
-### Dziwactwa Androida
-
-* Jakakolwiek wartość w `cameraDirection` skutkuje użyciem tylnej kamery.
-
-* Parametr `allowEdit` jest ignorowany.
-
-* Oba parametry `Camera.PictureSourceType.PHOTOLIBRARY` oraz `Camera.PictureSourceType.SAVEDPHOTOALBUM` wyświetlają ten sam album ze zdjęciami.
-
-### Jeżyna 10 dziwactwa
-
-* Parametr `quality` jest ignorowany.
-
-* Parametr `allowEdit` jest ignorowany.
-
-* Nie jest wspierane `Camera.MediaType`.
-
-* Parametr `correctOrientation` jest ignorowany.
-
-* Parametr `cameraDirection` jest ignorowany.
-
-### Firefox OS dziwactwa
-
-* Parametr `quality` jest ignorowany.
-
-* `Camera.DestinationType`jest ignorowane i jest równa `1` (plik obrazu URI)
-
-* Parametr `allowEdit` jest ignorowany.
-
-* Ignoruje `PictureSourceType` parametr (użytkownik wybiera go w oknie dialogowym)
-
-* Ignoruje`encodingType`
-
-* Ignoruje `targetWidth` i`targetHeight`
-
-* Nie jest wspierane `Camera.MediaType`.
-
-* Parametr `correctOrientation` jest ignorowany.
-
-* Parametr `cameraDirection` jest ignorowany.
-
-### Dziwactwa iOS
-
-* Ustaw `quality` poniżej 50 aby uniknąć błędów pamięci na niektórych urządzeniach.
-
-* Podczas korzystania z `destinationType.FILE_URI` , zdjęcia są zapisywane w katalogu tymczasowego stosowania. Zawartość katalogu tymczasowego stosowania jest usuwany po zakończeniu aplikacji.
-
-### Dziwactwa Tizen
-
-* opcje nie są obsługiwane
-
-* zawsze zwraca FILE URI
-
-### Windows Phone 7 i 8 dziwactwa
-
-* Parametr `allowEdit` jest ignorowany.
-
-* Parametr `correctOrientation` jest ignorowany.
-
-* Parametr `cameraDirection` jest ignorowany.
-
-* Ignoruje `saveToPhotoAlbum` parametr. Ważne: Wszystkie zdjęcia zrobione aparatem wp7/8 cordova API są zawsze kopiowane do telefonu w kamerze. W zależności od ustawień użytkownika może to też oznaczać że obraz jest automatycznie przesłane do ich OneDrive. Potencjalnie może to oznaczać, że obraz jest dostępne dla szerszego grona odbiorców niż Twoja aplikacja przeznaczona. Jeśli ten bloker aplikacji, trzeba będzie wdrożenie CameraCaptureTask, opisane na msdn: można także komentarz lub górę głosowanie powiązanych kwestii w [śledzenia błędów][3]
-
-* Ignoruje `mediaType` Właściwość `cameraOptions` jako SDK Windows Phone nie umożliwiają wybór filmów z PHOTOLIBRARY.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-funkcja wywołania zwrotnego PrzyBłędzie, która zawiera komunikat o błędzie.
-
- function(message) {
- // Show a helpful message
- }
-
-
-### Parametry
-
-* **message**: Natywny kod komunikatu zapewniany przez urządzenie. *(Ciąg znaków)*
-
-## cameraSuccess
-
-onSuccess funkcji wywołania zwrotnego, który dostarcza dane obrazu.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### Parametry
-
-* **imageData**: Dane obrazu kodowane przy pomocy Base64 *lub* URI pliku obrazu, w zależności od użycia `cameraOptions`. *(Ciąg znaków)*
-
-### Przykład
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Uchwyt do okna dialogowego popover, stworzony przez `navigator.camera.getPicture`.
-
-### Metody
-
-* **setPosition**: Ustawia pozycję wyskakującego okna.
-
-### Obsługiwane platformy
-
-* iOS
-
-### setPosition
-
-Ustaw pozycję popover.
-
-**Parametry**:
-
-* `cameraPopoverOptions`: `CameraPopoverOptions`, która określa nową pozycję
-
-### Przykład
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-tylko do iOS parametrami, które określić kotwicy element lokalizacji i strzałka kierunku popover, przy wyborze zdjęć z iPad biblioteki lub album.
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-### CameraPopoverOptions
-
-* **x**: współrzędna piksela x elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
-* **y**: współrzędna piksela y elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
-* **width**: szerokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
-* **height**: wysokość w pikselach elementu ekranu, na którym zakotwiczone jest wyskakujące okno. *(Liczba)*
-
-* **arrowDir**: Kierunek, który powinna wskazywać strzałka na wyskakującym oknie. Zdefiniowane w `Camera.PopoverArrowDirection` *(Liczba)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Należy pamiętać, że rozmiar popover może zmienić aby zmienić kierunek strzałki i orientacji ekranu. Upewnij się uwzględnić zmiany orientacji podczas określania położenia elementu kotwicy.
-
-## navigator.camera.cleanup
-
-Usuwa pośrednie zdjęcia zrobione przez aparat z czasowego składowania.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### Opis
-
-Usuwa pliki obrazów pośrednich, które są przechowywane w pamięci tymczasowej po wywołaniu `camera.getPicture`. Ma zastosowanie tylko, gdy wartość `Camera.sourceType` jest równa `Camera.PictureSourceType.CAMERA` i `Camera.destinationType` jest równa `Camera.DestinationType.FILE_URI`.
-
-### Obsługiwane platformy
-
-* iOS
-
-### Przykład
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/doc/ru/index.md b/plugins/cordova-plugin-camera/doc/ru/index.md
deleted file mode 100644
index f93609c..0000000
--- a/plugins/cordova-plugin-camera/doc/ru/index.md
+++ /dev/null
@@ -1,417 +0,0 @@
-
-
-# cordova-plugin-camera
-
-Этот плагин предоставляет API для съемки и для выбора изображения из библиотеки изображений системы.
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-Снимает фотографию с помощью камеры, или получает фотографию из галереи изображений устройства. Изображение передается на функцию обратного вызова успешного завершения как `String` в base64-кодировке, или как URI указывающего на файл изображения. Метод возвращает объект `CameraPopoverHandle`, который может использоваться для перемещения инструмента выбора файла.
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### Описание
-
-Функция `camera.getPicture` открывает приложение камеры устройства, которое позволяет снимать фотографии. Это происходит по умолчанию, когда `Camera.sourceType` равно `Camera.PictureSourceType.CAMERA` . Как только пользователь делает снимок,приложение камеры закрывается и приложение восстанавливается.
-
-Если `Camera.sourceType` является `Camera.PictureSourceType.PHOTOLIBRARY` или `Camera.PictureSourceType.SAVEDPHOTOALBUM` , то показывается диалоговое окно, которое позволяет пользователям выбрать существующее изображение. Функция `camera.getPicture` возвращает объект `CameraPopoverHandle` объект, который может использоваться для перемещения диалога выбора изображения, например, при изменении ориентации устройства.
-
-Возвращаемое значение отправляется в функцию обратного вызова `cameraSuccess` в одном из следующих форматов, в зависимости от параметра `cameraOptions` :
-
-* A объект `String` содержащий фото изображение в base64-кодировке.
-
-* Объект `String` представляющий расположение файла изображения на локальном хранилище (по умолчанию).
-
-Вы можете сделать все, что угодно вы хотите с закодированным изображением или URI, например:
-
-* Отобразить изображение с помощью тега ``, как показано в примере ниже
-
-* Сохранять данные локально (`LocalStorage`, [Lawnchair][1], и т.д.)
-
-* Отправлять данные на удаленный сервер
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**Примечание**: разрешение фото на более новых устройствах является достаточно хорошим. Фотографии из галереи устройства не масштабируются к более низкому качеству, даже если указан параметр `quality`. Чтобы избежать общих проблем с памятью, установите `Camera.destinationType` в `FILE_URI` вместо `DATA_URL`.
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Обозреватель
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 и 8
-* Windows 8
-
-### Предпочтения (iOS)
-
-* **CameraUsesGeolocation** (логическое значение, по умолчанию false). Для захвата изображения JPEG, значение true, чтобы получить данные геопозиционирования в заголовке EXIF. Это вызовет запрос на разрешения геолокации, если задано значение true.
-
-
-
-
-### Особенности Amazon Fire OS
-
-Amazon Fire OS используют намерения для запуска активности камеры на устройстве для съемки фотографий, и на устройствах с низким объемам памяти, активность Cordova может быть завершена. В этом случае изображение может не появиться при восстановлении активности Cordova.
-
-### Особенности Android
-
-Android используют намерения для запуска активности камеры на устройстве для съемки фотографий, и на устройствах с низким объемам памяти, активность Cordova может быть завершена. В этом случае изображение может не появиться при восстановлении активности Cordova.
-
-### Браузер причуды
-
-Может возвращать только фотографии как изображения в кодировке base64.
-
-### Особенности Firefox OS
-
-Плагин Camera на данный момент реализован с использованием [Web Activities][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### Особенности iOS
-
-Включение функции JavaScript `alert()` в любой из функций обратного вызова функции может вызвать проблемы. Оберните вызов alert в `setTimeout()` для позволения окну выбора изображений iOS полностью закрыться перед отображение оповещения:
-
- setTimeout(function() {/ / ваши вещи!}, 0);
-
-
-### Особенности Windows Phone 7
-
-Вызов встроенного приложения камеры, в то время как устройство подключено к Zune не работает, и инициирует обратный вызов для ошибки.
-
-### Особенности Tizen
-
-Tizen поддерживает только значение `destinationType` равное `Camera.DestinationType.FILE_URI` и значение `sourceType` равное `Camera.PictureSourceType.PHOTOLIBRARY`.
-
-### Пример
-
-Сделайте фотографию и получите его как изображение в base64-кодировке:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-Сделайте фотографию и получить расположение файла с изображением:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-Необязательные параметры для настройки параметров камеры.
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### Параметры
-
-* **quality**: качество сохраняемого изображения, выражается в виде числа в диапазоне от 0 до 100, где 100 является обычно полным изображением без потери качества при сжатии. Значение по умолчанию — 50. *(Число)* (Обратите внимание, что информация о разрешении камеры недоступна.)
-
-* **параметр destinationType**: выберите формат возвращаемого значения. Значение по умолчанию — FILE_URI. Определяется в `navigator.camera.DestinationType` *(число)*
-
- Camera.DestinationType = {
- DATA_URL: 0, / / возвращение изображения в base64-кодировке строки
- FILE_URI: 1, / / возврат файла изображения URI
- NATIVE_URI: 2 / / возвращение образа собственного URI (например, Библиотека активов: / / на iOS или содержание: / / на андроиде)
- };
-
-
-* **тип источника**: установить источник рисунка. По умолчанию используется камера. Определяется в `navigator.camera.PictureSourceType` *(число)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY: 0,
- CAMERA: 1,
- SAVEDPHOTOALBUM: 2
- };
-
-
-* **allowEdit**: позволит редактирование изображения средствами телефона перед окончательным выбором изображения. *(Логический)*
-
-* **Тип_шифрования**: выберите возвращенный файл в кодировку. Значение по умолчанию — JPEG. Определяется в `navigator.camera.EncodingType` *(число)*
-
- Camera.EncodingType = {
- JPEG: 0, // возвращает изображение в формате JPEG
- PNG: 1 // возвращает рисунок в формате PNG
- };
-
-
-* **targetWidth**: ширина изображения в пикселах к которой необходимо осуществить масштабирование. Это значение должно использоваться совместно с **targetHeight**. Пропорции изображения останутся неизменными. *(Число)*
-
-* **targetHeight**: высота изображения в пикселах к которой необходимо осуществить масштабирование. Это значение должно использоваться совместно с **targetWidth**. Пропорции изображения останутся неизменными. *(Число)*
-
-* **тип носителя**: Установите источник получения изображения, из которого надо выбрать изображение. Работает только если `PictureSourceType` равно `PHOTOLIBRARY` или `SAVEDPHOTOALBUM` . Определяется в `nagivator.camera.MediaType` *(число)*
-
- Camera.MediaType = {
- PICTURE: 0, / / разрешить выбор только сохраненных изображений. DEFAULT. Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: вращает изображение, чтобы внести исправления к ориентации устройства во время захвата. *(Логический)*
-
-* **saveToPhotoAlbum**: сохранить изображение в фотоальбом на устройстве после захвата. *(Логическое)*
-
-* **popoverOptions**: только для iOS параметры, которые определяют местоположение инструмента в iPad. Определены в`CameraPopoverOptions`.
-
-* **cameraDirection**: выбрать камеру для использования (передней или задней стороне). Значение по умолчанию — обратно. Определяется в `navigator.camera.Direction` *(число)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### Особенности Amazon Fire OS
-
-* Любое значение `cameraDirection` возвращает фотографию сделанную задней камерой.
-
-* Игнорирует параметр `allowEdit`.
-
-* Оба параметра `Camera.PictureSourceType.PHOTOLIBRARY` и `Camera.PictureSourceType.SAVEDPHOTOALBUM` отображают один и тот же фотоальбом.
-
-### Особенности Android
-
-* Любое значение `cameraDirection` возвращает фотографию сделанную задней камерой.
-
-* Игнорирует параметр `allowEdit`.
-
-* Оба параметра `Camera.PictureSourceType.PHOTOLIBRARY` и `Camera.PictureSourceType.SAVEDPHOTOALBUM` отображают один и тот же фотоальбом.
-
-### Особенности BlackBerry 10
-
-* Игнорирует `quality` параметр.
-
-* Игнорирует параметр `allowEdit`.
-
-* `Camera.MediaType` не поддерживается.
-
-* Игнорирует параметр `correctOrientation`.
-
-* Игнорирует параметр `cameraDirection`.
-
-### Особенности Firefox OS
-
-* Игнорирует `quality` параметр.
-
-* Значение `Camera.DestinationType` игнорируется и равно `1` (URI для файла изображения)
-
-* Игнорирует параметр `allowEdit`.
-
-* Игнорирует параметр `PictureSourceType` (пользователь выбирает его в диалоговом окне)
-
-* Игнорирует параметр `encodingType`
-
-* Игнорирует `targetWidth` и `targetHeight`
-
-* `Camera.MediaType` не поддерживается.
-
-* Игнорирует параметр `correctOrientation`.
-
-* Игнорирует параметр `cameraDirection`.
-
-### Особенности iOS
-
-* Установите `quality` ниже 50, для того чтобы избежать ошибок памяти на некоторых устройствах.
-
-* При использовании `destinationType.FILE_URI` , фотографии сохраняются во временном каталоге приложения. Содержимое приложения временного каталога удаляется при завершении приложения.
-
-### Особенности Tizen
-
-* options, не поддерживается
-
-* всегда возвращает URI файла
-
-### Особенности Windows Phone 7 и 8
-
-* Игнорирует параметр `allowEdit`.
-
-* Игнорирует параметр `correctOrientation`.
-
-* Игнорирует параметр `cameraDirection`.
-
-* Игнорирует `saveToPhotoAlbum` параметр. Важно: Все изображения, снятые камерой wp7/8 cordova API всегда копируются в рулон камеры телефона. В зависимости от параметров пользователя это также может означать, что изображение автоматически загружены на их OneDrive. Потенциально это может означать, что этот образ доступен для более широкой аудитории, чем ваше приложение предназначено. Если этот блокатор для вашего приложения, вам нужно будет осуществить CameraCaptureTask, как описано на сайте msdn: вы можете также комментарий или вверх голосование связанный с этим вопрос [отслеживания][3]
-
-* Игнорирует свойство `mediaType` объекта `cameraOptions` так как Windows Phone SDK не предоставляет способ выбрать видео из PHOTOLIBRARY.
-
- [3]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-Функция обратного вызова вызываемая в случае возникновения ошибки.
-
- function(message) {
- // Show a helpful message
- }
-
-
-### Параметры
-
-* **сообщение**: сообщение об ошибке предоставляемое платформой устройства. *(Строка)*
-
-## cameraSuccess
-
-Функция обратного вызова onSuccess, получающая данные изображения.
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### Параметры
-
-* **imageData**: Данные изображения в Base64 кодировке, *или* URI, в зависимости от применяемых параметров `cameraOptions`. *(Строка)*
-
-### Пример
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-Дескриптор диалогового окна инструмента, созданный `navigator.camera.getPicture`.
-
-### Методы
-
-* **setPosition**: Задайте положение инструмента выбора изображения.
-
-### Поддерживаемые платформы
-
-* iOS
-
-### setPosition
-
-Устанавливает положение инструмента выбора изображения.
-
-**Параметры**:
-
-* `cameraPopoverOptions`: Объект `CameraPopoverOptions`, определяющий новое положение
-
-### Пример
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-Параметры только для iOS, которые определяют расположение элемента привязки и направление стрелки инструмента при выборе изображений из библиотеки изображений iPad или альбома.
-
- {x: 0, y: 32, ширина: 320, высота: 480, arrowDir: Camera.PopoverArrowDirection.ARROW_ANY};
-
-
-### CameraPopoverOptions
-
-* **x**: x координата в пикселях элемента экрана, на котором закрепить инструмента. *(Число)*
-
-* **x**: y координата в пикселях элемента экрана, на котором закрепить инструмента. *(Число)*
-
-* **width**: ширина в пикселях элемента экрана, на котором закрепить инструмент выбора изображения. *(Число)*
-
-* **height**: высота в пикселях элемента экрана, на котором закрепить инструмент выбора изображения. *(Число)*
-
-* **arrowDir**: Направление, куда должна указывать стрелка на инструменте. Определено в `Camera.PopoverArrowDirection` *(число)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-Обратите внимание, что размер инструмента может изменяться для корректировки в зависимости направлении стрелки и ориентации экрана. Убедитесь, что учитываете возможные изменения ориентации при указании расположения элемента привязки.
-
-## navigator.camera.cleanup
-
-Удаляет промежуточные фотографии, сделанные камерой из временного хранилища.
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### Описание
-
-Удаляет промежуточные файлы изображений, которые хранятся во временном хранилище после вызова метода `camera.getPicture` . Применяется только тогда, когда значение `Camera.sourceType` равно `Camera.PictureSourceType.CAMERA` и `Camera.destinationType` равняется `Camera.DestinationType.FILE_URI`.
-
-### Поддерживаемые платформы
-
-* iOS
-
-### Пример
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/doc/zh/README.md b/plugins/cordova-plugin-camera/doc/zh/README.md
deleted file mode 100644
index 2f7c9e6..0000000
--- a/plugins/cordova-plugin-camera/doc/zh/README.md
+++ /dev/null
@@ -1,421 +0,0 @@
-
-
-# cordova-plugin-camera
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-這個外掛程式定義了一個全球 `navigator.camera` 物件,它提供了 API,拍照,從系統的圖像庫中選擇圖像。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-camera
-
-
-## API
-
- * 相機
- * navigator.camera.getPicture(success, fail, options)
- * CameraOptions
- * CameraPopoverHandle
- * CameraPopoverOptions
- * navigator.camera.cleanup
-
-## navigator.camera.getPicture
-
-需要一張照片,使用相機,或從設備的圖像庫檢索一張照片。 圖像被傳遞給成功回檔的 base64 編碼 `String`,或作為 URI 為影像檔。 該方法本身返回一個 `CameraPopoverHandle` 物件,它可以用來重新置放檔選擇氣泡框。
-
- navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
-
-
-#### 說明
-
-`camera.getPicture` 函數打開該設備的預設攝像頭應用程式,允許使用者拍照。 `Camera.sourceType` 等於 `Camera.PictureSourceType.CAMERA` 時,預設情況下,發生此行為。 一旦使用者打斷了他的照片,相機應用程式關閉,且應用程式還原。
-
-如果 `Camera.sourceType` 是 `Camera.PictureSourceType.PHOTOLIBRARY` 或 `Camera.PictureSourceType.SAVEDPHOTOALBUM`,然後顯示一個對話方塊,允許使用者選擇一個現有的圖像。 `camera.getPicture` 函數返回一個 `CameraPopoverHandle` 物件,它可以用於重新置放圖像選擇的對話方塊,例如,當設備的方向變化。
-
-傳回值是發送到 `cameraSuccess` 回呼函數中,在以下的格式,具體取決於指定的 `cameraOptions` 之一:
-
- * A `String` 包含的 base64 編碼的照片圖像。
-
- * A `String` 表示在本機存放區 (預設值) 上的影像檔位置。
-
-你可以做任何你想要的編碼的圖像或 URI,例如:
-
- * 呈現在圖像 `` 標記,如下面的示例所示
-
- * 保存本地的資料 ( `LocalStorage` , [Lawnchair](http://brianleroux.github.com/lawnchair/),等等.)
-
- * 將資料發佈到遠端伺服器
-
-**注**: 在更新設備上的照片解析度是很好。 選擇從設備的庫的照片是不壓縮螢幕使其以較低的品質,即使指定了一個 `quality` 參數。 要避免常見的記憶體問題,請將 `Camera.destinationType` 設置為 `FILE_URI`,而不是 `DATA_URL`.
-
-#### 支援的平臺
-
-![](doc/img/android-success.png) ![](doc/img/blackberry-success.png) ![](doc/img/browser-success.png) ![](doc/img/firefox-success.png) ![](doc/img/fireos-success.png) ![](doc/img/ios-success.png) ![](doc/img/windows-success.png) ![](doc/img/wp8-success.png) ![](doc/img/ubuntu-success.png)
-
-#### 示例
-
-拍一張照片,並檢索它作為一個 base64 編碼的圖像:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-拍一張照片和檢索圖像的檔位置:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-#### 首選項 (iOS)
-
- * **CameraUsesGeolocation**(布林值,預設值為 false)。 用於捕獲 jpeg 檔,設置為 true,以在 EXIF 頭資訊中獲取地理定位資料。 這將觸發請求的地理位置的許可權,如果設置為 true。
-
-
-
-
-#### 亞馬遜火 OS 怪癖
-
-亞馬遜火 OS 使用意圖啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。
-
-#### Android 的怪癖
-
-Android 使用意圖以啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。
-
-#### 瀏覽器的怪癖
-
-可以只返回照片作為 base64 編碼的圖像。
-
-#### 火狐瀏覽器作業系統的怪癖
-
-觀景窗外掛程式目前實施使用 [Web 活動](https://hacks.mozilla.org/2013/01/introducing-web-activities/).
-
-#### iOS 的怪癖
-
-包括 JavaScript `alert ()` 中的回呼函數會導致問題。 包裝內 `setTimeout()` 允許 iOS 圖像選取器或氣泡框以完全關閉之前,警報將顯示警報:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-#### Windows Phone 7 的怪癖
-
-調用本機攝像頭應用程式,而通過 Zune 所連接的設備不能工作,並且觸發錯誤回檔。
-
-#### Tizen 怪癖
-
-泰只支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `Camera.PictureSourceType.PHOTOLIBRARY` 的 `sourceType`.
-
-## CameraOptions
-
-要自訂相機設置的可選參數。
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
- * **品質**: 保存的圖像,表示為範圍 0-100,100,是通常全解析度,無損失從檔案壓縮的品質。 預設值為 50。 *(人數)*(請注意相機的解析度有關的資訊是不可用)。
-
- * **可**: 選擇傳回值的格式。預設值是 FILE_URI。定義在 `navigator.camera.DestinationType` *(人數)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
- * **時**: 設置圖片的來源。預設值是觀景窗。定義在 `navigator.camera.PictureSourceType` *(人數)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
- * **allowEdit**: 允許簡單編輯前選擇圖像。*(布林)*
-
- * **encodingType**: 選擇返回的影像檔的編碼。預設值為 JPEG。定義在 `navigator.camera.EncodingType` *(人數)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
- * **targetWidth**: 向尺度圖像的圖元寬度。必須用**targetHeight**。縱橫比保持不變。*(人數)*
-
- * **targetHeight**: 以圖元為單位向尺度圖像的高度。必須用**targetWidth**。縱橫比保持不變。*(人數)*
-
- * **媒體類型**: 設置的媒體,從選擇類型。 時才起作用 `PictureSourceType` 是 `PHOTOLIBRARY` 或 `SAVEDPHOTOALBUM` 。 定義在 `nagivator.camera.MediaType` *(人數)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. 預設情況。 Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
- * **correctOrientation**: 旋轉圖像,該設備時捕獲的定向的正確。*(布林)*
-
- * **saveToPhotoAlbum**: 將圖像保存到相冊在設備上捕獲後。*(布林)*
-
- * **popoverOptions**: 只有 iOS 在 iPad 中指定氣泡框位置的選項。在中定義`CameraPopoverOptions`.
-
- * **cameraDirection**: 選擇相機以使用 (前面或後面-面向)。預設值是背。定義在 `navigator.camera.Direction` *(人數)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-#### 亞馬遜火 OS 怪癖
-
- * 任何 `cameraDirection` 值回朝的照片中的結果。
-
- * 忽略 `allowEdit` 參數。
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。
-
-#### Android 的怪癖
-
- * 任何 `cameraDirection` 值回朝的照片中的結果。
-
- * 安卓也用於作物活動 allowEdit,即使作物應工作,實際上將裁剪的圖像傳回給科爾多瓦,那個唯一的作品一直是一個與谷歌加上照片應用程式捆綁在一起。 其他作物可能無法工作。
-
- * `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。
-
-#### 黑莓 10 怪癖
-
- * 忽略 `quality` 參數。
-
- * 忽略 `allowEdit` 參數。
-
- * `Camera.MediaType`不受支援。
-
- * 忽略 `correctOrientation` 參數。
-
- * 忽略 `cameraDirection` 參數。
-
-#### 火狐瀏覽器作業系統的怪癖
-
- * 忽略 `quality` 參數。
-
- * `Camera.DestinationType`將被忽略並且等於 `1` (影像檔的 URI)
-
- * 忽略 `allowEdit` 參數。
-
- * 忽略 `PictureSourceType` 參數 (使用者選擇它在對話方塊視窗中)
-
- * 忽略`encodingType`
-
- * 忽略了 `targetWidth` 和`targetHeight`
-
- * `Camera.MediaType`不受支援。
-
- * 忽略 `correctOrientation` 參數。
-
- * 忽略 `cameraDirection` 參數。
-
-#### iOS 的怪癖
-
- * 設置 `quality` 低於 50,避免在某些設備上的記憶體不足錯誤。
-
- * 當使用 `destinationType.FILE_URI` ,照片都保存在應用程式的臨時目錄。應用程式結束時,將刪除該應用程式的臨時目錄中的內容。
-
-#### Tizen 怪癖
-
- * 不支援的選項
-
- * 總是返回一個檔的 URI
-
-#### Windows Phone 7 和 8 怪癖
-
- * 忽略 `allowEdit` 參數。
-
- * 忽略 `correctOrientation` 參數。
-
- * 忽略 `cameraDirection` 參數。
-
- * 忽略 `saveToPhotoAlbum` 參數。 重要: 使用 wp7/8 科爾多瓦攝像頭 API 拍攝的所有圖像總是都複製到手機的相機膠捲。 根據使用者的設置,這可能也意味著圖像是自動上傳到他們另。 這有可能意味著的圖像,可以比你的應用程式的目的更多的觀眾。 如果此阻滯劑您的應用程式,您將需要實現 CameraCaptureTask 在 msdn 上記載: [HTTP://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx)你可能還評論或在[問題追蹤器](https://issues.apache.org/jira/browse/CB-2083)的向上投票的相關的問題
-
- * 忽略了 `mediaType` 屬性的 `cameraOptions` 作為 Windows Phone SDK 並不提供從 PHOTOLIBRARY 中選擇視頻的方法。
-
-## CameraError
-
-onError 的回呼函數提供了一條錯誤訊息。
-
- function(message) {
- // Show a helpful message
- }
-
-
-#### 說明
-
- * **message**: 消息提供的設備的本機代碼。*(String)*
-
-## cameraSuccess
-
-提供的圖像資料的 onSuccess 回呼函數。
-
- function(imageData) {
- // Do something with the image
- }
-
-
-#### 說明
-
- * **imageData**: Base64 編碼進行編碼的圖像資料,*或*影像檔的 URI,取決於 `cameraOptions` 效果。*(String)*
-
-#### 示例
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-由 `navigator.camera.getPicture` 創建的氣泡框對話方塊的控制碼.
-
-#### 說明
-
- * **setPosition**: Set the position of the popover. Takes the `CameraPopoverOptions` that specify the new position.
-
-#### 支援的平臺
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### 示例
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS 僅指定氣泡框的錨元素的位置和箭頭方向,從 iPad 庫或專輯選擇圖像時的參數。
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-#### 說明
-
- * **x**: x 螢幕元素到其錨定氣泡框上的圖元座標。*(人數)*
-
- * **y**: 螢幕元素到其錨定氣泡框上的 y 圖元座標。*(人數)*
-
- * **width**: 寬度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)*
-
- * **height**: 高度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)*
-
- * **arrowDir**: 氣泡框上的箭頭應指向的方向。定義在 `Camera.PopoverArrowDirection` *(人數)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-請注意氣泡框的大小可能會更改箭頭的方向和螢幕的方向進行調整。 請確保帳戶方向更改時指定錨元素位置。
-
-## navigator.camera.cleanup
-
-刪除中間從臨時存儲攝像機所拍攝的照片。
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-#### 說明
-
-刪除保留在臨時存儲在調用 `camera.getPicture` 後的中間的影像檔。 適用只有當 `Camera.sourceType` 的值等於 `Camera.PictureSourceType.CAMERA` 和 `Camera.destinationType` 等於 `Camera.DestinationType.FILE_URI`.
-
-#### 支援的平臺
-
-![](doc/img/android-fail.png) ![](doc/img/blackberry-fail.png) ![](doc/img/browser-fail.png) ![](doc/img/firefox-fail.png) ![](doc/img/fireos-fail.png) ![](doc/img/ios-success.png) ![](doc/img/windows-fail.png) ![](doc/img/wp8-fail.png) ![](doc/img/ubuntu-fail.png)
-
-#### 示例
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/doc/zh/index.md b/plugins/cordova-plugin-camera/doc/zh/index.md
deleted file mode 100644
index ab719ab..0000000
--- a/plugins/cordova-plugin-camera/doc/zh/index.md
+++ /dev/null
@@ -1,435 +0,0 @@
-
-
-# cordova-plugin-camera
-
-這個外掛程式定義了一個全球 `navigator.camera` 物件,它提供了 API,拍照,從系統的圖像庫中選擇圖像。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.camera);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-camera
-
-
-## navigator.camera.getPicture
-
-需要一張照片,使用相機,或從設備的圖像庫檢索一張照片。 圖像被傳遞給成功回檔的 base64 編碼 `String`,或作為 URI 為影像檔。 該方法本身返回一個 `CameraPopoverHandle` 物件,它可以用來重新置放檔選擇氣泡框。
-
- navigator.camera.getPicture( cameraSuccess, cameraError, cameraOptions );
-
-
-### 說明
-
-`camera.getPicture` 函數打開該設備的預設攝像頭應用程式,允許使用者拍照。 `Camera.sourceType` 等於 `Camera.PictureSourceType.CAMERA` 時,預設情況下,發生此行為。 一旦使用者打斷了他的照片,相機應用程式關閉,且應用程式還原。
-
-如果 `Camera.sourceType` 是 `Camera.PictureSourceType.PHOTOLIBRARY` 或 `Camera.PictureSourceType.SAVEDPHOTOALBUM`,然後顯示一個對話方塊,允許使用者選擇一個現有的圖像。 `camera.getPicture` 函數返回一個 `CameraPopoverHandle` 物件,它可以用於重新置放圖像選擇的對話方塊,例如,當設備的方向變化。
-
-傳回值是發送到 `cameraSuccess` 回呼函數中,在以下的格式,具體取決於指定的 `cameraOptions` 之一:
-
-* A `String` 包含的 base64 編碼的照片圖像。
-
-* A `String` 表示在本機存放區 (預設值) 上的影像檔位置。
-
-你可以做任何你想要的編碼的圖像或 URI,例如:
-
-* 呈現在圖像 `` 標記,如下面的示例所示
-
-* 保存本地的資料 ( `LocalStorage` , [Lawnchair][1],等等.)
-
-* 將資料發佈到遠端伺服器
-
- [1]: http://brianleroux.github.com/lawnchair/
-
-**注**: 在更新設備上的照片解析度是很好。 選擇從設備的庫的照片是不壓縮螢幕使其以較低的品質,即使指定了一個 `quality` 參數。 要避免常見的記憶體問題,請將 `Camera.destinationType` 設置為 `FILE_URI`,而不是 `DATA_URL`.
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* 瀏覽器
-* 火狐瀏覽器的作業系統
-* iOS
-* 泰
-* Windows Phone 7 和 8
-* Windows 8
-
-### 首選項 (iOS)
-
-* **CameraUsesGeolocation**(布林值,預設值為 false)。 用於捕獲 jpeg 檔,設置為 true,以在 EXIF 頭資訊中獲取地理定位資料。 這將觸發請求的地理位置的許可權,如果設置為 true。
-
-
-
-
-### 亞馬遜火 OS 怪癖
-
-亞馬遜火 OS 使用意圖啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。
-
-### Android 的怪癖
-
-Android 使用意圖以啟動相機活動設備來捕捉圖像上, 和手機上記憶體不足,科爾多瓦活動可能被殺害。 在這種情況下,可能不會顯示圖像時恢復了科爾多瓦活動。
-
-### 瀏覽器的怪癖
-
-可以只返回照片作為 base64 編碼的圖像。
-
-### 火狐瀏覽器作業系統的怪癖
-
-觀景窗外掛程式目前實施使用 [Web 活動][2].
-
- [2]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-
-### iOS 的怪癖
-
-包括 JavaScript `alert ()` 中的回呼函數會導致問題。 包裝內 `setTimeout()` 允許 iOS 圖像選取器或氣泡框以完全關閉之前,警報將顯示警報:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-
-### Windows Phone 7 的怪癖
-
-調用本機攝像頭應用程式,而通過 Zune 所連接的設備不能工作,並且觸發錯誤回檔。
-
-### 泰怪癖
-
-泰只支援 `destinationType` 的 `Camera.DestinationType.FILE_URI` 和 `Camera.PictureSourceType.PHOTOLIBRARY` 的 `sourceType`.
-
-### 示例
-
-拍一張照片,並檢索它作為一個 base64 編碼的圖像:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-拍一張照片和檢索圖像的檔位置:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-
-## CameraOptions
-
-要自訂相機設置的可選參數。
-
- { quality : 75,
- destinationType : Camera.DestinationType.DATA_URL,
- sourceType : Camera.PictureSourceType.CAMERA,
- allowEdit : true,
- encodingType: Camera.EncodingType.JPEG,
- targetWidth: 100,
- targetHeight: 100,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false };
-
-
-### 選項
-
-* **品質**: 保存的圖像,表示為範圍 0-100,100,是通常全解析度,無損失從檔案壓縮的品質。 預設值為 50。 *(人數)*(請注意相機的解析度有關的資訊是不可用)。
-
-* **可**: 選擇傳回值的格式。預設值是 FILE_URI。定義在 `navigator.camera.DestinationType` *(人數)*
-
- Camera.DestinationType = {
- DATA_URL : 0, // Return image as base64-encoded string
- FILE_URI : 1, // Return image file URI
- NATIVE_URI : 2 // Return image native URI (e.g., assets-library:// on iOS or content:// on Android)
- };
-
-
-* **時**: 設置圖片的來源。預設值是觀景窗。定義在 `navigator.camera.PictureSourceType` *(人數)*
-
- Camera.PictureSourceType = {
- PHOTOLIBRARY : 0,
- CAMERA : 1,
- SAVEDPHOTOALBUM : 2
- };
-
-
-* **allowEdit**: 允許簡單編輯前選擇圖像。*(布林)*
-
-* **encodingType**: 選擇返回的影像檔的編碼。預設值為 JPEG。定義在 `navigator.camera.EncodingType` *(人數)*
-
- Camera.EncodingType = {
- JPEG : 0, // Return JPEG encoded image
- PNG : 1 // Return PNG encoded image
- };
-
-
-* **targetWidth**: 向尺度圖像的圖元寬度。必須用**targetHeight**。縱橫比保持不變。*(人數)*
-
-* **targetHeight**: 以圖元為單位向尺度圖像的高度。必須用**targetWidth**。縱橫比保持不變。*(人數)*
-
-* **媒體類型**: 設置的媒體,從選擇類型。 時才起作用 `PictureSourceType` 是 `PHOTOLIBRARY` 或 `SAVEDPHOTOALBUM` 。 定義在 `nagivator.camera.MediaType` *(人數)*
-
- Camera.MediaType = {
- PICTURE: 0, // allow selection of still pictures only. 預設情況。 Will return format specified via DestinationType
- VIDEO: 1, // allow selection of video only, WILL ALWAYS RETURN FILE_URI
- ALLMEDIA : 2 // allow selection from all media types
- };
-
-
-* **correctOrientation**: 旋轉圖像,該設備時捕獲的定向的正確。*(布林)*
-
-* **saveToPhotoAlbum**: 將圖像保存到相冊在設備上捕獲後。*(布林)*
-
-* **popoverOptions**: 只有 iOS 在 iPad 中指定氣泡框位置的選項。在中定義`CameraPopoverOptions`.
-
-* **cameraDirection**: 選擇相機以使用 (前面或後面-面向)。預設值是背。定義在 `navigator.camera.Direction` *(人數)*
-
- Camera.Direction = {
- BACK : 0, // Use the back-facing camera
- FRONT : 1 // Use the front-facing camera
- };
-
-
-### 亞馬遜火 OS 怪癖
-
-* 任何 `cameraDirection` 值回朝的照片中的結果。
-
-* 忽略 `allowEdit` 參數。
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的相冊。
-
-### Android 的怪癖
-
-* 任何 `cameraDirection` 值結果在背面的照片。
-
-* 忽略 `allowEdit` 參數。
-
-* `Camera.PictureSourceType.PHOTOLIBRARY`和 `Camera.PictureSourceType.SAVEDPHOTOALBUM` 都顯示相同的寫真集。
-
-### 黑莓 10 的怪癖
-
-* 忽略 `quality` 參數。
-
-* 忽略 `allowEdit` 參數。
-
-* `Camera.MediaType`不受支援。
-
-* 忽略 `correctOrientation` 參數。
-
-* 忽略 `cameraDirection` 參數。
-
-### 火狐瀏覽器作業系統的怪癖
-
-* 忽略 `quality` 參數。
-
-* `Camera.DestinationType`將被忽略並且等於 `1` (影像檔的 URI)
-
-* 忽略 `allowEdit` 參數。
-
-* 忽略 `PictureSourceType` 參數 (使用者選擇它在對話方塊視窗中)
-
-* 忽略`encodingType`
-
-* 忽略了 `targetWidth` 和`targetHeight`
-
-* `Camera.MediaType`不受支援。
-
-* 忽略 `correctOrientation` 參數。
-
-* 忽略 `cameraDirection` 參數。
-
-### iOS 的怪癖
-
-* 設置 `quality` 低於 50,避免在某些設備上的記憶體不足錯誤。
-
-* 當使用 `destinationType.FILE_URI` ,照片都保存在應用程式的臨時目錄。應用程式結束時,將刪除該應用程式的臨時目錄中的內容。
-
-### 泰怪癖
-
-* 不支援的選項
-
-* 總是返回一個檔的 URI
-
-### Windows Phone 7 和 8 的怪癖
-
-* 忽略 `allowEdit` 參數。
-
-* 忽略 `correctOrientation` 參數。
-
-* 忽略 `cameraDirection` 參數。
-
-* 忽略 `saveToPhotoAlbum` 參數。 重要: 使用 wp7/8 科爾多瓦攝像頭 API 拍攝的所有圖像總是都複製到手機的相機膠捲。 根據使用者的設置,這可能也意味著圖像是自動上傳到他們另。 這有可能意味著的圖像,可以比你的應用程式的目的更多的觀眾。 如果此阻滯劑您的應用程式,您將需要實現 CameraCaptureTask 在 msdn 上記載: [HTTP://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx][3]你可能還評論或在[問題追蹤器][4]的向上投票的相關的問題
-
-* 忽略了 `mediaType` 屬性的 `cameraOptions` 作為 Windows Phone SDK 並不提供從 PHOTOLIBRARY 中選擇視頻的方法。
-
- [3]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx
- [4]: https://issues.apache.org/jira/browse/CB-2083
-
-## CameraError
-
-onError 的回呼函數提供了一條錯誤訊息。
-
- function(message) {
- // Show a helpful message
- }
-
-
-### 參數
-
-* **message**: 消息提供的設備的本機代碼。*(String)*
-
-## cameraSuccess
-
-提供的圖像資料的 onSuccess 回呼函數。
-
- function(imageData) {
- // Do something with the image
- }
-
-
-### 參數
-
-* **imageData**: Base64 編碼進行編碼的圖像資料,*或*影像檔的 URI,取決於 `cameraOptions` 效果。*(String)*
-
-### 示例
-
- // Show image
- //
- function cameraCallback(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
-
-## CameraPopoverHandle
-
-由 `navigator.camera.getPicture` 創建的氣泡框對話方塊的控制碼.
-
-### 方法
-
-* **setPosition**: 設置氣泡框的位置。
-
-### 支援的平臺
-
-* iOS
-
-### setPosition
-
-設置氣泡框的位置。
-
-**參數**:
-
-* `cameraPopoverOptions`: `CameraPopoverOptions` ,指定新的位置
-
-### 示例
-
- var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- { destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- });
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function() {
- var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- cameraPopoverHandle.setPosition(cameraPopoverOptions);
- }
-
-
-## CameraPopoverOptions
-
-iOS 僅指定氣泡框的錨元素的位置和箭頭方向,從 iPad 庫或專輯選擇圖像時的參數。
-
- { x : 0,
- y : 32,
- width : 320,
- height : 480,
- arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
- };
-
-
-### CameraPopoverOptions
-
-* **x**: x 螢幕元素到其錨定氣泡框上的圖元座標。*(人數)*
-
-* **y**: 螢幕元素到其錨定氣泡框上的 y 圖元座標。*(人數)*
-
-* **width**: 寬度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)*
-
-* **height**: 高度以圖元為單位),到其錨定氣泡框上的螢幕元素。*(人數)*
-
-* **arrowDir**: 氣泡框上的箭頭應指向的方向。定義在 `Camera.PopoverArrowDirection` *(人數)*
-
- Camera.PopoverArrowDirection = {
- ARROW_UP : 1, // matches iOS UIPopoverArrowDirection constants
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- };
-
-
-請注意氣泡框的大小可能會更改箭頭的方向和螢幕的方向進行調整。 請確保帳戶方向更改時指定錨元素位置。
-
-## navigator.camera.cleanup
-
-刪除中間從臨時存儲攝像機所拍攝的照片。
-
- navigator.camera.cleanup( cameraSuccess, cameraError );
-
-
-### 描述
-
-刪除保留在臨時存儲在調用 `camera.getPicture` 後的中間的影像檔。 適用只有當 `Camera.sourceType` 的值等於 `Camera.PictureSourceType.CAMERA` 和 `Camera.destinationType` 等於 `Camera.DestinationType.FILE_URI`.
-
-### 支援的平臺
-
-* iOS
-
-### 示例
-
- navigator.camera.cleanup(onSuccess, onFail);
-
- function onSuccess() {
- console.log("Camera cleanup success.")
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
diff --git a/plugins/cordova-plugin-camera/jsdoc2md/TEMPLATE.md b/plugins/cordova-plugin-camera/jsdoc2md/TEMPLATE.md
deleted file mode 100644
index 9260a3c..0000000
--- a/plugins/cordova-plugin-camera/jsdoc2md/TEMPLATE.md
+++ /dev/null
@@ -1,199 +0,0 @@
-{{>cdv-license~}}
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-camera.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-camera)
-
-# cordova-plugin-camera
-
-This plugin defines a global `navigator.camera` object, which provides an API for taking pictures and for choosing images from
-the system's image library.
-
-{{>cdv-header device-ready-warning-obj='navigator.camera' npmName='cordova-plugin-camera' cprName='org.apache.cordova.camera' pluginName='Plugin Camera' repoUrl='https://github.com/apache/cordova-plugin-camera' }}
-
----
-
-# API Reference
-
-{{#orphans~}}
-{{>member-index}}
-{{/orphans}}
-* [CameraPopoverHandle](#module_CameraPopoverHandle)
-* [CameraPopoverOptions](#module_CameraPopoverOptions)
-
----
-
-{{#modules~}}
-{{>header~}}
-{{>body~}}
-{{>members~}}
-
----
-
-{{/modules}}
-
-## `camera.getPicture` Errata
-
-#### Example
-
-Take a photo and retrieve it as a Base64-encoded image:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.DATA_URL
- });
-
- function onSuccess(imageData) {
- var image = document.getElementById('myImage');
- image.src = "data:image/jpeg;base64," + imageData;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-Take a photo and retrieve the image's file location:
-
- navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
- destinationType: Camera.DestinationType.FILE_URI });
-
- function onSuccess(imageURI) {
- var image = document.getElementById('myImage');
- image.src = imageURI;
- }
-
- function onFail(message) {
- alert('Failed because: ' + message);
- }
-
-#### Preferences (iOS)
-
-- __CameraUsesGeolocation__ (boolean, defaults to false). For capturing JPEGs, set to true to get geolocation data in the EXIF header. This will trigger a request for geolocation permissions if set to true.
-
-
-
-#### Amazon Fire OS Quirks
-
-Amazon Fire OS uses intents to launch the camera activity on the device to capture
-images, and on phones with low memory, the Cordova activity may be killed. In this
-scenario, the image may not appear when the Cordova activity is restored.
-
-#### Android Quirks
-
-Android uses intents to launch the camera activity on the device to capture
-images, and on phones with low memory, the Cordova activity may be killed. In this
-scenario, the result from the plugin call will be delivered via the resume event.
-See [the Android Lifecycle guide][android_lifecycle]
-for more information. The `pendingResult.result` value will contain the value that
-would be passed to the callbacks (either the URI/URL or an error message). Check
-the `pendingResult.pluginStatus` to determine whether or not the call was
-successful.
-
-#### Browser Quirks
-
-Can only return photos as Base64-encoded image.
-
-#### Firefox OS Quirks
-
-Camera plugin is currently implemented using [Web Activities][web_activities].
-
-#### iOS Quirks
-
-Including a JavaScript `alert()` in either of the callback functions
-can cause problems. Wrap the alert within a `setTimeout()` to allow
-the iOS image picker or popover to fully close before the alert
-displays:
-
- setTimeout(function() {
- // do your thing here!
- }, 0);
-
-#### Windows Phone 7 Quirks
-
-Invoking the native camera application while the device is connected
-via Zune does not work, and triggers an error callback.
-
-#### Tizen Quirks
-
-Tizen only supports a `destinationType` of
-`Camera.DestinationType.FILE_URI` and a `sourceType` of
-`Camera.PictureSourceType.PHOTOLIBRARY`.
-
-
-## `CameraOptions` Errata
-
-#### Amazon Fire OS Quirks
-
-- Any `cameraDirection` value results in a back-facing photo.
-
-- Ignores the `allowEdit` parameter.
-
-- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
-
-#### Android Quirks
-
-- Any `cameraDirection` value results in a back-facing photo.
-
-- **`allowEdit` is unpredictable on Android and it should not be used!** The Android implementation of this plugin tries to find and use an application on the user's device to do image cropping. The plugin has no control over what application the user selects to perform the image cropping and it is very possible that the user could choose an incompatible option and cause the plugin to fail. This sometimes works because most devices come with an application that handles cropping in a way that is compatible with this plugin (Google Plus Photos), but it is unwise to rely on that being the case. If image editing is essential to your application, consider seeking a third party library or plugin that provides its own image editing utility for a more robust solution.
-
-- `Camera.PictureSourceType.PHOTOLIBRARY` and `Camera.PictureSourceType.SAVEDPHOTOALBUM` both display the same photo album.
-
-- Ignores the `encodingType` parameter if the image is unedited (i.e. `quality` is 100, `correctOrientation` is false, and no `targetHeight` or `targetWidth` are specified). The `CAMERA` source will always return the JPEG file given by the native camera and the `PHOTOLIBRARY` and `SAVEDPHOTOALBUM` sources will return the selected file in its existing encoding.
-
-#### BlackBerry 10 Quirks
-
-- Ignores the `quality` parameter.
-
-- Ignores the `allowEdit` parameter.
-
-- `Camera.MediaType` is not supported.
-
-- Ignores the `correctOrientation` parameter.
-
-- Ignores the `cameraDirection` parameter.
-
-#### Firefox OS Quirks
-
-- Ignores the `quality` parameter.
-
-- `Camera.DestinationType` is ignored and equals `1` (image file URI)
-
-- Ignores the `allowEdit` parameter.
-
-- Ignores the `PictureSourceType` parameter (user chooses it in a dialog window)
-
-- Ignores the `encodingType`
-
-- Ignores the `targetWidth` and `targetHeight`
-
-- `Camera.MediaType` is not supported.
-
-- Ignores the `correctOrientation` parameter.
-
-- Ignores the `cameraDirection` parameter.
-
-#### iOS Quirks
-
-- When using `destinationType.FILE_URI`, photos are saved in the application's temporary directory. The contents of the application's temporary directory is deleted when the application ends.
-
-- When using `destinationType.NATIVE_URI` and `sourceType.CAMERA`, photos are saved in the saved photo album regardless on the value of `saveToPhotoAlbum` parameter.
-
-#### Tizen Quirks
-
-- options not supported
-
-- always returns a FILE URI
-
-#### Windows Phone 7 and 8 Quirks
-
-- Ignores the `allowEdit` parameter.
-
-- Ignores the `correctOrientation` parameter.
-
-- Ignores the `cameraDirection` parameter.
-
-- Ignores the `saveToPhotoAlbum` parameter. IMPORTANT: All images taken with the WP8/8 Cordova camera API are always copied to the phone's camera roll. Depending on the user's settings, this could also mean the image is auto-uploaded to their OneDrive. This could potentially mean the image is available to a wider audience than your app intended. If this is a blocker for your application, you will need to implement the CameraCaptureTask as [documented on MSDN][msdn_wp8_docs]. You may also comment or up-vote the related issue in the [issue tracker][wp8_bug].
-
-- Ignores the `mediaType` property of `cameraOptions` as the Windows Phone SDK does not provide a way to choose videos from PHOTOLIBRARY.
-
-[android_lifecycle]: http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html
-[web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/
-[wp8_bug]: https://issues.apache.org/jira/browse/CB-2083
-[msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx
diff --git a/plugins/cordova-plugin-camera/package.json b/plugins/cordova-plugin-camera/package.json
deleted file mode 100644
index dff031c..0000000
--- a/plugins/cordova-plugin-camera/package.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "name": "cordova-plugin-camera",
- "version": "2.1.1",
- "description": "Cordova Camera Plugin",
- "cordova": {
- "id": "cordova-plugin-camera",
- "platforms": [
- "firefoxos",
- "android",
- "amazon-fireos",
- "ubuntu",
- "ios",
- "blackberry10",
- "wp7",
- "wp8",
- "windows8",
- "browser",
- "windows"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-plugin-camera"
- },
- "keywords": [
- "cordova",
- "camera",
- "ecosystem:cordova",
- "cordova-firefoxos",
- "cordova-android",
- "cordova-amazon-fireos",
- "cordova-ubuntu",
- "cordova-ios",
- "cordova-blackberry10",
- "cordova-wp7",
- "cordova-wp8",
- "cordova-windows8",
- "cordova-browser",
- "cordova-windows"
- ],
- "peerDependencies": {
- "cordova-plugin-file": ">=2.0.0"
- },
- "scripts": {
- "precommit": "npm run gen-docs && git add README.md",
- "gen-docs": "jsdoc2md --template \"jsdoc2md/TEMPLATE.md\" \"www/**/*.js\" --plugin \"dmd-plugin-cordova-plugin\" > README.md",
- "test": "npm run jshint",
- "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
- },
- "author": "Apache Software Foundation",
- "license": "Apache-2.0",
- "devDependencies": {
- "dmd-plugin-cordova-plugin": "^0.1.0",
- "husky": "^0.10.1",
- "jsdoc-to-markdown": "^1.2.0",
- "jshint": "^2.6.0"
- }
-}
diff --git a/plugins/cordova-plugin-camera/plugin.xml b/plugins/cordova-plugin-camera/plugin.xml
deleted file mode 100644
index 40a0e3c..0000000
--- a/plugins/cordova-plugin-camera/plugin.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
-
- Camera
- Cordova Camera Plugin
- Apache 2.0
- cordova,camera
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
- https://issues.apache.org/jira/browse/CB/component/12320645
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- access_shared
- use_camera
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/src/android/CameraLauncher.java b/plugins/cordova-plugin-camera/src/android/CameraLauncher.java
deleted file mode 100644
index 1bb6dac..0000000
--- a/plugins/cordova-plugin-camera/src/android/CameraLauncher.java
+++ /dev/null
@@ -1,1257 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URI;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.LOG;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.ActivityNotFoundException;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.Bitmap.CompressFormat;
-import android.graphics.BitmapFactory;
-import android.graphics.Matrix;
-import android.media.MediaScannerConnection;
-import android.media.MediaScannerConnection.MediaScannerConnectionClient;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.provider.MediaStore;
-import android.util.Base64;
-import android.util.Log;
-import android.content.pm.PackageManager;
-/**
- * This class launches the camera view, allows the user to take a picture, closes the camera view,
- * and returns the captured image. When the camera view is closed, the screen displayed before
- * the camera view was shown is redisplayed.
- */
-public class CameraLauncher extends CordovaPlugin implements MediaScannerConnectionClient {
-
- private static final int DATA_URL = 0; // Return base64 encoded string
- private static final int FILE_URI = 1; // Return file uri (content://media/external/images/media/2 for Android)
- private static final int NATIVE_URI = 2; // On Android, this is the same as FILE_URI
-
- private static final int PHOTOLIBRARY = 0; // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
- private static final int CAMERA = 1; // Take picture from camera
- private static final int SAVEDPHOTOALBUM = 2; // Choose image from picture library (same as PHOTOLIBRARY for Android)
-
- private static final int PICTURE = 0; // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType
- private static final int VIDEO = 1; // allow selection of video only, ONLY RETURNS URL
- private static final int ALLMEDIA = 2; // allow selection from all media types
-
- private static final int JPEG = 0; // Take a picture of type JPEG
- private static final int PNG = 1; // Take a picture of type PNG
- private static final String GET_PICTURE = "Get Picture";
- private static final String GET_VIDEO = "Get Video";
- private static final String GET_All = "Get All";
-
- public static final int PERMISSION_DENIED_ERROR = 20;
- public static final int TAKE_PIC_SEC = 0;
- public static final int SAVE_TO_ALBUM_SEC = 1;
-
- private static final String LOG_TAG = "CameraLauncher";
-
- //Where did this come from?
- private static final int CROP_CAMERA = 100;
-
- private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
- private int targetWidth; // desired width of the image
- private int targetHeight; // desired height of the image
- private Uri imageUri; // Uri of captured image
- private int encodingType; // Type of encoding to use
- private int mediaType; // What type of media to retrieve
- private int destType; // Source type (needs to be saved for the permission handling)
- private int srcType; // Destination type (needs to be saved for permission handling)
- private boolean saveToPhotoAlbum; // Should the picture be saved to the device's photo album
- private boolean correctOrientation; // Should the pictures orientation be corrected
- private boolean orientationCorrected; // Has the picture's orientation been corrected
- private boolean allowEdit; // Should we allow the user to crop the image.
-
- protected final static String[] permissions = { Manifest.permission.READ_EXTERNAL_STORAGE };
-
- public CallbackContext callbackContext;
- private int numPics;
-
- private MediaScannerConnection conn; // Used to update gallery app with newly-written files
- private Uri scanMe; // Uri of image to be added to content store
- private Uri croppedUri;
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackContext The callback id used when calling back into JavaScript.
- * @return A PluginResult object with a status and message.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- this.callbackContext = callbackContext;
-
- if (action.equals("takePicture")) {
- this.srcType = CAMERA;
- this.destType = FILE_URI;
- this.saveToPhotoAlbum = false;
- this.targetHeight = 0;
- this.targetWidth = 0;
- this.encodingType = JPEG;
- this.mediaType = PICTURE;
- this.mQuality = 80;
-
- //Take the values from the arguments if they're not already defined (this is tricky)
- this.destType = args.getInt(1);
- this.srcType = args.getInt(2);
- this.mQuality = args.getInt(0);
- this.targetWidth = args.getInt(3);
- this.targetHeight = args.getInt(4);
- this.encodingType = args.getInt(5);
- this.mediaType = args.getInt(6);
- this.allowEdit = args.getBoolean(7);
- this.correctOrientation = args.getBoolean(8);
- this.saveToPhotoAlbum = args.getBoolean(9);
-
- // If the user specifies a 0 or smaller width/height
- // make it -1 so later comparisons succeed
- if (this.targetWidth < 1) {
- this.targetWidth = -1;
- }
- if (this.targetHeight < 1) {
- this.targetHeight = -1;
- }
-
- // We don't return full-quality PNG files. The camera outputs a JPEG
- // so requesting it as a PNG provides no actual benefit
- if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
- !this.correctOrientation && this.encodingType == PNG && this.srcType == CAMERA) {
- this.encodingType = JPEG;
- }
-
- try {
- if (this.srcType == CAMERA) {
- this.callTakePicture(destType, encodingType);
- }
- else if ((this.srcType == PHOTOLIBRARY) || (this.srcType == SAVEDPHOTOALBUM)) {
- // FIXME: Stop always requesting the permission
- if(!PermissionHelper.hasPermission(this, permissions[0])) {
- PermissionHelper.requestPermission(this, SAVE_TO_ALBUM_SEC, Manifest.permission.READ_EXTERNAL_STORAGE);
- } else {
- this.getImage(this.srcType, destType, encodingType);
- }
- }
- }
- catch (IllegalArgumentException e)
- {
- callbackContext.error("Illegal Argument Exception");
- PluginResult r = new PluginResult(PluginResult.Status.ERROR);
- callbackContext.sendPluginResult(r);
- return true;
- }
-
- PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
- r.setKeepCallback(true);
- callbackContext.sendPluginResult(r);
-
- return true;
- }
- return false;
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- private String getTempDirectoryPath() {
- File cache = null;
-
- // SD Card Mounted
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- cache = cordova.getActivity().getExternalCacheDir();
- }
- // Use internal storage
- else {
- cache = cordova.getActivity().getCacheDir();
- }
-
- // Create the cache directory if it doesn't exist
- cache.mkdirs();
- return cache.getAbsolutePath();
- }
-
- /**
- * Take a picture with the camera.
- * When an image is captured or the camera view is cancelled, the result is returned
- * in CordovaActivity.onActivityResult, which forwards the result to this.onActivityResult.
- *
- * The image can either be returned as a base64 string or a URI that points to the file.
- * To display base64 string in an img tag, set the source to:
- * img.src="data:image/jpeg;base64,"+result;
- * or to display URI in an img tag
- * img.src=result;
- *
- * @param quality Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
- * @param returnType Set the type of image to return.
- */
- public void callTakePicture(int returnType, int encodingType) {
- if (PermissionHelper.hasPermission(this, permissions[0])) {
- takePicture(returnType, encodingType);
- } else {
- PermissionHelper.requestPermission(this, TAKE_PIC_SEC, Manifest.permission.READ_EXTERNAL_STORAGE);
- }
- }
-
-
- public void takePicture(int returnType, int encodingType)
- {
- // Save the number of images currently on disk for later
- this.numPics = queryImgDB(whichContentStore()).getCount();
-
- // Let's use the intent and see what happens
- Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
-
- // Specify file so that large image is captured and returned
- File photo = createCaptureFile(encodingType);
- intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
- this.imageUri = Uri.fromFile(photo);
-
- if (this.cordova != null) {
- // Let's check to make sure the camera is actually installed. (Legacy Nexus 7 code)
- PackageManager mPm = this.cordova.getActivity().getPackageManager();
- if(intent.resolveActivity(mPm) != null)
- {
-
- this.cordova.startActivityForResult((CordovaPlugin) this, intent, (CAMERA + 1) * 16 + returnType + 1);
- }
- else
- {
- LOG.d(LOG_TAG, "Error: You don't have a default camera. Your device may not be CTS complaint.");
- }
- }
-// else
-// LOG.d(LOG_TAG, "ERROR: You must use the CordovaInterface for this to work correctly. Please implement it in your activity");
- }
-
- /**
- * Create a file in the applications temporary directory based upon the supplied encoding.
- *
- * @param encodingType of the image to be taken
- * @return a File object pointing to the temporary picture
- */
- private File createCaptureFile(int encodingType) {
- return createCaptureFile(encodingType, "");
- }
-
- /**
- * Create a file in the applications temporary directory based upon the supplied encoding.
- *
- * @param encodingType of the image to be taken
- * @param fileName or resultant File object.
- * @return a File object pointing to the temporary picture
- */
- private File createCaptureFile(int encodingType, String fileName) {
- if (fileName.isEmpty()) {
- fileName = ".Pic";
- }
-
- if (encodingType == JPEG) {
- fileName = fileName + ".jpg";
- } else if (encodingType == PNG) {
- fileName = fileName + ".png";
- } else {
- throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType);
- }
-
- return new File(getTempDirectoryPath(), fileName);
- }
-
-
-
- /**
- * Get image from photo library.
- *
- * @param quality Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
- * @param srcType The album to get image from.
- * @param returnType Set the type of image to return.
- * @param encodingType
- */
- // TODO: Images selected from SDCARD don't display correctly, but from CAMERA ALBUM do!
- // TODO: Images from kitkat filechooser not going into crop function
- public void getImage(int srcType, int returnType, int encodingType) {
- Intent intent = new Intent();
- String title = GET_PICTURE;
- croppedUri = null;
- if (this.mediaType == PICTURE) {
- intent.setType("image/*");
- if (this.allowEdit) {
- intent.setAction(Intent.ACTION_PICK);
- intent.putExtra("crop", "true");
- if (targetWidth > 0) {
- intent.putExtra("outputX", targetWidth);
- }
- if (targetHeight > 0) {
- intent.putExtra("outputY", targetHeight);
- }
- if (targetHeight > 0 && targetWidth > 0 && targetWidth == targetHeight) {
- intent.putExtra("aspectX", 1);
- intent.putExtra("aspectY", 1);
- }
- File photo = createCaptureFile(encodingType);
- croppedUri = Uri.fromFile(photo);
- intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, croppedUri);
- } else {
- intent.setAction(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- }
- } else if (this.mediaType == VIDEO) {
- intent.setType("video/*");
- title = GET_VIDEO;
- intent.setAction(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- } else if (this.mediaType == ALLMEDIA) {
- // I wanted to make the type 'image/*, video/*' but this does not work on all versions
- // of android so I had to go with the wildcard search.
- intent.setType("*/*");
- title = GET_All;
- intent.setAction(Intent.ACTION_GET_CONTENT);
- intent.addCategory(Intent.CATEGORY_OPENABLE);
- }
- if (this.cordova != null) {
- this.cordova.startActivityForResult((CordovaPlugin) this, Intent.createChooser(intent,
- new String(title)), (srcType + 1) * 16 + returnType + 1);
- }
- }
-
- /**
- * Brings up the UI to perform crop on passed image URI
- *
- * @param picUri
- */
- private void performCrop(Uri picUri, int destType, Intent cameraIntent) {
- try {
- Intent cropIntent = new Intent("com.android.camera.action.CROP");
- // indicate image type and Uri
- cropIntent.setDataAndType(picUri, "image/*");
- // set crop properties
- cropIntent.putExtra("crop", "true");
-
- // indicate output X and Y
- if (targetWidth > 0) {
- cropIntent.putExtra("outputX", targetWidth);
- }
- if (targetHeight > 0) {
- cropIntent.putExtra("outputY", targetHeight);
- }
- if (targetHeight > 0 && targetWidth > 0 && targetWidth == targetHeight) {
- cropIntent.putExtra("aspectX", 1);
- cropIntent.putExtra("aspectY", 1);
- }
- // create new file handle to get full resolution crop
- croppedUri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
- cropIntent.putExtra("output", croppedUri);
-
- // start the activity - we handle returning in onActivityResult
-
- if (this.cordova != null) {
- this.cordova.startActivityForResult((CordovaPlugin) this,
- cropIntent, CROP_CAMERA + destType);
- }
- } catch (ActivityNotFoundException anfe) {
- Log.e(LOG_TAG, "Crop operation not supported on this device");
- try {
- processResultFromCamera(destType, cameraIntent);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- Log.e(LOG_TAG, "Unable to write to file");
- }
- }
- }
-
- /**
- * Applies all needed transformation to the image received from the camera.
- *
- * @param destType In which form should we return the image
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- private void processResultFromCamera(int destType, Intent intent) throws IOException {
- int rotate = 0;
-
- // Create an ExifHelper to save the exif data that is lost during compression
- ExifHelper exif = new ExifHelper();
- String sourcePath = (this.allowEdit && this.croppedUri != null) ?
- FileHelper.stripFileProtocol(this.croppedUri.toString()) :
- FileHelper.stripFileProtocol(this.imageUri.toString());
-
- if (this.encodingType == JPEG) {
- try {
- //We don't support PNG, so let's not pretend we do
- exif.createInFile(sourcePath);
- exif.readExifData();
- rotate = exif.getOrientation();
-
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- Bitmap bitmap = null;
- Uri galleryUri = null;
-
- // CB-5479 When this option is given the unchanged image should be saved
- // in the gallery and the modified image is saved in the temporary
- // directory
- if (this.saveToPhotoAlbum) {
- galleryUri = Uri.fromFile(new File(getPicutresPath()));
-
- if(this.allowEdit && this.croppedUri != null) {
- writeUncompressedImage(this.croppedUri, galleryUri);
- } else {
- writeUncompressedImage(this.imageUri, galleryUri);
- }
-
- refreshGallery(galleryUri);
- }
-
- // If sending base64 image back
- if (destType == DATA_URL) {
- bitmap = getScaledBitmap(sourcePath);
-
- if (bitmap == null) {
- // Try to get the bitmap from intent.
- bitmap = (Bitmap)intent.getExtras().get("data");
- }
-
- // Double-check the bitmap.
- if (bitmap == null) {
- Log.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to create bitmap!");
- return;
- }
-
- if (rotate != 0 && this.correctOrientation) {
- bitmap = getRotatedBitmap(rotate, bitmap, exif);
- }
-
- this.processPicture(bitmap, this.encodingType);
-
- if (!this.saveToPhotoAlbum) {
- checkForDuplicateImage(DATA_URL);
- }
- }
-
- // If sending filename back
- else if (destType == FILE_URI || destType == NATIVE_URI) {
- // If all this is true we shouldn't compress the image.
- if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
- !this.correctOrientation) {
-
- // If we saved the uncompressed photo to the album, we can just
- // return the URI we already created
- if (this.saveToPhotoAlbum) {
- this.callbackContext.success(galleryUri.toString());
- } else {
- Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
-
- if(this.allowEdit && this.croppedUri != null) {
- writeUncompressedImage(this.croppedUri, uri);
- } else {
- writeUncompressedImage(this.imageUri, uri);
- }
-
- this.callbackContext.success(uri.toString());
- }
- } else {
- Uri uri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));
- bitmap = getScaledBitmap(sourcePath);
-
- // Double-check the bitmap.
- if (bitmap == null) {
- Log.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to create bitmap!");
- return;
- }
-
- if (rotate != 0 && this.correctOrientation) {
- bitmap = getRotatedBitmap(rotate, bitmap, exif);
- }
-
- // Add compressed version of captured image to returned media store Uri
- OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri);
- CompressFormat compressFormat = encodingType == JPEG ?
- CompressFormat.JPEG :
- CompressFormat.PNG;
-
- bitmap.compress(compressFormat, this.mQuality, os);
- os.close();
-
- // Restore exif data to file
- if (this.encodingType == JPEG) {
- String exifPath;
- exifPath = uri.getPath();
- exif.createOutFile(exifPath);
- exif.writeExifData();
- }
-
- // Send Uri back to JavaScript for viewing image
- this.callbackContext.success(uri.toString());
-
- }
- } else {
- throw new IllegalStateException();
- }
-
- this.cleanup(FILE_URI, this.imageUri, galleryUri, bitmap);
- bitmap = null;
- }
-
-private String getPicutresPath()
-{
- String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
- String imageFileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? ".jpg" : ".png");
- File storageDir = Environment.getExternalStoragePublicDirectory(
- Environment.DIRECTORY_PICTURES);
- String galleryPath = storageDir.getAbsolutePath() + "/" + imageFileName;
- return galleryPath;
-}
-
-private void refreshGallery(Uri contentUri)
-{
- Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
- mediaScanIntent.setData(contentUri);
- this.cordova.getActivity().sendBroadcast(mediaScanIntent);
-}
-
-
-private String ouputModifiedBitmap(Bitmap bitmap, Uri uri) throws IOException {
- // Some content: URIs do not map to file paths (e.g. picasa).
- String realPath = FileHelper.getRealPath(uri, this.cordova);
-
- // Get filename from uri
- String fileName = realPath != null ?
- realPath.substring(realPath.lastIndexOf('/') + 1) :
- "modified." + (this.encodingType == JPEG ? "jpg" : "png");
-
- String modifiedPath = getTempDirectoryPath() + "/" + fileName;
-
- OutputStream os = new FileOutputStream(modifiedPath);
- CompressFormat compressFormat = this.encodingType == JPEG ?
- CompressFormat.JPEG :
- CompressFormat.PNG;
-
- bitmap.compress(compressFormat, this.mQuality, os);
- os.close();
-
- if (realPath != null && this.encodingType == JPEG) {
- // Create an ExifHelper to save the exif data that is lost during compression
- ExifHelper exif = new ExifHelper();
-
- try {
- exif.createInFile(realPath);
- exif.readExifData();
- if (this.correctOrientation && this.orientationCorrected) {
- exif.resetOrientation();
- }
- exif.createOutFile(modifiedPath);
- exif.writeExifData();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- return modifiedPath;
- }
-
-
-
-/**
- * Applies all needed transformation to the image received from the gallery.
- *
- * @param destType In which form should we return the image
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- private void processResultFromGallery(int destType, Intent intent) {
- Uri uri = intent.getData();
- if (uri == null) {
- if (croppedUri != null) {
- uri = croppedUri;
- } else {
- this.failPicture("null data from photo library");
- return;
- }
- }
- int rotate = 0;
-
- String fileLocation = FileHelper.getRealPath(uri, this.cordova);
- Log.d(LOG_TAG, "File locaton is: " + fileLocation);
-
- // If you ask for video or all media type you will automatically get back a file URI
- // and there will be no attempt to resize any returned data
- if (this.mediaType != PICTURE) {
- this.callbackContext.success(fileLocation);
- }
- else {
- // This is a special case to just return the path as no scaling,
- // rotating, nor compressing needs to be done
- if (this.targetHeight == -1 && this.targetWidth == -1 &&
- (destType == FILE_URI || destType == NATIVE_URI) && !this.correctOrientation) {
- this.callbackContext.success(uri.toString());
- } else {
- String uriString = uri.toString();
- // Get the path to the image. Makes loading so much easier.
- String mimeType = FileHelper.getMimeType(uriString, this.cordova);
- // If we don't have a valid image so quit.
- if (!("image/jpeg".equalsIgnoreCase(mimeType) || "image/png".equalsIgnoreCase(mimeType))) {
- Log.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to retrieve path to picture!");
- return;
- }
- Bitmap bitmap = null;
- try {
- bitmap = getScaledBitmap(uriString);
- } catch (IOException e) {
- e.printStackTrace();
- }
- if (bitmap == null) {
- Log.d(LOG_TAG, "I either have a null image path or bitmap");
- this.failPicture("Unable to create bitmap!");
- return;
- }
-
- if (this.correctOrientation) {
- rotate = getImageOrientation(uri);
- if (rotate != 0) {
- Matrix matrix = new Matrix();
- matrix.setRotate(rotate);
- try {
- bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
- this.orientationCorrected = true;
- } catch (OutOfMemoryError oom) {
- this.orientationCorrected = false;
- }
- }
- }
-
- // If sending base64 image back
- if (destType == DATA_URL) {
- this.processPicture(bitmap, this.encodingType);
- }
-
- // If sending filename back
- else if (destType == FILE_URI || destType == NATIVE_URI) {
- // Did we modify the image?
- if ( (this.targetHeight > 0 && this.targetWidth > 0) ||
- (this.correctOrientation && this.orientationCorrected) ) {
- try {
- String modifiedPath = this.ouputModifiedBitmap(bitmap, uri);
- // The modified image is cached by the app in order to get around this and not have to delete you
- // application cache I'm adding the current system time to the end of the file url.
- this.callbackContext.success("file://" + modifiedPath + "?" + System.currentTimeMillis());
-
- } catch (Exception e) {
- e.printStackTrace();
- this.failPicture("Error retrieving image.");
- }
- }
- else {
- this.callbackContext.success(fileLocation);
- }
- }
- if (bitmap != null) {
- bitmap.recycle();
- bitmap = null;
- }
- System.gc();
- }
- }
- }
-
- /**
- * Called when the camera view exits.
- *
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- */
- public void onActivityResult(int requestCode, int resultCode, Intent intent) {
-
- // Get src and dest types from request code for a Camera Activity
- int srcType = (requestCode / 16) - 1;
- int destType = (requestCode % 16) - 1;
-
- // If Camera Crop
- if (requestCode >= CROP_CAMERA) {
- if (resultCode == Activity.RESULT_OK) {
-
- // Because of the inability to pass through multiple intents, this hack will allow us
- // to pass arcane codes back.
- destType = requestCode - CROP_CAMERA;
- try {
- processResultFromCamera(destType, intent);
- } catch (IOException e) {
- e.printStackTrace();
- Log.e(LOG_TAG, "Unable to write to file");
- }
-
- }// If cancelled
- else if (resultCode == Activity.RESULT_CANCELED) {
- this.failPicture("Camera cancelled.");
- }
-
- // If something else
- else {
- this.failPicture("Did not complete!");
- }
- }
- // If CAMERA
- else if (srcType == CAMERA) {
- // If image available
- if (resultCode == Activity.RESULT_OK) {
- try {
- if(this.allowEdit)
- {
- Uri tmpFile = Uri.fromFile(createCaptureFile(this.encodingType));
- performCrop(tmpFile, destType, intent);
- }
- else {
- this.processResultFromCamera(destType, intent);
- }
- } catch (IOException e) {
- e.printStackTrace();
- this.failPicture("Error capturing image.");
- }
- }
-
- // If cancelled
- else if (resultCode == Activity.RESULT_CANCELED) {
- this.failPicture("Camera cancelled.");
- }
-
- // If something else
- else {
- this.failPicture("Did not complete!");
- }
- }
- // If retrieving photo from library
- else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
- if (resultCode == Activity.RESULT_OK && intent != null) {
- final Intent i = intent;
- final int finalDestType = destType;
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- processResultFromGallery(finalDestType, i);
- }
- });
- }
- else if (resultCode == Activity.RESULT_CANCELED) {
- this.failPicture("Selection cancelled.");
- }
- else {
- this.failPicture("Selection did not complete!");
- }
- }
- }
-
- private int getImageOrientation(Uri uri) {
- int rotate = 0;
- String[] cols = { MediaStore.Images.Media.ORIENTATION };
- try {
- Cursor cursor = cordova.getActivity().getContentResolver().query(uri,
- cols, null, null, null);
- if (cursor != null) {
- cursor.moveToPosition(0);
- rotate = cursor.getInt(0);
- cursor.close();
- }
- } catch (Exception e) {
- // You can get an IllegalArgumentException if ContentProvider doesn't support querying for orientation.
- }
- return rotate;
- }
-
- /**
- * Figure out if the bitmap should be rotated. For instance if the picture was taken in
- * portrait mode
- *
- * @param rotate
- * @param bitmap
- * @return rotated bitmap
- */
- private Bitmap getRotatedBitmap(int rotate, Bitmap bitmap, ExifHelper exif) {
- Matrix matrix = new Matrix();
- if (rotate == 180) {
- matrix.setRotate(rotate);
- } else {
- matrix.setRotate(rotate, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2);
- }
-
- try
- {
- bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
- exif.resetOrientation();
- }
- catch (OutOfMemoryError oom)
- {
- // You can run out of memory if the image is very large:
- // http://simonmacdonald.blogspot.ca/2012/07/change-to-camera-code-in-phonegap-190.html
- // If this happens, simply do not rotate the image and return it unmodified.
- // If you do not catch the OutOfMemoryError, the Android app crashes.
- }
-
- return bitmap;
- }
-
- /**
- * In the special case where the default width, height and quality are unchanged
- * we just write the file out to disk saving the expensive Bitmap.compress function.
- *
- * @param uri
- * @throws FileNotFoundException
- * @throws IOException
- */
- private void writeUncompressedImage(Uri src, Uri dest) throws FileNotFoundException,
- IOException {
- FileInputStream fis = null;
- OutputStream os = null;
- try {
- fis = new FileInputStream(FileHelper.stripFileProtocol(src.toString()));
- os = this.cordova.getActivity().getContentResolver().openOutputStream(dest);
- byte[] buffer = new byte[4096];
- int len;
- while ((len = fis.read(buffer)) != -1) {
- os.write(buffer, 0, len);
- }
- os.flush();
- } finally {
- if (os != null) {
- try {
- os.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG,"Exception while closing output stream.");
- }
- }
- if (fis != null) {
- try {
- fis.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG,"Exception while closing file input stream.");
- }
- }
- }
- }
-
- /**
- * Create entry in media store for image
- *
- * @return uri
- */
- private Uri getUriFromMediaStore() {
- ContentValues values = new ContentValues();
- values.put(android.provider.MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
- Uri uri;
- try {
- uri = this.cordova.getActivity().getContentResolver().insert(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
- } catch (RuntimeException e) {
- LOG.d(LOG_TAG, "Can't write to external media storage.");
- try {
- uri = this.cordova.getActivity().getContentResolver().insert(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI, values);
- } catch (RuntimeException ex) {
- LOG.d(LOG_TAG, "Can't write to internal media storage.");
- return null;
- }
- }
- return uri;
- }
-
- /**
- * Return a scaled bitmap based on the target width and height
- *
- * @param imagePath
- * @return
- * @throws IOException
- */
- private Bitmap getScaledBitmap(String imageUrl) throws IOException {
- // If no new width or height were specified return the original bitmap
- if (this.targetWidth <= 0 && this.targetHeight <= 0) {
- InputStream fileStream = null;
- Bitmap image = null;
- try {
- fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
- image = BitmapFactory.decodeStream(fileStream);
- } finally {
- if (fileStream != null) {
- try {
- fileStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG,"Exception while closing file input stream.");
- }
- }
- }
- return image;
- }
-
- // figure out the original width and height of the image
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inJustDecodeBounds = true;
- InputStream fileStream = null;
- try {
- fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
- BitmapFactory.decodeStream(fileStream, null, options);
- } finally {
- if (fileStream != null) {
- try {
- fileStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG,"Exception while closing file input stream.");
- }
- }
- }
-
- //CB-2292: WTF? Why is the width null?
- if(options.outWidth == 0 || options.outHeight == 0)
- {
- return null;
- }
-
- // determine the correct aspect ratio
- int[] widthHeight = calculateAspectRatio(options.outWidth, options.outHeight);
-
- // Load in the smallest bitmap possible that is closest to the size we want
- options.inJustDecodeBounds = false;
- options.inSampleSize = calculateSampleSize(options.outWidth, options.outHeight, this.targetWidth, this.targetHeight);
- Bitmap unscaledBitmap = null;
- try {
- fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
- unscaledBitmap = BitmapFactory.decodeStream(fileStream, null, options);
- } finally {
- if (fileStream != null) {
- try {
- fileStream.close();
- } catch (IOException e) {
- LOG.d(LOG_TAG,"Exception while closing file input stream.");
- }
- }
- }
- if (unscaledBitmap == null) {
- return null;
- }
-
- return Bitmap.createScaledBitmap(unscaledBitmap, widthHeight[0], widthHeight[1], true);
- }
-
- /**
- * Maintain the aspect ratio so the resulting image does not look smooshed
- *
- * @param origWidth
- * @param origHeight
- * @return
- */
- public int[] calculateAspectRatio(int origWidth, int origHeight) {
- int newWidth = this.targetWidth;
- int newHeight = this.targetHeight;
-
- // If no new width or height were specified return the original bitmap
- if (newWidth <= 0 && newHeight <= 0) {
- newWidth = origWidth;
- newHeight = origHeight;
- }
- // Only the width was specified
- else if (newWidth > 0 && newHeight <= 0) {
- newHeight = (newWidth * origHeight) / origWidth;
- }
- // only the height was specified
- else if (newWidth <= 0 && newHeight > 0) {
- newWidth = (newHeight * origWidth) / origHeight;
- }
- // If the user specified both a positive width and height
- // (potentially different aspect ratio) then the width or height is
- // scaled so that the image fits while maintaining aspect ratio.
- // Alternatively, the specified width and height could have been
- // kept and Bitmap.SCALE_TO_FIT specified when scaling, but this
- // would result in whitespace in the new image.
- else {
- double newRatio = newWidth / (double) newHeight;
- double origRatio = origWidth / (double) origHeight;
-
- if (origRatio > newRatio) {
- newHeight = (newWidth * origHeight) / origWidth;
- } else if (origRatio < newRatio) {
- newWidth = (newHeight * origWidth) / origHeight;
- }
- }
-
- int[] retval = new int[2];
- retval[0] = newWidth;
- retval[1] = newHeight;
- return retval;
- }
-
- /**
- * Figure out what ratio we can load our image into memory at while still being bigger than
- * our desired width and height
- *
- * @param srcWidth
- * @param srcHeight
- * @param dstWidth
- * @param dstHeight
- * @return
- */
- public static int calculateSampleSize(int srcWidth, int srcHeight, int dstWidth, int dstHeight) {
- final float srcAspect = (float)srcWidth / (float)srcHeight;
- final float dstAspect = (float)dstWidth / (float)dstHeight;
-
- if (srcAspect > dstAspect) {
- return srcWidth / dstWidth;
- } else {
- return srcHeight / dstHeight;
- }
- }
-
- /**
- * Creates a cursor that can be used to determine how many images we have.
- *
- * @return a cursor
- */
- private Cursor queryImgDB(Uri contentStore) {
- return this.cordova.getActivity().getContentResolver().query(
- contentStore,
- new String[] { MediaStore.Images.Media._ID },
- null,
- null,
- null);
- }
-
- /**
- * Cleans up after picture taking. Checking for duplicates and that kind of stuff.
- * @param newImage
- */
- private void cleanup(int imageType, Uri oldImage, Uri newImage, Bitmap bitmap) {
- if (bitmap != null) {
- bitmap.recycle();
- }
-
- // Clean up initial camera-written image file.
- (new File(FileHelper.stripFileProtocol(oldImage.toString()))).delete();
-
- checkForDuplicateImage(imageType);
- // Scan for the gallery to update pic refs in gallery
- if (this.saveToPhotoAlbum && newImage != null) {
- this.scanForGallery(newImage);
- }
-
- System.gc();
- }
-
- /**
- * Used to find out if we are in a situation where the Camera Intent adds to images
- * to the content store. If we are using a FILE_URI and the number of images in the DB
- * increases by 2 we have a duplicate, when using a DATA_URL the number is 1.
- *
- * @param type FILE_URI or DATA_URL
- */
- private void checkForDuplicateImage(int type) {
- int diff = 1;
- Uri contentStore = whichContentStore();
- Cursor cursor = queryImgDB(contentStore);
- int currentNumOfImages = cursor.getCount();
-
- if (type == FILE_URI && this.saveToPhotoAlbum) {
- diff = 2;
- }
-
- // delete the duplicate file if the difference is 2 for file URI or 1 for Data URL
- if ((currentNumOfImages - numPics) == diff) {
- cursor.moveToLast();
- int id = Integer.valueOf(cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media._ID)));
- if (diff == 2) {
- id--;
- }
- Uri uri = Uri.parse(contentStore + "/" + id);
- this.cordova.getActivity().getContentResolver().delete(uri, null, null);
- cursor.close();
- }
- }
-
- /**
- * Determine if we are storing the images in internal or external storage
- * @return Uri
- */
- private Uri whichContentStore() {
- if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- return android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
- } else {
- return android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI;
- }
- }
-
- /**
- * Compress bitmap using jpeg, convert to Base64 encoded string, and return to JavaScript.
- *
- * @param bitmap
- */
- public void processPicture(Bitmap bitmap, int encodingType) {
- ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream();
- CompressFormat compressFormat = encodingType == JPEG ?
- CompressFormat.JPEG :
- CompressFormat.PNG;
-
- try {
- if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
- byte[] code = jpeg_data.toByteArray();
- byte[] output = Base64.encode(code, Base64.NO_WRAP);
- String js_out = new String(output);
- this.callbackContext.success(js_out);
- js_out = null;
- output = null;
- code = null;
- }
- } catch (Exception e) {
- this.failPicture("Error compressing image.");
- }
- jpeg_data = null;
- }
-
- /**
- * Send error message to JavaScript.
- *
- * @param err
- */
- public void failPicture(String err) {
- this.callbackContext.error(err);
- }
-
- private void scanForGallery(Uri newImage) {
- this.scanMe = newImage;
- if(this.conn != null) {
- this.conn.disconnect();
- }
- this.conn = new MediaScannerConnection(this.cordova.getActivity().getApplicationContext(), this);
- conn.connect();
- }
-
- public void onMediaScannerConnected() {
- try{
- this.conn.scanFile(this.scanMe.toString(), "image/*");
- } catch (java.lang.IllegalStateException e){
- LOG.e(LOG_TAG, "Can't scan file in MediaScanner after taking picture");
- }
-
- }
-
- public void onScanCompleted(String path, Uri uri) {
- this.conn.disconnect();
- }
-
-
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException
- {
- for(int r:grantResults)
- {
- if(r == PackageManager.PERMISSION_DENIED)
- {
- this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, PERMISSION_DENIED_ERROR));
- return;
- }
- }
- switch(requestCode)
- {
- case TAKE_PIC_SEC:
- takePicture(this.destType, this.encodingType);
- break;
- case SAVE_TO_ALBUM_SEC:
- this.getImage(this.srcType, this.destType, this.encodingType);
- break;
- }
- }
-
- /**
- * Taking or choosing a picture launches another Activity, so we need to implement the
- * save/restore APIs to handle the case where the CordovaActivity is killed by the OS
- * before we get the launched Activity's result.
- */
- public Bundle onSaveInstanceState() {
- Bundle state = new Bundle();
- state.putInt("destType", this.destType);
- state.putInt("srcType", this.srcType);
- state.putInt("mQuality", this.mQuality);
- state.putInt("targetWidth", this.targetWidth);
- state.putInt("targetHeight", this.targetHeight);
- state.putInt("encodingType", this.encodingType);
- state.putInt("mediaType", this.mediaType);
- state.putInt("numPics", this.numPics);
- state.putBoolean("allowEdit", this.allowEdit);
- state.putBoolean("correctOrientation", this.correctOrientation);
- state.putBoolean("saveToPhotoAlbum", this.saveToPhotoAlbum);
-
- if(this.croppedUri != null) {
- state.putString("croppedUri", this.croppedUri.toString());
- }
-
- if(this.imageUri != null) {
- state.putString("imageUri", this.imageUri.toString());
- }
-
- return state;
- }
-
- public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {
- this.destType = state.getInt("destType");
- this.srcType = state.getInt("srcType");
- this.mQuality = state.getInt("mQuality");
- this.targetWidth = state.getInt("targetWidth");
- this.targetHeight = state.getInt("targetHeight");
- this.encodingType = state.getInt("encodingType");
- this.mediaType = state.getInt("mediaType");
- this.numPics = state.getInt("numPics");
- this.allowEdit = state.getBoolean("allowEdit");
- this.correctOrientation = state.getBoolean("correctOrientation");
- this.saveToPhotoAlbum = state.getBoolean("saveToPhotoAlbum");
-
- if(state.containsKey("croppedUri")) {
- this.croppedUri = Uri.parse(state.getString("croppedUri"));
- }
-
- if(state.containsKey("imageUri")) {
- this.imageUri = Uri.parse(state.getString("imageUri"));
- }
-
- this.callbackContext = callbackContext;
- }
-}
diff --git a/plugins/cordova-plugin-camera/src/android/ExifHelper.java b/plugins/cordova-plugin-camera/src/android/ExifHelper.java
deleted file mode 100644
index 5160a2f..0000000
--- a/plugins/cordova-plugin-camera/src/android/ExifHelper.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-import java.io.IOException;
-
-import android.media.ExifInterface;
-
-public class ExifHelper {
- private String aperture = null;
- private String datetime = null;
- private String exposureTime = null;
- private String flash = null;
- private String focalLength = null;
- private String gpsAltitude = null;
- private String gpsAltitudeRef = null;
- private String gpsDateStamp = null;
- private String gpsLatitude = null;
- private String gpsLatitudeRef = null;
- private String gpsLongitude = null;
- private String gpsLongitudeRef = null;
- private String gpsProcessingMethod = null;
- private String gpsTimestamp = null;
- private String iso = null;
- private String make = null;
- private String model = null;
- private String orientation = null;
- private String whiteBalance = null;
-
- private ExifInterface inFile = null;
- private ExifInterface outFile = null;
-
- /**
- * The file before it is compressed
- *
- * @param filePath
- * @throws IOException
- */
- public void createInFile(String filePath) throws IOException {
- this.inFile = new ExifInterface(filePath);
- }
-
- /**
- * The file after it has been compressed
- *
- * @param filePath
- * @throws IOException
- */
- public void createOutFile(String filePath) throws IOException {
- this.outFile = new ExifInterface(filePath);
- }
-
- /**
- * Reads all the EXIF data from the input file.
- */
- public void readExifData() {
- this.aperture = inFile.getAttribute(ExifInterface.TAG_APERTURE);
- this.datetime = inFile.getAttribute(ExifInterface.TAG_DATETIME);
- this.exposureTime = inFile.getAttribute(ExifInterface.TAG_EXPOSURE_TIME);
- this.flash = inFile.getAttribute(ExifInterface.TAG_FLASH);
- this.focalLength = inFile.getAttribute(ExifInterface.TAG_FOCAL_LENGTH);
- this.gpsAltitude = inFile.getAttribute(ExifInterface.TAG_GPS_ALTITUDE);
- this.gpsAltitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF);
- this.gpsDateStamp = inFile.getAttribute(ExifInterface.TAG_GPS_DATESTAMP);
- this.gpsLatitude = inFile.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
- this.gpsLatitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
- this.gpsLongitude = inFile.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
- this.gpsLongitudeRef = inFile.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
- this.gpsProcessingMethod = inFile.getAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD);
- this.gpsTimestamp = inFile.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP);
- this.iso = inFile.getAttribute(ExifInterface.TAG_ISO);
- this.make = inFile.getAttribute(ExifInterface.TAG_MAKE);
- this.model = inFile.getAttribute(ExifInterface.TAG_MODEL);
- this.orientation = inFile.getAttribute(ExifInterface.TAG_ORIENTATION);
- this.whiteBalance = inFile.getAttribute(ExifInterface.TAG_WHITE_BALANCE);
- }
-
- /**
- * Writes the previously stored EXIF data to the output file.
- *
- * @throws IOException
- */
- public void writeExifData() throws IOException {
- // Don't try to write to a null file
- if (this.outFile == null) {
- return;
- }
-
- if (this.aperture != null) {
- this.outFile.setAttribute(ExifInterface.TAG_APERTURE, this.aperture);
- }
- if (this.datetime != null) {
- this.outFile.setAttribute(ExifInterface.TAG_DATETIME, this.datetime);
- }
- if (this.exposureTime != null) {
- this.outFile.setAttribute(ExifInterface.TAG_EXPOSURE_TIME, this.exposureTime);
- }
- if (this.flash != null) {
- this.outFile.setAttribute(ExifInterface.TAG_FLASH, this.flash);
- }
- if (this.focalLength != null) {
- this.outFile.setAttribute(ExifInterface.TAG_FOCAL_LENGTH, this.focalLength);
- }
- if (this.gpsAltitude != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_ALTITUDE, this.gpsAltitude);
- }
- if (this.gpsAltitudeRef != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF, this.gpsAltitudeRef);
- }
- if (this.gpsDateStamp != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_DATESTAMP, this.gpsDateStamp);
- }
- if (this.gpsLatitude != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LATITUDE, this.gpsLatitude);
- }
- if (this.gpsLatitudeRef != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, this.gpsLatitudeRef);
- }
- if (this.gpsLongitude != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, this.gpsLongitude);
- }
- if (this.gpsLongitudeRef != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, this.gpsLongitudeRef);
- }
- if (this.gpsProcessingMethod != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD, this.gpsProcessingMethod);
- }
- if (this.gpsTimestamp != null) {
- this.outFile.setAttribute(ExifInterface.TAG_GPS_TIMESTAMP, this.gpsTimestamp);
- }
- if (this.iso != null) {
- this.outFile.setAttribute(ExifInterface.TAG_ISO, this.iso);
- }
- if (this.make != null) {
- this.outFile.setAttribute(ExifInterface.TAG_MAKE, this.make);
- }
- if (this.model != null) {
- this.outFile.setAttribute(ExifInterface.TAG_MODEL, this.model);
- }
- if (this.orientation != null) {
- this.outFile.setAttribute(ExifInterface.TAG_ORIENTATION, this.orientation);
- }
- if (this.whiteBalance != null) {
- this.outFile.setAttribute(ExifInterface.TAG_WHITE_BALANCE, this.whiteBalance);
- }
-
- this.outFile.saveAttributes();
- }
-
- public int getOrientation() {
- int o = Integer.parseInt(this.orientation);
-
- if (o == ExifInterface.ORIENTATION_NORMAL) {
- return 0;
- } else if (o == ExifInterface.ORIENTATION_ROTATE_90) {
- return 90;
- } else if (o == ExifInterface.ORIENTATION_ROTATE_180) {
- return 180;
- } else if (o == ExifInterface.ORIENTATION_ROTATE_270) {
- return 270;
- } else {
- return 0;
- }
- }
-
- public void resetOrientation() {
- this.orientation = "" + ExifInterface.ORIENTATION_NORMAL;
- }
-}
diff --git a/plugins/cordova-plugin-camera/src/android/FileHelper.java b/plugins/cordova-plugin-camera/src/android/FileHelper.java
deleted file mode 100644
index b1593f2..0000000
--- a/plugins/cordova-plugin-camera/src/android/FileHelper.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.cordova.camera;
-
-import android.annotation.SuppressLint;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.CursorLoader;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Environment;
-import android.provider.DocumentsContract;
-import android.provider.MediaStore;
-import android.webkit.MimeTypeMap;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.LOG;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Locale;
-
-public class FileHelper {
- private static final String LOG_TAG = "FileUtils";
- private static final String _DATA = "_data";
-
- /**
- * Returns the real path of the given URI string.
- * If the given URI string represents a content:// URI, the real path is retrieved from the media store.
- *
- * @param uriString the URI string of the audio/image/video
- * @param cordova the current application context
- * @return the full path to the file
- */
- @SuppressWarnings("deprecation")
- public static String getRealPath(Uri uri, CordovaInterface cordova) {
- String realPath = null;
-
- if (Build.VERSION.SDK_INT < 11)
- realPath = FileHelper.getRealPathFromURI_BelowAPI11(cordova.getActivity(), uri);
-
- // SDK >= 11 && SDK < 19
- else if (Build.VERSION.SDK_INT < 19)
- realPath = FileHelper.getRealPathFromURI_API11to18(cordova.getActivity(), uri);
-
- // SDK > 19 (Android 4.4)
- else
- realPath = FileHelper.getRealPathFromURI_API19(cordova.getActivity(), uri);
-
- return realPath;
- }
-
- /**
- * Returns the real path of the given URI.
- * If the given URI is a content:// URI, the real path is retrieved from the media store.
- *
- * @param uri the URI of the audio/image/video
- * @param cordova the current application context
- * @return the full path to the file
- */
- public static String getRealPath(String uriString, CordovaInterface cordova) {
- return FileHelper.getRealPath(Uri.parse(uriString), cordova);
- }
-
- @SuppressLint("NewApi")
- public static String getRealPathFromURI_API19(final Context context, final Uri uri) {
-
- // DocumentProvider
- if ( DocumentsContract.isDocumentUri(context, uri)) {
-
- // ExternalStorageProvider
- if (isExternalStorageDocument(uri)) {
- final String docId = DocumentsContract.getDocumentId(uri);
- final String[] split = docId.split(":");
- final String type = split[0];
-
- if ("primary".equalsIgnoreCase(type)) {
- return Environment.getExternalStorageDirectory() + "/" + split[1];
- }
-
- // TODO handle non-primary volumes
- }
- // DownloadsProvider
- else if (isDownloadsDocument(uri)) {
-
- final String id = DocumentsContract.getDocumentId(uri);
- final Uri contentUri = ContentUris.withAppendedId(
- Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
-
- return getDataColumn(context, contentUri, null, null);
- }
- // MediaProvider
- else if (isMediaDocument(uri)) {
- final String docId = DocumentsContract.getDocumentId(uri);
- final String[] split = docId.split(":");
- final String type = split[0];
-
- Uri contentUri = null;
- if ("image".equals(type)) {
- contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
- } else if ("video".equals(type)) {
- contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
- } else if ("audio".equals(type)) {
- contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
- }
-
- final String selection = "_id=?";
- final String[] selectionArgs = new String[] {
- split[1]
- };
-
- return getDataColumn(context, contentUri, selection, selectionArgs);
- }
- }
- // MediaStore (and general)
- else if ("content".equalsIgnoreCase(uri.getScheme())) {
-
- // Return the remote address
- if (isGooglePhotosUri(uri))
- return uri.getLastPathSegment();
-
- return getDataColumn(context, uri, null, null);
- }
- // File
- else if ("file".equalsIgnoreCase(uri.getScheme())) {
- return uri.getPath();
- }
-
- return null;
- }
-
- @SuppressLint("NewApi")
- public static String getRealPathFromURI_API11to18(Context context, Uri contentUri) {
- String[] proj = { MediaStore.Images.Media.DATA };
- String result = null;
-
- try {
- CursorLoader cursorLoader = new CursorLoader(context, contentUri, proj, null, null, null);
- Cursor cursor = cursorLoader.loadInBackground();
-
- if (cursor != null) {
- int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
- cursor.moveToFirst();
- result = cursor.getString(column_index);
- }
- } catch (Exception e) {
- result = null;
- }
- return result;
- }
-
- public static String getRealPathFromURI_BelowAPI11(Context context, Uri contentUri) {
- String[] proj = { MediaStore.Images.Media.DATA };
- String result = null;
-
- try {
- Cursor cursor = context.getContentResolver().query(contentUri, proj, null, null, null);
- int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
- cursor.moveToFirst();
- result = cursor.getString(column_index);
-
- } catch (Exception e) {
- result = null;
- }
- return result;
- }
-
- /**
- * Returns an input stream based on given URI string.
- *
- * @param uriString the URI string from which to obtain the input stream
- * @param cordova the current application context
- * @return an input stream into the data at the given URI or null if given an invalid URI string
- * @throws IOException
- */
- public static InputStream getInputStreamFromUriString(String uriString, CordovaInterface cordova)
- throws IOException {
- InputStream returnValue = null;
- if (uriString.startsWith("content")) {
- Uri uri = Uri.parse(uriString);
- returnValue = cordova.getActivity().getContentResolver().openInputStream(uri);
- } else if (uriString.startsWith("file://")) {
- int question = uriString.indexOf("?");
- if (question > -1) {
- uriString = uriString.substring(0, question);
- }
- if (uriString.startsWith("file:///android_asset/")) {
- Uri uri = Uri.parse(uriString);
- String relativePath = uri.getPath().substring(15);
- returnValue = cordova.getActivity().getAssets().open(relativePath);
- } else {
- // might still be content so try that first
- try {
- returnValue = cordova.getActivity().getContentResolver().openInputStream(Uri.parse(uriString));
- } catch (Exception e) {
- returnValue = null;
- }
- if (returnValue == null) {
- returnValue = new FileInputStream(getRealPath(uriString, cordova));
- }
- }
- } else {
- returnValue = new FileInputStream(uriString);
- }
- return returnValue;
- }
-
- /**
- * Removes the "file://" prefix from the given URI string, if applicable.
- * If the given URI string doesn't have a "file://" prefix, it is returned unchanged.
- *
- * @param uriString the URI string to operate on
- * @return a path without the "file://" prefix
- */
- public static String stripFileProtocol(String uriString) {
- if (uriString.startsWith("file://")) {
- uriString = uriString.substring(7);
- }
- return uriString;
- }
-
- public static String getMimeTypeForExtension(String path) {
- String extension = path;
- int lastDot = extension.lastIndexOf('.');
- if (lastDot != -1) {
- extension = extension.substring(lastDot + 1);
- }
- // Convert the URI string to lower case to ensure compatibility with MimeTypeMap (see CB-2185).
- extension = extension.toLowerCase(Locale.getDefault());
- if (extension.equals("3ga")) {
- return "audio/3gpp";
- }
- return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
- }
-
- /**
- * Returns the mime type of the data specified by the given URI string.
- *
- * @param uriString the URI string of the data
- * @return the mime type of the specified data
- */
- public static String getMimeType(String uriString, CordovaInterface cordova) {
- String mimeType = null;
-
- Uri uri = Uri.parse(uriString);
- if (uriString.startsWith("content://")) {
- mimeType = cordova.getActivity().getContentResolver().getType(uri);
- } else {
- mimeType = getMimeTypeForExtension(uri.getPath());
- }
-
- return mimeType;
- }
-
- /**
- * Get the value of the data column for this Uri. This is useful for
- * MediaStore Uris, and other file-based ContentProviders.
- *
- * @param context The context.
- * @param uri The Uri to query.
- * @param selection (Optional) Filter used in the query.
- * @param selectionArgs (Optional) Selection arguments used in the query.
- * @return The value of the _data column, which is typically a file path.
- * @author paulburke
- */
- public static String getDataColumn(Context context, Uri uri, String selection,
- String[] selectionArgs) {
-
- Cursor cursor = null;
- final String column = "_data";
- final String[] projection = {
- column
- };
-
- try {
- cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
- null);
- if (cursor != null && cursor.moveToFirst()) {
-
- final int column_index = cursor.getColumnIndexOrThrow(column);
- return cursor.getString(column_index);
- }
- } finally {
- if (cursor != null)
- cursor.close();
- }
- return null;
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is ExternalStorageProvider.
- * @author paulburke
- */
- public static boolean isExternalStorageDocument(Uri uri) {
- return "com.android.externalstorage.documents".equals(uri.getAuthority());
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is DownloadsProvider.
- * @author paulburke
- */
- public static boolean isDownloadsDocument(Uri uri) {
- return "com.android.providers.downloads.documents".equals(uri.getAuthority());
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is MediaProvider.
- * @author paulburke
- */
- public static boolean isMediaDocument(Uri uri) {
- return "com.android.providers.media.documents".equals(uri.getAuthority());
- }
-
- /**
- * @param uri The Uri to check.
- * @return Whether the Uri authority is Google Photos.
- */
- public static boolean isGooglePhotosUri(Uri uri) {
- return "com.google.android.apps.photos.content".equals(uri.getAuthority());
- }
-}
diff --git a/plugins/cordova-plugin-camera/src/android/PermissionHelper.java b/plugins/cordova-plugin-camera/src/android/PermissionHelper.java
deleted file mode 100644
index cf4247b..0000000
--- a/plugins/cordova-plugin-camera/src/android/PermissionHelper.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.camera;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-
-import android.content.pm.PackageManager;
-
-/**
- * This class provides reflective methods for permission requesting and checking so that plugins
- * written for cordova-android 5.0.0+ can still compile with earlier cordova-android versions.
- */
-public class PermissionHelper {
- private static final String LOG_TAG = "CordovaPermissionHelper";
-
- /**
- * Requests a "dangerous" permission for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermission() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permission request
- * @param permission The permission to be requested
- */
- public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
- PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
- }
-
- /**
- * Requests "dangerous" permissions for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermissions() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permissions are being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permissions request
- * @param permissions The permissions to be requested
- */
- public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
- try {
- Method requestPermission = CordovaInterface.class.getDeclaredMethod(
- "requestPermissions", CordovaPlugin.class, int.class, String[].class);
-
- // If there is no exception, then this is cordova-android 5.0.0+
- requestPermission.invoke(plugin.cordova, plugin, requestCode, permissions);
- } catch (NoSuchMethodException noSuchMethodException) {
- // cordova-android version is less than 5.0.0, so permission is implicitly granted
- LOG.d(LOG_TAG, "No need to request permissions " + Arrays.toString(permissions));
-
- // Notify the plugin that all were granted by using more reflection
- deliverPermissionResult(plugin, requestCode, permissions);
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when requesting permissions " + Arrays.toString(permissions), illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method does not throw any exceptions, so this should never be caught
- LOG.e(LOG_TAG, "invocationTargetException when requesting permissions " + Arrays.toString(permissions), invocationTargetException);
- }
- }
-
- /**
- * Checks at runtime to see if the application has been granted a permission. This is a helper
- * method alternative to cordovaInterface.hasPermission() that does not require the project to
- * be built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being checked against
- * @param permission The permission to be checked
- *
- * @return True if the permission has already been granted and false otherwise
- */
- public static boolean hasPermission(CordovaPlugin plugin, String permission) {
- try {
- Method hasPermission = CordovaInterface.class.getDeclaredMethod("hasPermission", String.class);
-
- // If there is no exception, then this is cordova-android 5.0.0+
- return (Boolean) hasPermission.invoke(plugin.cordova, permission);
- } catch (NoSuchMethodException noSuchMethodException) {
- // cordova-android version is less than 5.0.0, so permission is implicitly granted
- LOG.d(LOG_TAG, "No need to check for permission " + permission);
- return true;
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when checking permission " + permission, illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method does not throw any exceptions, so this should never be caught
- LOG.e(LOG_TAG, "invocationTargetException when checking permission " + permission, invocationTargetException);
- }
- return false;
- }
-
- private static void deliverPermissionResult(CordovaPlugin plugin, int requestCode, String[] permissions) {
- // Generate the request results
- int[] requestResults = new int[permissions.length];
- Arrays.fill(requestResults, PackageManager.PERMISSION_GRANTED);
-
- try {
- Method onRequestPermissionResult = CordovaPlugin.class.getDeclaredMethod(
- "onRequestPermissionResult", int.class, String[].class, int[].class);
-
- onRequestPermissionResult.invoke(plugin, requestCode, permissions, requestResults);
- } catch (NoSuchMethodException noSuchMethodException) {
- // Should never be caught since the plugin must be written for cordova-android 5.0.0+ if it
- // made it to this point
- LOG.e(LOG_TAG, "NoSuchMethodException when delivering permissions results", noSuchMethodException);
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when delivering permissions results", illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method may throw a JSONException. We are just duplicating cordova-android's
- // exception handling behavior here; all it does is log the exception in CordovaActivity,
- // print the stacktrace, and ignore it
- LOG.e(LOG_TAG, "InvocationTargetException when delivering permissions results", invocationTargetException);
- }
- }
-}
diff --git a/plugins/cordova-plugin-camera/src/blackberry10/index.js b/plugins/cordova-plugin-camera/src/blackberry10/index.js
deleted file mode 100644
index afc3539..0000000
--- a/plugins/cordova-plugin-camera/src/blackberry10/index.js
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* globals qnx, FileError, PluginResult */
-
-var PictureSourceType = {
- PHOTOLIBRARY : 0, // Choose image from picture library (same as SAVEDPHOTOALBUM for Android)
- CAMERA : 1, // Take picture from camera
- SAVEDPHOTOALBUM : 2 // Choose image from picture library (same as PHOTOLIBRARY for Android)
- },
- DestinationType = {
- DATA_URL: 0, // Return base64 encoded string
- FILE_URI: 1, // Return file uri (content://media/external/images/media/2 for Android)
- NATIVE_URI: 2 // Return native uri (eg. asset-library://... for iOS)
- },
- savePath = window.qnx.webplatform.getApplication().getEnv("HOME").replace('/data', '') + '/shared/camera/',
- invokeAvailable = true;
-
-//check for camera card - it isn't currently availble in work perimeter
-window.qnx.webplatform.getApplication().invocation.queryTargets(
- {
- type: 'image/jpeg',
- action: 'bb.action.CAPTURE',
- target_type: 'CARD'
- },
- function (error, targets) {
- invokeAvailable = !error && targets && targets instanceof Array &&
- targets.filter(function (t) { return t.default === 'sys.camera.card'; }).length > 0;
- }
-);
-
-//open a webview with getUserMedia camera card implementation when camera card not available
-function showCameraDialog (done, cancel, fail) {
- var wv = qnx.webplatform.createWebView(function () {
- wv.url = 'local:///chrome/camera.html';
- wv.allowQnxObject = true;
- wv.allowRpc = true;
- wv.zOrder = 1;
- wv.setGeometry(0, 0, screen.width, screen.height);
- wv.backgroundColor = 0x00000000;
- wv.active = true;
- wv.visible = true;
- wv.on('UserMediaRequest', function (evt, args) {
- wv.allowUserMedia(JSON.parse(args).id, 'CAMERA_UNIT_REAR');
- });
- wv.on('JavaScriptCallback', function (evt, data) {
- var args = JSON.parse(data).args;
- if (args[0] === 'cordova-plugin-camera') {
- if (args[1] === 'cancel') {
- cancel('User canceled');
- } else if (args[1] === 'error') {
- fail(args[2]);
- } else {
- saveImage(args[1], done, fail);
- }
- wv.un('JavaScriptCallback', arguments.callee);
- wv.visible = false;
- wv.destroy();
- qnx.webplatform.getApplication().unlockRotation();
- }
- });
- wv.on('Destroyed', function () {
- wv.delete();
- });
- qnx.webplatform.getApplication().lockRotation();
- qnx.webplatform.getController().dispatchEvent('webview.initialized', [wv]);
- });
-}
-
-//create unique name for saved file (same pattern as BB10 camera app)
-function imgName() {
- var date = new Date(),
- pad = function (n) { return n < 10 ? '0' + n : n; };
- return 'IMG_' + date.getFullYear() + pad(date.getMonth() + 1) + pad(date.getDate()) + '_' +
- pad(date.getHours()) + pad(date.getMinutes()) + pad(date.getSeconds()) + '.png';
-}
-
-//convert dataURI to Blob
-function dataURItoBlob(dataURI) {
- var byteString = atob(dataURI.split(',')[1]),
- mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0],
- arrayBuffer = new ArrayBuffer(byteString.length),
- ia = new Uint8Array(arrayBuffer),
- i;
- for (i = 0; i < byteString.length; i++) {
- ia[i] = byteString.charCodeAt(i);
- }
- return new Blob([new DataView(arrayBuffer)], { type: mimeString });
-}
-
-//save dataURI to file system and call success with path
-function saveImage(data, success, fail) {
- var name = savePath + imgName();
- require('lib/webview').setSandbox(false);
- window.webkitRequestFileSystem(window.PERSISTENT, 0, function (fs) {
- fs.root.getFile(name, { create: true }, function (entry) {
- entry.createWriter(function (writer) {
- writer.onwriteend = function () {
- success(name);
- };
- writer.onerror = fail;
- writer.write(dataURItoBlob(data));
- });
- }, fail);
- }, fail);
-}
-
-function encodeBase64(filePath, callback) {
- var sandbox = window.qnx.webplatform.getController().setFileSystemSandbox, // save original sandbox value
- errorHandler = function (err) {
- var msg = "An error occured: ";
-
- switch (err.code) {
- case FileError.NOT_FOUND_ERR:
- msg += "File or directory not found";
- break;
-
- case FileError.NOT_READABLE_ERR:
- msg += "File or directory not readable";
- break;
-
- case FileError.PATH_EXISTS_ERR:
- msg += "File or directory already exists";
- break;
-
- case FileError.TYPE_MISMATCH_ERR:
- msg += "Invalid file type";
- break;
-
- default:
- msg += "Unknown Error";
- break;
- }
-
- // set it back to original value
- window.qnx.webplatform.getController().setFileSystemSandbox = sandbox;
- callback(msg);
- },
- gotFile = function (fileEntry) {
- fileEntry.file(function (file) {
- var reader = new FileReader();
-
- reader.onloadend = function (e) {
- // set it back to original value
- window.qnx.webplatform.getController().setFileSystemSandbox = sandbox;
- callback(this.result);
- };
-
- reader.readAsDataURL(file);
- }, errorHandler);
- },
- onInitFs = function (fs) {
- window.qnx.webplatform.getController().setFileSystemSandbox = false;
- fs.root.getFile(filePath, {create: false}, gotFile, errorHandler);
- };
-
- window.webkitRequestFileSystem(window.TEMPORARY, 10 * 1024 * 1024, onInitFs, errorHandler); // set size to 10MB max
-}
-
-module.exports = {
- takePicture: function (success, fail, args, env) {
- var destinationType = JSON.parse(decodeURIComponent(args[1])),
- sourceType = JSON.parse(decodeURIComponent(args[2])),
- result = new PluginResult(args, env),
- done = function (data) {
- if (destinationType === DestinationType.FILE_URI) {
- data = "file://" + data;
- result.callbackOk(data, false);
- } else {
- encodeBase64(data, function (data) {
- if (/^data:/.test(data)) {
- data = data.slice(data.indexOf(",") + 1);
- result.callbackOk(data, false);
- } else {
- result.callbackError(data, false);
- }
- });
- }
- },
- cancel = function (reason) {
- result.callbackError(reason, false);
- },
- invoked = function (error) {
- if (error) {
- result.callbackError(error, false);
- }
- };
-
- switch(sourceType) {
- case PictureSourceType.CAMERA:
- if (invokeAvailable) {
- window.qnx.webplatform.getApplication().cards.camera.open("photo", done, cancel, invoked);
- } else {
- showCameraDialog(done, cancel, fail);
- }
- break;
-
- case PictureSourceType.PHOTOLIBRARY:
- case PictureSourceType.SAVEDPHOTOALBUM:
- window.qnx.webplatform.getApplication().cards.filePicker.open({
- mode: "Picker",
- type: ["picture"]
- }, done, cancel, invoked);
- break;
- }
-
- result.noResult(true);
- }
-};
diff --git a/plugins/cordova-plugin-camera/src/browser/CameraProxy.js b/plugins/cordova-plugin-camera/src/browser/CameraProxy.js
deleted file mode 100644
index 8f95c6f..0000000
--- a/plugins/cordova-plugin-camera/src/browser/CameraProxy.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-var HIGHEST_POSSIBLE_Z_INDEX = 2147483647;
-
-function takePicture(success, error, opts) {
- if (opts && opts[2] === 1) {
- capture(success, error);
- } else {
- var input = document.createElement('input');
- input.style.position = 'relative';
- input.style.zIndex = HIGHEST_POSSIBLE_Z_INDEX;
- input.type = 'file';
- input.name = 'files[]';
-
- input.onchange = function(inputEvent) {
- var reader = new FileReader();
- reader.onload = function(readerEvent) {
- input.parentNode.removeChild(input);
-
- var imageData = readerEvent.target.result;
-
- return success(imageData.substr(imageData.indexOf(',') + 1));
- };
-
- reader.readAsDataURL(inputEvent.target.files[0]);
- };
-
- document.body.appendChild(input);
- }
-}
-
-function capture(success, errorCallback) {
- var localMediaStream;
-
- var video = document.createElement('video');
- var button = document.createElement('button');
- var parent = document.createElement('div');
- parent.style.position = 'relative';
- parent.style.zIndex = HIGHEST_POSSIBLE_Z_INDEX;
- parent.appendChild(video);
- parent.appendChild(button);
-
- video.width = 320;
- video.height = 240;
- button.innerHTML = 'Capture!';
-
- button.onclick = function() {
- // create a canvas and capture a frame from video stream
- var canvas = document.createElement('canvas');
- canvas.getContext('2d').drawImage(video, 0, 0, 320, 240);
-
- // convert image stored in canvas to base64 encoded image
- var imageData = canvas.toDataURL('img/png');
- imageData = imageData.replace('data:image/png;base64,', '');
-
- // stop video stream, remove video and button.
- // Note that MediaStream.stop() is deprecated as of Chrome 47.
- if (localMediaStream.stop) {
- localMediaStream.stop();
- } else {
- localMediaStream.getTracks().forEach(function (track) {
- track.stop();
- });
- }
- parent.parentNode.removeChild(parent);
-
- return success(imageData);
- };
-
- navigator.getUserMedia = navigator.getUserMedia ||
- navigator.webkitGetUserMedia ||
- navigator.mozGetUserMedia ||
- navigator.msGetUserMedia;
-
- var successCallback = function(stream) {
- localMediaStream = stream;
- video.src = window.URL.createObjectURL(localMediaStream);
- video.play();
-
- document.body.appendChild(parent);
- };
-
- if (navigator.getUserMedia) {
- navigator.getUserMedia({video: true, audio: true}, successCallback, errorCallback);
- } else {
- alert('Browser does not support camera :(');
- }
-}
-
-module.exports = {
- takePicture: takePicture,
- cleanup: function(){}
-};
-
-require("cordova/exec/proxy").add("Camera",module.exports);
diff --git a/plugins/cordova-plugin-camera/src/firefoxos/CameraProxy.js b/plugins/cordova-plugin-camera/src/firefoxos/CameraProxy.js
deleted file mode 100644
index 1e3018e..0000000
--- a/plugins/cordova-plugin-camera/src/firefoxos/CameraProxy.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/* globals MozActivity */
-
-function takePicture(success, error, opts) {
- var pick = new MozActivity({
- name: "pick",
- data: {
- type: ["image/*"]
- }
- });
-
- pick.onerror = error || function() {};
-
- pick.onsuccess = function() {
- // image is returned as Blob in this.result.blob
- // we need to call success with url or base64 encoded image
- if (opts && opts.destinationType === 0) {
- // TODO: base64
- return;
- }
- if (!opts || !opts.destinationType || opts.destinationType > 0) {
- // url
- return success(window.URL.createObjectURL(this.result.blob));
- }
- };
-}
-
-module.exports = {
- takePicture: takePicture,
- cleanup: function(){}
-};
-
-require("cordova/exec/proxy").add("Camera", module.exports);
diff --git a/plugins/cordova-plugin-camera/src/ios/CDVCamera.h b/plugins/cordova-plugin-camera/src/ios/CDVCamera.h
deleted file mode 100644
index f64f66c..0000000
--- a/plugins/cordova-plugin-camera/src/ios/CDVCamera.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import
-#import
-
-enum CDVDestinationType {
- DestinationTypeDataUrl = 0,
- DestinationTypeFileUri,
- DestinationTypeNativeUri
-};
-typedef NSUInteger CDVDestinationType;
-
-enum CDVEncodingType {
- EncodingTypeJPEG = 0,
- EncodingTypePNG
-};
-typedef NSUInteger CDVEncodingType;
-
-enum CDVMediaType {
- MediaTypePicture = 0,
- MediaTypeVideo,
- MediaTypeAll
-};
-typedef NSUInteger CDVMediaType;
-
-@interface CDVPictureOptions : NSObject
-
-@property (strong) NSNumber* quality;
-@property (assign) CDVDestinationType destinationType;
-@property (assign) UIImagePickerControllerSourceType sourceType;
-@property (assign) CGSize targetSize;
-@property (assign) CDVEncodingType encodingType;
-@property (assign) CDVMediaType mediaType;
-@property (assign) BOOL allowsEditing;
-@property (assign) BOOL correctOrientation;
-@property (assign) BOOL saveToPhotoAlbum;
-@property (strong) NSDictionary* popoverOptions;
-@property (assign) UIImagePickerControllerCameraDevice cameraDirection;
-
-@property (assign) BOOL popoverSupported;
-@property (assign) BOOL usesGeolocation;
-@property (assign) BOOL cropToSize;
-
-+ (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command;
-
-@end
-
-@interface CDVCameraPicker : UIImagePickerController
-
-@property (strong) CDVPictureOptions* pictureOptions;
-
-@property (copy) NSString* callbackId;
-@property (copy) NSString* postUrl;
-@property (strong) UIPopoverController* pickerPopoverController;
-@property (assign) BOOL cropToSize;
-@property (strong) UIView* webView;
-
-+ (instancetype) createFromPictureOptions:(CDVPictureOptions*)options;
-
-@end
-
-// ======================================================================= //
-
-@interface CDVCamera : CDVPlugin
-{}
-
-@property (strong) CDVCameraPicker* pickerController;
-@property (strong) NSMutableDictionary *metadata;
-@property (strong, nonatomic) CLLocationManager *locationManager;
-@property (strong) NSData* data;
-
-/*
- * getPicture
- *
- * arguments:
- * 1: this is the javascript function that will be called with the results, the first parameter passed to the
- * javascript function is the picture as a Base64 encoded string
- * 2: this is the javascript function to be called if there was an error
- * options:
- * quality: integer between 1 and 100
- */
-- (void)takePicture:(CDVInvokedUrlCommand*)command;
-- (void)cleanup:(CDVInvokedUrlCommand*)command;
-- (void)repositionPopover:(CDVInvokedUrlCommand*)command;
-
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info;
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo;
-- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker;
-- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
-
-- (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation;
-- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
-
-@end
diff --git a/plugins/cordova-plugin-camera/src/ios/CDVCamera.m b/plugins/cordova-plugin-camera/src/ios/CDVCamera.m
deleted file mode 100644
index 1fae2e2..0000000
--- a/plugins/cordova-plugin-camera/src/ios/CDVCamera.m
+++ /dev/null
@@ -1,765 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVCamera.h"
-#import "CDVJpegHeaderWriter.h"
-#import "UIImage+CropScaleOrientation.h"
-#import
-#import
-#import
-#import
-#import
-#import
-#import
-#import
-#import
-
-#ifndef __CORDOVA_4_0_0
- #import
-#endif
-
-#define CDV_PHOTO_PREFIX @"cdv_photo_"
-
-static NSSet* org_apache_cordova_validArrowDirections;
-
-static NSString* toBase64(NSData* data) {
- SEL s1 = NSSelectorFromString(@"cdv_base64EncodedString");
- SEL s2 = NSSelectorFromString(@"base64EncodedString");
- SEL s3 = NSSelectorFromString(@"base64EncodedStringWithOptions:");
-
- if ([data respondsToSelector:s1]) {
- NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s1];
- return func(data, s1);
- } else if ([data respondsToSelector:s2]) {
- NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s2];
- return func(data, s2);
- } else if ([data respondsToSelector:s3]) {
- NSString* (*func)(id, SEL, NSUInteger) = (void *)[data methodForSelector:s3];
- return func(data, s3, 0);
- } else {
- return nil;
- }
-}
-
-@implementation CDVPictureOptions
-
-+ (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command
-{
- CDVPictureOptions* pictureOptions = [[CDVPictureOptions alloc] init];
-
- pictureOptions.quality = [command argumentAtIndex:0 withDefault:@(50)];
- pictureOptions.destinationType = [[command argumentAtIndex:1 withDefault:@(DestinationTypeFileUri)] unsignedIntegerValue];
- pictureOptions.sourceType = [[command argumentAtIndex:2 withDefault:@(UIImagePickerControllerSourceTypeCamera)] unsignedIntegerValue];
-
- NSNumber* targetWidth = [command argumentAtIndex:3 withDefault:nil];
- NSNumber* targetHeight = [command argumentAtIndex:4 withDefault:nil];
- pictureOptions.targetSize = CGSizeMake(0, 0);
- if ((targetWidth != nil) && (targetHeight != nil)) {
- pictureOptions.targetSize = CGSizeMake([targetWidth floatValue], [targetHeight floatValue]);
- }
-
- pictureOptions.encodingType = [[command argumentAtIndex:5 withDefault:@(EncodingTypeJPEG)] unsignedIntegerValue];
- pictureOptions.mediaType = [[command argumentAtIndex:6 withDefault:@(MediaTypePicture)] unsignedIntegerValue];
- pictureOptions.allowsEditing = [[command argumentAtIndex:7 withDefault:@(NO)] boolValue];
- pictureOptions.correctOrientation = [[command argumentAtIndex:8 withDefault:@(NO)] boolValue];
- pictureOptions.saveToPhotoAlbum = [[command argumentAtIndex:9 withDefault:@(NO)] boolValue];
- pictureOptions.popoverOptions = [command argumentAtIndex:10 withDefault:nil];
- pictureOptions.cameraDirection = [[command argumentAtIndex:11 withDefault:@(UIImagePickerControllerCameraDeviceRear)] unsignedIntegerValue];
-
- pictureOptions.popoverSupported = NO;
- pictureOptions.usesGeolocation = NO;
-
- return pictureOptions;
-}
-
-@end
-
-
-@interface CDVCamera ()
-
-@property (readwrite, assign) BOOL hasPendingOperation;
-
-@end
-
-@implementation CDVCamera
-
-+ (void)initialize
-{
- org_apache_cordova_validArrowDirections = [[NSSet alloc] initWithObjects:[NSNumber numberWithInt:UIPopoverArrowDirectionUp], [NSNumber numberWithInt:UIPopoverArrowDirectionDown], [NSNumber numberWithInt:UIPopoverArrowDirectionLeft], [NSNumber numberWithInt:UIPopoverArrowDirectionRight], [NSNumber numberWithInt:UIPopoverArrowDirectionAny], nil];
-}
-
-@synthesize hasPendingOperation, pickerController, locationManager;
-
-- (NSURL*) urlTransformer:(NSURL*)url
-{
- NSURL* urlToTransform = url;
-
- // for backwards compatibility - we check if this property is there
- SEL sel = NSSelectorFromString(@"urlTransformer");
- if ([self.commandDelegate respondsToSelector:sel]) {
- // grab the block from the commandDelegate
- NSURL* (^urlTransformer)(NSURL*) = ((id(*)(id, SEL))objc_msgSend)(self.commandDelegate, sel);
- // if block is not null, we call it
- if (urlTransformer) {
- urlToTransform = urlTransformer(url);
- }
- }
-
- return urlToTransform;
-}
-
-- (BOOL)usesGeolocation
-{
- id useGeo = [self.commandDelegate.settings objectForKey:[@"CameraUsesGeolocation" lowercaseString]];
- return [(NSNumber*)useGeo boolValue];
-}
-
-- (BOOL)popoverSupported
-{
- return (NSClassFromString(@"UIPopoverController") != nil) &&
- (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
-}
-
-- (void)takePicture:(CDVInvokedUrlCommand*)command
-{
- self.hasPendingOperation = YES;
-
- __weak CDVCamera* weakSelf = self;
-
- [self.commandDelegate runInBackground:^{
-
- CDVPictureOptions* pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
- pictureOptions.popoverSupported = [weakSelf popoverSupported];
- pictureOptions.usesGeolocation = [weakSelf usesGeolocation];
- pictureOptions.cropToSize = NO;
-
- BOOL hasCamera = [UIImagePickerController isSourceTypeAvailable:pictureOptions.sourceType];
- if (!hasCamera) {
- NSLog(@"Camera.getPicture: source type %lu not available.", (unsigned long)pictureOptions.sourceType);
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No camera available"];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- // Validate the app has permission to access the camera
- if (pictureOptions.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice respondsToSelector:@selector(authorizationStatusForMediaType:)]) {
- AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
- if (authStatus == AVAuthorizationStatusDenied ||
- authStatus == AVAuthorizationStatusRestricted) {
- // If iOS 8+, offer a link to the Settings app
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
- NSString* settingsButton = (&UIApplicationOpenSettingsURLString != NULL)
- ? NSLocalizedString(@"Settings", nil)
- : nil;
-#pragma clang diagnostic pop
-
- // Denied; show an alert
- dispatch_async(dispatch_get_main_queue(), ^{
- [[[UIAlertView alloc] initWithTitle:[[NSBundle mainBundle]
- objectForInfoDictionaryKey:@"CFBundleDisplayName"]
- message:NSLocalizedString(@"Access to the camera has been prohibited; please enable it in the Settings app to continue.", nil)
- delegate:weakSelf
- cancelButtonTitle:NSLocalizedString(@"OK", nil)
- otherButtonTitles:settingsButton, nil] show];
- });
- }
- }
-
- CDVCameraPicker* cameraPicker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
- weakSelf.pickerController = cameraPicker;
-
- cameraPicker.delegate = weakSelf;
- cameraPicker.callbackId = command.callbackId;
- // we need to capture this state for memory warnings that dealloc this object
- cameraPicker.webView = weakSelf.webView;
-
- // Perform UI operations on the main thread
- dispatch_async(dispatch_get_main_queue(), ^{
- // If a popover is already open, close it; we only want one at a time.
- if (([[weakSelf pickerController] pickerPopoverController] != nil) && [[[weakSelf pickerController] pickerPopoverController] isPopoverVisible]) {
- [[[weakSelf pickerController] pickerPopoverController] dismissPopoverAnimated:YES];
- [[[weakSelf pickerController] pickerPopoverController] setDelegate:nil];
- [[weakSelf pickerController] setPickerPopoverController:nil];
- }
-
- if ([weakSelf popoverSupported] && (pictureOptions.sourceType != UIImagePickerControllerSourceTypeCamera)) {
- if (cameraPicker.pickerPopoverController == nil) {
- cameraPicker.pickerPopoverController = [[NSClassFromString(@"UIPopoverController") alloc] initWithContentViewController:cameraPicker];
- }
- [weakSelf displayPopover:pictureOptions.popoverOptions];
- weakSelf.hasPendingOperation = NO;
- } else {
- [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^{
- weakSelf.hasPendingOperation = NO;
- }];
- }
- });
- }];
-}
-
-// Delegate for camera permission UIAlertView
-- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
-{
- // If Settings button (on iOS 8), open the settings app
- if (buttonIndex == 1) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
- if (&UIApplicationOpenSettingsURLString != NULL) {
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
- }
-#pragma clang diagnostic pop
- }
-
- // Dismiss the view
- [[self.pickerController presentingViewController] dismissViewControllerAnimated:YES completion:nil];
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"]; // error callback expects string ATM
-
- [self.commandDelegate sendPluginResult:result callbackId:self.pickerController.callbackId];
-
- self.hasPendingOperation = NO;
- self.pickerController = nil;
-}
-
-- (void)repositionPopover:(CDVInvokedUrlCommand*)command
-{
- NSDictionary* options = [command argumentAtIndex:0 withDefault:nil];
-
- [self displayPopover:options];
-}
-
-- (NSInteger)integerValueForKey:(NSDictionary*)dict key:(NSString*)key defaultValue:(NSInteger)defaultValue
-{
- NSInteger value = defaultValue;
-
- NSNumber* val = [dict valueForKey:key]; // value is an NSNumber
-
- if (val != nil) {
- value = [val integerValue];
- }
- return value;
-}
-
-- (void)displayPopover:(NSDictionary*)options
-{
- NSInteger x = 0;
- NSInteger y = 32;
- NSInteger width = 320;
- NSInteger height = 480;
- UIPopoverArrowDirection arrowDirection = UIPopoverArrowDirectionAny;
-
- if (options) {
- x = [self integerValueForKey:options key:@"x" defaultValue:0];
- y = [self integerValueForKey:options key:@"y" defaultValue:32];
- width = [self integerValueForKey:options key:@"width" defaultValue:320];
- height = [self integerValueForKey:options key:@"height" defaultValue:480];
- arrowDirection = [self integerValueForKey:options key:@"arrowDir" defaultValue:UIPopoverArrowDirectionAny];
- if (![org_apache_cordova_validArrowDirections containsObject:[NSNumber numberWithUnsignedInteger:arrowDirection]]) {
- arrowDirection = UIPopoverArrowDirectionAny;
- }
- }
-
- [[[self pickerController] pickerPopoverController] setDelegate:self];
- [[[self pickerController] pickerPopoverController] presentPopoverFromRect:CGRectMake(x, y, width, height)
- inView:[self.webView superview]
- permittedArrowDirections:arrowDirection
- animated:YES];
-}
-
-- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
-{
- if([navigationController isKindOfClass:[UIImagePickerController class]]){
- UIImagePickerController* cameraPicker = (UIImagePickerController*)navigationController;
-
- if(![cameraPicker.mediaTypes containsObject:(NSString*)kUTTypeImage]){
- [viewController.navigationItem setTitle:NSLocalizedString(@"Videos", nil)];
- }
- }
-}
-
-- (void)cleanup:(CDVInvokedUrlCommand*)command
-{
- // empty the tmp directory
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- NSError* err = nil;
- BOOL hasErrors = NO;
-
- // clear contents of NSTemporaryDirectory
- NSString* tempDirectoryPath = NSTemporaryDirectory();
- NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];
- NSString* fileName = nil;
- BOOL result;
-
- while ((fileName = [directoryEnumerator nextObject])) {
- // only delete the files we created
- if (![fileName hasPrefix:CDV_PHOTO_PREFIX]) {
- continue;
- }
- NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
- result = [fileMgr removeItemAtPath:filePath error:&err];
- if (!result && err) {
- NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
- hasErrors = YES;
- }
- }
-
- CDVPluginResult* pluginResult;
- if (hasErrors) {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:@"One or more files failed to be deleted."];
- } else {
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- }
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-}
-
-- (void)popoverControllerDidDismissPopover:(id)popoverController
-{
- UIPopoverController* pc = (UIPopoverController*)popoverController;
-
- [pc dismissPopoverAnimated:YES];
- pc.delegate = nil;
- if (self.pickerController && self.pickerController.callbackId && self.pickerController.pickerPopoverController) {
- self.pickerController.pickerPopoverController = nil;
- NSString* callbackId = self.pickerController.callbackId;
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no image selected"]; // error callback expects string ATM
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- self.hasPendingOperation = NO;
-}
-
-- (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPictureOptions*)options
-{
- NSData* data = nil;
-
- switch (options.encodingType) {
- case EncodingTypePNG:
- data = UIImagePNGRepresentation(image);
- break;
- case EncodingTypeJPEG:
- {
- if ((options.allowsEditing == NO) && (options.targetSize.width <= 0) && (options.targetSize.height <= 0) && (options.correctOrientation == NO) && (([options.quality integerValue] == 100) || (options.sourceType != UIImagePickerControllerSourceTypeCamera))){
- // use image unedited as requested , don't resize
- data = UIImageJPEGRepresentation(image, 1.0);
- } else {
- if (options.usesGeolocation) {
- NSDictionary* controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
- if (controllerMetadata) {
- self.data = data;
- self.metadata = [[NSMutableDictionary alloc] init];
-
- NSMutableDictionary* EXIFDictionary = [[controllerMetadata objectForKey:(NSString*)kCGImagePropertyExifDictionary]mutableCopy];
- if (EXIFDictionary) {
- [self.metadata setObject:EXIFDictionary forKey:(NSString*)kCGImagePropertyExifDictionary];
- }
-
- if (IsAtLeastiOSVersion(@"8.0")) {
- [[self locationManager] performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") withObject:nil afterDelay:0];
- }
- [[self locationManager] startUpdatingLocation];
- }
- } else {
- data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f);
- }
- }
- }
- break;
- default:
- break;
- };
-
- return data;
-}
-
-- (NSString*)tempFilePath:(NSString*)extension
-{
- NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];
- NSFileManager* fileMgr = [[NSFileManager alloc] init]; // recommended by Apple (vs [NSFileManager defaultManager]) to be threadsafe
- NSString* filePath;
-
- // generate unique file name
- int i = 1;
- do {
- filePath = [NSString stringWithFormat:@"%@/%@%03d.%@", docsPath, CDV_PHOTO_PREFIX, i++, extension];
- } while ([fileMgr fileExistsAtPath:filePath]);
-
- return filePath;
-}
-
-- (UIImage*)retrieveImage:(NSDictionary*)info options:(CDVPictureOptions*)options
-{
- // get the image
- UIImage* image = nil;
- if (options.allowsEditing && [info objectForKey:UIImagePickerControllerEditedImage]) {
- image = [info objectForKey:UIImagePickerControllerEditedImage];
- } else {
- image = [info objectForKey:UIImagePickerControllerOriginalImage];
- }
-
- if (options.correctOrientation) {
- image = [image imageCorrectedForCaptureOrientation];
- }
-
- UIImage* scaledImage = nil;
-
- if ((options.targetSize.width > 0) && (options.targetSize.height > 0)) {
- // if cropToSize, resize image and crop to target size, otherwise resize to fit target without cropping
- if (options.cropToSize) {
- scaledImage = [image imageByScalingAndCroppingForSize:options.targetSize];
- } else {
- scaledImage = [image imageByScalingNotCroppingForSize:options.targetSize];
- }
- }
-
- return (scaledImage == nil ? image : scaledImage);
-}
-
-- (void)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info completion:(void (^)(CDVPluginResult* res))completion
-{
- CDVPluginResult* result = nil;
- BOOL saveToPhotoAlbum = options.saveToPhotoAlbum;
- UIImage* image = nil;
-
- switch (options.destinationType) {
- case DestinationTypeNativeUri:
- {
- NSURL* url = [info objectForKey:UIImagePickerControllerReferenceURL];
- saveToPhotoAlbum = NO;
- // If, for example, we use sourceType = Camera, URL might be nil because image is stored in memory.
- // In this case we must save image to device before obtaining an URI.
- if (url == nil) {
- image = [self retrieveImage:info options:options];
- ALAssetsLibrary* library = [ALAssetsLibrary new];
- [library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)(image.imageOrientation) completionBlock:^(NSURL *assetURL, NSError *error) {
- CDVPluginResult* resultToReturn = nil;
- if (error) {
- resultToReturn = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]];
- } else {
- NSString* nativeUri = [[self urlTransformer:assetURL] absoluteString];
- resultToReturn = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
- }
- completion(resultToReturn);
- }];
- return;
- } else {
- NSString* nativeUri = [[self urlTransformer:url] absoluteString];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
- }
- }
- break;
- case DestinationTypeFileUri:
- {
- image = [self retrieveImage:info options:options];
- NSData* data = [self processImage:image info:info options:options];
- if (data) {
-
- NSString* extension = options.encodingType == EncodingTypePNG? @"png" : @"jpg";
- NSString* filePath = [self tempFilePath:extension];
- NSError* err = nil;
-
- // save file
- if (![data writeToFile:filePath options:NSAtomicWrite error:&err]) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[[self urlTransformer:[NSURL fileURLWithPath:filePath]] absoluteString]];
- }
- }
- }
- break;
- case DestinationTypeDataUrl:
- {
- image = [self retrieveImage:info options:options];
- NSData* data = [self processImage:image info:info options:options];
- if (data) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:toBase64(data)];
- }
- }
- break;
- default:
- break;
- };
-
- if (saveToPhotoAlbum && image) {
- ALAssetsLibrary* library = [ALAssetsLibrary new];
- [library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)(image.imageOrientation) completionBlock:nil];
- }
-
- completion(result);
-}
-
-- (CDVPluginResult*)resultForVideo:(NSDictionary*)info
-{
- NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
- return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath];
-}
-
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
-{
- __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
- __weak CDVCamera* weakSelf = self;
-
- dispatch_block_t invoke = ^(void) {
- __block CDVPluginResult* result = nil;
-
- NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
- if ([mediaType isEqualToString:(NSString*)kUTTypeImage]) {
- [weakSelf resultForImage:cameraPicker.pictureOptions info:info completion:^(CDVPluginResult* res) {
- [weakSelf.commandDelegate sendPluginResult:res callbackId:cameraPicker.callbackId];
- weakSelf.hasPendingOperation = NO;
- weakSelf.pickerController = nil;
- }];
- }
- else {
- result = [weakSelf resultForVideo:info];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
- weakSelf.hasPendingOperation = NO;
- weakSelf.pickerController = nil;
- }
- };
-
- if (cameraPicker.pictureOptions.popoverSupported && (cameraPicker.pickerPopoverController != nil)) {
- [cameraPicker.pickerPopoverController dismissPopoverAnimated:YES];
- cameraPicker.pickerPopoverController.delegate = nil;
- cameraPicker.pickerPopoverController = nil;
- invoke();
- } else {
- [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:invoke];
- }
-}
-
-// older api calls newer didFinishPickingMediaWithInfo
-- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo
-{
- NSDictionary* imageInfo = [NSDictionary dictionaryWithObject:image forKey:UIImagePickerControllerOriginalImage];
-
- [self imagePickerController:picker didFinishPickingMediaWithInfo:imageInfo];
-}
-
-- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
-{
- __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
- __weak CDVCamera* weakSelf = self;
-
- dispatch_block_t invoke = ^ (void) {
- CDVPluginResult* result;
- if (picker.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != ALAuthorizationStatusAuthorized) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"];
- } else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no image selected"];
- }
-
-
- [weakSelf.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
-
- weakSelf.hasPendingOperation = NO;
- weakSelf.pickerController = nil;
- };
-
- [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:invoke];
-}
-
-- (CLLocationManager*)locationManager
-{
- if (locationManager != nil) {
- return locationManager;
- }
-
- locationManager = [[CLLocationManager alloc] init];
- [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
- [locationManager setDelegate:self];
-
- return locationManager;
-}
-
-- (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation
-{
- if (locationManager == nil) {
- return;
- }
-
- [self.locationManager stopUpdatingLocation];
- self.locationManager = nil;
-
- NSMutableDictionary *GPSDictionary = [[NSMutableDictionary dictionary] init];
-
- CLLocationDegrees latitude = newLocation.coordinate.latitude;
- CLLocationDegrees longitude = newLocation.coordinate.longitude;
-
- // latitude
- if (latitude < 0.0) {
- latitude = latitude * -1.0f;
- [GPSDictionary setObject:@"S" forKey:(NSString*)kCGImagePropertyGPSLatitudeRef];
- } else {
- [GPSDictionary setObject:@"N" forKey:(NSString*)kCGImagePropertyGPSLatitudeRef];
- }
- [GPSDictionary setObject:[NSNumber numberWithFloat:latitude] forKey:(NSString*)kCGImagePropertyGPSLatitude];
-
- // longitude
- if (longitude < 0.0) {
- longitude = longitude * -1.0f;
- [GPSDictionary setObject:@"W" forKey:(NSString*)kCGImagePropertyGPSLongitudeRef];
- }
- else {
- [GPSDictionary setObject:@"E" forKey:(NSString*)kCGImagePropertyGPSLongitudeRef];
- }
- [GPSDictionary setObject:[NSNumber numberWithFloat:longitude] forKey:(NSString*)kCGImagePropertyGPSLongitude];
-
- // altitude
- CGFloat altitude = newLocation.altitude;
- if (!isnan(altitude)){
- if (altitude < 0) {
- altitude = -altitude;
- [GPSDictionary setObject:@"1" forKey:(NSString *)kCGImagePropertyGPSAltitudeRef];
- } else {
- [GPSDictionary setObject:@"0" forKey:(NSString *)kCGImagePropertyGPSAltitudeRef];
- }
- [GPSDictionary setObject:[NSNumber numberWithFloat:altitude] forKey:(NSString *)kCGImagePropertyGPSAltitude];
- }
-
- // Time and date
- NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
- [formatter setDateFormat:@"HH:mm:ss.SSSSSS"];
- [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
- [GPSDictionary setObject:[formatter stringFromDate:newLocation.timestamp] forKey:(NSString *)kCGImagePropertyGPSTimeStamp];
- [formatter setDateFormat:@"yyyy:MM:dd"];
- [GPSDictionary setObject:[formatter stringFromDate:newLocation.timestamp] forKey:(NSString *)kCGImagePropertyGPSDateStamp];
-
- [self.metadata setObject:GPSDictionary forKey:(NSString *)kCGImagePropertyGPSDictionary];
- [self imagePickerControllerReturnImageResult];
-}
-
-- (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error
-{
- if (locationManager == nil) {
- return;
- }
-
- [self.locationManager stopUpdatingLocation];
- self.locationManager = nil;
-
- [self imagePickerControllerReturnImageResult];
-}
-
-- (void)imagePickerControllerReturnImageResult
-{
- CDVPictureOptions* options = self.pickerController.pictureOptions;
- CDVPluginResult* result = nil;
-
- if (self.metadata) {
- CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge CFDataRef)self.data, NULL);
- CFStringRef sourceType = CGImageSourceGetType(sourceImage);
-
- CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);
- CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, (__bridge CFDictionaryRef)self.metadata);
- CGImageDestinationFinalize(destinationImage);
-
- CFRelease(sourceImage);
- CFRelease(destinationImage);
- }
-
- switch (options.destinationType) {
- case DestinationTypeFileUri:
- {
- NSError* err = nil;
- NSString* extension = self.pickerController.pictureOptions.encodingType == EncodingTypePNG ? @"png":@"jpg";
- NSString* filePath = [self tempFilePath:extension];
-
- // save file
- if (![self.data writeToFile:filePath options:NSAtomicWrite error:&err]) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
- }
- else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[[self urlTransformer:[NSURL fileURLWithPath:filePath]] absoluteString]];
- }
- }
- break;
- case DestinationTypeDataUrl:
- {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:toBase64(self.data)];
- }
- break;
- case DestinationTypeNativeUri:
- default:
- break;
- };
-
- if (result) {
- [self.commandDelegate sendPluginResult:result callbackId:self.pickerController.callbackId];
- }
-
- self.hasPendingOperation = NO;
- self.pickerController = nil;
- self.data = nil;
- self.metadata = nil;
-
- if (options.saveToPhotoAlbum) {
- ALAssetsLibrary *library = [ALAssetsLibrary new];
- [library writeImageDataToSavedPhotosAlbum:self.data metadata:self.metadata completionBlock:nil];
- }
-}
-
-@end
-
-@implementation CDVCameraPicker
-
-- (BOOL)prefersStatusBarHidden
-{
- return YES;
-}
-
-- (UIViewController*)childViewControllerForStatusBarHidden
-{
- return nil;
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
- SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
- if ([self respondsToSelector:sel]) {
- [self performSelector:sel withObject:nil afterDelay:0];
- }
-
- [super viewWillAppear:animated];
-}
-
-+ (instancetype) createFromPictureOptions:(CDVPictureOptions*)pictureOptions;
-{
- CDVCameraPicker* cameraPicker = [[CDVCameraPicker alloc] init];
- cameraPicker.pictureOptions = pictureOptions;
- cameraPicker.sourceType = pictureOptions.sourceType;
- cameraPicker.allowsEditing = pictureOptions.allowsEditing;
-
- if (cameraPicker.sourceType == UIImagePickerControllerSourceTypeCamera) {
- // We only allow taking pictures (no video) in this API.
- cameraPicker.mediaTypes = @[(NSString*)kUTTypeImage];
- // We can only set the camera device if we're actually using the camera.
- cameraPicker.cameraDevice = pictureOptions.cameraDirection;
- } else if (pictureOptions.mediaType == MediaTypeAll) {
- cameraPicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:cameraPicker.sourceType];
- } else {
- NSArray* mediaArray = @[(NSString*)(pictureOptions.mediaType == MediaTypeVideo ? kUTTypeMovie : kUTTypeImage)];
- cameraPicker.mediaTypes = mediaArray;
- }
-
- return cameraPicker;
-}
-
-@end
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/src/ios/CDVExif.h b/plugins/cordova-plugin-camera/src/ios/CDVExif.h
deleted file mode 100644
index 3e8adbd..0000000
--- a/plugins/cordova-plugin-camera/src/ios/CDVExif.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#ifndef CordovaLib_ExifData_h
-#define CordovaLib_ExifData_h
-
-// exif data types
-typedef enum exifDataTypes {
- EDT_UBYTE = 1, // 8 bit unsigned integer
- EDT_ASCII_STRING, // 8 bits containing 7 bit ASCII code, null terminated
- EDT_USHORT, // 16 bit unsigned integer
- EDT_ULONG, // 32 bit unsigned integer
- EDT_URATIONAL, // 2 longs, first is numerator and second is denominator
- EDT_SBYTE,
- EDT_UNDEFINED, // 8 bits
- EDT_SSHORT,
- EDT_SLONG, // 32bit signed integer (2's complement)
- EDT_SRATIONAL, // 2 SLONGS, first long is numerator, second is denominator
- EDT_SINGLEFLOAT,
- EDT_DOUBLEFLOAT
-} ExifDataTypes;
-
-// maps integer code for exif data types to width in bytes
-static const int DataTypeToWidth[] = {1,1,2,4,8,1,1,2,4,8,4,8};
-
-static const int RECURSE_HORIZON = 8;
-#endif
diff --git a/plugins/cordova-plugin-camera/src/ios/CDVJpegHeaderWriter.h b/plugins/cordova-plugin-camera/src/ios/CDVJpegHeaderWriter.h
deleted file mode 100644
index 3b43ef0..0000000
--- a/plugins/cordova-plugin-camera/src/ios/CDVJpegHeaderWriter.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-
-@interface CDVJpegHeaderWriter : NSObject {
- NSDictionary * SubIFDTagFormatDict;
- NSDictionary * IFD0TagFormatDict;
-}
-
-- (NSData*) spliceExifBlockIntoJpeg: (NSData*) jpegdata
- withExifBlock: (NSString*) exifstr;
-- (NSString*) createExifAPP1 : (NSDictionary*) datadict;
-- (NSString*) formattedHexStringFromDecimalNumber: (NSNumber*) numb
- withPlaces: (NSNumber*) width;
-- (NSString*) formatNumberWithLeadingZeroes: (NSNumber*) numb
- withPlaces: (NSNumber*) places;
-- (NSString*) decimalToUnsignedRational: (NSNumber*) numb
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator;
-- (void) continuedFraction: (double) val
- withFractionList: (NSMutableArray*) fractionlist
- withHorizon: (int) horizon;
-//- (void) expandContinuedFraction: (NSArray*) fractionlist;
-- (void) splitDouble: (double) val
- withIntComponent: (int*) rightside
- withFloatRemainder: (double*) leftside;
-- (NSString*) formatRationalWithNumerator: (NSNumber*) numerator
- withDenominator: (NSNumber*) denominator
- asSigned: (Boolean) signedFlag;
-- (NSString*) hexStringFromData : (NSData*) data;
-- (NSNumber*) numericFromHexString : (NSString *) hexstring;
-
-/*
-- (void) readExifMetaData : (NSData*) imgdata;
-- (void) spliceImageData : (NSData*) imgdata withExifData: (NSDictionary*) exifdata;
-- (void) locateExifMetaData : (NSData*) imgdata;
-- (NSString*) createExifAPP1 : (NSDictionary*) datadict;
-- (void) createExifDataString : (NSDictionary*) datadict;
-- (NSString*) createDataElement : (NSString*) element
- withElementData: (NSString*) data
- withExternalDataBlock: (NSDictionary*) memblock;
-- (NSString*) hexStringFromData : (NSData*) data;
-- (NSNumber*) numericFromHexString : (NSString *) hexstring;
-*/
-@end
diff --git a/plugins/cordova-plugin-camera/src/ios/CDVJpegHeaderWriter.m b/plugins/cordova-plugin-camera/src/ios/CDVJpegHeaderWriter.m
deleted file mode 100644
index 4d3ea24..0000000
--- a/plugins/cordova-plugin-camera/src/ios/CDVJpegHeaderWriter.m
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVJpegHeaderWriter.h"
-#include "CDVExif.h"
-
-/* macros for tag info shorthand:
- tagno : tag number
- typecode : data type
- components : number of components
- appendString (TAGINF_W_APPEND only) : string to append to data
- Exif date data format include an extra 0x00 to the end of the data
- */
-#define TAGINF(tagno, typecode, components) [NSArray arrayWithObjects: tagno, typecode, components, nil]
-#define TAGINF_W_APPEND(tagno, typecode, components, appendString) [NSArray arrayWithObjects: tagno, typecode, components, appendString, nil]
-
-const uint mJpegId = 0xffd8; // JPEG format marker
-const uint mExifMarker = 0xffe1; // APP1 jpeg header marker
-const uint mExif = 0x45786966; // ASCII 'Exif', first characters of valid exif header after size
-const uint mMotorallaByteAlign = 0x4d4d; // 'MM', motorola byte align, msb first or 'sane'
-const uint mIntelByteAlgin = 0x4949; // 'II', Intel byte align, lsb first or 'batshit crazy reverso world'
-const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a(MM) or 0x2a00(II), tiff version number
-
-
-@implementation CDVJpegHeaderWriter
-
-- (id) init {
- self = [super init];
- // supported tags for exif IFD
- IFD0TagFormatDict = [[NSDictionary alloc] initWithObjectsAndKeys:
- // TAGINF(@"010e", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"ImageDescription",
- TAGINF_W_APPEND(@"0132", [NSNumber numberWithInt:EDT_ASCII_STRING], @20, @"00"), @"DateTime",
- TAGINF(@"010f", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Make",
- TAGINF(@"0110", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Model",
- TAGINF(@"0131", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Software",
- TAGINF(@"011a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"XResolution",
- TAGINF(@"011b", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"YResolution",
- // currently supplied outside of Exif data block by UIImagePickerControllerMediaMetadata, this is set manually in CDVCamera.m
- /* TAGINF(@"0112", [NSNumber numberWithInt:EDT_USHORT], @1), @"Orientation",
-
- // rest of the tags are supported by exif spec, but are not specified by UIImagePickerControllerMediaMedadata
- // should camera hardware supply these values in future versions, or if they can be derived, ImageHeaderWriter will include them gracefully
- TAGINF(@"0128", [NSNumber numberWithInt:EDT_USHORT], @1), @"ResolutionUnit",
- TAGINF(@"013e", [NSNumber numberWithInt:EDT_URATIONAL], @2), @"WhitePoint",
- TAGINF(@"013f", [NSNumber numberWithInt:EDT_URATIONAL], @6), @"PrimaryChromaticities",
- TAGINF(@"0211", [NSNumber numberWithInt:EDT_URATIONAL], @3), @"YCbCrCoefficients",
- TAGINF(@"0213", [NSNumber numberWithInt:EDT_USHORT], @1), @"YCbCrPositioning",
- TAGINF(@"0214", [NSNumber numberWithInt:EDT_URATIONAL], @6), @"ReferenceBlackWhite",
- TAGINF(@"8298", [NSNumber numberWithInt:EDT_URATIONAL], @0), @"Copyright",
-
- // offset to exif subifd, we determine this dynamically based on the size of the main exif IFD
- TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1), @"ExifOffset",*/
- nil];
-
-
- // supported tages for exif subIFD
- SubIFDTagFormatDict = [[NSDictionary alloc] initWithObjectsAndKeys:
- //TAGINF(@"9000", [NSNumber numberWithInt:], @), @"ExifVersion",
- //TAGINF(@"9202",[NSNumber numberWithInt:EDT_URATIONAL],@1), @"ApertureValue",
- //TAGINF(@"9203",[NSNumber numberWithInt:EDT_SRATIONAL],@1), @"BrightnessValue",
- TAGINF(@"a001",[NSNumber numberWithInt:EDT_USHORT],@1), @"ColorSpace",
- TAGINF_W_APPEND(@"9004",[NSNumber numberWithInt:EDT_ASCII_STRING],@20,@"00"), @"DateTimeDigitized",
- TAGINF_W_APPEND(@"9003",[NSNumber numberWithInt:EDT_ASCII_STRING],@20,@"00"), @"DateTimeOriginal",
- TAGINF(@"a402", [NSNumber numberWithInt:EDT_USHORT], @1), @"ExposureMode",
- TAGINF(@"8822", [NSNumber numberWithInt:EDT_USHORT], @1), @"ExposureProgram",
- //TAGINF(@"829a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"ExposureTime",
- //TAGINF(@"829d", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"FNumber",
- TAGINF(@"9209", [NSNumber numberWithInt:EDT_USHORT], @1), @"Flash",
- // FocalLengthIn35mmFilm
- TAGINF(@"a405", [NSNumber numberWithInt:EDT_USHORT], @1), @"FocalLenIn35mmFilm",
- //TAGINF(@"920a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"FocalLength",
- //TAGINF(@"8827", [NSNumber numberWithInt:EDT_USHORT], @2), @"ISOSpeedRatings",
- TAGINF(@"9207", [NSNumber numberWithInt:EDT_USHORT],@1), @"MeteringMode",
- // specific to compressed data
- TAGINF(@"a002", [NSNumber numberWithInt:EDT_ULONG],@1), @"PixelXDimension",
- TAGINF(@"a003", [NSNumber numberWithInt:EDT_ULONG],@1), @"PixelYDimension",
- // data type undefined, but this is a DSC camera, so value is always 1, treat as ushort
- TAGINF(@"a301", [NSNumber numberWithInt:EDT_USHORT],@1), @"SceneType",
- TAGINF(@"a217",[NSNumber numberWithInt:EDT_USHORT],@1), @"SensingMethod",
- //TAGINF(@"9201", [NSNumber numberWithInt:EDT_SRATIONAL], @1), @"ShutterSpeedValue",
- // specifies location of main subject in scene (x,y,wdith,height) expressed before rotation processing
- //TAGINF(@"9214", [NSNumber numberWithInt:EDT_USHORT], @4), @"SubjectArea",
- TAGINF(@"a403", [NSNumber numberWithInt:EDT_USHORT], @1), @"WhiteBalance",
- nil];
- return self;
-}
-
-- (NSData*) spliceExifBlockIntoJpeg: (NSData*) jpegdata withExifBlock: (NSString*) exifstr {
-
- CDVJpegHeaderWriter * exifWriter = [[CDVJpegHeaderWriter alloc] init];
-
- NSMutableData * exifdata = [NSMutableData dataWithCapacity: [exifstr length]/2];
- int idx;
- for (idx = 0; idx+1 < [exifstr length]; idx+=2) {
- NSRange range = NSMakeRange(idx, 2);
- NSString* hexStr = [exifstr substringWithRange:range];
- NSScanner* scanner = [NSScanner scannerWithString:hexStr];
- unsigned int intValue;
- [scanner scanHexInt:&intValue];
- [exifdata appendBytes:&intValue length:1];
- }
-
- NSMutableData * ddata = [NSMutableData dataWithCapacity: [jpegdata length]];
- NSMakeRange(0,4);
- int loc = 0;
- bool done = false;
- // read the jpeg data until we encounter the app1==0xFFE1 marker
- while (loc+1 < [jpegdata length]) {
- NSData * blag = [jpegdata subdataWithRange: NSMakeRange(loc,2)];
- if( [[blag description] isEqualToString : @""]) {
- // read the APP1 block size bits
- NSString * the = [exifWriter hexStringFromData:[jpegdata subdataWithRange: NSMakeRange(loc+2,2)]];
- NSNumber * app1width = [exifWriter numericFromHexString:the];
- //consume the original app1 block
- [ddata appendData:exifdata];
- // advance our loc marker past app1
- loc += [app1width intValue] + 2;
- done = true;
- } else {
- if(!done) {
- [ddata appendData:blag];
- loc += 2;
- } else {
- break;
- }
- }
- }
- // copy the remaining data
- [ddata appendData:[jpegdata subdataWithRange: NSMakeRange(loc,[jpegdata length]-loc)]];
- return ddata;
-}
-
-
-
-/**
- * Create the Exif data block as a hex string
- * jpeg uses Application Markers (APP's) as markers for application data
- * APP1 is the application marker reserved for exif data
- *
- * (NSDictionary*) datadict - with subdictionaries marked '{TIFF}' and '{EXIF}' as returned by imagePickerController with a valid
- * didFinishPickingMediaWithInfo data dict, under key @"UIImagePickerControllerMediaMetadata"
- *
- * the following constructs a hex string to Exif specifications, and is therefore brittle
- * altering the order of arguments to the string constructors, modifying field sizes or formats,
- * and any other minor change will likely prevent the exif data from being read
- */
-- (NSString*) createExifAPP1 : (NSDictionary*) datadict {
- NSMutableString * app1; // holds finalized product
- NSString * exifIFD; // exif information file directory
- NSString * subExifIFD; // subexif information file directory
-
- // FFE1 is the hex APP1 marker code, and will allow client apps to read the data
- NSString * app1marker = @"ffe1";
- // SSSS size, to be determined
- // EXIF ascii characters followed by 2bytes of zeros
- NSString * exifmarker = @"457869660000";
- // Tiff header: 4d4d is motorolla byte align (big endian), 002a is hex for 42
- NSString * tiffheader = @"4d4d002a";
- //first IFD offset from the Tiff header to IFD0. Since we are writing it, we know it's address 0x08
- NSString * ifd0offset = @"00000008";
- // current offset to next data area
- int currentDataOffset = 0;
-
- //data labeled as TIFF in UIImagePickerControllerMediaMetaData is part of the EXIF IFD0 portion of APP1
- exifIFD = [self createExifIFDFromDict: [datadict objectForKey:@"{TIFF}"] withFormatDict: IFD0TagFormatDict isIFD0:YES currentDataOffset:¤tDataOffset];
-
- //data labeled as EXIF in UIImagePickerControllerMediaMetaData is part of the EXIF Sub IFD portion of APP1
- subExifIFD = [self createExifIFDFromDict: [datadict objectForKey:@"{Exif}"] withFormatDict: SubIFDTagFormatDict isIFD0:NO currentDataOffset:¤tDataOffset];
- /*
- NSLog(@"SUB EXIF IFD %@ WITH SIZE: %d",exifIFD,[exifIFD length]);
-
- NSLog(@"SUB EXIF IFD %@ WITH SIZE: %d",subExifIFD,[subExifIFD length]);
- */
- // construct the complete app1 data block
- app1 = [[NSMutableString alloc] initWithFormat: @"%@%04x%@%@%@%@%@",
- app1marker,
- (unsigned int)(16 + ([exifIFD length]/2) + ([subExifIFD length]/2)) /*16+[exifIFD length]/2*/,
- exifmarker,
- tiffheader,
- ifd0offset,
- exifIFD,
- subExifIFD];
-
- return app1;
-}
-
-// returns hex string representing a valid exif information file directory constructed from the datadict and formatdict
-- (NSString*) createExifIFDFromDict : (NSDictionary*) datadict
- withFormatDict : (NSDictionary*) formatdict
- isIFD0 : (BOOL) ifd0flag
- currentDataOffset : (int*) dataoffset {
- NSArray * datakeys = [datadict allKeys]; // all known data keys
- NSArray * knownkeys = [formatdict allKeys]; // only keys in knowkeys are considered for entry in this IFD
- NSMutableArray * ifdblock = [[NSMutableArray alloc] initWithCapacity: [datadict count]]; // all ifd entries
- NSMutableArray * ifddatablock = [[NSMutableArray alloc] initWithCapacity: [datadict count]]; // data block entries
- // ifd0flag = NO; // ifd0 requires a special flag and has offset to next ifd appended to end
-
- // iterate through known provided data keys
- for (int i = 0; i < [datakeys count]; i++) {
- NSString * key = [datakeys objectAtIndex:i];
- // don't muck about with unknown keys
- if ([knownkeys indexOfObject: key] != NSNotFound) {
- // create new IFD entry
- NSString * entry = [self createIFDElement: key
- withFormat: [formatdict objectForKey:key]
- withElementData: [datadict objectForKey:key]];
- // create the IFD entry's data block
- NSString * data = [self createIFDElementDataWithFormat: [formatdict objectForKey:key]
- withData: [datadict objectForKey:key]];
- if (entry) {
- [ifdblock addObject:entry];
- if(!data) {
- [ifdblock addObject:@""];
- } else {
- [ifddatablock addObject:data];
- }
- }
- }
- }
-
- NSMutableString * exifstr = [[NSMutableString alloc] initWithCapacity: [ifdblock count] * 24];
- NSMutableString * dbstr = [[NSMutableString alloc] initWithCapacity: 100];
-
- int addr=*dataoffset; // current offset/address in datablock
- if (ifd0flag) {
- // calculate offset to datablock based on ifd file entry count
- addr += 14+(12*([ifddatablock count]+1)); // +1 for tag 0x8769, exifsubifd offset
- } else {
- // current offset + numSubIFDs (2-bytes) + 12*numSubIFDs + endMarker (4-bytes)
- addr += 2+(12*[ifddatablock count])+4;
- }
-
- for (int i = 0; i < [ifdblock count]; i++) {
- NSString * entry = [ifdblock objectAtIndex:i];
- NSString * data = [ifddatablock objectAtIndex:i];
-
- // check if the data fits into 4 bytes
- if( [data length] <= 8) {
- // concatenate the entry and the (4byte) data entry into the final IFD entry and append to exif ifd string
- [exifstr appendFormat : @"%@%@", entry, data];
- } else {
- [exifstr appendFormat : @"%@%08x", entry, addr];
- [dbstr appendFormat: @"%@", data];
- addr+= [data length] / 2;
- /*
- NSLog(@"=====data-length[%i]=======",[data length]);
- NSLog(@"addr-offset[%i]",addr);
- NSLog(@"entry[%@]",entry);
- NSLog(@"data[%@]",data);
- */
- }
- }
-
- // calculate IFD0 terminal offset tags, currently ExifSubIFD
- unsigned int entrycount = (unsigned int)[ifdblock count];
- if (ifd0flag) {
- // 18 accounts for 8769's width + offset to next ifd, 8 accounts for start of header
- NSNumber * offset = [NSNumber numberWithUnsignedInteger:[exifstr length] / 2 + [dbstr length] / 2 + 18+8];
-
- [self appendExifOffsetTagTo: exifstr
- withOffset : offset];
- entrycount++;
- }
- *dataoffset = addr;
- return [[NSString alloc] initWithFormat: @"%04x%@%@%@",
- entrycount,
- exifstr,
- @"00000000", // offset to next IFD, 0 since there is none
- dbstr]; // lastly, the datablock
-}
-
-// Creates an exif formatted exif information file directory entry
-- (NSString*) createIFDElement: (NSString*) elementName withFormat: (NSArray*) formtemplate withElementData: (NSString*) data {
- //NSArray * fielddata = [formatdict objectForKey: elementName];// format data of desired field
- if (formtemplate) {
- // format string @"%@%@%@%@", tag number, data format, components, value
- NSNumber * dataformat = [formtemplate objectAtIndex:1];
- NSNumber * components = [formtemplate objectAtIndex:2];
- if([components intValue] == 0) {
- components = [NSNumber numberWithUnsignedInteger:[data length] * DataTypeToWidth[[dataformat intValue]-1]];
- }
-
- return [[NSString alloc] initWithFormat: @"%@%@%08x",
- [formtemplate objectAtIndex:0], // the field code
- [self formatNumberWithLeadingZeroes: dataformat withPlaces: @4], // the data type code
- [components intValue]]; // number of components
- }
- return NULL;
-}
-
-/**
- * appends exif IFD0 tag 8769 "ExifOffset" to the string provided
- * (NSMutableString*) str - string you wish to append the 8769 tag to: APP1 or IFD0 hex data string
- * // TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1), @"ExifOffset",
- */
-- (void) appendExifOffsetTagTo: (NSMutableString*) str withOffset : (NSNumber*) offset {
- NSArray * format = TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1);
-
- NSString * entry = [self createIFDElement: @"ExifOffset"
- withFormat: format
- withElementData: [offset stringValue]];
-
- NSString * data = [self createIFDElementDataWithFormat: format
- withData: [offset stringValue]];
- [str appendFormat:@"%@%@", entry, data];
-}
-
-// formats the Information File Directory Data to exif format
-- (NSString*) createIFDElementDataWithFormat: (NSArray*) dataformat withData: (NSString*) data {
- NSMutableString * datastr = nil;
- NSNumber * tmp = nil;
- NSNumber * formatcode = [dataformat objectAtIndex:1];
- NSUInteger formatItemsCount = [dataformat count];
- NSNumber * num = @0;
- NSNumber * denom = @0;
-
- switch ([formatcode intValue]) {
- case EDT_UBYTE:
- break;
- case EDT_ASCII_STRING:
- datastr = [[NSMutableString alloc] init];
- for (int i = 0; i < [data length]; i++) {
- [datastr appendFormat:@"%02x",[data characterAtIndex:i]];
- }
- if (formatItemsCount > 3) {
- // We have additional data to append.
- // currently used by Date format to append final 0x00 but can be used by other data types as well in the future
- [datastr appendString:[dataformat objectAtIndex:3]];
- }
- if ([datastr length] < 8) {
- NSString * format = [NSString stringWithFormat:@"%%0%dd", (int)(8 - [datastr length])];
- [datastr appendFormat:format,0];
- }
- return datastr;
- case EDT_USHORT:
- return [[NSString alloc] initWithFormat : @"%@%@",
- [self formattedHexStringFromDecimalNumber: [NSNumber numberWithInt: [data intValue]] withPlaces: @4],
- @"0000"];
- case EDT_ULONG:
- tmp = [NSNumber numberWithUnsignedLong:[data intValue]];
- return [NSString stringWithFormat : @"%@",
- [self formattedHexStringFromDecimalNumber: tmp withPlaces: @8]];
- case EDT_URATIONAL:
- return [self decimalToUnsignedRational: [NSNumber numberWithDouble:[data doubleValue]]
- withResultNumerator: &num
- withResultDenominator: &denom];
- case EDT_SBYTE:
-
- break;
- case EDT_UNDEFINED:
- break; // 8 bits
- case EDT_SSHORT:
- break;
- case EDT_SLONG:
- break; // 32bit signed integer (2's complement)
- case EDT_SRATIONAL:
- break; // 2 SLONGS, first long is numerator, second is denominator
- case EDT_SINGLEFLOAT:
- break;
- case EDT_DOUBLEFLOAT:
- break;
- }
- return datastr;
-}
-
-//======================================================================================================================
-// Utility Methods
-//======================================================================================================================
-
-// creates a formatted little endian hex string from a number and width specifier
-- (NSString*) formattedHexStringFromDecimalNumber: (NSNumber*) numb withPlaces: (NSNumber*) width {
- NSMutableString * str = [[NSMutableString alloc] initWithCapacity:[width intValue]];
- NSString * formatstr = [[NSString alloc] initWithFormat: @"%%%@%dx", @"0", [width intValue]];
- [str appendFormat:formatstr, [numb intValue]];
- return str;
-}
-
-// format number as string with leading 0's
-- (NSString*) formatNumberWithLeadingZeroes: (NSNumber *) numb withPlaces: (NSNumber *) places {
- NSNumberFormatter * formatter = [[NSNumberFormatter alloc] init];
- NSString *formatstr = [@"" stringByPaddingToLength:[places unsignedIntegerValue] withString:@"0" startingAtIndex:0];
- [formatter setPositiveFormat:formatstr];
- return [formatter stringFromNumber:numb];
-}
-
-// approximate a decimal with a rational by method of continued fraction
-// can be collasped into decimalToUnsignedRational after testing
-- (void) decimalToRational: (NSNumber *) numb
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator {
- NSMutableArray * fractionlist = [[NSMutableArray alloc] initWithCapacity:8];
-
- [self continuedFraction: [numb doubleValue]
- withFractionList: fractionlist
- withHorizon: 8];
-
- // simplify complex fraction represented by partial fraction list
- [self expandContinuedFraction: fractionlist
- withResultNumerator: numerator
- withResultDenominator: denominator];
-
-}
-
-// approximate a decimal with an unsigned rational by method of continued fraction
-- (NSString*) decimalToUnsignedRational: (NSNumber *) numb
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator {
- NSMutableArray * fractionlist = [[NSMutableArray alloc] initWithCapacity:8];
-
- // generate partial fraction list
- [self continuedFraction: [numb doubleValue]
- withFractionList: fractionlist
- withHorizon: 8];
-
- // simplify complex fraction represented by partial fraction list
- [self expandContinuedFraction: fractionlist
- withResultNumerator: numerator
- withResultDenominator: denominator];
-
- return [self formatFractionList: fractionlist];
-}
-
-// recursive implementation of decimal approximation by continued fraction
-- (void) continuedFraction: (double) val
- withFractionList: (NSMutableArray*) fractionlist
- withHorizon: (int) horizon {
- int whole;
- double remainder;
- // 1. split term
- [self splitDouble: val withIntComponent: &whole withFloatRemainder: &remainder];
- [fractionlist addObject: [NSNumber numberWithInt:whole]];
-
- // 2. calculate reciprocal of remainder
- if (!remainder) return; // early exit, exact fraction found, avoids recip/0
- double recip = 1 / remainder;
-
- // 3. exit condition
- if ([fractionlist count] > horizon) {
- return;
- }
-
- // 4. recurse
- [self continuedFraction:recip withFractionList: fractionlist withHorizon: horizon];
-
-}
-
-// expand continued fraction list, creating a single level rational approximation
--(void) expandContinuedFraction: (NSArray*) fractionlist
- withResultNumerator: (NSNumber**) numerator
- withResultDenominator: (NSNumber**) denominator {
- NSUInteger i = 0;
- int den = 0;
- int num = 0;
- if ([fractionlist count] == 1) {
- *numerator = [NSNumber numberWithInt:[[fractionlist objectAtIndex:0] intValue]];
- *denominator = @1;
- return;
- }
-
- //begin at the end of the list
- i = [fractionlist count] - 1;
- num = 1;
- den = [[fractionlist objectAtIndex:i] intValue];
-
- while (i > 0) {
- int t = [[fractionlist objectAtIndex: i-1] intValue];
- num = t * den + num;
- if (i==1) {
- break;
- } else {
- t = num;
- num = den;
- den = t;
- }
- i--;
- }
- // set result parameters values
- *numerator = [NSNumber numberWithInt: num];
- *denominator = [NSNumber numberWithInt: den];
-}
-
-// formats expanded fraction list to string matching exif specification
-- (NSString*) formatFractionList: (NSArray *) fractionlist {
- NSMutableString * str = [[NSMutableString alloc] initWithCapacity:16];
-
- if ([fractionlist count] == 1){
- [str appendFormat: @"%08x00000001", [[fractionlist objectAtIndex:0] intValue]];
- }
- return str;
-}
-
-// format rational as
-- (NSString*) formatRationalWithNumerator: (NSNumber*) numerator withDenominator: (NSNumber*) denominator asSigned: (Boolean) signedFlag {
- NSMutableString * str = [[NSMutableString alloc] initWithCapacity:16];
- if (signedFlag) {
- long num = [numerator longValue];
- long den = [denominator longValue];
- [str appendFormat: @"%08lx%08lx", num >= 0 ? num : ~ABS(num) + 1, num >= 0 ? den : ~ABS(den) + 1];
- } else {
- [str appendFormat: @"%08lx%08lx", [numerator unsignedLongValue], [denominator unsignedLongValue]];
- }
- return str;
-}
-
-// split a floating point number into two integer values representing the left and right side of the decimal
-- (void) splitDouble: (double) val withIntComponent: (int*) rightside withFloatRemainder: (double*) leftside {
- *rightside = val; // convert numb to int representation, which truncates the decimal portion
- *leftside = val - *rightside;
-}
-
-
-//
-- (NSString*) hexStringFromData : (NSData*) data {
- //overflow detection
- const unsigned char *dataBuffer = [data bytes];
- return [[NSString alloc] initWithFormat: @"%02x%02x",
- (unsigned char)dataBuffer[0],
- (unsigned char)dataBuffer[1]];
-}
-
-// convert a hex string to a number
-- (NSNumber*) numericFromHexString : (NSString *) hexstring {
- NSScanner * scan = NULL;
- unsigned int numbuf= 0;
-
- scan = [NSScanner scannerWithString:hexstring];
- [scan scanHexInt:&numbuf];
- return [NSNumber numberWithInt:numbuf];
-}
-
-@end
diff --git a/plugins/cordova-plugin-camera/src/ios/UIImage+CropScaleOrientation.h b/plugins/cordova-plugin-camera/src/ios/UIImage+CropScaleOrientation.h
deleted file mode 100644
index 31bc42f..0000000
--- a/plugins/cordova-plugin-camera/src/ios/UIImage+CropScaleOrientation.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-
-@interface UIImage (CropScaleOrientation)
-
-- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize;
-- (UIImage*)imageCorrectedForCaptureOrientation;
-- (UIImage*)imageCorrectedForCaptureOrientation:(UIImageOrientation)imageOrientation;
-- (UIImage*)imageByScalingNotCroppingForSize:(CGSize)targetSize;
-
-@end
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/src/ios/UIImage+CropScaleOrientation.m b/plugins/cordova-plugin-camera/src/ios/UIImage+CropScaleOrientation.m
deleted file mode 100644
index a66a5d8..0000000
--- a/plugins/cordova-plugin-camera/src/ios/UIImage+CropScaleOrientation.m
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "UIImage+CropScaleOrientation.h"
-
-@implementation UIImage (CropScaleOrientation)
-
-- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize
-{
- UIImage* sourceImage = self;
- UIImage* newImage = nil;
- CGSize imageSize = sourceImage.size;
- CGFloat width = imageSize.width;
- CGFloat height = imageSize.height;
- CGFloat targetWidth = targetSize.width;
- CGFloat targetHeight = targetSize.height;
- CGFloat scaleFactor = 0.0;
- CGFloat scaledWidth = targetWidth;
- CGFloat scaledHeight = targetHeight;
- CGPoint thumbnailPoint = CGPointMake(0.0, 0.0);
-
- if (CGSizeEqualToSize(imageSize, targetSize) == NO) {
- CGFloat widthFactor = targetWidth / width;
- CGFloat heightFactor = targetHeight / height;
-
- if (widthFactor > heightFactor) {
- scaleFactor = widthFactor; // scale to fit height
- } else {
- scaleFactor = heightFactor; // scale to fit width
- }
- scaledWidth = width * scaleFactor;
- scaledHeight = height * scaleFactor;
-
- // center the image
- if (widthFactor > heightFactor) {
- thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5;
- } else if (widthFactor < heightFactor) {
- thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5;
- }
- }
-
- UIGraphicsBeginImageContext(targetSize); // this will crop
-
- CGRect thumbnailRect = CGRectZero;
- thumbnailRect.origin = thumbnailPoint;
- thumbnailRect.size.width = scaledWidth;
- thumbnailRect.size.height = scaledHeight;
-
- [sourceImage drawInRect:thumbnailRect];
-
- newImage = UIGraphicsGetImageFromCurrentImageContext();
- if (newImage == nil) {
- NSLog(@"could not scale image");
- }
-
- // pop the context to get back to the default
- UIGraphicsEndImageContext();
- return newImage;
-}
-
-- (UIImage*)imageCorrectedForCaptureOrientation:(UIImageOrientation)imageOrientation
-{
- float rotation_radians = 0;
- bool perpendicular = false;
-
- switch (imageOrientation) {
- case UIImageOrientationUp :
- rotation_radians = 0.0;
- break;
-
- case UIImageOrientationDown:
- rotation_radians = M_PI; // don't be scared of radians, if you're reading this, you're good at math
- break;
-
- case UIImageOrientationRight:
- rotation_radians = M_PI_2;
- perpendicular = true;
- break;
-
- case UIImageOrientationLeft:
- rotation_radians = -M_PI_2;
- perpendicular = true;
- break;
-
- default:
- break;
- }
-
- UIGraphicsBeginImageContext(CGSizeMake(self.size.width, self.size.height));
- CGContextRef context = UIGraphicsGetCurrentContext();
-
- // Rotate around the center point
- CGContextTranslateCTM(context, self.size.width / 2, self.size.height / 2);
- CGContextRotateCTM(context, rotation_radians);
-
- CGContextScaleCTM(context, 1.0, -1.0);
- float width = perpendicular ? self.size.height : self.size.width;
- float height = perpendicular ? self.size.width : self.size.height;
- CGContextDrawImage(context, CGRectMake(-width / 2, -height / 2, width, height), [self CGImage]);
-
- // Move the origin back since the rotation might've change it (if its 90 degrees)
- if (perpendicular) {
- CGContextTranslateCTM(context, -self.size.height / 2, -self.size.width / 2);
- }
-
- UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return newImage;
-}
-
-- (UIImage*)imageCorrectedForCaptureOrientation
-{
- return [self imageCorrectedForCaptureOrientation:[self imageOrientation]];
-}
-
-- (UIImage*)imageByScalingNotCroppingForSize:(CGSize)targetSize
-{
- UIImage* sourceImage = self;
- UIImage* newImage = nil;
- CGSize imageSize = sourceImage.size;
- CGFloat width = imageSize.width;
- CGFloat height = imageSize.height;
- CGFloat targetWidth = targetSize.width;
- CGFloat targetHeight = targetSize.height;
- CGFloat scaleFactor = 0.0;
- CGSize scaledSize = targetSize;
-
- if (CGSizeEqualToSize(imageSize, targetSize) == NO) {
- CGFloat widthFactor = targetWidth / width;
- CGFloat heightFactor = targetHeight / height;
-
- // opposite comparison to imageByScalingAndCroppingForSize in order to contain the image within the given bounds
- if (widthFactor > heightFactor) {
- scaleFactor = heightFactor; // scale to fit height
- } else {
- scaleFactor = widthFactor; // scale to fit width
- }
- scaledSize = CGSizeMake(MIN(width * scaleFactor, targetWidth), MIN(height * scaleFactor, targetHeight));
- }
-
- // If the pixels are floats, it causes a white line in iOS8 and probably other versions too
- scaledSize.width = (int)scaledSize.width;
- scaledSize.height = (int)scaledSize.height;
-
- UIGraphicsBeginImageContext(scaledSize); // this will resize
-
- [sourceImage drawInRect:CGRectMake(0, 0, scaledSize.width, scaledSize.height)];
-
- newImage = UIGraphicsGetImageFromCurrentImageContext();
- if (newImage == nil) {
- NSLog(@"could not scale image");
- }
-
- // pop the context to get back to the default
- UIGraphicsEndImageContext();
- return newImage;
-}
-
-@end
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/CaptureWidget.qml b/plugins/cordova-plugin-camera/src/ubuntu/CaptureWidget.qml
deleted file mode 100644
index 0a332e2..0000000
--- a/plugins/cordova-plugin-camera/src/ubuntu/CaptureWidget.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright 2013 Canonical Ltd.
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-import QtQuick 2.0
-import QtMultimedia 5.0
-
-Rectangle {
- property string shootImagePath: "shoot.png"
- function isSuffix(str, suffix) {
- return String(str).substr(String(str).length - suffix.length) == suffix
- }
-
- id: ui
- color: "#252423"
- anchors.fill: parent
-
- Camera {
- objectName: "camera"
- id: camera
- onError: {
- console.log(errorString);
- }
- videoRecorder.audioBitRate: 128000
- imageCapture {
- onImageSaved: {
- root.exec("Camera", "onImageSaved", [path]);
- ui.destroy();
- }
- }
- }
- VideoOutput {
- id: output
- source: camera
- width: parent.width
- height: parent.height
- }
-
- Item {
- anchors.bottom: parent.bottom
- width: parent.width
- height: shootButton.height
- BorderImage {
- id: leftBackground
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: middle.left
- anchors.topMargin: units.dp(2)
- anchors.bottomMargin: units.dp(2)
- source: "toolbar-left.png"
- Image {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: parent.iconSpacing
- source: "back.png"
- width: units.gu(6)
- height: units.gu(5)
- MouseArea {
- anchors.fill: parent
- onClicked: {
- root.exec("Camera", "cancel");
- }
- }
- }
- }
- BorderImage {
- id: middle
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- height: shootButton.height + units.gu(1)
- width: shootButton.width
- source: "toolbar-middle.png"
- Image {
- id: shootButton
- width: units.gu(8)
- height: width
- anchors.horizontalCenter: parent.horizontalCenter
- source: shootImagePath
- MouseArea {
- anchors.fill: parent
- onClicked: {
- camera.imageCapture.captureToLocation(ui.parent.plugin('Camera').generateLocation("jpg"));
- }
- }
- }
- }
- BorderImage {
- id: rightBackground
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: middle.right
- anchors.topMargin: units.dp(2)
- anchors.bottomMargin: units.dp(2)
- source: "toolbar-right.png"
- }
- }
-}
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/back.png b/plugins/cordova-plugin-camera/src/ubuntu/back.png
deleted file mode 100644
index af78faa..0000000
Binary files a/plugins/cordova-plugin-camera/src/ubuntu/back.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/camera.cpp b/plugins/cordova-plugin-camera/src/ubuntu/camera.cpp
deleted file mode 100644
index c58af32..0000000
--- a/plugins/cordova-plugin-camera/src/ubuntu/camera.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#include "camera.h"
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-const char code[] = "\
-var component, object; \
-function createObject() { \
- component = Qt.createComponent(%1); \
- if (component.status == Component.Ready) \
- finishCreation(); \
- else \
- component.statusChanged.connect(finishCreation); \
-} \
-function finishCreation() { \
- CordovaWrapper.global.cameraPluginWidget = component.createObject(root, \
- {root: root, cordova: cordova}); \
-} \
-createObject()";
-
-
-Camera::Camera(Cordova *cordova):
- CPlugin(cordova),
- _lastScId(0),
- _lastEcId(0) {
-}
-
-bool Camera::preprocessImage(QString &path) {
- bool convertToPNG = (*_options.find("encodingType")).toInt() == Camera::PNG;
- int quality = (*_options.find("quality")).toInt();
- int width = (*_options.find("targetWidth")).toInt();
- int height = (*_options.find("targetHeight")).toInt();
-
- QImage image(path);
- if (width <= 0)
- width = image.width();
- if (height <= 0)
- height = image.height();
- image = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
-
- QFile oldImage(path);
- QTemporaryFile newImage;
-
- const char *type;
- if (convertToPNG) {
- path = generateLocation("png");
- type = "png";
- } else {
- path = generateLocation("jpg");
- type = "jpg";
- }
-
- image.save(path, type, quality);
-
- oldImage.remove();
-
- return true;
-}
-
-void Camera::onImageSaved(QString path) {
- bool dataURL = _options.find("destinationType")->toInt() == Camera::DATA_URL;
-
- QString cbParams;
- if (preprocessImage(path)) {
- QString absolutePath = QFileInfo(path).absoluteFilePath();
- if (dataURL) {
- QFile image(absolutePath);
- image.open(QIODevice::ReadOnly);
- QByteArray content = image.readAll().toBase64();
- cbParams = QString("\"%1\"").arg(content.data());
- image.remove();
- } else {
- cbParams = CordovaInternal::format(QString("file://localhost") + absolutePath);
- }
- }
-
- this->callback(_lastScId, cbParams);
-
- _lastEcId = _lastScId = 0;
-}
-
-void Camera::takePicture(int scId, int ecId, int quality, int destinationType, int/*sourceType*/, int targetWidth, int targetHeight, int encodingType,
- int/*mediaType*/, bool/*allowEdit*/, bool/*correctOrientation*/, bool/*saveToPhotoAlbum*/, const QVariantMap &/*popoverOptions*/, int/*cameraDirection*/) {
- if (_camera.isNull()) {
- _camera = QSharedPointer(new QCamera());
- }
-
- if (((_lastScId || _lastEcId) && (_lastScId != scId && _lastEcId != ecId)) || !_camera->isAvailable() || _camera->lockStatus() != QCamera::Unlocked) {
- this->cb(_lastEcId, "Device is busy");
- return;
- }
-
- _options.clear();
- _options.insert("quality", quality);
- _options.insert("destinationType", destinationType);
- _options.insert("targetWidth", targetWidth);
- _options.insert("targetHeight", targetHeight);
- _options.insert("encodingType", encodingType);
-
- _lastScId = scId;
- _lastEcId = ecId;
-
- QString path = m_cordova->get_app_dir() + "/../qml/CaptureWidget.qml";
-
- // TODO: relative url
- QString qml = QString(code).arg(CordovaInternal::format(path));
- m_cordova->execQML(qml);
-}
-
-void Camera::cancel() {
- m_cordova->execQML("CordovaWrapper.global.cameraPluginWidget.destroy()");
- this->cb(_lastEcId, "canceled");
-
- _lastEcId = _lastScId = 0;
-}
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/camera.h b/plugins/cordova-plugin-camera/src/ubuntu/camera.h
deleted file mode 100644
index 6d96038..0000000
--- a/plugins/cordova-plugin-camera/src/ubuntu/camera.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#ifndef CAMERA_H
-#define CAMERA_H
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-class Camera: public CPlugin {
- Q_OBJECT
-public:
- explicit Camera(Cordova *cordova);
-
- virtual const QString fullName() override {
- return Camera::fullID();
- }
-
- virtual const QString shortName() override {
- return "Camera";
- }
-
- static const QString fullID() {
- return "Camera";
- }
-
-public slots:
- void takePicture(int scId, int ecId, int quality, int destinationType, int/*sourceType*/, int targetWidth, int targetHeight, int encodingType,
- int/*mediaType*/, bool/*allowEdit*/, bool/*correctOrientation*/, bool/*saveToPhotoAlbum*/, const QVariantMap &popoverOptions, int cameraDirection);
- void cancel();
-
- void onImageSaved(QString path);
-
- QString generateLocation(const QString &extension) {
- int i = 1;
- for (;;++i) {
- QString path = QString("%1/.local/share/%2/persistent/%3.%4").arg(QDir::homePath())
- .arg(QCoreApplication::applicationName()).arg(i).arg(extension);
-
- if (!QFileInfo(path).exists())
- return path;
- }
- }
-private:
- bool preprocessImage(QString &path);
-
- int _lastScId;
- int _lastEcId;
- QSharedPointer _camera;
-
- QVariantMap _options;
-protected:
- enum DestinationType {
- DATA_URL = 0,
- FILE_URI = 1
- };
- enum EncodingType {
- JPEG = 0,
- PNG = 1
- };
-};
-
-#endif // CAMERA_H
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/shoot.png b/plugins/cordova-plugin-camera/src/ubuntu/shoot.png
deleted file mode 100644
index c093b63..0000000
Binary files a/plugins/cordova-plugin-camera/src/ubuntu/shoot.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/toolbar-left.png b/plugins/cordova-plugin-camera/src/ubuntu/toolbar-left.png
deleted file mode 100644
index 720d7f6..0000000
Binary files a/plugins/cordova-plugin-camera/src/ubuntu/toolbar-left.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/toolbar-middle.png b/plugins/cordova-plugin-camera/src/ubuntu/toolbar-middle.png
deleted file mode 100644
index 77595bb..0000000
Binary files a/plugins/cordova-plugin-camera/src/ubuntu/toolbar-middle.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/src/ubuntu/toolbar-right.png b/plugins/cordova-plugin-camera/src/ubuntu/toolbar-right.png
deleted file mode 100644
index e4e6aa6..0000000
Binary files a/plugins/cordova-plugin-camera/src/ubuntu/toolbar-right.png and /dev/null differ
diff --git a/plugins/cordova-plugin-camera/src/windows/CameraProxy.js b/plugins/cordova-plugin-camera/src/windows/CameraProxy.js
deleted file mode 100644
index e0be5b8..0000000
--- a/plugins/cordova-plugin-camera/src/windows/CameraProxy.js
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*jshint unused:true, undef:true, browser:true */
-/*global Windows:true, URL:true, module:true, require:true, WinJS:true */
-
-
-var Camera = require('./Camera');
-
-
-var getAppData = function () {
- return Windows.Storage.ApplicationData.current;
-};
-var encodeToBase64String = function (buffer) {
- return Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-};
-var OptUnique = Windows.Storage.CreationCollisionOption.generateUniqueName;
-var CapMSType = Windows.Media.Capture.MediaStreamType;
-var webUIApp = Windows.UI.WebUI.WebUIApplication;
-var fileIO = Windows.Storage.FileIO;
-var pickerLocId = Windows.Storage.Pickers.PickerLocationId;
-
-module.exports = {
-
- // args will contain :
- // ... it is an array, so be careful
- // 0 quality:50,
- // 1 destinationType:Camera.DestinationType.FILE_URI,
- // 2 sourceType:Camera.PictureSourceType.CAMERA,
- // 3 targetWidth:-1,
- // 4 targetHeight:-1,
- // 5 encodingType:Camera.EncodingType.JPEG,
- // 6 mediaType:Camera.MediaType.PICTURE,
- // 7 allowEdit:false,
- // 8 correctOrientation:false,
- // 9 saveToPhotoAlbum:false,
- // 10 popoverOptions:null
- // 11 cameraDirection:0
-
- takePicture: function (successCallback, errorCallback, args) {
- var sourceType = args[2];
-
- if (sourceType != Camera.PictureSourceType.CAMERA) {
- takePictureFromFile(successCallback, errorCallback, args);
- } else {
- takePictureFromCamera(successCallback, errorCallback, args);
- }
- }
-};
-
-// https://msdn.microsoft.com/en-us/library/windows/apps/ff462087(v=vs.105).aspx
-var windowsVideoContainers = [".avi", ".flv", ".asx", ".asf", ".mov", ".mp4", ".mpg", ".rm", ".srt", ".swf", ".wmv", ".vob"];
-var windowsPhoneVideoContainers = [".avi", ".3gp", ".3g2", ".wmv", ".3gp", ".3g2", ".mp4", ".m4v"];
-
-// Default aspect ratio 1.78 (16:9 hd video standard)
-var DEFAULT_ASPECT_RATIO = '1.8';
-
-// Highest possible z-index supported across browsers. Anything used above is converted to this value.
-var HIGHEST_POSSIBLE_Z_INDEX = 2147483647;
-
-// Resize method
-function resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType) {
- var tempPhotoFileName = "";
- if (encodingType == Camera.EncodingType.PNG) {
- tempPhotoFileName = "camera_cordova_temp_return.png";
- } else {
- tempPhotoFileName = "camera_cordova_temp_return.jpg";
- }
-
- var storageFolder = getAppData().localFolder;
- file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting)
- .then(function (storageFile) {
- return fileIO.readBufferAsync(storageFile);
- })
- .then(function(buffer) {
- var strBase64 = encodeToBase64String(buffer);
- var imageData = "data:" + file.contentType + ";base64," + strBase64;
- var image = new Image();
- image.src = imageData;
- image.onload = function() {
- var ratio = Math.min(targetWidth / this.width, targetHeight / this.height);
- var imageWidth = ratio * this.width;
- var imageHeight = ratio * this.height;
-
- var canvas = document.createElement('canvas');
- var storageFileName;
-
- canvas.width = imageWidth;
- canvas.height = imageHeight;
-
- canvas.getContext("2d").drawImage(this, 0, 0, imageWidth, imageHeight);
-
- var fileContent = canvas.toDataURL(file.contentType).split(',')[1];
-
- var storageFolder = getAppData().localFolder;
-
- storageFolder.createFileAsync(tempPhotoFileName, OptUnique)
- .then(function (storagefile) {
- var content = Windows.Security.Cryptography.CryptographicBuffer.decodeFromBase64String(fileContent);
- storageFileName = storagefile.name;
- return fileIO.writeBufferAsync(storagefile, content);
- })
- .done(function () {
- successCallback("ms-appdata:///local/" + storageFileName);
- }, errorCallback);
- };
- })
- .done(null, function(err) {
- errorCallback(err);
- }
- );
-}
-
-// Because of asynchronous method, so let the successCallback be called in it.
-function resizeImageBase64(successCallback, errorCallback, file, targetWidth, targetHeight) {
- fileIO.readBufferAsync(file).done( function(buffer) {
- var strBase64 = encodeToBase64String(buffer);
- var imageData = "data:" + file.contentType + ";base64," + strBase64;
-
- var image = new Image();
- image.src = imageData;
-
- image.onload = function() {
- var ratio = Math.min(targetWidth / this.width, targetHeight / this.height);
- var imageWidth = ratio * this.width;
- var imageHeight = ratio * this.height;
- var canvas = document.createElement('canvas');
-
- canvas.width = imageWidth;
- canvas.height = imageHeight;
-
- var ctx = canvas.getContext("2d");
- ctx.drawImage(this, 0, 0, imageWidth, imageHeight);
-
- // The resized file ready for upload
- var finalFile = canvas.toDataURL(file.contentType);
-
- // Remove the prefix such as "data:" + contentType + ";base64," , in order to meet the Cordova API.
- var arr = finalFile.split(",");
- var newStr = finalFile.substr(arr[0].length + 1);
- successCallback(newStr);
- };
- }, function(err) { errorCallback(err); });
-}
-
-function takePictureFromFile(successCallback, errorCallback, args) {
- // Detect Windows Phone
- if (navigator.appVersion.indexOf('Windows Phone 8.1') >= 0) {
- takePictureFromFileWP(successCallback, errorCallback, args);
- } else {
- takePictureFromFileWindows(successCallback, errorCallback, args);
- }
-}
-
-function takePictureFromFileWP(successCallback, errorCallback, args) {
- var mediaType = args[6],
- destinationType = args[1],
- targetWidth = args[3],
- targetHeight = args[4],
- encodingType = args[5];
-
- /*
- Need to add and remove an event listener to catch activation state
- Using FileOpenPicker will suspend the app and it's required to catch the PickSingleFileAndContinue
- https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn631755.aspx
- */
- var filePickerActivationHandler = function(eventArgs) {
- if (eventArgs.kind === Windows.ApplicationModel.Activation.ActivationKind.pickFileContinuation) {
- var file = eventArgs.files[0];
- if (!file) {
- errorCallback("User didn't choose a file.");
- webUIApp.removeEventListener("activated", filePickerActivationHandler);
- return;
- }
- if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
- if (targetHeight > 0 && targetWidth > 0) {
- resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType);
- }
- else {
- var storageFolder = getAppData().localFolder;
- file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) {
- if(destinationType == Camera.DestinationType.NATIVE_URI) {
- successCallback("ms-appdata:///local/" + storageFile.name);
- }
- else {
- successCallback(URL.createObjectURL(storageFile));
- }
- }, function () {
- errorCallback("Can't access localStorage folder.");
- });
- }
- }
- else {
- if (targetHeight > 0 && targetWidth > 0) {
- resizeImageBase64(successCallback, errorCallback, file, targetWidth, targetHeight);
- } else {
- fileIO.readBufferAsync(file).done(function (buffer) {
- var strBase64 =encodeToBase64String(buffer);
- successCallback(strBase64);
- }, errorCallback);
- }
- }
- webUIApp.removeEventListener("activated", filePickerActivationHandler);
- }
- };
-
- var fileOpenPicker = new Windows.Storage.Pickers.FileOpenPicker();
- if (mediaType == Camera.MediaType.PICTURE) {
- fileOpenPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
- fileOpenPicker.suggestedStartLocation = pickerLocId.picturesLibrary;
- }
- else if (mediaType == Camera.MediaType.VIDEO) {
- fileOpenPicker.fileTypeFilter.replaceAll(windowsPhoneVideoContainers);
- fileOpenPicker.suggestedStartLocation = pickerLocId.videosLibrary;
- }
- else {
- fileOpenPicker.fileTypeFilter.replaceAll(["*"]);
- fileOpenPicker.suggestedStartLocation = pickerLocId.documentsLibrary;
- }
-
- webUIApp.addEventListener("activated", filePickerActivationHandler);
- fileOpenPicker.pickSingleFileAndContinue();
-}
-
-function takePictureFromFileWindows(successCallback, errorCallback, args) {
- var mediaType = args[6],
- destinationType = args[1],
- targetWidth = args[3],
- targetHeight = args[4],
- encodingType = args[5];
-
- var fileOpenPicker = new Windows.Storage.Pickers.FileOpenPicker();
- if (mediaType == Camera.MediaType.PICTURE) {
- fileOpenPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
- fileOpenPicker.suggestedStartLocation = pickerLocId.picturesLibrary;
- }
- else if (mediaType == Camera.MediaType.VIDEO) {
- fileOpenPicker.fileTypeFilter.replaceAll(windowsVideoContainers);
- fileOpenPicker.suggestedStartLocation = pickerLocId.videosLibrary;
- }
- else {
- fileOpenPicker.fileTypeFilter.replaceAll(["*"]);
- fileOpenPicker.suggestedStartLocation = pickerLocId.documentsLibrary;
- }
-
- fileOpenPicker.pickSingleFileAsync().done(function (file) {
- if (!file) {
- errorCallback("User didn't choose a file.");
- return;
- }
- if (destinationType == Camera.DestinationType.FILE_URI || destinationType == Camera.DestinationType.NATIVE_URI) {
- if (targetHeight > 0 && targetWidth > 0) {
- resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType);
- }
- else {
- var storageFolder = getAppData().localFolder;
- file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) {
- if(destinationType == Camera.DestinationType.NATIVE_URI) {
- successCallback("ms-appdata:///local/" + storageFile.name);
- }
- else {
- successCallback(URL.createObjectURL(storageFile));
- }
- }, function () {
- errorCallback("Can't access localStorage folder.");
- });
- }
- }
- else {
- if (targetHeight > 0 && targetWidth > 0) {
- resizeImageBase64(successCallback, errorCallback, file, targetWidth, targetHeight);
- } else {
- fileIO.readBufferAsync(file).done(function (buffer) {
- var strBase64 =encodeToBase64String(buffer);
- successCallback(strBase64);
- }, errorCallback);
- }
- }
- }, function () {
- errorCallback("User didn't choose a file.");
- });
-}
-
-function takePictureFromCamera(successCallback, errorCallback, args) {
- // Check if necessary API available
- if (!Windows.Media.Capture.CameraCaptureUI) {
- takePictureFromCameraWP(successCallback, errorCallback, args);
- } else {
- takePictureFromCameraWindows(successCallback, errorCallback, args);
- }
-}
-
-function takePictureFromCameraWP(successCallback, errorCallback, args) {
- // We are running on WP8.1 which lacks CameraCaptureUI class
- // so we need to use MediaCapture class instead and implement custom UI for camera
- var destinationType = args[1],
- targetWidth = args[3],
- targetHeight = args[4],
- encodingType = args[5],
- saveToPhotoAlbum = args[9],
- cameraDirection = args[11],
- capturePreview = null,
- cameraCaptureButton = null,
- cameraCancelButton = null,
- capture = null,
- captureSettings = null,
- CaptureNS = Windows.Media.Capture,
- sensor = null;
-
- function createCameraUI() {
- // create style for take and cancel buttons
- var buttonStyle = "width:45%;padding: 10px 16px;font-size: 18px;line-height: 1.3333333;color: #333;background-color: #fff;border-color: #ccc; border: 1px solid transparent;border-radius: 6px; display: block; margin: 20px; z-index: 1000;border-color: #adadad;";
-
- // Create fullscreen preview
- // z-order style element for capturePreview and cameraCancelButton elts
- // is necessary to avoid overriding by another page elements, -1 sometimes is not enough
- capturePreview = document.createElement("video");
- capturePreview.style.cssText = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: " + (HIGHEST_POSSIBLE_Z_INDEX - 1) + ";";
-
- // Create capture button
- cameraCaptureButton = document.createElement("button");
- cameraCaptureButton.innerText = "Take";
- cameraCaptureButton.style.cssText = buttonStyle + "position: fixed; left: 0; bottom: 0; margin: 20px; z-index: " + HIGHEST_POSSIBLE_Z_INDEX + ";";
-
- // Create cancel button
- cameraCancelButton = document.createElement("button");
- cameraCancelButton.innerText = "Cancel";
- cameraCancelButton.style.cssText = buttonStyle + "position: fixed; right: 0; bottom: 0; margin: 20px; z-index: " + HIGHEST_POSSIBLE_Z_INDEX + ";";
-
- capture = new CaptureNS.MediaCapture();
-
- captureSettings = new CaptureNS.MediaCaptureInitializationSettings();
- captureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.video;
- }
-
- function continueVideoOnFocus() {
- // if preview is defined it would be stuck, play it
- if (capturePreview) {
- capturePreview.play();
- }
- }
-
- function startCameraPreview() {
- // Search for available camera devices
- // This is necessary to detect which camera (front or back) we should use
- var DeviceEnum = Windows.Devices.Enumeration;
- var expectedPanel = cameraDirection === 1 ? DeviceEnum.Panel.front : DeviceEnum.Panel.back;
-
- // Add focus event handler to capture the event when user suspends the app and comes back while the preview is on
- window.addEventListener("focus", continueVideoOnFocus);
-
- DeviceEnum.DeviceInformation.findAllAsync(DeviceEnum.DeviceClass.videoCapture).then(function (devices) {
- if (devices.length <= 0) {
- destroyCameraPreview();
- errorCallback('Camera not found');
- return;
- }
-
- devices.forEach(function(currDev) {
- if (currDev.enclosureLocation.panel && currDev.enclosureLocation.panel == expectedPanel) {
- captureSettings.videoDeviceId = currDev.id;
- }
- });
-
- captureSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.photo;
-
- return capture.initializeAsync(captureSettings);
- }).then(function () {
-
- // create focus control if available
- var VideoDeviceController = capture.videoDeviceController;
- var FocusControl = VideoDeviceController.focusControl;
-
- if (FocusControl.supported === true) {
- capturePreview.addEventListener('click', function () {
- // Make sure function isn't called again before previous focus is completed
- if (this.getAttribute('clicked') === '1') {
- return false;
- } else {
- this.setAttribute('clicked', '1');
- }
- var preset = Windows.Media.Devices.FocusPreset.autoNormal;
- var parent = this;
- FocusControl.setPresetAsync(preset).done(function () {
- // set the clicked attribute back to '0' to allow focus again
- parent.setAttribute('clicked', '0');
- });
- });
- }
-
- // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
- capturePreview.msZoom = true;
- capturePreview.src = URL.createObjectURL(capture);
- capturePreview.play();
-
- // Bind events to controls
- sensor = Windows.Devices.Sensors.SimpleOrientationSensor.getDefault();
- if (sensor !== null) {
- sensor.addEventListener("orientationchanged", onOrientationChange);
- }
-
- // add click events to capture and cancel buttons
- cameraCaptureButton.addEventListener('click', onCameraCaptureButtonClick);
- cameraCancelButton.addEventListener('click', onCameraCancelButtonClick);
-
- // Change default orientation
- if (sensor) {
- setPreviewRotation(sensor.getCurrentOrientation());
- } else {
- setPreviewRotation(Windows.Graphics.Display.DisplayInformation.getForCurrentView().currentOrientation);
- }
-
- // Get available aspect ratios
- var aspectRatios = getAspectRatios(capture);
-
- // Couldn't find a good ratio
- if (aspectRatios.length === 0) {
- destroyCameraPreview();
- errorCallback('There\'s not a good aspect ratio available');
- return;
- }
-
- // add elements to body
- document.body.appendChild(capturePreview);
- document.body.appendChild(cameraCaptureButton);
- document.body.appendChild(cameraCancelButton);
-
- if (aspectRatios.indexOf(DEFAULT_ASPECT_RATIO) > -1) {
- return setAspectRatio(capture, DEFAULT_ASPECT_RATIO);
- } else {
- // Doesn't support 16:9 - pick next best
- return setAspectRatio(capture, aspectRatios[0]);
- }
- }).done(null, function (err) {
- destroyCameraPreview();
- errorCallback('Camera intitialization error ' + err);
- });
- }
-
- function destroyCameraPreview() {
- // If sensor is available, remove event listener
- if (sensor !== null) {
- sensor.removeEventListener('orientationchanged', onOrientationChange);
- }
-
- // Pause and dispose preview element
- capturePreview.pause();
- capturePreview.src = null;
-
- // Remove event listeners from buttons
- cameraCaptureButton.removeEventListener('click', onCameraCaptureButtonClick);
- cameraCancelButton.removeEventListener('click', onCameraCancelButtonClick);
-
- // Remove the focus event handler
- window.removeEventListener("focus", continueVideoOnFocus);
-
- // Remove elements
- [capturePreview, cameraCaptureButton, cameraCancelButton].forEach(function (elem) {
- if (elem /* && elem in document.body.childNodes */) {
- document.body.removeChild(elem);
- }
- });
-
- // Stop and dispose media capture manager
- if (capture) {
- capture.stopRecordAsync();
- capture = null;
- }
- }
-
- function captureAction() {
-
- var encodingProperties,
- fileName,
- tempFolder = getAppData().temporaryFolder;
-
- if (encodingType == Camera.EncodingType.PNG) {
- fileName = 'photo.png';
- encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createPng();
- } else {
- fileName = 'photo.jpg';
- encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg();
- }
-
- tempFolder.createFileAsync(fileName, OptUnique)
- .then(function(tempCapturedFile) {
- return new WinJS.Promise(function (complete) {
- var photoStream = new Windows.Storage.Streams.InMemoryRandomAccessStream();
- var finalStream = new Windows.Storage.Streams.InMemoryRandomAccessStream();
- capture.capturePhotoToStreamAsync(encodingProperties, photoStream)
- .then(function() {
- return Windows.Graphics.Imaging.BitmapDecoder.createAsync(photoStream);
- })
- .then(function(dec) {
- finalStream.size = 0; // BitmapEncoder requires the output stream to be empty
- return Windows.Graphics.Imaging.BitmapEncoder.createForTranscodingAsync(finalStream, dec);
- })
- .then(function(enc) {
- // We need to rotate the photo wrt sensor orientation
- enc.bitmapTransform.rotation = orientationToRotation(sensor.getCurrentOrientation());
- return enc.flushAsync();
- })
- .then(function() {
- return tempCapturedFile.openAsync(Windows.Storage.FileAccessMode.readWrite);
- })
- .then(function(fileStream) {
- return Windows.Storage.Streams.RandomAccessStream.copyAndCloseAsync(finalStream, fileStream);
- })
- .done(function() {
- photoStream.close();
- finalStream.close();
- complete(tempCapturedFile);
- }, function() {
- photoStream.close();
- finalStream.close();
- throw new Error("An error has occured while capturing the photo.");
- });
- });
- })
- .done(function(capturedFile) {
- destroyCameraPreview();
- savePhoto(capturedFile, {
- destinationType: destinationType,
- targetHeight: targetHeight,
- targetWidth: targetWidth,
- encodingType: encodingType,
- saveToPhotoAlbum: saveToPhotoAlbum
- }, successCallback, errorCallback);
- }, function(err) {
- destroyCameraPreview();
- errorCallback(err);
- });
- }
-
- function getAspectRatios(capture) {
- var videoDeviceController = capture.videoDeviceController;
- var photoAspectRatios = videoDeviceController.getAvailableMediaStreamProperties(CapMSType.photo).map(function (element) {
- return (element.width / element.height).toFixed(1);
- }).filter(function (element, index, array) { return (index === array.indexOf(element)); });
-
- var videoAspectRatios = videoDeviceController.getAvailableMediaStreamProperties(CapMSType.videoRecord).map(function (element) {
- return (element.width / element.height).toFixed(1);
- }).filter(function (element, index, array) { return (index === array.indexOf(element)); });
-
- var videoPreviewAspectRatios = videoDeviceController.getAvailableMediaStreamProperties(CapMSType.videoPreview).map(function (element) {
- return (element.width / element.height).toFixed(1);
- }).filter(function (element, index, array) { return (index === array.indexOf(element)); });
-
- var allAspectRatios = [].concat(photoAspectRatios, videoAspectRatios, videoPreviewAspectRatios);
-
- var aspectObj = allAspectRatios.reduce(function (map, item) {
- if (!map[item]) {
- map[item] = 0;
- }
- map[item]++;
- return map;
- }, {});
-
- return Object.keys(aspectObj).filter(function (k) {
- return aspectObj[k] === 3;
- });
- }
-
- function setAspectRatio(capture, aspect) {
- // Max photo resolution with desired aspect ratio
- var videoDeviceController = capture.videoDeviceController;
- var photoResolution = videoDeviceController.getAvailableMediaStreamProperties(CapMSType.photo)
- .filter(function (elem) {
- return ((elem.width / elem.height).toFixed(1) === aspect);
- })
- .reduce(function (prop1, prop2) {
- return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;
- });
-
- // Max video resolution with desired aspect ratio
- var videoRecordResolution = videoDeviceController.getAvailableMediaStreamProperties(CapMSType.videoRecord)
- .filter(function (elem) {
- return ((elem.width / elem.height).toFixed(1) === aspect);
- })
- .reduce(function (prop1, prop2) {
- return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;
- });
-
- // Max video preview resolution with desired aspect ratio
- var videoPreviewResolution = videoDeviceController.getAvailableMediaStreamProperties(CapMSType.videoPreview)
- .filter(function (elem) {
- return ((elem.width / elem.height).toFixed(1) === aspect);
- })
- .reduce(function (prop1, prop2) {
- return (prop1.width * prop1.height) > (prop2.width * prop2.height) ? prop1 : prop2;
- });
-
- return videoDeviceController.setMediaStreamPropertiesAsync(CapMSType.photo, photoResolution)
- .then(function () {
- return videoDeviceController.setMediaStreamPropertiesAsync(CapMSType.videoPreview, videoPreviewResolution);
- })
- .then(function () {
- return videoDeviceController.setMediaStreamPropertiesAsync(CapMSType.videoRecord, videoRecordResolution);
- });
- }
-
- /**
- * When Capture button is clicked, try to capture a picture and return
- */
- function onCameraCaptureButtonClick() {
- // Make sure user can't click more than once
- if (this.getAttribute('clicked') === '1') {
- return false;
- } else {
- this.setAttribute('clicked', '1');
- }
- captureAction();
- }
-
- /**
- * When Cancel button is clicked, destroy camera preview and return with error callback
- */
- function onCameraCancelButtonClick() {
- // Make sure user can't click more than once
- if (this.getAttribute('clicked') === '1') {
- return false;
- } else {
- this.setAttribute('clicked', '1');
- }
- destroyCameraPreview();
- errorCallback('no image selected');
- }
-
- /**
- * When the phone orientation change, get the event and change camera preview rotation
- * @param {Object} e - SimpleOrientationSensorOrientationChangedEventArgs
- */
- function onOrientationChange(e) {
- setPreviewRotation(e.orientation);
- }
-
- /**
- * Converts SimpleOrientation to a VideoRotation to remove difference between camera sensor orientation
- * and video orientation
- * @param {number} orientation - Windows.Devices.Sensors.SimpleOrientation
- * @return {number} - Windows.Media.Capture.VideoRotation
- */
- function orientationToRotation(orientation) {
- // VideoRotation enumerable and BitmapRotation enumerable have the same values
- // https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.capture.videorotation.aspx
- // https://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.imaging.bitmaprotation.aspx
-
- switch (orientation) {
- // portrait
- case Windows.Devices.Sensors.SimpleOrientation.notRotated:
- return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
- // landscape
- case Windows.Devices.Sensors.SimpleOrientation.rotated90DegreesCounterclockwise:
- return Windows.Media.Capture.VideoRotation.none;
- // portrait-flipped (not supported by WinPhone Apps)
- case Windows.Devices.Sensors.SimpleOrientation.rotated180DegreesCounterclockwise:
- // Falling back to portrait default
- return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
- // landscape-flipped
- case Windows.Devices.Sensors.SimpleOrientation.rotated270DegreesCounterclockwise:
- return Windows.Media.Capture.VideoRotation.clockwise180Degrees;
- // faceup & facedown
- default:
- // Falling back to portrait default
- return Windows.Media.Capture.VideoRotation.clockwise90Degrees;
- }
- }
-
- /**
- * Rotates the current MediaCapture's video
- * @param {number} orientation - Windows.Devices.Sensors.SimpleOrientation
- */
- function setPreviewRotation(orientation) {
- capture.setPreviewRotation(orientationToRotation(orientation));
- }
-
- try {
- createCameraUI();
- startCameraPreview();
- } catch (ex) {
- errorCallback(ex);
- }
-}
-
-function takePictureFromCameraWindows(successCallback, errorCallback, args) {
- var destinationType = args[1],
- targetWidth = args[3],
- targetHeight = args[4],
- encodingType = args[5],
- allowCrop = !!args[7],
- saveToPhotoAlbum = args[9],
- WMCapture = Windows.Media.Capture,
- cameraCaptureUI = new WMCapture.CameraCaptureUI();
-
- cameraCaptureUI.photoSettings.allowCropping = allowCrop;
-
- if (encodingType == Camera.EncodingType.PNG) {
- cameraCaptureUI.photoSettings.format = WMCapture.CameraCaptureUIPhotoFormat.png;
- } else {
- cameraCaptureUI.photoSettings.format = WMCapture.CameraCaptureUIPhotoFormat.jpeg;
- }
-
- // decide which max pixels should be supported by targetWidth or targetHeight.
- var maxRes = null;
- var UIMaxRes = WMCapture.CameraCaptureUIMaxPhotoResolution;
- var totalPixels = targetWidth * targetHeight;
-
- if (targetWidth == -1 && targetHeight == -1) {
- maxRes = UIMaxRes.highestAvailable;
- }
- // Temp fix for CB-10539
- /*else if (totalPixels <= 320 * 240) {
- maxRes = UIMaxRes.verySmallQvga;
- }*/
- else if (totalPixels <= 640 * 480) {
- maxRes = UIMaxRes.smallVga;
- } else if (totalPixels <= 1024 * 768) {
- maxRes = UIMaxRes.mediumXga;
- } else if (totalPixels <= 3 * 1000 * 1000) {
- maxRes = UIMaxRes.large3M;
- } else if (totalPixels <= 5 * 1000 * 1000) {
- maxRes = UIMaxRes.veryLarge5M;
- } else {
- maxRes = UIMaxRes.highestAvailable;
- }
-
- cameraCaptureUI.photoSettings.maxResolution = maxRes;
-
- var cameraPicture;
- var savePhotoOnFocus = function() {
-
- window.removeEventListener("focus", savePhotoOnFocus);
- // call only when the app is in focus again
- savePhoto(cameraPicture, {
- destinationType: destinationType,
- targetHeight: targetHeight,
- targetWidth: targetWidth,
- encodingType: encodingType,
- saveToPhotoAlbum: saveToPhotoAlbum
- }, successCallback, errorCallback);
- };
-
- // add and delete focus eventHandler to capture the focus back from cameraUI to app
- window.addEventListener("focus", savePhotoOnFocus);
- cameraCaptureUI.captureFileAsync(WMCapture.CameraCaptureUIMode.photo).done(function(picture) {
- if (!picture) {
- errorCallback("User didn't capture a photo.");
- window.removeEventListener("focus", savePhotoOnFocus);
- return;
- }
- cameraPicture = picture;
- }, function() {
- errorCallback("Fail to capture a photo.");
- window.removeEventListener("focus", savePhotoOnFocus);
- });
-}
-
-function savePhoto(picture, options, successCallback, errorCallback) {
- // success callback for capture operation
- var success = function(picture) {
- if (options.destinationType == Camera.DestinationType.FILE_URI || options.destinationType == Camera.DestinationType.NATIVE_URI) {
- if (options.targetHeight > 0 && options.targetWidth > 0) {
- resizeImage(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight, options.encodingType);
- } else {
- picture.copyAsync(getAppData().localFolder, picture.name, OptUnique).done(function (copiedFile) {
- successCallback("ms-appdata:///local/" + copiedFile.name);
- },errorCallback);
- }
- } else {
- if (options.targetHeight > 0 && options.targetWidth > 0) {
- resizeImageBase64(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight);
- } else {
- fileIO.readBufferAsync(picture).done(function(buffer) {
- var strBase64 = encodeToBase64String(buffer);
- picture.deleteAsync().done(function() {
- successCallback(strBase64);
- }, function(err) {
- errorCallback(err);
- });
- }, errorCallback);
- }
- }
- };
-
- if (!options.saveToPhotoAlbum) {
- success(picture);
- return;
- } else {
- var savePicker = new Windows.Storage.Pickers.FileSavePicker();
- var saveFile = function(file) {
- if (file) {
- // Prevent updates to the remote version of the file until we're done
- Windows.Storage.CachedFileManager.deferUpdates(file);
- picture.moveAndReplaceAsync(file)
- .then(function() {
- // Let Windows know that we're finished changing the file so
- // the other app can update the remote version of the file.
- return Windows.Storage.CachedFileManager.completeUpdatesAsync(file);
- })
- .done(function(updateStatus) {
- if (updateStatus === Windows.Storage.Provider.FileUpdateStatus.complete) {
- success(picture);
- } else {
- errorCallback("File update status is not complete.");
- }
- }, errorCallback);
- } else {
- errorCallback("Failed to select a file.");
- }
- };
- savePicker.suggestedStartLocation = pickerLocId.picturesLibrary;
-
- if (options.encodingType === Camera.EncodingType.PNG) {
- savePicker.fileTypeChoices.insert("PNG", [".png"]);
- savePicker.suggestedFileName = "photo.png";
- } else {
- savePicker.fileTypeChoices.insert("JPEG", [".jpg"]);
- savePicker.suggestedFileName = "photo.jpg";
- }
-
- // If Windows Phone 8.1 use pickSaveFileAndContinue()
- if (navigator.appVersion.indexOf('Windows Phone 8.1') >= 0) {
- /*
- Need to add and remove an event listener to catch activation state
- Using FileSavePicker will suspend the app and it's required to catch the pickSaveFileContinuation
- https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn631755.aspx
- */
- var fileSaveHandler = function(eventArgs) {
- if (eventArgs.kind === Windows.ApplicationModel.Activation.ActivationKind.pickSaveFileContinuation) {
- var file = eventArgs.file;
- saveFile(file);
- webUIApp.removeEventListener("activated", fileSaveHandler);
- }
- };
- webUIApp.addEventListener("activated", fileSaveHandler);
- savePicker.pickSaveFileAndContinue();
- } else {
- savePicker.pickSaveFileAsync()
- .done(saveFile, errorCallback);
- }
- }
-}
-
-require("cordova/exec/proxy").add("Camera",module.exports);
diff --git a/plugins/cordova-plugin-camera/src/wp/Camera.cs b/plugins/cordova-plugin-camera/src/wp/Camera.cs
deleted file mode 100644
index 264a205..0000000
--- a/plugins/cordova-plugin-camera/src/wp/Camera.cs
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-using System;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Collections.Generic;
-using Microsoft.Phone.Tasks;
-using System.Runtime.Serialization;
-using System.IO;
-using System.IO.IsolatedStorage;
-using System.Windows.Media.Imaging;
-using Microsoft.Phone;
-using Microsoft.Xna.Framework.Media;
-using System.Diagnostics;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- public class Camera : BaseCommand
- {
-
- ///
- /// Return base64 encoded string
- ///
- private const int DATA_URL = 0;
-
- ///
- /// Return file uri
- ///
- private const int FILE_URI = 1;
-
- ///
- /// Return native uri
- ///
- private const int NATIVE_URI = 2;
-
- ///
- /// Choose image from picture library
- ///
- private const int PHOTOLIBRARY = 0;
-
- ///
- /// Take picture from camera
- ///
-
- private const int CAMERA = 1;
-
- ///
- /// Choose image from picture library
- ///
- private const int SAVEDPHOTOALBUM = 2;
-
- ///
- /// Take a picture of type JPEG
- ///
- private const int JPEG = 0;
-
- ///
- /// Take a picture of type PNG
- ///
- private const int PNG = 1;
-
- ///
- /// Folder to store captured images
- ///
- private const string isoFolder = "CapturedImagesCache";
-
- ///
- /// Represents captureImage action options.
- ///
- [DataContract]
- public class CameraOptions
- {
- ///
- /// Source to getPicture from.
- ///
- [DataMember(IsRequired = false, Name = "sourceType")]
- public int PictureSourceType { get; set; }
-
- ///
- /// Format of image that returned from getPicture.
- ///
- [DataMember(IsRequired = false, Name = "destinationType")]
- public int DestinationType { get; set; }
-
- ///
- /// Quality of saved image
- ///
- [DataMember(IsRequired = false, Name = "quality")]
- public int Quality { get; set; }
-
- ///
- /// Controls whether or not the image is also added to the device photo album.
- ///
- [DataMember(IsRequired = false, Name = "saveToPhotoAlbum")]
- public bool SaveToPhotoAlbum { get; set; }
-
- ///
- /// Ignored
- ///
- [DataMember(IsRequired = false, Name = "correctOrientation")]
- public bool CorrectOrientation { get; set; }
-
- ///
- /// Ignored
- ///
- [DataMember(IsRequired = false, Name = "allowEdit")]
- public bool AllowEdit { get; set; }
-
- ///
- /// Height in pixels to scale image
- ///
- [DataMember(IsRequired = false, Name = "encodingType")]
- public int EncodingType { get; set; }
-
- ///
- /// Height in pixels to scale image
- ///
- [DataMember(IsRequired = false, Name = "mediaType")]
- public int MediaType { get; set; }
-
-
- ///
- /// Height in pixels to scale image
- ///
- [DataMember(IsRequired = false, Name = "targetHeight")]
- public int TargetHeight { get; set; }
-
-
- ///
- /// Width in pixels to scale image
- ///
- [DataMember(IsRequired = false, Name = "targetWidth")]
- public int TargetWidth { get; set; }
-
- ///
- /// Creates options object with default parameters
- ///
- public CameraOptions()
- {
- this.SetDefaultValues(new StreamingContext());
- }
-
- ///
- /// Initializes default values for class fields.
- /// Implemented in separate method because default constructor is not invoked during deserialization.
- ///
- ///
- [OnDeserializing()]
- public void SetDefaultValues(StreamingContext context)
- {
- PictureSourceType = CAMERA;
- DestinationType = FILE_URI;
- Quality = 80;
- TargetHeight = -1;
- TargetWidth = -1;
- SaveToPhotoAlbum = false;
- CorrectOrientation = true;
- AllowEdit = false;
- MediaType = -1;
- EncodingType = -1;
- }
- }
-
- ///
- /// Camera options
- ///
- CameraOptions cameraOptions;
-
- public void takePicture(string options)
- {
- try
- {
- string[] args = JSON.JsonHelper.Deserialize(options);
- // ["quality", "destinationType", "sourceType", "targetWidth", "targetHeight", "encodingType",
- // "mediaType", "allowEdit", "correctOrientation", "saveToPhotoAlbum" ]
- cameraOptions = new CameraOptions();
- cameraOptions.Quality = int.Parse(args[0]);
- cameraOptions.DestinationType = int.Parse(args[1]);
- cameraOptions.PictureSourceType = int.Parse(args[2]);
- cameraOptions.TargetWidth = int.Parse(args[3]);
- cameraOptions.TargetHeight = int.Parse(args[4]);
- cameraOptions.EncodingType = int.Parse(args[5]);
- cameraOptions.MediaType = int.Parse(args[6]);
- cameraOptions.AllowEdit = bool.Parse(args[7]);
- cameraOptions.CorrectOrientation = bool.Parse(args[8]);
- cameraOptions.SaveToPhotoAlbum = bool.Parse(args[9]);
-
- // a very large number will force the other value to be the bound
- if (cameraOptions.TargetWidth > -1 && cameraOptions.TargetHeight == -1)
- {
- cameraOptions.TargetHeight = 100000;
- }
- else if (cameraOptions.TargetHeight > -1 && cameraOptions.TargetWidth == -1)
- {
- cameraOptions.TargetWidth = 100000;
- }
- }
- catch (Exception ex)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
- return;
- }
-
- // Api supports FILE_URI, DATA_URL, NATIVE_URI destination types.
- // Treat all other destination types as an error.
- switch (cameraOptions.DestinationType)
- {
- case Camera.FILE_URI:
- case Camera.DATA_URL:
- case Camera.NATIVE_URI:
- break;
- default:
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Incorrect option: destinationType"));
- return;
- }
-
- ChooserBase chooserTask = null;
- if (cameraOptions.PictureSourceType == CAMERA)
- {
- chooserTask = new CameraCaptureTask();
- }
- else if ((cameraOptions.PictureSourceType == PHOTOLIBRARY) || (cameraOptions.PictureSourceType == SAVEDPHOTOALBUM))
- {
- chooserTask = new PhotoChooserTask();
- }
- // if chooserTask is still null, then PictureSourceType was invalid
- if (chooserTask != null)
- {
- chooserTask.Completed += onTaskCompleted;
- chooserTask.Show();
- }
- else
- {
- Debug.WriteLine("Unrecognized PictureSourceType :: " + cameraOptions.PictureSourceType.ToString());
- DispatchCommandResult(new PluginResult(PluginResult.Status.NO_RESULT));
- }
- }
-
- public void onTaskCompleted(object sender, PhotoResult e)
- {
- var task = sender as ChooserBase;
- if (task != null)
- {
- task.Completed -= onTaskCompleted;
- }
-
- if (e.Error != null)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR));
- return;
- }
-
- switch (e.TaskResult)
- {
- case TaskResult.OK:
- try
- {
- string imagePathOrContent = string.Empty;
-
- // Save image back to media library
- // only save to photoalbum if it didn't come from there ...
- if (cameraOptions.PictureSourceType == CAMERA && cameraOptions.SaveToPhotoAlbum)
- {
- MediaLibrary library = new MediaLibrary();
- Picture pict = library.SavePicture(e.OriginalFileName, e.ChosenPhoto); // to save to photo-roll ...
- }
-
- int newAngle = 0;
- // There's bug in Windows Phone 8.1 causing Seek on a DssPhotoStream not working properly.
- // https://connect.microsoft.com/VisualStudio/feedback/details/783252
- // But a mis-oriented file is better than nothing, so try and catch.
- try {
- int orient = ImageExifHelper.getImageOrientationFromStream(e.ChosenPhoto);
- switch (orient) {
- case ImageExifOrientation.LandscapeLeft:
- newAngle = 90;
- break;
- case ImageExifOrientation.PortraitUpsideDown:
- newAngle = 180;
- break;
- case ImageExifOrientation.LandscapeRight:
- newAngle = 270;
- break;
- case ImageExifOrientation.Portrait:
- default: break; // 0 default already set
- }
- } catch {
- Debug.WriteLine("Error fetching orientation from Exif");
- }
-
- if (newAngle != 0)
- {
- using (Stream rotImageStream = ImageExifHelper.RotateStream(e.ChosenPhoto, newAngle))
- {
- // we should reset stream position after saving stream to media library
- rotImageStream.Seek(0, SeekOrigin.Begin);
- if (cameraOptions.DestinationType == DATA_URL)
- {
- imagePathOrContent = GetImageContent(rotImageStream);
- }
- else // FILE_URL or NATIVE_URI (both use the same resultant uri format)
- {
- imagePathOrContent = SaveImageToLocalStorage(rotImageStream, Path.GetFileName(e.OriginalFileName));
- }
- }
- }
- else // no need to reorient
- {
- if (cameraOptions.DestinationType == DATA_URL)
- {
- imagePathOrContent = GetImageContent(e.ChosenPhoto);
- }
- else // FILE_URL or NATIVE_URI (both use the same resultant uri format)
- {
- imagePathOrContent = SaveImageToLocalStorage(e.ChosenPhoto, Path.GetFileName(e.OriginalFileName));
- }
- }
-
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, imagePathOrContent));
- }
- catch (Exception)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Error retrieving image."));
- }
- break;
- case TaskResult.Cancel:
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Selection cancelled."));
- break;
- default:
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Selection did not complete!"));
- break;
- }
- }
-
- ///
- /// Returns image content in a form of base64 string
- ///
- /// Image stream
- /// Base64 representation of the image
- private string GetImageContent(Stream stream)
- {
- byte[] imageContent = null;
-
- try
- {
- // Resize photo and convert to JPEG
- imageContent = ResizePhoto(stream);
- }
- finally
- {
- stream.Dispose();
- }
-
- return Convert.ToBase64String(imageContent);
- }
-
- ///
- /// Resize image
- ///
- /// Image stream
- /// resized image
- private byte[] ResizePhoto(Stream stream)
- {
- //output
- byte[] resizedFile;
-
- BitmapImage objBitmap = new BitmapImage();
- objBitmap.SetSource(stream);
- objBitmap.CreateOptions = BitmapCreateOptions.None;
-
- WriteableBitmap objWB = new WriteableBitmap(objBitmap);
- objBitmap.UriSource = null;
-
- // Calculate resultant image size
- int width, height;
- if (cameraOptions.TargetWidth >= 0 && cameraOptions.TargetHeight >= 0)
- {
- // Keep proportionally
- double ratio = Math.Min(
- (double)cameraOptions.TargetWidth / objWB.PixelWidth,
- (double)cameraOptions.TargetHeight / objWB.PixelHeight);
- width = Convert.ToInt32(ratio * objWB.PixelWidth);
- height = Convert.ToInt32(ratio * objWB.PixelHeight);
- }
- else
- {
- width = objWB.PixelWidth;
- height = objWB.PixelHeight;
- }
-
- //Hold the result stream
- using (MemoryStream objBitmapStreamResized = new MemoryStream())
- {
-
- try
- {
- // resize the photo with user defined TargetWidth & TargetHeight
- Extensions.SaveJpeg(objWB, objBitmapStreamResized, width, height, 0, cameraOptions.Quality);
- }
- finally
- {
- //Dispose bitmaps immediately, they are memory expensive
- DisposeImage(objBitmap);
- DisposeImage(objWB);
- GC.Collect();
- }
-
- //Convert the resized stream to a byte array.
- int streamLength = (int)objBitmapStreamResized.Length;
- resizedFile = new Byte[streamLength]; //-1
- objBitmapStreamResized.Position = 0;
-
- //for some reason we have to set Position to zero, but we don't have to earlier when we get the bytes from the chosen photo...
- objBitmapStreamResized.Read(resizedFile, 0, streamLength);
- }
-
- return resizedFile;
- }
-
- ///
- /// Util: Dispose a bitmap resource
- ///
- /// BitmapSource subclass to dispose
- private void DisposeImage(BitmapSource image)
- {
- if (image != null)
- {
- try
- {
- using (var ms = new MemoryStream(new byte[] { 0x0 }))
- {
- image.SetSource(ms);
- }
- }
- catch (Exception)
- {
- }
- }
- }
-
- ///
- /// Saves captured image in isolated storage
- ///
- /// image file name
- /// Image path
- private string SaveImageToLocalStorage(Stream stream, string imageFileName)
- {
-
- if (stream == null)
- {
- throw new ArgumentNullException("imageBytes");
- }
- try
- {
- var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
-
- if (!isoFile.DirectoryExists(isoFolder))
- {
- isoFile.CreateDirectory(isoFolder);
- }
-
- string filePath = System.IO.Path.Combine("///" + isoFolder + "/", imageFileName);
-
- using (IsolatedStorageFileStream outputStream = isoFile.CreateFile(filePath))
- {
- BitmapImage objBitmap = new BitmapImage();
- objBitmap.SetSource(stream);
- objBitmap.CreateOptions = BitmapCreateOptions.None;
-
- WriteableBitmap objWB = new WriteableBitmap(objBitmap);
- objBitmap.UriSource = null;
-
- try
- {
-
- //use photo's actual width & height if user doesn't provide width & height
- if (cameraOptions.TargetWidth < 0 && cameraOptions.TargetHeight < 0)
- {
- objWB.SaveJpeg(outputStream, objWB.PixelWidth, objWB.PixelHeight, 0, cameraOptions.Quality);
- }
- else
- {
- //Resize
- //Keep proportionally
- double ratio = Math.Min((double)cameraOptions.TargetWidth / objWB.PixelWidth, (double)cameraOptions.TargetHeight / objWB.PixelHeight);
- int width = Convert.ToInt32(ratio * objWB.PixelWidth);
- int height = Convert.ToInt32(ratio * objWB.PixelHeight);
-
- // resize the photo with user defined TargetWidth & TargetHeight
- objWB.SaveJpeg(outputStream, width, height, 0, cameraOptions.Quality);
- }
- }
- finally
- {
- //Dispose bitmaps immediately, they are memory expensive
- DisposeImage(objBitmap);
- DisposeImage(objWB);
- GC.Collect();
- }
- }
-
- return new Uri(filePath, UriKind.Relative).ToString();
- }
- catch (Exception)
- {
- //TODO: log or do something else
- throw;
- }
- finally
- {
- stream.Dispose();
- }
- }
-
- }
-}
diff --git a/plugins/cordova-plugin-camera/tests/ios/.npmignore b/plugins/cordova-plugin-camera/tests/ios/.npmignore
deleted file mode 100644
index b512c09..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 22fcf41..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/xcshareddata/CDVCameraTest.xccheckout b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/xcshareddata/CDVCameraTest.xccheckout
deleted file mode 100644
index c8a5605..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/xcshareddata/CDVCameraTest.xccheckout
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- IDESourceControlProjectFavoriteDictionaryKey
-
- IDESourceControlProjectIdentifier
- 6BE9AD73-1B9F-4362-98D7-DC631BEC6185
- IDESourceControlProjectName
- CDVCameraTest
- IDESourceControlProjectOriginsDictionary
-
- 729B5706E7BAF4E9EE7AEE3C003A08107411AB7C
- github.com:shazron/cordova-plugin-camera.git
-
- IDESourceControlProjectPath
- tests/ios/CDVCameraTest.xcworkspace
- IDESourceControlProjectRelativeInstallPathDictionary
-
- 729B5706E7BAF4E9EE7AEE3C003A08107411AB7C
- ../../..
-
- IDESourceControlProjectURL
- github.com:shazron/cordova-plugin-camera.git
- IDESourceControlProjectVersion
- 111
- IDESourceControlProjectWCCIdentifier
- 729B5706E7BAF4E9EE7AEE3C003A08107411AB7C
- IDESourceControlProjectWCConfigurations
-
-
- IDESourceControlRepositoryExtensionIdentifierKey
- public.vcs.git
- IDESourceControlWCCIdentifierKey
- 729B5706E7BAF4E9EE7AEE3C003A08107411AB7C
- IDESourceControlWCCName
- cordova-plugin-camera
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme
deleted file mode 100644
index 3e8cd2c..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraLibTests/CameraTest.m b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraLibTests/CameraTest.m
deleted file mode 100644
index d1da2fa..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraLibTests/CameraTest.m
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import "CDVCamera.h"
-#import "UIImage+CropScaleOrientation.h"
-#import
-#import
-#import
-#import
-
-
-@interface CameraTest : XCTestCase
-
-@property (nonatomic, strong) CDVCamera* plugin;
-
-@end
-
-@interface CDVCamera ()
-
-// expose private interface
-- (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPictureOptions*)options;
-- (UIImage*)retrieveImage:(NSDictionary*)info options:(CDVPictureOptions*)options;
-- (CDVPluginResult*)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info;
-- (CDVPluginResult*)resultForVideo:(NSDictionary*)info;
-
-@end
-
-@implementation CameraTest
-
-- (void)setUp {
- [super setUp];
- // Put setup code here. This method is called before the invocation of each test method in the class.
-
- self.plugin = [[CDVCamera alloc] init];
-}
-
-- (void)tearDown {
- // Put teardown code here. This method is called after the invocation of each test method in the class.
- [super tearDown];
-}
-
-- (void) testPictureOptionsCreate
-{
- NSArray* args;
- CDVPictureOptions* options;
- NSDictionary* popoverOptions;
-
- // No arguments, check whether the defaults are set
- args = @[];
- CDVInvokedUrlCommand* command = [[CDVInvokedUrlCommand alloc] initWithArguments:args callbackId:@"dummy" className:@"myclassname" methodName:@"mymethodname"];
-
- options = [CDVPictureOptions createFromTakePictureArguments:command];
-
- XCTAssertEqual([options.quality intValue], 50);
- XCTAssertEqual(options.destinationType, (int)DestinationTypeFileUri);
- XCTAssertEqual(options.sourceType, (int)UIImagePickerControllerSourceTypeCamera);
- XCTAssertEqual(options.targetSize.width, 0);
- XCTAssertEqual(options.targetSize.height, 0);
- XCTAssertEqual(options.encodingType, (int)EncodingTypeJPEG);
- XCTAssertEqual(options.mediaType, (int)MediaTypePicture);
- XCTAssertEqual(options.allowsEditing, NO);
- XCTAssertEqual(options.correctOrientation, NO);
- XCTAssertEqual(options.saveToPhotoAlbum, NO);
- XCTAssertEqualObjects(options.popoverOptions, nil);
- XCTAssertEqual(options.cameraDirection, (int)UIImagePickerControllerCameraDeviceRear);
- XCTAssertEqual(options.popoverSupported, NO);
- XCTAssertEqual(options.usesGeolocation, NO);
-
- // Set each argument, check whether they are set. different from defaults
- popoverOptions = @{ @"x" : @1, @"y" : @2, @"width" : @3, @"height" : @4 };
-
- args = @[
- @(49),
- @(DestinationTypeDataUrl),
- @(UIImagePickerControllerSourceTypePhotoLibrary),
- @(120),
- @(240),
- @(EncodingTypePNG),
- @(MediaTypeVideo),
- @YES,
- @YES,
- @YES,
- popoverOptions,
- @(UIImagePickerControllerCameraDeviceFront),
- ];
-
- command = [[CDVInvokedUrlCommand alloc] initWithArguments:args callbackId:@"dummy" className:@"myclassname" methodName:@"mymethodname"];
- options = [CDVPictureOptions createFromTakePictureArguments:command];
-
- XCTAssertEqual([options.quality intValue], 49);
- XCTAssertEqual(options.destinationType, (int)DestinationTypeDataUrl);
- XCTAssertEqual(options.sourceType, (int)UIImagePickerControllerSourceTypePhotoLibrary);
- XCTAssertEqual(options.targetSize.width, 120);
- XCTAssertEqual(options.targetSize.height, 240);
- XCTAssertEqual(options.encodingType, (int)EncodingTypePNG);
- XCTAssertEqual(options.mediaType, (int)MediaTypeVideo);
- XCTAssertEqual(options.allowsEditing, YES);
- XCTAssertEqual(options.correctOrientation, YES);
- XCTAssertEqual(options.saveToPhotoAlbum, YES);
- XCTAssertEqualObjects(options.popoverOptions, popoverOptions);
- XCTAssertEqual(options.cameraDirection, (int)UIImagePickerControllerCameraDeviceFront);
- XCTAssertEqual(options.popoverSupported, NO);
- XCTAssertEqual(options.usesGeolocation, NO);
-}
-
-- (void) testCameraPickerCreate
-{
- NSDictionary* popoverOptions;
- NSArray* args;
- CDVPictureOptions* pictureOptions;
- CDVCameraPicker* picker;
-
- // Souce is Camera, and image type
-
- popoverOptions = @{ @"x" : @1, @"y" : @2, @"width" : @3, @"height" : @4 };
- args = @[
- @(49),
- @(DestinationTypeDataUrl),
- @(UIImagePickerControllerSourceTypeCamera),
- @(120),
- @(240),
- @(EncodingTypePNG),
- @(MediaTypeAll),
- @YES,
- @YES,
- @YES,
- popoverOptions,
- @(UIImagePickerControllerCameraDeviceFront),
- ];
-
- CDVInvokedUrlCommand* command = [[CDVInvokedUrlCommand alloc] initWithArguments:args callbackId:@"dummy" className:@"myclassname" methodName:@"mymethodname"];
- pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
-
- if ([UIImagePickerController isSourceTypeAvailable:pictureOptions.sourceType]) {
- picker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
-
- XCTAssertEqualObjects(picker.pictureOptions, pictureOptions);
-
- XCTAssertEqual(picker.sourceType, pictureOptions.sourceType);
- XCTAssertEqual(picker.allowsEditing, pictureOptions.allowsEditing);
- XCTAssertEqualObjects(picker.mediaTypes, @[(NSString*)kUTTypeImage]);
- XCTAssertEqual(picker.cameraDevice, pictureOptions.cameraDirection);
- }
-
- // Souce is not Camera, and all media types
-
- args = @[
- @(49),
- @(DestinationTypeDataUrl),
- @(UIImagePickerControllerSourceTypePhotoLibrary),
- @(120),
- @(240),
- @(EncodingTypePNG),
- @(MediaTypeAll),
- @YES,
- @YES,
- @YES,
- popoverOptions,
- @(UIImagePickerControllerCameraDeviceFront),
- ];
-
- command = [[CDVInvokedUrlCommand alloc] initWithArguments:args callbackId:@"dummy" className:@"myclassname" methodName:@"mymethodname"];
- pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
-
- if ([UIImagePickerController isSourceTypeAvailable:pictureOptions.sourceType]) {
- picker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
-
- XCTAssertEqualObjects(picker.pictureOptions, pictureOptions);
-
- XCTAssertEqual(picker.sourceType, pictureOptions.sourceType);
- XCTAssertEqual(picker.allowsEditing, pictureOptions.allowsEditing);
- XCTAssertEqualObjects(picker.mediaTypes, [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]);
- }
-
- // Souce is not Camera, and either Image or Movie media type
-
- args = @[
- @(49),
- @(DestinationTypeDataUrl),
- @(UIImagePickerControllerSourceTypePhotoLibrary),
- @(120),
- @(240),
- @(EncodingTypePNG),
- @(MediaTypeVideo),
- @YES,
- @YES,
- @YES,
- popoverOptions,
- @(UIImagePickerControllerCameraDeviceFront),
- ];
-
- command = [[CDVInvokedUrlCommand alloc] initWithArguments:args callbackId:@"dummy" className:@"myclassname" methodName:@"mymethodname"];
- pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
-
- if ([UIImagePickerController isSourceTypeAvailable:pictureOptions.sourceType]) {
- picker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
-
- XCTAssertEqualObjects(picker.pictureOptions, pictureOptions);
-
- XCTAssertEqual(picker.sourceType, pictureOptions.sourceType);
- XCTAssertEqual(picker.allowsEditing, pictureOptions.allowsEditing);
- XCTAssertEqualObjects(picker.mediaTypes, @[(NSString*)kUTTypeMovie]);
- }
-}
-
-- (UIImage*) createImage:(CGRect)rect orientation:(UIImageOrientation)imageOrientation {
- UIGraphicsBeginImageContext(rect.size);
- CGContextRef context = UIGraphicsGetCurrentContext();
-
- CGContextSetFillColorWithColor(context, [[UIColor greenColor] CGColor]);
- CGContextFillRect(context, rect);
-
- CGImageRef result = CGBitmapContextCreateImage(UIGraphicsGetCurrentContext());
- UIImage* image = [UIImage imageWithCGImage:result scale:1.0f orientation:imageOrientation];
-
- UIGraphicsEndImageContext();
-
- return image;
-}
-
-- (void) testImageScaleCropForSize {
-
- UIImage *sourceImagePortrait, *sourceImageLandscape, *targetImage;
- CGSize targetSize = CGSizeZero;
-
- sourceImagePortrait = [self createImage:CGRectMake(0, 0, 2448, 3264) orientation:UIImageOrientationUp];
- sourceImageLandscape = [self createImage:CGRectMake(0, 0, 3264, 2448) orientation:UIImageOrientationUp];
-
- // test 640x480
-
- targetSize = CGSizeMake(640, 480);
-
- targetImage = [sourceImagePortrait imageByScalingAndCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageByScalingAndCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
-
- // test 800x600
-
- targetSize = CGSizeMake(800, 600);
-
- targetImage = [sourceImagePortrait imageByScalingAndCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageByScalingAndCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- // test 1024x768
-
- targetSize = CGSizeMake(1024, 768);
-
- targetImage = [sourceImagePortrait imageByScalingAndCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageByScalingAndCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-}
-
-- (void) testImageScaleNoCropForSize {
- UIImage *sourceImagePortrait, *sourceImageLandscape, *targetImage;
- CGSize targetSize = CGSizeZero;
-
- sourceImagePortrait = [self createImage:CGRectMake(0, 0, 2448, 3264) orientation:UIImageOrientationUp];
- sourceImageLandscape = [self createImage:CGRectMake(0, 0, 3264, 2448) orientation:UIImageOrientationUp];
-
- // test 640x480
-
- targetSize = CGSizeMake(640, 480);
-
- targetImage = [sourceImagePortrait imageByScalingNotCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageByScalingNotCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
-
- // test 800x600
-
- targetSize = CGSizeMake(800, 600);
-
- targetImage = [sourceImagePortrait imageByScalingNotCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageByScalingNotCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- // test 1024x768
-
- targetSize = CGSizeMake(1024, 768);
-
- targetImage = [sourceImagePortrait imageByScalingNotCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageByScalingNotCroppingForSize:targetSize];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-}
-
-- (void) testImageCorrectedForOrientation {
- UIImage *sourceImagePortrait, *sourceImageLandscape, *targetImage;
- CGSize targetSize = CGSizeZero;
-
- sourceImagePortrait = [self createImage:CGRectMake(0, 0, 2448, 3264) orientation:UIImageOrientationDown];
- sourceImageLandscape = [self createImage:CGRectMake(0, 0, 3264, 2448) orientation:UIImageOrientationDown];
-
- // PORTRAIT - image size should be unchanged
-
- targetSize = CGSizeMake(2448, 3264);
-
- targetImage = [sourceImagePortrait imageCorrectedForCaptureOrientation:UIImageOrientationUp];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
- XCTAssertEqual(targetImage.imageOrientation, UIImageOrientationUp);
-
- targetImage = [sourceImagePortrait imageCorrectedForCaptureOrientation:UIImageOrientationDown];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
- XCTAssertEqual(targetImage.imageOrientation, UIImageOrientationUp);
-
- targetImage = [sourceImagePortrait imageCorrectedForCaptureOrientation:UIImageOrientationRight];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
- XCTAssertEqual(targetImage.imageOrientation, UIImageOrientationUp);
-
- targetImage = [sourceImagePortrait imageCorrectedForCaptureOrientation:UIImageOrientationLeft];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
- XCTAssertEqual(targetImage.imageOrientation, UIImageOrientationUp);
-
- // LANDSCAPE - image size should be unchanged
-
- targetSize = CGSizeMake(3264, 2448);
-
- targetImage = [sourceImageLandscape imageCorrectedForCaptureOrientation:UIImageOrientationUp];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageCorrectedForCaptureOrientation:UIImageOrientationDown];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageCorrectedForCaptureOrientation:UIImageOrientationRight];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-
- targetImage = [sourceImageLandscape imageCorrectedForCaptureOrientation:UIImageOrientationLeft];
- XCTAssertEqual(targetImage.size.width, targetSize.width);
- XCTAssertEqual(targetImage.size.height, targetSize.height);
-}
-
-
-- (void) testRetrieveImage
-{
- CDVPictureOptions* pictureOptions = [[CDVPictureOptions alloc] init];
- NSDictionary *infoDict1, *infoDict2;
- UIImage* resultImage;
-
- UIImage* originalImage = [self createImage:CGRectMake(0, 0, 1024, 768) orientation:UIImageOrientationDown];
- UIImage* originalCorrectedForOrientation = [originalImage imageCorrectedForCaptureOrientation];
-
- UIImage* editedImage = [self createImage:CGRectMake(0, 0, 800, 600) orientation:UIImageOrientationDown];
- UIImage* scaledImageWithCrop = [originalImage imageByScalingAndCroppingForSize:CGSizeMake(640, 480)];
- UIImage* scaledImageNoCrop = [originalImage imageByScalingNotCroppingForSize:CGSizeMake(640, 480)];
-
- infoDict1 = @{
- UIImagePickerControllerOriginalImage : originalImage
- };
-
- infoDict2 = @{
- UIImagePickerControllerOriginalImage : originalImage,
- UIImagePickerControllerEditedImage : editedImage
- };
-
- // Original with no options
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeZero;
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = NO;
-
- resultImage = [self.plugin retrieveImage:infoDict1 options:pictureOptions];
- XCTAssertEqualObjects(resultImage, originalImage);
-
- // Original with no options
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeZero;
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = NO;
-
- resultImage = [self.plugin retrieveImage:infoDict2 options:pictureOptions];
- XCTAssertEqualObjects(resultImage, editedImage);
-
- // Original with corrected orientation
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeZero;
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = YES;
-
- resultImage = [self.plugin retrieveImage:infoDict1 options:pictureOptions];
- XCTAssertNotEqual(resultImage.imageOrientation, originalImage.imageOrientation);
- XCTAssertEqual(resultImage.imageOrientation, originalCorrectedForOrientation.imageOrientation);
- XCTAssertEqual(resultImage.size.width, originalCorrectedForOrientation.size.width);
- XCTAssertEqual(resultImage.size.height, originalCorrectedForOrientation.size.height);
-
- // Original with targetSize, no crop
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeMake(640, 480);
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = NO;
-
- resultImage = [self.plugin retrieveImage:infoDict1 options:pictureOptions];
- XCTAssertEqual(resultImage.size.width, scaledImageNoCrop.size.width);
- XCTAssertEqual(resultImage.size.height, scaledImageNoCrop.size.height);
-
- // Original with targetSize, plus crop
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeMake(640, 480);
- pictureOptions.cropToSize = YES;
- pictureOptions.correctOrientation = NO;
-
- resultImage = [self.plugin retrieveImage:infoDict1 options:pictureOptions];
- XCTAssertEqual(resultImage.size.width, scaledImageWithCrop.size.width);
- XCTAssertEqual(resultImage.size.height, scaledImageWithCrop.size.height);
-}
-
-- (void) testProcessImage
-{
- CDVPictureOptions* pictureOptions = [[CDVPictureOptions alloc] init];
- NSData* resultData;
-
- UIImage* originalImage = [self createImage:CGRectMake(0, 0, 1024, 768) orientation:UIImageOrientationDown];
- NSData* originalImageDataPNG = UIImagePNGRepresentation(originalImage);
- NSData* originalImageDataJPEG = UIImageJPEGRepresentation(originalImage, 1.0);
-
- // Original, PNG
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeZero;
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = NO;
- pictureOptions.encodingType = EncodingTypePNG;
-
- resultData = [self.plugin processImage:originalImage info:@{} options:pictureOptions];
- XCTAssertEqualObjects([resultData base64EncodedStringWithOptions:0], [originalImageDataPNG base64EncodedStringWithOptions:0]);
-
- // Original, JPEG, full quality
-
- pictureOptions.allowsEditing = NO;
- pictureOptions.targetSize = CGSizeZero;
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = NO;
- pictureOptions.encodingType = EncodingTypeJPEG;
-
- resultData = [self.plugin processImage:originalImage info:@{} options:pictureOptions];
- XCTAssertEqualObjects([resultData base64EncodedStringWithOptions:0], [originalImageDataJPEG base64EncodedStringWithOptions:0]);
-
- // Original, JPEG, with quality value
-
- pictureOptions.allowsEditing = YES;
- pictureOptions.targetSize = CGSizeZero;
- pictureOptions.cropToSize = NO;
- pictureOptions.correctOrientation = NO;
- pictureOptions.encodingType = EncodingTypeJPEG;
- pictureOptions.quality = @(57);
-
- NSData* originalImageDataJPEGWithQuality = UIImageJPEGRepresentation(originalImage, [pictureOptions.quality floatValue]/ 100.f);
- resultData = [self.plugin processImage:originalImage info:@{} options:pictureOptions];
- XCTAssertEqualObjects([resultData base64EncodedStringWithOptions:0], [originalImageDataJPEGWithQuality base64EncodedStringWithOptions:0]);
-
- // TODO: usesGeolocation is not tested
-}
-
-@end
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraLibTests/Info.plist b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraLibTests/Info.plist
deleted file mode 100644
index 95c8add..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraLibTests/Info.plist
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- BNDL
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.pbxproj b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.pbxproj
deleted file mode 100644
index 3e5a4c0..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,561 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 30486FEB1A40DC350065C233 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30486FEA1A40DC350065C233 /* UIKit.framework */; };
- 30486FED1A40DC3B0065C233 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30486FEC1A40DC3A0065C233 /* Foundation.framework */; };
- 30486FF91A40DCC70065C233 /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = 30486FF31A40DCC70065C233 /* CDVCamera.m */; };
- 30486FFA1A40DCC70065C233 /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 30486FF61A40DCC70065C233 /* CDVJpegHeaderWriter.m */; };
- 30486FFB1A40DCC70065C233 /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 30486FF81A40DCC70065C233 /* UIImage+CropScaleOrientation.m */; };
- 304870011A40DD620065C233 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30486FFE1A40DD180065C233 /* CoreGraphics.framework */; };
- 304870021A40DD860065C233 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30486FFE1A40DD180065C233 /* CoreGraphics.framework */; };
- 304870031A40DD8C0065C233 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30486FEA1A40DC350065C233 /* UIKit.framework */; };
- 304870051A40DD9A0065C233 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 304870041A40DD9A0065C233 /* MobileCoreServices.framework */; };
- 304870071A40DDAC0065C233 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 304870061A40DDAC0065C233 /* AssetsLibrary.framework */; };
- 304870091A40DDB90065C233 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 304870081A40DDB90065C233 /* CoreLocation.framework */; };
- 3048700B1A40DDF30065C233 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3048700A1A40DDF30065C233 /* ImageIO.framework */; };
- 308F59B11A4228730031A4D4 /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; };
- 7E9F51B119DA114400DA31AC /* CameraTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* CameraTest.m */; };
- 7E9F51B919DA1B1600DA31AC /* libCDVCameraLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* libCDVCameraLib.a */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 30486FFC1A40DCE80065C233 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D;
- remoteInfo = CordovaLib;
- };
- 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 68A32D7114102E1C006B237C;
- remoteInfo = CordovaLib;
- };
- 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 7E9F519419DA102000DA31AC;
- remoteInfo = CDVCameraLib;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 7E9F519319DA102000DA31AC /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/$(PRODUCT_NAME)";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 30486FEA1A40DC350065C233 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
- 30486FEC1A40DC3A0065C233 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
- 30486FF21A40DCC70065C233 /* CDVCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCamera.h; sourceTree = ""; };
- 30486FF31A40DCC70065C233 /* CDVCamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCamera.m; sourceTree = ""; };
- 30486FF41A40DCC70065C233 /* CDVExif.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVExif.h; sourceTree = ""; };
- 30486FF51A40DCC70065C233 /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJpegHeaderWriter.h; sourceTree = ""; };
- 30486FF61A40DCC70065C233 /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJpegHeaderWriter.m; sourceTree = ""; };
- 30486FF71A40DCC70065C233 /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+CropScaleOrientation.h"; sourceTree = ""; };
- 30486FF81A40DCC70065C233 /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+CropScaleOrientation.m"; sourceTree = ""; };
- 30486FFE1A40DD180065C233 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
- 304870041A40DD9A0065C233 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/MobileCoreServices.framework; sourceTree = DEVELOPER_DIR; };
- 304870061A40DDAC0065C233 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/AssetsLibrary.framework; sourceTree = DEVELOPER_DIR; };
- 304870081A40DDB90065C233 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreLocation.framework; sourceTree = DEVELOPER_DIR; };
- 3048700A1A40DDF30065C233 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/ImageIO.framework; sourceTree = DEVELOPER_DIR; };
- 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = ""; };
- 7E9F519519DA102000DA31AC /* libCDVCameraLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVCameraLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 7E9F519F19DA102000DA31AC /* CDVCameraLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVCameraLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
- 7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 7E9F51B019DA114400DA31AC /* CameraTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CameraTest.m; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 7E9F519219DA102000DA31AC /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 308F59B11A4228730031A4D4 /* libCordova.a in Frameworks */,
- 304870011A40DD620065C233 /* CoreGraphics.framework in Frameworks */,
- 30486FED1A40DC3B0065C233 /* Foundation.framework in Frameworks */,
- 30486FEB1A40DC350065C233 /* UIKit.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 7E9F519C19DA102000DA31AC /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3048700B1A40DDF30065C233 /* ImageIO.framework in Frameworks */,
- 304870091A40DDB90065C233 /* CoreLocation.framework in Frameworks */,
- 304870071A40DDAC0065C233 /* AssetsLibrary.framework in Frameworks */,
- 304870051A40DD9A0065C233 /* MobileCoreServices.framework in Frameworks */,
- 304870031A40DD8C0065C233 /* UIKit.framework in Frameworks */,
- 304870021A40DD860065C233 /* CoreGraphics.framework in Frameworks */,
- 7E9F51B919DA1B1600DA31AC /* libCDVCameraLib.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 30486FF11A40DCC70065C233 /* CDVCameraLib */ = {
- isa = PBXGroup;
- children = (
- 30486FF21A40DCC70065C233 /* CDVCamera.h */,
- 30486FF31A40DCC70065C233 /* CDVCamera.m */,
- 30486FF41A40DCC70065C233 /* CDVExif.h */,
- 30486FF51A40DCC70065C233 /* CDVJpegHeaderWriter.h */,
- 30486FF61A40DCC70065C233 /* CDVJpegHeaderWriter.m */,
- 30486FF71A40DCC70065C233 /* UIImage+CropScaleOrientation.h */,
- 30486FF81A40DCC70065C233 /* UIImage+CropScaleOrientation.m */,
- );
- name = CDVCameraLib;
- path = ../../../src/ios;
- sourceTree = "";
- };
- 308F59B01A4227A60031A4D4 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 3048700A1A40DDF30065C233 /* ImageIO.framework */,
- 304870081A40DDB90065C233 /* CoreLocation.framework */,
- 304870061A40DDAC0065C233 /* AssetsLibrary.framework */,
- 304870041A40DD9A0065C233 /* MobileCoreServices.framework */,
- 30486FFE1A40DD180065C233 /* CoreGraphics.framework */,
- 30486FEC1A40DC3A0065C233 /* Foundation.framework */,
- 30486FEA1A40DC350065C233 /* UIKit.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
- 7E9F517119DA09CE00DA31AC = {
- isa = PBXGroup;
- children = (
- 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */,
- 308F59B01A4227A60031A4D4 /* Frameworks */,
- 30486FF11A40DCC70065C233 /* CDVCameraLib */,
- 7E9F51A019DA102000DA31AC /* CDVCameraLibTests */,
- 7E9F517D19DA0A0A00DA31AC /* Products */,
- );
- sourceTree = "";
- };
- 7E9F517D19DA0A0A00DA31AC /* Products */ = {
- isa = PBXGroup;
- children = (
- 7E9F519519DA102000DA31AC /* libCDVCameraLib.a */,
- 7E9F519F19DA102000DA31AC /* CDVCameraLibTests.xctest */,
- );
- name = Products;
- sourceTree = "";
- };
- 7E9F518C19DA0F8300DA31AC /* Products */ = {
- isa = PBXGroup;
- children = (
- 7E9F519019DA0F8300DA31AC /* libCordova.a */,
- );
- name = Products;
- sourceTree = "";
- };
- 7E9F51A019DA102000DA31AC /* CDVCameraLibTests */ = {
- isa = PBXGroup;
- children = (
- 7E9F51A119DA102000DA31AC /* Supporting Files */,
- 7E9F51B019DA114400DA31AC /* CameraTest.m */,
- );
- path = CDVCameraLibTests;
- sourceTree = "";
- };
- 7E9F51A119DA102000DA31AC /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- 7E9F51A219DA102000DA31AC /* Info.plist */,
- );
- name = "Supporting Files";
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 7E9F519419DA102000DA31AC /* CDVCameraLib */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVCameraLib" */;
- buildPhases = (
- 7E9F519119DA102000DA31AC /* Sources */,
- 7E9F519219DA102000DA31AC /* Frameworks */,
- 7E9F519319DA102000DA31AC /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- 30486FFD1A40DCE80065C233 /* PBXTargetDependency */,
- );
- name = CDVCameraLib;
- productName = CDVCameraLib;
- productReference = 7E9F519519DA102000DA31AC /* libCDVCameraLib.a */;
- productType = "com.apple.product-type.library.static";
- };
- 7E9F519E19DA102000DA31AC /* CDVCameraLibTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVCameraLibTests" */;
- buildPhases = (
- 7E9F519B19DA102000DA31AC /* Sources */,
- 7E9F519C19DA102000DA31AC /* Frameworks */,
- 7E9F519D19DA102000DA31AC /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */,
- );
- name = CDVCameraLibTests;
- productName = CDVCameraLibTests;
- productReference = 7E9F519F19DA102000DA31AC /* CDVCameraLibTests.xctest */;
- productType = "com.apple.product-type.bundle.unit-test";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 7E9F517219DA09CE00DA31AC /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0610;
- TargetAttributes = {
- 7E9F519419DA102000DA31AC = {
- CreatedOnToolsVersion = 6.0;
- };
- 7E9F519E19DA102000DA31AC = {
- CreatedOnToolsVersion = 6.0;
- };
- };
- };
- buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVCameraTest" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 7E9F517119DA09CE00DA31AC;
- productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */;
- projectDirPath = "";
- projectReferences = (
- {
- ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */;
- ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
- },
- );
- projectRoot = "";
- targets = (
- 7E9F519419DA102000DA31AC /* CDVCameraLib */,
- 7E9F519E19DA102000DA31AC /* CDVCameraLibTests */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
- 7E9F519019DA0F8300DA31AC /* libCordova.a */ = {
- isa = PBXReferenceProxy;
- fileType = archive.ar;
- path = libCordova.a;
- remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-/* End PBXReferenceProxy section */
-
-/* Begin PBXResourcesBuildPhase section */
- 7E9F519D19DA102000DA31AC /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 7E9F519119DA102000DA31AC /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 30486FF91A40DCC70065C233 /* CDVCamera.m in Sources */,
- 30486FFB1A40DCC70065C233 /* UIImage+CropScaleOrientation.m in Sources */,
- 30486FFA1A40DCC70065C233 /* CDVJpegHeaderWriter.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 7E9F519B19DA102000DA31AC /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 7E9F51B119DA114400DA31AC /* CameraTest.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 30486FFD1A40DCE80065C233 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = CordovaLib;
- targetProxy = 30486FFC1A40DCE80065C233 /* PBXContainerItemProxy */;
- };
- 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 7E9F519419DA102000DA31AC /* CDVCameraLib */;
- targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 7E9F517619DA09CE00DA31AC /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ONLY_ACTIVE_ARCH = YES;
- };
- name = Debug;
- };
- 7E9F517719DA09CE00DA31AC /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- };
- name = Release;
- };
- 7E9F51A419DA102000DA31AC /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
- "\"$(OBJROOT)/UninstalledProducts/include\"",
- "\"$(BUILT_PRODUCTS_DIR)\"",
- );
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- MTL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- };
- name = Debug;
- };
- 7E9F51A519DA102000DA31AC /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
- "\n\"$(OBJROOT)/UninstalledProducts/include\"\n\"$(BUILT_PRODUCTS_DIR)\"",
- );
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 7E9F51A719DA102000DA31AC /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- INFOPLIST_FILE = CDVCameraLibTests/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MTL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-framework",
- XCTest,
- "-all_load",
- "-ObjC",
- );
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = iphoneos;
- };
- name = Debug;
- };
- 7E9F51A819DA102000DA31AC /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- INFOPLIST_FILE = CDVCameraLibTests/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- MTL_ENABLE_DEBUG_INFO = NO;
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-framework",
- XCTest,
- "-all_load",
- "-ObjC",
- );
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = iphoneos;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVCameraTest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7E9F517619DA09CE00DA31AC /* Debug */,
- 7E9F517719DA09CE00DA31AC /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVCameraLib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7E9F51A419DA102000DA31AC /* Debug */,
- 7E9F51A519DA102000DA31AC /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVCameraLibTests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7E9F51A719DA102000DA31AC /* Debug */,
- 7E9F51A819DA102000DA31AC /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 7E9F517219DA09CE00DA31AC /* Project object */;
-}
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 98498f8..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.xcworkspace/xcshareddata/CDVCameraTest.xccheckout b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.xcworkspace/xcshareddata/CDVCameraTest.xccheckout
deleted file mode 100644
index 2a654cb..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/project.xcworkspace/xcshareddata/CDVCameraTest.xccheckout
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- IDESourceControlProjectFavoriteDictionaryKey
-
- IDESourceControlProjectIdentifier
- 6BE9AD73-1B9F-4362-98D7-DC631BEC6185
- IDESourceControlProjectName
- CDVCameraTest
- IDESourceControlProjectOriginsDictionary
-
- BEF5A5D0FF64801E558286389440357A9233D7DB
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
-
- IDESourceControlProjectPath
- tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj
- IDESourceControlProjectRelativeInstallPathDictionary
-
- BEF5A5D0FF64801E558286389440357A9233D7DB
- ../../../../..
-
- IDESourceControlProjectURL
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
- IDESourceControlProjectVersion
- 111
- IDESourceControlProjectWCCIdentifier
- BEF5A5D0FF64801E558286389440357A9233D7DB
- IDESourceControlProjectWCConfigurations
-
-
- IDESourceControlRepositoryExtensionIdentifierKey
- public.vcs.git
- IDESourceControlWCCIdentifierKey
- BEF5A5D0FF64801E558286389440357A9233D7DB
- IDESourceControlWCCName
- cordova-plugin-camera
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/xcshareddata/xcschemes/CDVCameraLib.xcscheme b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/xcshareddata/xcschemes/CDVCameraLib.xcscheme
deleted file mode 100644
index f0a8304..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/xcshareddata/xcschemes/CDVCameraLib.xcscheme
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/xcshareddata/xcschemes/CDVCameraLibTests.xcscheme b/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/xcshareddata/xcschemes/CDVCameraLibTests.xcscheme
deleted file mode 100644
index b5d2603..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/CDVCameraTest/CDVCameraTest.xcodeproj/xcshareddata/xcschemes/CDVCameraLibTests.xcscheme
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/ios/README.md b/plugins/cordova-plugin-camera/tests/ios/README.md
deleted file mode 100644
index b839310..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-# iOS Tests for CDVCamera
-
-You need to install `node.js` to pull in `cordova-ios`.
-
-First install cordova-ios:
-
- npm install
-
-... in the current folder.
-
-
-# Testing from Xcode
-
-1. Launch the `CDVCameraTest.xcworkspace` file.
-2. Choose "CDVCameraLibTests" from the scheme drop-down menu
-3. Click and hold on the `Play` button, and choose the `Wrench` icon to run the tests
-
-
-# Testing from the command line
-
- npm test
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/de/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/de/README.md
deleted file mode 100644
index 0b3ae96..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/de/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# iOS-Tests für CDVCamera
-
-Sie müssen installieren `node.js` in `Cordova-Ios` zu ziehen.
-
-Installieren Sie Cordova-Ios zum ersten Mal:
-
- npm install
-
-
-... im aktuellen Ordner.
-
-# Testen von Xcode
-
- 1. Starten Sie die Datei `CDVCameraTest.xcworkspace` .
- 2. Wählen Sie im Dropdown-Schema "CDVCameraLibTests"
- 3. Klicken Sie und halten Sie auf den `Play` -Button und wählen Sie das `Schraubenschlüssel` -Symbol zum Ausführen der tests
-
-# Tests von der Befehlszeile aus
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/es/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/es/README.md
deleted file mode 100644
index 7240746..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/es/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# Pruebas de iOS para CDVCamera
-
-Necesita instalar `node.js` en `Córdoba-ios`.
-
-Primero instalar cordova-ios:
-
- npm install
-
-
-... en la carpeta actual.
-
-# Prueba de Xcode
-
- 1. Iniciar el archivo `CDVCameraTest.xcworkspace` .
- 2. Elija "CDVCameraLibTests" en el menú de lista desplegable esquema
- 3. Haga clic y mantenga el botón de `Play` y elegir el icono de `llave inglesa` para ejecutar las pruebas
-
-# Pruebas desde la línea de comandos
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/fr/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/fr/README.md
deleted file mode 100644
index 4c656a3..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/fr/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# Tests d'iOS pour CDVCamera
-
-Vous devez installer `node.js` à `cordova-ios`.
-
-Commencez par installer cordova-ios :
-
- npm install
-
-
-... dans le dossier actuel.
-
-# Tests de Xcode
-
- 1. Lancez le fichier `CDVCameraTest.xcworkspace` .
- 2. Choisissez « CDVCameraLibTests » dans le menu déroulant de régime
- 3. Cliquez et maintenez sur la touche `Play` et cliquez sur l'icône de `clé` pour exécuter les tests
-
-# Test de la ligne de commande
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/it/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/it/README.md
deleted file mode 100644
index af02253..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/it/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# Test di iOS per CDVCamera
-
-È necessario installare `node. js` per tirare in `cordova-ios`.
-
-In primo luogo installare cordova-ios:
-
- npm install
-
-
-... nella cartella corrente.
-
-# Test da Xcode
-
- 1. Lanciare il file `CDVCameraTest.xcworkspace` .
- 2. Scegli "CDVCameraLibTests" dal menu a discesa Schema
- 3. Fare clic e tenere premuto il pulsante `Play` e scegliere l'icona della `chiave inglese` per eseguire i test
-
-# Test dalla riga di comando
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/ja/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/ja/README.md
deleted file mode 100644
index ca0fe84..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/ja/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# CDVCamera の iOS のテスト
-
-`Node.js` `コルドバ`ios をプルするをインストールする必要があります。.
-
-コルドバ ios をインストールします。
-
- npm install
-
-
-現在のフォルダーに.
-
-# Xcode からテスト
-
- 1. `CDVCameraTest.xcworkspace`ファイルを起動します。
- 2. スキーム] ドロップダウン メニューから"CDVCameraLibTests"を選択します。
- 3. クリックし、`再生`ボタンを押し、テストを実行する`レンチ`のアイコンを選択
-
-# コマンドラインからテスト
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/ko/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/ko/README.md
deleted file mode 100644
index 3ad9cfc..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/ko/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# CDVCamera에 대 한 iOS 테스트
-
-`Node.js` `코르도바` ios에서를 설치 해야.
-
-코르도바-ios를 설치 하는 첫번째는:
-
- npm install
-
-
-현재 폴더에....
-
-# Xcode에서 테스트
-
- 1. `CDVCameraTest.xcworkspace` 파일을 시작 합니다.
- 2. 구성표 드롭 다운 메뉴에서 "CDVCameraLibTests"를 선택
- 3. 클릭 하 고 `재생` 버튼에는 테스트를 실행 하려면 `공구 모양` 아이콘을 선택
-
-# 명령줄에서 테스트
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/pl/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/pl/README.md
deleted file mode 100644
index 82caa41..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/pl/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# iOS testy dla CDVCamera
-
-Musisz zainstalować `node.js` ciągnąć w `cordova-ios`.
-
-Najpierw zainstalować cordova-ios:
-
- npm install
-
-
-... w folderze bieżącym.
-
-# Badania z Xcode
-
- 1. Uruchom plik `CDVCameraTest.xcworkspace` .
- 2. Wybierz z menu rozwijanego systemu "CDVCameraLibTests"
- 3. Kliknij i przytrzymaj przycisk `Play` i wybrać ikonę `klucz` do testów
-
-# Badania z wiersza polecenia
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/doc/zh/README.md b/plugins/cordova-plugin-camera/tests/ios/doc/zh/README.md
deleted file mode 100644
index 5312987..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/doc/zh/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# CDVCamera 的 iOS 測試
-
-您需要安裝`node.js`拉`科爾多瓦 ios`中.
-
-第一次安裝科爾多瓦 ios:
-
- npm install
-
-
-在當前資料夾中。
-
-# 從 Xcode 測試
-
- 1. 啟動`CDVCameraTest.xcworkspace`檔。
- 2. 從方案下拉式功能表中選擇"CDVCameraLibTests"
- 3. 按一下並堅持`播放`按鈕,然後選擇要運行的測試的`扳手`圖示
-
-# 從命令列測試
-
- npm test
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/ios/package.json b/plugins/cordova-plugin-camera/tests/ios/package.json
deleted file mode 100644
index 84bd9ec..0000000
--- a/plugins/cordova-plugin-camera/tests/ios/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "cordova-plugin-camera-test-ios",
- "version": "1.0.0",
- "description": "iOS Unit Tests for Camera Plugin",
- "author": "Apache Software Foundation",
- "license": "Apache Version 2.0",
- "dependencies": {
- "cordova-ios": "^3.7.0"
- },
- "scripts": {
- "test": "xcodebuild -scheme CordovaLib && xcodebuild test -scheme CDVCameraLibTests -destination 'platform=iOS Simulator,name=iPhone 5'"
- }
-}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-camera/tests/plugin.xml b/plugins/cordova-plugin-camera/tests/plugin.xml
deleted file mode 100644
index 754ba7a..0000000
--- a/plugins/cordova-plugin-camera/tests/plugin.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
- Cordova Camera Plugin Tests
- Apache 2.0
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/tests/tests.js b/plugins/cordova-plugin-camera/tests/tests.js
deleted file mode 100644
index fd7bd6f..0000000
--- a/plugins/cordova-plugin-camera/tests/tests.js
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* globals Camera, resolveLocalFileSystemURI, FileEntry, CameraPopoverOptions, FileTransfer, FileUploadOptions, LocalFileSystem, MSApp */
-/* jshint jasmine: true */
-
-exports.defineAutoTests = function () {
- describe('Camera (navigator.camera)', function () {
- it("should exist", function () {
- expect(navigator.camera).toBeDefined();
- });
-
- it("should contain a getPicture function", function () {
- expect(navigator.camera.getPicture).toBeDefined();
- expect(typeof navigator.camera.getPicture == 'function').toBe(true);
- });
- });
-
- describe('Camera Constants (window.Camera + navigator.camera)', function () {
- it("camera.spec.1 window.Camera should exist", function () {
- expect(window.Camera).toBeDefined();
- });
-
- it("camera.spec.2 should contain three DestinationType constants", function () {
- expect(Camera.DestinationType.DATA_URL).toBe(0);
- expect(Camera.DestinationType.FILE_URI).toBe(1);
- expect(Camera.DestinationType.NATIVE_URI).toBe(2);
- expect(navigator.camera.DestinationType.DATA_URL).toBe(0);
- expect(navigator.camera.DestinationType.FILE_URI).toBe(1);
- expect(navigator.camera.DestinationType.NATIVE_URI).toBe(2);
- });
-
- it("camera.spec.3 should contain two EncodingType constants", function () {
- expect(Camera.EncodingType.JPEG).toBe(0);
- expect(Camera.EncodingType.PNG).toBe(1);
- expect(navigator.camera.EncodingType.JPEG).toBe(0);
- expect(navigator.camera.EncodingType.PNG).toBe(1);
- });
-
- it("camera.spec.4 should contain three MediaType constants", function () {
- expect(Camera.MediaType.PICTURE).toBe(0);
- expect(Camera.MediaType.VIDEO).toBe(1);
- expect(Camera.MediaType.ALLMEDIA).toBe(2);
- expect(navigator.camera.MediaType.PICTURE).toBe(0);
- expect(navigator.camera.MediaType.VIDEO).toBe(1);
- expect(navigator.camera.MediaType.ALLMEDIA).toBe(2);
- });
-
- it("camera.spec.5 should contain three PictureSourceType constants", function () {
- expect(Camera.PictureSourceType.PHOTOLIBRARY).toBe(0);
- expect(Camera.PictureSourceType.CAMERA).toBe(1);
- expect(Camera.PictureSourceType.SAVEDPHOTOALBUM).toBe(2);
- expect(navigator.camera.PictureSourceType.PHOTOLIBRARY).toBe(0);
- expect(navigator.camera.PictureSourceType.CAMERA).toBe(1);
- expect(navigator.camera.PictureSourceType.SAVEDPHOTOALBUM).toBe(2);
- });
- });
-};
-
-
-/******************************************************************************/
-/******************************************************************************/
-/******************************************************************************/
-
-exports.defineManualTests = function (contentEl, createActionButton) {
- var pictureUrl = null;
- var fileObj = null;
- var fileEntry = null;
- var pageStartTime = +new Date();
-
- //default camera options
- var camQualityDefault = ['50', 50];
- var camDestinationTypeDefault = ['FILE_URI', 1];
- var camPictureSourceTypeDefault = ['CAMERA', 1];
- var camAllowEditDefault = ['allowEdit', false];
- var camEncodingTypeDefault = ['JPEG', 0];
- var camMediaTypeDefault = ['mediaType', 0];
- var camCorrectOrientationDefault = ['correctOrientation', false];
- var camSaveToPhotoAlbumDefault = ['saveToPhotoAlbum', true];
-
- function log(value) {
- console.log(value);
- document.getElementById('camera_status').textContent += (new Date() - pageStartTime) / 1000 + ': ' + value + '\n';
- }
-
- function clearStatus() {
- document.getElementById('camera_status').innerHTML = '';
- document.getElementById('camera_image').src = 'about:blank';
- var canvas = document.getElementById('canvas');
- canvas.width = canvas.height = 1;
- pictureUrl = null;
- fileObj = null;
- fileEntry = null;
- }
-
- function setPicture(url, callback) {
- try {
- window.atob(url);
- // if we got here it is a base64 string (DATA_URL)
- url = "data:image/jpeg;base64," + url;
- } catch (e) {
- // not DATA_URL
- }
- log('URL: "' + url.slice(0, 90) + '"');
-
- pictureUrl = url;
- var img = document.getElementById('camera_image');
- var startTime = new Date();
- img.src = url;
- img.onloadend = function () {
- log('Image tag load time: ' + (new Date() - startTime));
- if (callback) {
- callback();
- }
- };
- }
-
- function onGetPictureError(e) {
- log('Error getting picture: ' + (e.code || e));
- }
-
- function getPictureWin(data) {
- setPicture(data);
- // TODO: Fix resolveLocalFileSystemURI to work with native-uri.
- if (pictureUrl.indexOf('file:') === 0 || pictureUrl.indexOf('content:') === 0 || pictureUrl.indexOf('ms-appdata:') === 0 || pictureUrl.indexOf('assets-library:') === 0) {
- resolveLocalFileSystemURI(data, function (e) {
- fileEntry = e;
- logCallback('resolveLocalFileSystemURI()', true)(e.toURL());
- readFile();
- }, logCallback('resolveLocalFileSystemURI()', false));
- } else if (pictureUrl.indexOf('data:image/jpeg;base64') === 0) {
- // do nothing
- } else {
- var path = pictureUrl.replace(/^file:\/\/(localhost)?/, '').replace(/%20/g, ' ');
- fileEntry = new FileEntry('image_name.png', path);
- }
- }
-
- function getPicture() {
- clearStatus();
- var options = extractOptions();
- log('Getting picture with options: ' + JSON.stringify(options));
- var popoverHandle = navigator.camera.getPicture(getPictureWin, onGetPictureError, options);
-
- // Reposition the popover if the orientation changes.
- window.onorientationchange = function () {
- var newPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, 0);
- popoverHandle.setPosition(newPopoverOptions);
- };
- }
-
- function uploadImage() {
- var ft = new FileTransfer(),
- options = new FileUploadOptions();
- options.fileKey = "photo";
- options.fileName = 'test.jpg';
- options.mimeType = "image/jpeg";
- ft.onprogress = function (progressEvent) {
- console.log('progress: ' + progressEvent.loaded + ' of ' + progressEvent.total);
- };
- var server = "http://cordova-filetransfer.jitsu.com";
-
- ft.upload(pictureUrl, server + '/upload', win, fail, options);
- function win(information_back) {
- log('upload complete');
- }
- function fail(message) {
- log('upload failed: ' + JSON.stringify(message));
- }
- }
-
- function logCallback(apiName, success) {
- return function () {
- log('Call to ' + apiName + (success ? ' success: ' : ' failed: ') + JSON.stringify([].slice.call(arguments)));
- };
- }
-
- /**
- * Select image from library using a NATIVE_URI destination type
- * This calls FileEntry.getMetadata, FileEntry.setMetadata, FileEntry.getParent, FileEntry.file, and FileReader.readAsDataURL.
- */
- function readFile() {
- function onFileReadAsDataURL(evt) {
- var img = document.getElementById('camera_image');
- img.style.visibility = "visible";
- img.style.display = "block";
- img.src = evt.target.result;
- log("FileReader.readAsDataURL success");
- }
-
- function onFileReceived(file) {
- log('Got file: ' + JSON.stringify(file));
- fileObj = file;
-
- var reader = new FileReader();
- reader.onload = function () {
- log('FileReader.readAsDataURL() - length = ' + reader.result.length);
- };
- reader.onerror = logCallback('FileReader.readAsDataURL', false);
- reader.onloadend = onFileReadAsDataURL;
- reader.readAsDataURL(file);
- }
-
- // Test out onFileReceived when the file object was set via a native elements.
- if (fileObj) {
- onFileReceived(fileObj);
- } else {
- fileEntry.file(onFileReceived, logCallback('FileEntry.file', false));
- }
- }
-
- function getFileInfo() {
- // Test FileEntry API here.
- fileEntry.getMetadata(logCallback('FileEntry.getMetadata', true), logCallback('FileEntry.getMetadata', false));
- fileEntry.setMetadata(logCallback('FileEntry.setMetadata', true), logCallback('FileEntry.setMetadata', false), { "com.apple.MobileBackup": 1 });
- fileEntry.getParent(logCallback('FileEntry.getParent', true), logCallback('FileEntry.getParent', false));
- fileEntry.getParent(logCallback('FileEntry.getParent', true), logCallback('FileEntry.getParent', false));
- }
-
- /**
- * Copy image from library using a NATIVE_URI destination type
- * This calls FileEntry.copyTo and FileEntry.moveTo.
- */
- function copyImage() {
- var onFileSystemReceived = function (fileSystem) {
- var destDirEntry = fileSystem.root;
- var origName = fileEntry.name;
-
- // Test FileEntry API here.
- fileEntry.copyTo(destDirEntry, 'copied_file.png', logCallback('FileEntry.copyTo', true), logCallback('FileEntry.copyTo', false));
- fileEntry.moveTo(destDirEntry, 'moved_file.png', logCallback('FileEntry.moveTo', true), logCallback('FileEntry.moveTo', false));
-
- //cleanup
- //rename moved file back to original name so other tests can reference image
- resolveLocalFileSystemURI(destDirEntry.nativeURL+'moved_file.png', function(fileEntry) {
- fileEntry.moveTo(destDirEntry, origName, logCallback('FileEntry.moveTo', true), logCallback('FileEntry.moveTo', false));
- console.log('Cleanup: successfully renamed file back to original name');
- }, function () {
- console.log('Cleanup: failed to rename file back to original name');
- });
-
- //remove copied file
- resolveLocalFileSystemURI(destDirEntry.nativeURL+'copied_file.png', function(fileEntry) {
- fileEntry.remove(logCallback('FileEntry.remove', true), logCallback('FileEntry.remove', false));
- console.log('Cleanup: successfully removed copied file');
- }, function () {
- console.log('Cleanup: failed to remove copied file');
- });
- };
-
- window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, onFileSystemReceived, null);
- }
-
- /**
- * Write image to library using a NATIVE_URI destination type
- * This calls FileEntry.createWriter, FileWriter.write, and FileWriter.truncate.
- */
- function writeImage() {
- var onFileWriterReceived = function (fileWriter) {
- fileWriter.onwrite = logCallback('FileWriter.write', true);
- fileWriter.onerror = logCallback('FileWriter.write', false);
- fileWriter.write("some text!");
- };
-
- var onFileTruncateWriterReceived = function (fileWriter) {
- fileWriter.onwrite = logCallback('FileWriter.truncate', true);
- fileWriter.onerror = logCallback('FileWriter.truncate', false);
- fileWriter.truncate(10);
- };
-
- fileEntry.createWriter(onFileWriterReceived, logCallback('FileEntry.createWriter', false));
- fileEntry.createWriter(onFileTruncateWriterReceived, null);
- }
-
- function displayImageUsingCanvas() {
- var canvas = document.getElementById('canvas');
- var img = document.getElementById('camera_image');
- var w = img.width;
- var h = img.height;
- h = 100 / w * h;
- w = 100;
- canvas.width = w;
- canvas.height = h;
- var context = canvas.getContext('2d');
- context.drawImage(img, 0, 0, w, h);
- }
-
- /**
- * Remove image from library using a NATIVE_URI destination type
- * This calls FileEntry.remove.
- */
- function removeImage() {
- fileEntry.remove(logCallback('FileEntry.remove', true), logCallback('FileEntry.remove', false));
- }
-
- function testInputTag(inputEl) {
- clearStatus();
- // iOS 6 likes to dead-lock in the onchange context if you
- // do any alerts or try to remote-debug.
- window.setTimeout(function () {
- testNativeFile2(inputEl);
- }, 0);
- }
-
- function testNativeFile2(inputEl) {
- if (!inputEl.value) {
- alert('No file selected.');
- return;
- }
- fileObj = inputEl.files[0];
- if (!fileObj) {
- alert('Got value but no file.');
- return;
- }
- var URLApi = window.URL || window.webkitURL;
- if (URLApi) {
- var blobURL = URLApi.createObjectURL(fileObj);
- if (blobURL) {
- setPicture(blobURL, function () {
- URLApi.revokeObjectURL(blobURL);
- });
- } else {
- log('URL.createObjectURL returned null');
- }
- } else {
- log('URL.createObjectURL() not supported.');
- }
- }
-
- function extractOptions() {
- var els = document.querySelectorAll('#image-options select');
- var ret = {};
- /*jshint -W084 */
- for (var i = 0, el; el = els[i]; ++i) {
- var value = el.value;
- if (value === '') continue;
- value = +value;
-
- if (el.isBool) {
- ret[el.getAttribute("name")] = !!value;
- } else {
- ret[el.getAttribute("name")] = value;
- }
- }
- /*jshint +W084 */
- return ret;
- }
-
- function createOptionsEl(name, values, selectionDefault) {
- var openDiv = '
' +
- 'Options not specified should be the default value' +
- ' Status box should update with image and info whenever an image is taken or selected from library' +
- '
' +
- '
All default options. Should be able to edit once picture is taken and will be saved to library.
' +
- '
sourceType=PHOTOLIBRARY Should be able to see picture that was just taken in previous test and edit when selected
' +
- '
sourceType=Camera allowEdit=false saveToPhotoAlbum=false Should not be able to edit when taken and will not save to library
' +
- '
encodingType=PNG allowEdit=true saveToPhotoAlbum=true cameraDirection=FRONT Should bring up front camera. Verify in status box info URL that image is encoded as PNG.
' +
- '
sourceType=SAVEDPHOTOALBUM mediaType=VIDEO Should only be able to select a video
' +
- '
sourceType=SAVEDPHOTOALBUM mediaType=PICTURE allowEdit=false Should only be able to select a picture and not edit
' +
- '
sourceType=PHOTOLIBRARY mediaType=ALLMEDIA allowEdit=true Should be able to select pics and videos and edit picture if selected
' +
- '
sourceType=CAMERA targetWidth & targetHeight=50 allowEdit=false Do Get File Metadata test below and take note of size Repeat test but with width and height=800. Size should be significantly larger.
' +
- '
quality=0 targetWidth & targetHeight=default allowEdit=false Do Get File Metadata test below and take note of size Repeat test but with quality=80. Size should be significantly larger.
' +
- '
',
- inputs_div = '
Native File Inputs
' +
- 'For the following tests, status box should update with file selected' +
- '
input type=file
' +
- '
capture=camera
' +
- '
capture=camcorder
' +
- '
capture=microphone
',
- actions_div = '
Actions
' +
- 'For the following tests, ensure that an image is set in status box' +
- '' +
- 'Expected result: Get metadata about file selected. Status box will show, along with the metadata, "Call to FileEntry.getMetadata success, Call to FileEntry.setMetadata success, Call to FileEntry.getParent success"' +
- '' +
- 'Expected result: Read contents of file. Status box will show "Got file: {some metadata}, FileReader.readAsDataURL() - length = someNumber"' +
- '' +
- 'Expected result: Copy image to new location and move file to different location. Status box will show "Call to FileEntry.copyTo success:{some metadata}, Call to FileEntry.moveTo success:{some metadata}"' +
- '' +
- 'Expected result: Write image to library. Status box will show "Call to FileWriter.write success:{some metadata}, Call to FileWriter.truncate success:{some metadata}"' +
- '' +
- 'Expected result: Upload image to server. Status box may print out progress. Once finished will show "upload complete"' +
- '' +
- 'Expected result: Display image using canvas. Image will be displayed in status box under "canvas:"' +
- '' +
- 'Expected result: Remove image from library. Status box will show "FileEntry.remove success:["OK"]';
-
- // We need to wrap this code due to Windows security restrictions
- // see http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences for details
- if (window.MSApp && window.MSApp.execUnsafeLocalFunction) {
- MSApp.execUnsafeLocalFunction(function() {
- contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div + actions_div;
- });
- } else {
- contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div + actions_div;
- }
-
- var elements = document.getElementsByClassName("testInputTag");
- var listener = function (e) {
- testInputTag(e.target);
- };
- for (var i = 0; i < elements.length; ++i) {
- var item = elements[i];
- item.addEventListener("change", listener, false);
- }
-
- createActionButton('Get picture', function () {
- getPicture();
- }, 'getpicture');
-
- createActionButton('Clear Status', function () {
- clearStatus();
- }, 'getpicture');
-
- createActionButton('Get File Metadata', function () {
- getFileInfo();
- }, 'metadata');
-
- createActionButton('Read with FileReader', function () {
- readFile();
- }, 'reader');
-
- createActionButton('Copy Image', function () {
- copyImage();
- }, 'copy');
-
- createActionButton('Write Image', function () {
- writeImage();
- }, 'write');
-
- createActionButton('Upload Image', function () {
- uploadImage();
- }, 'upload');
-
- createActionButton('Draw Using Canvas', function () {
- displayImageUsingCanvas();
- }, 'draw_canvas');
-
- createActionButton('Remove Image', function () {
- removeImage();
- }, 'remove');
-};
diff --git a/plugins/cordova-plugin-camera/www/Camera.js b/plugins/cordova-plugin-camera/www/Camera.js
deleted file mode 100644
index 2f9154b..0000000
--- a/plugins/cordova-plugin-camera/www/Camera.js
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
- exec = require('cordova/exec'),
- Camera = require('./Camera');
- // XXX: commented out
- //CameraPopoverHandle = require('./CameraPopoverHandle');
-
-/**
- * @namespace navigator
- */
-
-/**
- * @exports camera
- */
-var cameraExport = {};
-
-// Tack on the Camera Constants to the base camera plugin.
-for (var key in Camera) {
- cameraExport[key] = Camera[key];
-}
-
-/**
- * Callback function that provides an error message.
- * @callback module:camera.onError
- * @param {string} message - The message is provided by the device's native code.
- */
-
-/**
- * Callback function that provides the image data.
- * @callback module:camera.onSuccess
- * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
- * @example
- * // Show image
- * //
- * function cameraCallback(imageData) {
- * var image = document.getElementById('myImage');
- * image.src = "data:image/jpeg;base64," + imageData;
- * }
- */
-
-/**
- * Optional parameters to customize the camera settings.
- * * [Quirks](#CameraOptions-quirks)
- * @typedef module:camera.CameraOptions
- * @type {Object}
- * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
- * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
- * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
- * @property {Boolean} [allowEdit=true] - Allow simple editing of image before selection.
- * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
- * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
- * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
- * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
- * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
- * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
- * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
- * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
- */
-
-/**
- * @description Takes a photo using the camera, or retrieves a photo from the device's
- * image gallery. The image is passed to the success callback as a
- * Base64-encoded `String`, or as the URI for the image file.
- *
- * The `camera.getPicture` function opens the device's default camera
- * application that allows users to snap pictures by default - this behavior occurs,
- * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
- * Once the user snaps the photo, the camera application closes and the application is restored.
- *
- * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
- * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
- * that allows users to select an existing image. The
- * `camera.getPicture` function returns a [`CameraPopoverHandle`]{@link module:CameraPopoverHandle} object,
- * which can be used to reposition the image selection dialog, for
- * example, when the device orientation changes.
- *
- * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
- * one of the following formats, depending on the specified
- * `cameraOptions`:
- *
- * - A `String` containing the Base64-encoded photo image.
- *
- * - A `String` representing the image file location on local storage (default).
- *
- * You can do whatever you want with the encoded image or URI, for
- * example:
- *
- * - Render the image in an `` tag, as in the example below
- *
- * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
- *
- * - Post the data to a remote server
- *
- * __NOTE__: Photo resolution on newer devices is quite good. Photos
- * selected from the device's gallery are not downscaled to a lower
- * quality, even if a `quality` parameter is specified. To avoid common
- * memory problems, set `Camera.destinationType` to `FILE_URI` rather
- * than `DATA_URL`.
- *
- * __Supported Platforms__
- *
- * - Android
- * - BlackBerry
- * - Browser
- * - Firefox
- * - FireOS
- * - iOS
- * - Windows
- * - WP8
- * - Ubuntu
- *
- * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
- *
- * @example
- * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
- * @param {module:camera.onSuccess} successCallback
- * @param {module:camera.onError} errorCallback
- * @param {module:camera.CameraOptions} options CameraOptions
- */
-cameraExport.getPicture = function(successCallback, errorCallback, options) {
- argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
- options = options || {};
- var getValue = argscheck.getValue;
-
- var quality = getValue(options.quality, 50);
- var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
- var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
- var targetWidth = getValue(options.targetWidth, -1);
- var targetHeight = getValue(options.targetHeight, -1);
- var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
- var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
- var allowEdit = !!options.allowEdit;
- var correctOrientation = !!options.correctOrientation;
- var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
- var popoverOptions = getValue(options.popoverOptions, null);
- var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
-
- var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
- mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
-
- exec(successCallback, errorCallback, "Camera", "takePicture", args);
- // XXX: commented out
- //return new CameraPopoverHandle();
-};
-
-/**
- * Removes intermediate image files that are kept in temporary storage
- * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
- * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
- * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * navigator.camera.cleanup(onSuccess, onFail);
- *
- * function onSuccess() {
- * console.log("Camera cleanup success.")
- * }
- *
- * function onFail(message) {
- * alert('Failed because: ' + message);
- * }
- */
-cameraExport.cleanup = function(successCallback, errorCallback) {
- exec(successCallback, errorCallback, "Camera", "cleanup", []);
-};
-
-module.exports = cameraExport;
diff --git a/plugins/cordova-plugin-camera/www/CameraConstants.js b/plugins/cordova-plugin-camera/www/CameraConstants.js
deleted file mode 100644
index c2bbbf5..0000000
--- a/plugins/cordova-plugin-camera/www/CameraConstants.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * @module Camera
- */
-module.exports = {
- /**
- * @enum {number}
- */
- DestinationType:{
- /** Return base64 encoded string */
- DATA_URL: 0,
- /** Return file uri (content://media/external/images/media/2 for Android) */
- FILE_URI: 1,
- /** Return native uri (eg. asset-library://... for iOS) */
- NATIVE_URI: 2
- },
- /**
- * @enum {number}
- */
- EncodingType:{
- /** Return JPEG encoded image */
- JPEG: 0,
- /** Return PNG encoded image */
- PNG: 1
- },
- /**
- * @enum {number}
- */
- MediaType:{
- /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
- PICTURE: 0,
- /** Allow selection of video only, ONLY RETURNS URL */
- VIDEO: 1,
- /** Allow selection from all media types */
- ALLMEDIA : 2
- },
- /**
- * @enum {number}
- */
- PictureSourceType:{
- /** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
- PHOTOLIBRARY : 0,
- /** Take picture from camera */
- CAMERA : 1,
- /** Choose image from picture library (same as PHOTOLIBRARY for Android) */
- SAVEDPHOTOALBUM : 2
- },
- /**
- * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
- * @enum {number}
- */
- PopoverArrowDirection:{
- ARROW_UP : 1,
- ARROW_DOWN : 2,
- ARROW_LEFT : 4,
- ARROW_RIGHT : 8,
- ARROW_ANY : 15
- },
- /**
- * @enum {number}
- */
- Direction:{
- /** Use the back-facing camera */
- BACK: 0,
- /** Use the front-facing camera */
- FRONT: 1
- }
-};
diff --git a/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js b/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
deleted file mode 100644
index ba1063a..0000000
--- a/plugins/cordova-plugin-camera/www/CameraPopoverHandle.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * @ignore in favour of iOS' one
- * A handle to an image picker popover.
- */
-var CameraPopoverHandle = function() {
- this.setPosition = function(popoverOptions) {
- console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
- };
-};
-
-module.exports = CameraPopoverHandle;
diff --git a/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
deleted file mode 100644
index 27998b6..0000000
--- a/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Camera = require('./Camera');
-
-/**
- * @namespace navigator
- */
-
-/**
- * iOS-only parameters that specify the anchor element location and arrow
- * direction of the popover when selecting images from an iPad's library
- * or album.
- * Note that the size of the popover may change to adjust to the
- * direction of the arrow and orientation of the screen. Make sure to
- * account for orientation changes when specifying the anchor element
- * location.
- * @module CameraPopoverOptions
- * @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
- * @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
- * @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
- * @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
- */
-var CameraPopoverOptions = function (x, y, width, height, arrowDir) {
- // information of rectangle that popover should be anchored to
- this.x = x || 0;
- this.y = y || 32;
- this.width = width || 320;
- this.height = height || 480;
- this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
-};
-
-module.exports = CameraPopoverOptions;
diff --git a/plugins/cordova-plugin-camera/www/blackberry10/assets/camera.html b/plugins/cordova-plugin-camera/www/blackberry10/assets/camera.html
deleted file mode 100644
index 2ebd9d1..0000000
--- a/plugins/cordova-plugin-camera/www/blackberry10/assets/camera.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-camera/www/blackberry10/assets/camera.js b/plugins/cordova-plugin-camera/www/blackberry10/assets/camera.js
deleted file mode 100644
index 8a245e5..0000000
--- a/plugins/cordova-plugin-camera/www/blackberry10/assets/camera.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-document.addEventListener('DOMContentLoaded', function () {
- document.getElementById('back').onclick = function () {
- window.qnx.callExtensionMethod('cordova-plugin-camera', 'cancel');
- };
- window.navigator.webkitGetUserMedia(
- { video: true },
- function (stream) {
- var video = document.getElementById('v'),
- canvas = document.getElementById('c'),
- camera = document.getElementById('camera');
- video.autoplay = true;
- video.width = window.innerWidth;
- video.height = window.innerHeight - 100;
- video.src = window.webkitURL.createObjectURL(stream);
- camera.onclick = function () {
- canvas.width = video.videoWidth;
- canvas.height = video.videoHeight;
- canvas.getContext('2d').drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
- window.qnx.callExtensionMethod('cordova-plugin-camera', canvas.toDataURL('img/png'));
- };
- },
- function () {
- window.qnx.callExtensionMethod('cordova-plugin-camera', 'error', 'getUserMedia failed');
- }
- );
-});
diff --git a/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js b/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
deleted file mode 100644
index 3990e18..0000000
--- a/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-/**
- * @namespace navigator
- */
-
-/**
- * A handle to an image picker popover.
- *
- * __Supported Platforms__
- *
- * - iOS
- *
- * @example
- * var cameraPopoverHandle = navigator.camera.getPicture(onSuccess, onFail,
- * {
- * destinationType: Camera.DestinationType.FILE_URI,
- * sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
- * popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
- * });
- *
- * // Reposition the popover if the orientation changes.
- * window.onorientationchange = function() {
- * var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
- * cameraPopoverHandle.setPosition(cameraPopoverOptions);
- * }
- * @module CameraPopoverHandle
- */
-var CameraPopoverHandle = function() {
- /** Set the position of the popover.
- * @param {module:CameraPopoverOptions} popoverOptions
- */
- this.setPosition = function(popoverOptions) {
- var args = [ popoverOptions ];
- exec(null, null, "Camera", "repositionPopover", args);
- };
-};
-
-module.exports = CameraPopoverHandle;
diff --git a/plugins/cordova-plugin-compat/README.md b/plugins/cordova-plugin-compat/README.md
deleted file mode 100644
index 095c384..0000000
--- a/plugins/cordova-plugin-compat/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-cordova-plugin-compat
-------------------------
-
-This repo is for remaining backwards compatible with previous versions of Cordova.
-
-## USAGE
-
-Your plugin can depend on this plugin and use it to handle the new run time permissions Android 6.0.0 (cordova-android 5.0.0) introduced.
-
-View [this commit](https://github.com/apache/cordova-plugin-camera/commit/a9c18710f23e86f5b7f8918dfab7c87a85064870) to see how to depend on `cordova-plugin-compat`. View [this file](https://github.com/apache/cordova-plugin-camera/blob/master/src/android/CameraLauncher.java) to see how `PermissionHelper` is being used to request and store permissions. Read more about Android permissions at http://cordova.apache.org/docs/en/latest/guide/platforms/android/plugin.html#android-permissions.
diff --git a/plugins/cordova-plugin-compat/RELEASENOTES.md b/plugins/cordova-plugin-compat/RELEASENOTES.md
deleted file mode 100644
index b7aa129..0000000
--- a/plugins/cordova-plugin-compat/RELEASENOTES.md
+++ /dev/null
@@ -1,29 +0,0 @@
-
-# Release Notes
-
-### 1.1.0 (Nov 02, 2016)
-* [CB-11625](https://issues.apache.org/jira/browse/CB-11625) Adding the `BuildConfig` fetching code as a backup to using a new preference
-* Add github pull request template
-
-### 1.0.0 (Apr 15, 2016)
-* Initial release
-* Moved `PermissionHelper.java` into `src`
diff --git a/plugins/cordova-plugin-compat/package.json b/plugins/cordova-plugin-compat/package.json
deleted file mode 100644
index f31174d..0000000
--- a/plugins/cordova-plugin-compat/package.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "cordova-plugin-compat",
- "description": "This repo is for remaining backwards compatible with previous versions of Cordova.",
- "version": "1.1.0",
- "homepage": "http://github.com/apache/cordova-plugin-compat#readme",
- "repository": {
- "type": "git",
- "url": "git://github.com/apache/cordova-plugin-compat.git"
- },
- "bugs": {
- "url": "https://github.com/apache/cordova-plugin-compat/issues"
- },
- "cordova": {
- "id": "cordova-plugin-compat",
- "platforms": [
- "android"
- ]
- },
- "keywords": [
- "ecosystem:cordova",
- "ecosystem:phonegap",
- "cordova-android"
- ],
- "engines": [
- {
- "name": "cordova",
- "version": ">=5.0.0"
- }
- ],
- "author": "Apache Software Foundation",
- "license": "Apache-2.0"
-}
diff --git a/plugins/cordova-plugin-compat/plugin.xml b/plugins/cordova-plugin-compat/plugin.xml
deleted file mode 100644
index 40b45cc..0000000
--- a/plugins/cordova-plugin-compat/plugin.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- Compat
- Cordova Compatibility Plugin
- Apache 2.0
- cordova,compat
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-compat.git
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-compat/src/android/BuildHelper.java b/plugins/cordova-plugin-compat/src/android/BuildHelper.java
deleted file mode 100644
index d9b18aa..0000000
--- a/plugins/cordova-plugin-compat/src/android/BuildHelper.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova;
-
-/*
- * This is a utility class that allows us to get the BuildConfig variable, which is required
- * for the use of different providers. This is not guaranteed to work, and it's better for this
- * to be set in the build step in config.xml
- *
- */
-
-import android.app.Activity;
-import android.content.Context;
-
-import java.lang.reflect.Field;
-
-
-public class BuildHelper {
-
-
- private static String TAG="BuildHelper";
-
- /*
- * This needs to be implemented if you wish to use the Camera Plugin or other plugins
- * that read the Build Configuration.
- *
- * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to
- * StackOverflow. This is annoying as hell! However, this method does not work with
- * ProGuard, and you should use the config.xml to define the application_id
- *
- */
-
- public static Object getBuildConfigValue(Context ctx, String key)
- {
- try
- {
- Class> clazz = Class.forName(ctx.getPackageName() + ".BuildConfig");
- Field field = clazz.getField(key);
- return field.get(null);
- } catch (ClassNotFoundException e) {
- LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?");
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- LOG.d(TAG, key + " is not a valid field. Check your build.gradle");
- } catch (IllegalAccessException e) {
- LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace.");
- e.printStackTrace();
- }
-
- return null;
- }
-
-}
diff --git a/plugins/cordova-plugin-compat/src/android/PermissionHelper.java b/plugins/cordova-plugin-compat/src/android/PermissionHelper.java
deleted file mode 100644
index bbd7911..0000000
--- a/plugins/cordova-plugin-compat/src/android/PermissionHelper.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-
-import android.content.pm.PackageManager;
-
-/**
- * This class provides reflective methods for permission requesting and checking so that plugins
- * written for cordova-android 5.0.0+ can still compile with earlier cordova-android versions.
- */
-public class PermissionHelper {
- private static final String LOG_TAG = "CordovaPermissionHelper";
-
- /**
- * Requests a "dangerous" permission for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermission() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permission request
- * @param permission The permission to be requested
- */
- public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
- PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
- }
-
- /**
- * Requests "dangerous" permissions for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermissions() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permissions are being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permissions request
- * @param permissions The permissions to be requested
- */
- public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
- try {
- Method requestPermission = CordovaInterface.class.getDeclaredMethod(
- "requestPermissions", CordovaPlugin.class, int.class, String[].class);
-
- // If there is no exception, then this is cordova-android 5.0.0+
- requestPermission.invoke(plugin.cordova, plugin, requestCode, permissions);
- } catch (NoSuchMethodException noSuchMethodException) {
- // cordova-android version is less than 5.0.0, so permission is implicitly granted
- LOG.d(LOG_TAG, "No need to request permissions " + Arrays.toString(permissions));
-
- // Notify the plugin that all were granted by using more reflection
- deliverPermissionResult(plugin, requestCode, permissions);
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when requesting permissions " + Arrays.toString(permissions), illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method does not throw any exceptions, so this should never be caught
- LOG.e(LOG_TAG, "invocationTargetException when requesting permissions " + Arrays.toString(permissions), invocationTargetException);
- }
- }
-
- /**
- * Checks at runtime to see if the application has been granted a permission. This is a helper
- * method alternative to cordovaInterface.hasPermission() that does not require the project to
- * be built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being checked against
- * @param permission The permission to be checked
- *
- * @return True if the permission has already been granted and false otherwise
- */
- public static boolean hasPermission(CordovaPlugin plugin, String permission) {
- try {
- Method hasPermission = CordovaInterface.class.getDeclaredMethod("hasPermission", String.class);
-
- // If there is no exception, then this is cordova-android 5.0.0+
- return (Boolean) hasPermission.invoke(plugin.cordova, permission);
- } catch (NoSuchMethodException noSuchMethodException) {
- // cordova-android version is less than 5.0.0, so permission is implicitly granted
- LOG.d(LOG_TAG, "No need to check for permission " + permission);
- return true;
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when checking permission " + permission, illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method does not throw any exceptions, so this should never be caught
- LOG.e(LOG_TAG, "invocationTargetException when checking permission " + permission, invocationTargetException);
- }
- return false;
- }
-
- private static void deliverPermissionResult(CordovaPlugin plugin, int requestCode, String[] permissions) {
- // Generate the request results
- int[] requestResults = new int[permissions.length];
- Arrays.fill(requestResults, PackageManager.PERMISSION_GRANTED);
-
- try {
- Method onRequestPermissionResult = CordovaPlugin.class.getDeclaredMethod(
- "onRequestPermissionResult", int.class, String[].class, int[].class);
-
- onRequestPermissionResult.invoke(plugin, requestCode, permissions, requestResults);
- } catch (NoSuchMethodException noSuchMethodException) {
- // Should never be caught since the plugin must be written for cordova-android 5.0.0+ if it
- // made it to this point
- LOG.e(LOG_TAG, "NoSuchMethodException when delivering permissions results", noSuchMethodException);
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when delivering permissions results", illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method may throw a JSONException. We are just duplicating cordova-android's
- // exception handling behavior here; all it does is log the exception in CordovaActivity,
- // print the stacktrace, and ignore it
- LOG.e(LOG_TAG, "InvocationTargetException when delivering permissions results", invocationTargetException);
- }
- }
-}
diff --git a/plugins/cordova-plugin-console/CONTRIBUTING.md b/plugins/cordova-plugin-console/CONTRIBUTING.md
deleted file mode 100644
index 4c8e6a5..0000000
--- a/plugins/cordova-plugin-console/CONTRIBUTING.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-# Contributing to Apache Cordova
-
-Anyone can contribute to Cordova. And we need your contributions.
-
-There are multiple ways to contribute: report bugs, improve the docs, and
-contribute code.
-
-For instructions on this, start with the
-[contribution overview](http://cordova.apache.org/contribute/).
-
-The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
- - Run the tests so your patch doesn't break existing functionality.
-
-We look forward to your contributions!
diff --git a/plugins/cordova-plugin-console/LICENSE b/plugins/cordova-plugin-console/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/plugins/cordova-plugin-console/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/NOTICE b/plugins/cordova-plugin-console/NOTICE
deleted file mode 100644
index 8ec56a5..0000000
--- a/plugins/cordova-plugin-console/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-console/README.md b/plugins/cordova-plugin-console/README.md
deleted file mode 100644
index eaf510a..0000000
--- a/plugins/cordova-plugin-console/README.md
+++ /dev/null
@@ -1,109 +0,0 @@
----
-title: Console
-description: Get JavaScript logs in your native logs.
----
-
-
-|Android 4.4|Android 5.1|iOS 9.3|iOS 10.0|Windows 10 Store|Travis CI|
-|:-:|:-:|:-:|:-:|:-:|:-:|
-|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-console/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-console)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-console/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-console)|
-
-# cordova-plugin-console
-
-This plugin is meant to ensure that console.log() is as useful as it can be.
-It adds additional function for iOS, Ubuntu, Windows Phone 8, and Windows. If
-you are happy with how console.log() works for you, then you probably
-don't need this plugin.
-
-This plugin defines a global `console` object.
-
-Although the object is in the global scope, features provided by this plugin
-are not available until after the `deviceready` event.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Console%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
-
-
-## Installation
-
- cordova plugin add cordova-plugin-console
-
-### Android Quirks
-
-On some platforms other than Android, console.log() will act on multiple
-arguments, such as console.log("1", "2", "3"). However, Android will act only
-on the first argument. Subsequent arguments to console.log() will be ignored.
-This plugin is not the cause of that, it is a limitation of Android itself.
-
-## Supported Methods
-
-The plugin support following methods of the `console` object:
-
-- `console.log`
-- `console.error`
-- `console.exception`
-- `console.warn`
-- `console.info`
-- `console.debug`
-- `console.assert`
-- `console.dir`
-- `console.dirxml`
-- `console.time`
-- `console.timeEnd`
-- `console.table`
-
-## Partially supported Methods
-
-Methods of the `console` object which implemented, but behave different from browser implementation:
-
-- `console.group`
-- `console.groupCollapsed`
-
-The grouping methods are just log name of the group and don't actually indicate grouping for later
-calls to `console` object methods.
-
-## Not supported Methods
-
-Methods of the `console` object which are implemented, but do nothing:
-
-- `console.clear`
-- `console.trace`
-- `console.groupEnd`
-- `console.timeStamp`
-- `console.profile`
-- `console.profileEnd`
-- `console.count`
-
-## Supported formatting
-
-The following formatting options available:
-
-Format chars:
-
-* `%j` - format arg as JSON
-* `%o` - format arg as JSON
-* `%c` - format arg as `''`. No color formatting could be done.
-* `%%` - replace with `'%'`
-
-Any other char following `%` will format its arg via `toString()`.
diff --git a/plugins/cordova-plugin-console/RELEASENOTES.md b/plugins/cordova-plugin-console/RELEASENOTES.md
deleted file mode 100644
index bb3d5b0..0000000
--- a/plugins/cordova-plugin-console/RELEASENOTES.md
+++ /dev/null
@@ -1,113 +0,0 @@
-
-# Release Notes
-
-### 1.0.6 (Feb 28, 2017)
-* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
-* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
-
-### 1.0.5 (Dec 07, 2016)
-* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 1.0.5
-* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
-* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
-
-### 1.0.4 (Sep 08, 2016)
-* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to `cordovaDependencies`
-* add `JIRA` issue tracker link
-* Add badges for paramedic builds on Jenkins
-* Add pull request template.
-* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
-
-### 1.0.3 (Apr 15, 2016)
-* [CB-10720](https://issues.apache.org/jira/browse/CB-10720) Minor spelling/formatting changes.
-* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
-
-### 1.0.2 (Nov 18, 2015)
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
-* Fixing contribute link.
-* Document formatting options for the console object
-* [CB-5089](https://issues.apache.org/jira/browse/CB-5089) Document supported methods for console object
-* reverted `d58f218b9149d362ebb0b8ce697cf403569d14cd` because `logger` is not needed on **Android**
-
-### 1.0.1 (Jun 17, 2015)
-* move logger.js and console-via-logger.js to common modules, instead of the numerous repeats that were there.
-* clean up tests, info is below log level so it does not exist by default.
-* add a couple tests
-* [CB-9191](https://issues.apache.org/jira/browse/CB-9191) Add basic test
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-console documentation translation: cordova-plugin-console
-* attempt to fix npm markdown issue
-
-### 1.0.0 (Apr 15, 2015)
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
-* Use TRAVIS_BUILD_DIR, install paramedic by npm
-* docs: renamed Windows8 to Windows
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
-* [CB-8560](https://issues.apache.org/jira/browse/CB-8560) Integrate TravisCI
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-console documentation translation: cordova-plugin-console
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
-* [CB-8362](https://issues.apache.org/jira/browse/CB-8362) Add Windows platform section to Console plugin
-
-### 0.2.13 (Feb 04, 2015)
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
-
-### 0.2.12 (Dec 02, 2014)
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-console documentation translation: cordova-plugin-console
-
-### 0.2.11 (Sep 17, 2014)
-* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-console documentation translation
-
-### 0.2.10 (Aug 06, 2014)
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
-
-### 0.2.9 (Jun 05, 2014)
-* [CB-6848](https://issues.apache.org/jira/browse/CB-6848) Add Android quirk, list applicable platforms
-* [CB-6796](https://issues.apache.org/jira/browse/CB-6796) Add license
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
-
-### 0.2.8 (Apr 17, 2014)
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
-* Add NOTICE file
-
-### 0.2.7 (Feb 05, 2014)
-* Native console needs to be called DebugConsole to avoid ambiguous reference. This commit requires the 3.4.0 version of the native class factory
-* [CB-4718](https://issues.apache.org/jira/browse/CB-4718) fixed Console plugin not working on wp
-
-### 0.2.6 (Jan 02, 2014)
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Console plugin
-
-### 0.2.5 (Dec 4, 2013)
-* add ubuntu platform
-
-### 0.2.4 (Oct 28, 2013)
-* [CB-5154](https://issues.apache.org/jira/browse/CB-5154) log formatting incorrectly to native
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for console plugin
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
-
-### 0.2.3 (Sept 25, 2013)
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.console to org.apache.cordova.console
-* Rename CHANGELOG.md -> RELEASENOTES.md
-* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
-
-
diff --git a/plugins/cordova-plugin-console/doc/de/README.md b/plugins/cordova-plugin-console/doc/de/README.md
deleted file mode 100644
index 933c1b7..0000000
--- a/plugins/cordova-plugin-console/doc/de/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-Dieses Plugin stellt sicher, dass der Befehl console.log() so hilfreich ist, wie er sein kann. Es fügt zusätzliche Funktion für iOS, Ubuntu, Windows Phone 8 und Windows. Teilweise kann es vorkommen, dass der Befehl console.log() nicht korrekt erkannt wird, und es zu Fehlern bzw. zu nicht angezeigten Logs in der Console kommt. Wenn Sie mit der derzeitigen Funktionsweise zufrieden sind, kann es sein, dass Sie dieses Plugin nicht benötigen.
-
-Dieses Plugin wird ein global-`console`-Objekt definiert.
-
-Obwohl das Objekt im globalen Gültigkeitsbereich ist, stehen Features von diesem Plugin nicht bis nach dem `deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-console
-
-
-### Android Eigenarten
-
-Auf einigen Plattformen als Android fungieren console.log() auf mehrere Argumente wie console.log ("1", "2", "3"). Android wird jedoch nur auf das erste Argument fungieren. Nachfolgende Argumente zu console.log() werden ignoriert. Dieses Plugin ist nicht die Verantwortung dafür, es ist eine Einschränkung von Android selbst.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/de/index.md b/plugins/cordova-plugin-console/doc/de/index.md
deleted file mode 100644
index 9551782..0000000
--- a/plugins/cordova-plugin-console/doc/de/index.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-Dieses Plugin stellt sicher, dass der Befehl console.log() so hilfreich ist, wie er sein kann. Es fügt zusätzliche Funktion für iOS, Ubuntu, Windows Phone 8 und Windows 8 hinzu. Teilweise kann es vorkommen, dass der Befehl console.log() nicht korrekt erkannt wird, und es zu Fehlern bzw. zu nicht angezeigten Logs in der Console kommt. Wenn Sie mit der derzeitigen Funktionsweise zufrieden sind, kann es sein, dass Sie dieses Plugin nicht benötigen.
-
-Dieses Plugin wird ein global-`console`-Objekt definiert.
-
-Obwohl das Objekt im globalen Gültigkeitsbereich ist, stehen Features von diesem Plugin nicht bis nach dem `deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-console
-
-
-### Android Eigenarten
-
-Auf einigen Plattformen als Android fungieren console.log() auf mehrere Argumente wie console.log ("1", "2", "3"). Android wird jedoch nur auf das erste Argument fungieren. Nachfolgende Argumente zu console.log() werden ignoriert. Dieses Plugin ist nicht die Verantwortung dafür, es ist eine Einschränkung von Android selbst.
diff --git a/plugins/cordova-plugin-console/doc/es/README.md b/plugins/cordova-plugin-console/doc/es/README.md
deleted file mode 100644
index b089d63..0000000
--- a/plugins/cordova-plugin-console/doc/es/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-Este plugin es para asegurarse de que console.log() es tan útil como puede ser. Agrega la función adicional para iOS, Ubuntu, Windows Phone 8 y Windows. Si estás contento con cómo funciona console.log() para ti, entonces probablemente no necesitas este plugin.
-
-Este plugin define un global `console` objeto.
-
-Aunque el objeto está en el ámbito global, características proporcionadas por este plugin no están disponibles hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log ("console.log funciona bien");}
-
-
-## Instalación
-
- cordova plugin add cordova-plugin-console
-
-
-### Rarezas Android
-
-En algunas plataformas que no sean Android, console.log() actuará en varios argumentos, como console.log ("1", "2", "3"). Sin embargo, Android actuará sólo en el primer argumento. Se omitirá posteriores argumentos para console.log(). Este plugin no es la causa de eso, es una limitación propia de Android.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/es/index.md b/plugins/cordova-plugin-console/doc/es/index.md
deleted file mode 100644
index e6b8e68..0000000
--- a/plugins/cordova-plugin-console/doc/es/index.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# cordova-plugin-console
-
-Este plugin es para asegurarse de que console.log() es tan útil como puede ser. Añade función adicional para iOS, Windows Phone 8, Ubuntu y Windows 8. Si estás contento con cómo funciona console.log() para ti, entonces probablemente no necesitas este plugin.
-
-Este plugin define un global `console` objeto.
-
-Aunque el objeto está en el ámbito global, características proporcionadas por este plugin no están disponibles hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log ("console.log funciona bien");}
-
-
-## Instalación
-
- Cordova plugin agregar cordova-plugin-console
-
-
-### Rarezas Android
-
-En algunas plataformas que no sean Android, console.log() actuará en varios argumentos, como console.log ("1", "2", "3"). Sin embargo, Android actuará sólo en el primer argumento. Se omitirá posteriores argumentos para console.log(). Este plugin no es la causa de eso, es una limitación propia de Android.
diff --git a/plugins/cordova-plugin-console/doc/fr/README.md b/plugins/cordova-plugin-console/doc/fr/README.md
deleted file mode 100644
index 74207ac..0000000
--- a/plugins/cordova-plugin-console/doc/fr/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-Ce plugin est destiné à faire en sorte que console.log() est aussi utile que possible. Il ajoute une fonction supplémentaire pour iOS, Ubuntu, Windows Phone 8 et Windows. Si vous êtes satisfait du fonctionnement de console.log() pour vous, alors vous avez probablement pas besoin ce plugin.
-
-Ce plugin définit un global `console` objet.
-
-Bien que l'objet est dans la portée globale, les fonctions offertes par ce plugin ne sont pas disponibles jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log ("console.log fonctionne bien");}
-
-
-## Installation
-
- cordova plugin add cordova-plugin-console
-
-
-### Quirks Android
-
-Sur certaines plateformes autres que Android, console.log() va agir sur plusieurs arguments, tels que console.log ("1", "2", "3"). Toutefois, Android doit agir uniquement sur le premier argument. Les arguments suivants à console.log() seront ignorées. Ce plugin n'est pas la cause de cela, il s'agit d'une limitation d'Android lui-même.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/fr/index.md b/plugins/cordova-plugin-console/doc/fr/index.md
deleted file mode 100644
index d0dbba5..0000000
--- a/plugins/cordova-plugin-console/doc/fr/index.md
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-# cordova-plugin-console
-
-Ce plugin est destiné à faire en sorte que console.log() est aussi utile que possible. Il ajoute une fonction supplémentaire pour iOS, Ubuntu, Windows Phone 8 et Windows 8. Si vous êtes satisfait du fonctionnement de console.log() pour vous, alors vous avez probablement pas besoin ce plugin.
-
-Ce plugin définit un global `console` objet.
-
-Bien que l'objet est dans la portée globale, les fonctions offertes par ce plugin ne sont pas disponibles jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log ("console.log fonctionne bien");}
-
-
-## Installation
-
- Cordova plugin ajouter cordova-plugin-console
-
-
-### Quirks Android
-
-Sur certaines plateformes autres que Android, console.log() va agir sur plusieurs arguments, tels que console.log ("1", "2", "3"). Toutefois, Android doit agir uniquement sur le premier argument. Les arguments suivants à console.log() seront ignorées. Ce plugin n'est pas la cause de cela, il s'agit d'une limitation d'Android lui-même.
diff --git a/plugins/cordova-plugin-console/doc/it/README.md b/plugins/cordova-plugin-console/doc/it/README.md
deleted file mode 100644
index 5394d55..0000000
--- a/plugins/cordova-plugin-console/doc/it/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-Questo plugin è intesa a garantire che console.log() è tanto utile quanto può essere. Aggiunge una funzione aggiuntiva per iOS, Ubuntu, Windows Phone 8 e Windows. Se sei soddisfatto di come console.log() funziona per voi, quindi probabilmente non è necessario questo plugin.
-
-Questo plugin definisce un oggetto globale `console`.
-
-Sebbene l'oggetto sia in ambito globale, funzionalità fornite da questo plugin non sono disponibili fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-console
-
-
-### Stranezze Android
-
-Su alcune piattaforme diverse da Android, console.log() agirà su più argomenti, come ad esempio console ("1", "2", "3"). Tuttavia, Android agirà solo sul primo argomento. Argomenti successivi a console.log() verranno ignorati. Questo plugin non è la causa di ciò, è una limitazione di Android stesso.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/it/index.md b/plugins/cordova-plugin-console/doc/it/index.md
deleted file mode 100644
index f0625b3..0000000
--- a/plugins/cordova-plugin-console/doc/it/index.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-Questo plugin è intesa a garantire che console.log() è tanto utile quanto può essere. Aggiunge una funzione aggiuntiva per iOS, Ubuntu, Windows 8 e Windows Phone 8. Se sei soddisfatto di come console.log() funziona per voi, quindi probabilmente non è necessario questo plugin.
-
-Questo plugin definisce un oggetto globale `console`.
-
-Sebbene l'oggetto sia in ambito globale, funzionalità fornite da questo plugin non sono disponibili fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-console
-
-
-### Stranezze Android
-
-Su alcune piattaforme diverse da Android, console.log() agirà su più argomenti, come ad esempio console ("1", "2", "3"). Tuttavia, Android agirà solo sul primo argomento. Argomenti successivi a console.log() verranno ignorati. Questo plugin non è la causa di ciò, è una limitazione di Android stesso.
diff --git a/plugins/cordova-plugin-console/doc/ja/README.md b/plugins/cordova-plugin-console/doc/ja/README.md
deleted file mode 100644
index 059c373..0000000
--- a/plugins/cordova-plugin-console/doc/ja/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-このプラグインは、その console.log() がすることができます便利なことを確認するものです。 それは iOS、Ubuntu、Windows Phone 8 は、Windows に追加の関数を追加します。 場合はあなたのための console.log() の作品に満足しているし、おそらく必要はありませんこのプラグイン。
-
-このプラグインでは、グローバル ・ `console` オブジェクトを定義します。
-
-オブジェクトは、グローバル スコープでですが、このプラグインによって提供される機能は、`deviceready` イベントの後まで使用できません。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-console
-
-
-### Android の癖
-
-アンドロイド以外のいくつかのプラットフォームで console.log() は console.log (「1」、「2」、「3」) など、複数の引数に動作します。 しかし、アンドロイドは、最初の引数でのみ動作します。 console.log() に後続の引数は無視されます。 このプラグインが原因ではない、それは Android の自体の制限です。
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/ja/index.md b/plugins/cordova-plugin-console/doc/ja/index.md
deleted file mode 100644
index 413593c..0000000
--- a/plugins/cordova-plugin-console/doc/ja/index.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-このプラグインは、その console.log() がすることができます便利なことを確認するものです。 それは、iOS、Ubuntu、Windows Phone 8 および Windows 8 の追加関数を追加します。 場合はあなたのための console.log() の作品に満足しているし、おそらく必要はありませんこのプラグイン。
-
-このプラグインでは、グローバル ・ `console` オブジェクトを定義します。
-
-オブジェクトは、グローバル スコープでですが、このプラグインによって提供される機能は、`deviceready` イベントの後まで使用できません。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-console
-
-
-### Android の癖
-
-アンドロイド以外のいくつかのプラットフォームで console.log() は console.log (「1」、「2」、「3」) など、複数の引数に動作します。 しかし、アンドロイドは、最初の引数でのみ動作します。 console.log() に後続の引数は無視されます。 このプラグインが原因ではない、それは Android の自体の制限です。
diff --git a/plugins/cordova-plugin-console/doc/ko/README.md b/plugins/cordova-plugin-console/doc/ko/README.md
deleted file mode 100644
index d03ee5a..0000000
--- a/plugins/cordova-plugin-console/doc/ko/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-이 플러그인을 console.log()로 수 유용 되도록 의미입니다. 그것은 iOS, 우분투, Windows Phone 8, 및 창에 대 한 추가 기능을 추가합니다. Console.log() 당신을 위해 작동 하는 어떻게 행복 한 경우에, 그때 당신은 아마 필요 하지 않습니다이 플러그인.
-
-이 플러그인 글로벌 `console` 개체를 정의합니다.
-
-개체가 전역 범위에 있지만,이 플러그인에 의해 제공 되는 기능 하지 사용할 수 있습니다까지 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-console
-
-
-### 안 드 로이드 단점
-
-안 드 로이드 이외의 일부 플랫폼에서 console.log() console.log ("1", "2", "3")와 같이 여러 인수에 작동할 것 이다. 그러나, 안 드 로이드는 첫 번째 인수에만 작동할 것 이다. Console.log() 후속 인수는 무시 됩니다. 이 플러그인의 원인이 되지 않습니다, 그리고 그것은 안 드 로이드 자체의 한계입니다.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/ko/index.md b/plugins/cordova-plugin-console/doc/ko/index.md
deleted file mode 100644
index ca631e4..0000000
--- a/plugins/cordova-plugin-console/doc/ko/index.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-이 플러그인을 console.log()로 수 유용 되도록 의미입니다. IOS, 우분투, Windows Phone 8 및 윈도우 8에 대 한 추가 기능을 추가 하 고 합니다. Console.log() 당신을 위해 작동 하는 어떻게 행복 한 경우에, 그때 당신은 아마 필요 하지 않습니다이 플러그인.
-
-이 플러그인 글로벌 `console` 개체를 정의합니다.
-
-개체가 전역 범위에 있지만,이 플러그인에 의해 제공 되는 기능 하지 사용할 수 있습니다까지 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-console
-
-
-### 안 드 로이드 단점
-
-안 드 로이드 이외의 일부 플랫폼에서 console.log() console.log ("1", "2", "3")와 같이 여러 인수에 작동할 것 이다. 그러나, 안 드 로이드는 첫 번째 인수에만 작동할 것 이다. Console.log() 후속 인수는 무시 됩니다. 이 플러그인의 원인이 되지 않습니다, 그리고 그것은 안 드 로이드 자체의 한계입니다.
diff --git a/plugins/cordova-plugin-console/doc/pl/README.md b/plugins/cordova-plugin-console/doc/pl/README.md
deleted file mode 100644
index 78ab9d2..0000000
--- a/plugins/cordova-plugin-console/doc/pl/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-Ten plugin jest przeznaczona do zapewnienia, że console.log() jest tak przydatne, jak to może być. To dodaje dodatkową funkcję dla iOS, Ubuntu, Windows Phone 8 i Windows. Jeśli jesteś zadowolony z jak console.log() pracuje dla Ciebie, wtedy prawdopodobnie nie potrzebują tej wtyczki.
-
-Ten plugin definiuje obiekt globalny `console`.
-
-Mimo, że obiekt jest w globalnym zasięgu, funkcji oferowanych przez ten plugin nie są dostępne dopiero po turnieju `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-console
-
-
-### Dziwactwa Androida
-
-Na niektórych platformach innych niż Android console.log() będzie działać na wielu argumentów, takich jak console.log ("1", "2", "3"). Jednak Android będzie działać tylko na pierwszy argument. Kolejne argumenty do console.log() będą ignorowane. Ten plugin nie jest przyczyną, że, jest to ograniczenie Androida, sam.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/pl/index.md b/plugins/cordova-plugin-console/doc/pl/index.md
deleted file mode 100644
index 922b577..0000000
--- a/plugins/cordova-plugin-console/doc/pl/index.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-Ten plugin jest przeznaczona do zapewnienia, że console.log() jest tak przydatne, jak to może być. To dodaje dodatkową funkcję dla iOS, Ubuntu, Windows Phone 8 i Windows 8. Jeśli jesteś zadowolony z jak console.log() pracuje dla Ciebie, wtedy prawdopodobnie nie potrzebują tej wtyczki.
-
-Ten plugin definiuje obiekt globalny `console`.
-
-Mimo, że obiekt jest w globalnym zasięgu, funkcji oferowanych przez ten plugin nie są dostępne dopiero po turnieju `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-console
-
-
-### Dziwactwa Androida
-
-Na niektórych platformach innych niż Android console.log() będzie działać na wielu argumentów, takich jak console.log ("1", "2", "3"). Jednak Android będzie działać tylko na pierwszy argument. Kolejne argumenty do console.log() będą ignorowane. Ten plugin nie jest przyczyną, że, jest to ograniczenie Androida, sam.
diff --git a/plugins/cordova-plugin-console/doc/ru/index.md b/plugins/cordova-plugin-console/doc/ru/index.md
deleted file mode 100644
index 3cfe15d..0000000
--- a/plugins/cordova-plugin-console/doc/ru/index.md
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-# cordova-plugin-console
-
-Этот плагин предназначен для обеспечения как полезным, поскольку это может быть что console.log(). Он добавляет дополнительные функции для iOS, Ubuntu, Windows Phone 8 и Windows 8. Если вы не довольны как console.log() работает для вас, то вы вероятно не нужен этот плагин.
-
-## Установка
-
- cordova plugin add cordova-plugin-console
-
-
-### Особенности Android
-
-На некоторых платформах, отличных от Android console.log() будет действовать на нескольких аргументов, например console.log («1», «2», «3»). Тем не менее Android будет действовать только на первого аргумента. Последующие аргументы для console.log() будет игнорироваться. Этот плагин не является причиной этого, это ограничение Android сам.
diff --git a/plugins/cordova-plugin-console/doc/zh/README.md b/plugins/cordova-plugin-console/doc/zh/README.md
deleted file mode 100644
index ce27c3e..0000000
--- a/plugins/cordova-plugin-console/doc/zh/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# cordova-plugin-console
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-console.svg)](https://travis-ci.org/apache/cordova-plugin-console)
-
-這個外掛程式是為了確保該 console.log() 是一樣有用,它可以是。 它將添加附加功能的 iOS,Ubuntu,Windows Phone 8 和視窗。 如果你是快樂與 console.log() 是如何為你工作,那麼可能不需要這個外掛程式。
-
-這個外掛程式定義了一個全域 `console` 物件。
-
-儘管物件是在全球範圍內,提供這個外掛程式的功能不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-console
-
-
-### Android 的怪癖
-
-在一些平臺上除了 Android,console.log() 亦會根據多個參數,如 console.log ("1"、"2"、"3")。 然而,安卓系統只亦會根據第一個參數。 對 console.log() 的後續參數將被忽略。 這個外掛程式不是的原因,它是一個 android 作業系統本身的限制。
\ No newline at end of file
diff --git a/plugins/cordova-plugin-console/doc/zh/index.md b/plugins/cordova-plugin-console/doc/zh/index.md
deleted file mode 100644
index e18a141..0000000
--- a/plugins/cordova-plugin-console/doc/zh/index.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-# cordova-plugin-console
-
-這個外掛程式是為了確保該 console.log() 是一樣有用,它可以是。 它將添加附加功能的 iOS、 Ubuntu,Windows Phone 8 和 Windows 8。 如果你是快樂與 console.log() 是如何為你工作,那麼可能不需要這個外掛程式。
-
-這個外掛程式定義了一個全域 `console` 物件。
-
-儘管物件是在全球範圍內,提供這個外掛程式的功能不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log("console.log works well");
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-console
-
-
-### Android 的怪癖
-
-在一些平臺上除了 Android,console.log() 亦會根據多個參數,如 console.log ("1"、"2"、"3")。 然而,安卓系統只亦會根據第一個參數。 對 console.log() 的後續參數將被忽略。 這個外掛程式不是的原因,它是一個 android 作業系統本身的限制。
diff --git a/plugins/cordova-plugin-console/package.json b/plugins/cordova-plugin-console/package.json
deleted file mode 100644
index b923db7..0000000
--- a/plugins/cordova-plugin-console/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "cordova-plugin-console",
- "version": "1.0.6",
- "description": "Cordova Console Plugin",
- "cordova": {
- "id": "cordova-plugin-console",
- "platforms": [
- "ios",
- "ubuntu",
- "wp7",
- "wp8",
- "windows8",
- "windows"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-plugin-console"
- },
- "keywords": [
- "cordova",
- "console",
- "ecosystem:cordova",
- "cordova-ios",
- "cordova-ubuntu",
- "cordova-wp7",
- "cordova-wp8",
- "cordova-windows8",
- "cordova-windows"
- ],
- "scripts": {
- "test": "npm run jshint",
- "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
- },
- "author": "Apache Software Foundation",
- "license": "Apache-2.0",
- "engines": {
- "cordovaDependencies": {
- "2.0.0": {
- "cordova": ">100"
- }
- }
- },
- "devDependencies": {
- "jshint": "^2.6.0"
- }
-}
diff --git a/plugins/cordova-plugin-console/plugin.xml b/plugins/cordova-plugin-console/plugin.xml
deleted file mode 100644
index 208a88d..0000000
--- a/plugins/cordova-plugin-console/plugin.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
- Console
- Cordova Console Plugin
- Apache 2.0
- cordova,console
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
- https://issues.apache.org/jira/browse/CB/component/12320644
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-console/src/ios/CDVLogger.h b/plugins/cordova-plugin-console/src/ios/CDVLogger.h
deleted file mode 100644
index 7cfb306..0000000
--- a/plugins/cordova-plugin-console/src/ios/CDVLogger.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-
-@interface CDVLogger : CDVPlugin
-
-- (void)logLevel:(CDVInvokedUrlCommand*)command;
-
-@end
diff --git a/plugins/cordova-plugin-console/src/ios/CDVLogger.m b/plugins/cordova-plugin-console/src/ios/CDVLogger.m
deleted file mode 100644
index ccfa3a5..0000000
--- a/plugins/cordova-plugin-console/src/ios/CDVLogger.m
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVLogger.h"
-#import
-
-@implementation CDVLogger
-
-/* log a message */
-- (void)logLevel:(CDVInvokedUrlCommand*)command
-{
- id level = [command argumentAtIndex:0];
- id message = [command argumentAtIndex:1];
-
- if ([level isEqualToString:@"LOG"]) {
- NSLog(@"%@", message);
- } else {
- NSLog(@"%@: %@", level, message);
- }
-}
-
-@end
diff --git a/plugins/cordova-plugin-console/src/ubuntu/console.cpp b/plugins/cordova-plugin-console/src/ubuntu/console.cpp
deleted file mode 100644
index 9de09f4..0000000
--- a/plugins/cordova-plugin-console/src/ubuntu/console.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "console.h"
-
-#include
-
-Console::Console(Cordova *cordova) : CPlugin(cordova) {
-}
-
-void Console::logLevel(int scId, int ecId, QString level, QString message) {
- Q_UNUSED(scId)
- Q_UNUSED(ecId)
-
- if (level != "LOG")
- std::cout << "[" << level.toStdString() << "] ";
- std::cout << message.toStdString() << std::endl;
-}
diff --git a/plugins/cordova-plugin-console/src/ubuntu/console.h b/plugins/cordova-plugin-console/src/ubuntu/console.h
deleted file mode 100644
index 3f3d163..0000000
--- a/plugins/cordova-plugin-console/src/ubuntu/console.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef CONSOLE_H_FDSVCXGFRS
-#define CONSOLE_H_FDSVCXGFRS
-
-#include
-
-#include
-
-class Console : public CPlugin {
- Q_OBJECT
-public:
- explicit Console(Cordova *cordova);
-
- virtual const QString fullName() override {
- return Console::fullID();
- }
-
- virtual const QString shortName() override {
- return "Console";
- }
-
- static const QString fullID() {
- return "Console";
- }
-
-public slots:
- void logLevel(int scId, int ecId, QString level, QString message);
-};
-
-#endif
diff --git a/plugins/cordova-plugin-console/src/wp/DebugConsole.cs b/plugins/cordova-plugin-console/src/wp/DebugConsole.cs
deleted file mode 100644
index 9bb5476..0000000
--- a/plugins/cordova-plugin-console/src/wp/DebugConsole.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-using System;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-using System.Diagnostics;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- public class DebugConsole : BaseCommand
- {
- public void logLevel(string options)
- {
- string[] args = JSON.JsonHelper.Deserialize(options);
- string level = args[0];
- string msg = args[1];
-
- if (level.Equals("LOG"))
- {
- Debug.WriteLine(msg);
- }
- else
- {
- Debug.WriteLine(level + ": " + msg);
- }
- }
- }
-}
diff --git a/plugins/cordova-plugin-console/tests/plugin.xml b/plugins/cordova-plugin-console/tests/plugin.xml
deleted file mode 100644
index 6ca80a8..0000000
--- a/plugins/cordova-plugin-console/tests/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- Cordova Console Plugin Tests
- Apache 2.0
-
-
-
-
diff --git a/plugins/cordova-plugin-console/tests/tests.js b/plugins/cordova-plugin-console/tests/tests.js
deleted file mode 100644
index 74765d9..0000000
--- a/plugins/cordova-plugin-console/tests/tests.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* jshint jasmine: true */
-
-exports.defineAutoTests = function () {
- describe("Console", function () {
- it("console.spec.1 should exist", function() {
- expect(window.console).toBeDefined();
- });
-
- it("console.spec.2 has required methods log|warn|error", function(){
- expect(window.console.log).toBeDefined();
- expect(typeof window.console.log).toBe('function');
-
- expect(window.console.warn).toBeDefined();
- expect(typeof window.console.warn).toBe('function');
-
- expect(window.console.error).toBeDefined();
- expect(typeof window.console.error).toBe('function');
- });
- });
-};
-
-exports.defineManualTests = function (contentEl, createActionButton) {};
diff --git a/plugins/cordova-plugin-console/www/console-via-logger.js b/plugins/cordova-plugin-console/www/console-via-logger.js
deleted file mode 100644
index ffee326..0000000
--- a/plugins/cordova-plugin-console/www/console-via-logger.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-//------------------------------------------------------------------------------
-
-var logger = require("./logger");
-
-//------------------------------------------------------------------------------
-// object that we're exporting
-//------------------------------------------------------------------------------
-var console = module.exports;
-
-//------------------------------------------------------------------------------
-// copy of the original console object
-//------------------------------------------------------------------------------
-var WinConsole = window.console;
-
-//------------------------------------------------------------------------------
-// whether to use the logger
-//------------------------------------------------------------------------------
-var UseLogger = false;
-
-//------------------------------------------------------------------------------
-// Timers
-//------------------------------------------------------------------------------
-var Timers = {};
-
-//------------------------------------------------------------------------------
-// used for unimplemented methods
-//------------------------------------------------------------------------------
-function noop() {}
-
-//------------------------------------------------------------------------------
-// used for unimplemented methods
-//------------------------------------------------------------------------------
-console.useLogger = function (value) {
- if (arguments.length) UseLogger = !!value;
-
- if (UseLogger) {
- if (logger.useConsole()) {
- throw new Error("console and logger are too intertwingly");
- }
- }
-
- return UseLogger;
-};
-
-//------------------------------------------------------------------------------
-console.log = function() {
- if (logger.useConsole()) return;
- logger.log.apply(logger, [].slice.call(arguments));
-};
-
-//------------------------------------------------------------------------------
-console.error = function() {
- if (logger.useConsole()) return;
- logger.error.apply(logger, [].slice.call(arguments));
-};
-
-//------------------------------------------------------------------------------
-console.warn = function() {
- if (logger.useConsole()) return;
- logger.warn.apply(logger, [].slice.call(arguments));
-};
-
-//------------------------------------------------------------------------------
-console.info = function() {
- if (logger.useConsole()) return;
- logger.info.apply(logger, [].slice.call(arguments));
-};
-
-//------------------------------------------------------------------------------
-console.debug = function() {
- if (logger.useConsole()) return;
- logger.debug.apply(logger, [].slice.call(arguments));
-};
-
-//------------------------------------------------------------------------------
-console.assert = function(expression) {
- if (expression) return;
-
- var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log("ASSERT: " + message);
-};
-
-//------------------------------------------------------------------------------
-console.clear = function() {};
-
-//------------------------------------------------------------------------------
-console.dir = function(object) {
- console.log("%o", object);
-};
-
-//------------------------------------------------------------------------------
-console.dirxml = function(node) {
- console.log(node.innerHTML);
-};
-
-//------------------------------------------------------------------------------
-console.trace = noop;
-
-//------------------------------------------------------------------------------
-console.group = console.log;
-
-//------------------------------------------------------------------------------
-console.groupCollapsed = console.log;
-
-//------------------------------------------------------------------------------
-console.groupEnd = noop;
-
-//------------------------------------------------------------------------------
-console.time = function(name) {
- Timers[name] = new Date().valueOf();
-};
-
-//------------------------------------------------------------------------------
-console.timeEnd = function(name) {
- var timeStart = Timers[name];
- if (!timeStart) {
- console.warn("unknown timer: " + name);
- return;
- }
-
- var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ": " + timeElapsed + "ms");
-};
-
-//------------------------------------------------------------------------------
-console.timeStamp = noop;
-
-//------------------------------------------------------------------------------
-console.profile = noop;
-
-//------------------------------------------------------------------------------
-console.profileEnd = noop;
-
-//------------------------------------------------------------------------------
-console.count = noop;
-
-//------------------------------------------------------------------------------
-console.exception = console.log;
-
-//------------------------------------------------------------------------------
-console.table = function(data, columns) {
- console.log("%o", data);
-};
-
-//------------------------------------------------------------------------------
-// return a new function that calls both functions passed as args
-//------------------------------------------------------------------------------
-function wrappedOrigCall(orgFunc, newFunc) {
- return function() {
- var args = [].slice.call(arguments);
- try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
- };
-}
-
-//------------------------------------------------------------------------------
-// For every function that exists in the original console object, that
-// also exists in the new console object, wrap the new console method
-// with one that calls both
-//------------------------------------------------------------------------------
-for (var key in console) {
- if (typeof WinConsole[key] == "function") {
- console[key] = wrappedOrigCall(WinConsole[key], console[key]);
- }
-}
diff --git a/plugins/cordova-plugin-console/www/logger.js b/plugins/cordova-plugin-console/www/logger.js
deleted file mode 100644
index 430d887..0000000
--- a/plugins/cordova-plugin-console/www/logger.js
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-//------------------------------------------------------------------------------
-// The logger module exports the following properties/functions:
-//
-// LOG - constant for the level LOG
-// ERROR - constant for the level ERROR
-// WARN - constant for the level WARN
-// INFO - constant for the level INFO
-// DEBUG - constant for the level DEBUG
-// logLevel() - returns current log level
-// logLevel(value) - sets and returns a new log level
-// useConsole() - returns whether logger is using console
-// useConsole(value) - sets and returns whether logger is using console
-// log(message,...) - logs a message at level LOG
-// error(message,...) - logs a message at level ERROR
-// warn(message,...) - logs a message at level WARN
-// info(message,...) - logs a message at level INFO
-// debug(message,...) - logs a message at level DEBUG
-// logLevel(level,message,...) - logs a message specified level
-//
-//------------------------------------------------------------------------------
-
-var logger = exports;
-
-var exec = require('cordova/exec');
-
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
-var CurrentLevel;
-
-var originalConsole = console;
-
-/**
- * Logging levels
- */
-
-var Levels = [
- "LOG",
- "ERROR",
- "WARN",
- "INFO",
- "DEBUG"
-];
-
-/*
- * add the logging levels to the logger object and
- * to a separate levelsMap object for testing
- */
-
-var LevelsMap = {};
-for (var i=0; i 0){
- formatArgs.unshift(fmtString); // add formatString
- }
-
- var message = logger.format.apply(logger.format, formatArgs);
-
- if (LevelsMap[level] === null) {
- throw new Error("invalid logging level: " + level);
- }
-
- if (LevelsMap[level] > CurrentLevel) return;
-
- // queue the message if not yet at deviceready
- if (!DeviceReady && !UseConsole) {
- Queued.push([level, message]);
- return;
- }
-
- // Log using the native logger if that is enabled
- if (UseLogger) {
- exec(null, null, "Console", "logLevel", [level, message]);
- }
-
- // Log using the console if that is enabled
- if (UseConsole) {
- // make sure console is not using logger
- if (console.useLogger()) {
- throw new Error("console and logger are too intertwingly");
- }
-
- // log to the console
- switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log("ERROR: " + message); break;
- case logger.WARN: originalConsole.log("WARN: " + message); break;
- case logger.INFO: originalConsole.log("INFO: " + message); break;
- case logger.DEBUG: originalConsole.log("DEBUG: " + message); break;
- }
- }
-};
-
-
-/**
- * Formats a string and arguments following it ala console.log()
- *
- * Any remaining arguments will be appended to the formatted string.
- *
- * for rationale, see FireBug's Console API:
- * http://getfirebug.com/wiki/index.php/Console_API
- */
-logger.format = function(formatString, args) {
- return __format(arguments[0], [].slice.call(arguments,1)).join(' ');
-};
-
-
-//------------------------------------------------------------------------------
-/**
- * Formats a string and arguments following it ala vsprintf()
- *
- * format chars:
- * %j - format arg as JSON
- * %o - format arg as JSON
- * %c - format arg as ''
- * %% - replace with '%'
- * any other char following % will format it's
- * arg via toString().
- *
- * Returns an array containing the formatted string and any remaining
- * arguments.
- */
-function __format(formatString, args) {
- if (formatString === null || formatString === undefined) return [""];
- if (arguments.length == 1) return [formatString.toString()];
-
- if (typeof formatString != "string")
- formatString = formatString.toString();
-
- var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
-
- while (args.length) {
- var match = pattern.exec(rest);
- if (!match) break;
-
- var arg = args.shift();
- rest = match[3];
- result.push(match[1]);
-
- if (match[2] == '%') {
- result.push('%');
- args.unshift(arg);
- continue;
- }
-
- result.push(__formatted(arg, match[2]));
- }
-
- result.push(rest);
-
- var remainingArgs = [].slice.call(args);
- remainingArgs.unshift(result.join(''));
- return remainingArgs;
-}
-
-function __formatted(object, formatChar) {
-
- try {
- switch(formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
- }
- }
- catch (e) {
- return "error JSON.stringify()ing argument: " + e;
- }
-
- if ((object === null) || (object === undefined)) {
- return Object.prototype.toString.call(object);
- }
-
- return object.toString();
-}
-
-
-//------------------------------------------------------------------------------
-// when deviceready fires, log queued messages
-logger.__onDeviceReady = function() {
- if (DeviceReady) return;
-
- DeviceReady = true;
-
- for (var i=0; i
-
-# Contributing to Apache Cordova
-
-Anyone can contribute to Cordova. And we need your contributions.
-
-There are multiple ways to contribute: report bugs, improve the docs, and
-contribute code.
-
-For instructions on this, start with the
-[contribution overview](http://cordova.apache.org/contribute/).
-
-The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
- - Run the tests so your patch doesn't break existing functionality.
-
-We look forward to your contributions!
diff --git a/plugins/cordova-plugin-contacts/LICENSE b/plugins/cordova-plugin-contacts/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/plugins/cordova-plugin-contacts/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/NOTICE b/plugins/cordova-plugin-contacts/NOTICE
deleted file mode 100644
index b0398ea..0000000
--- a/plugins/cordova-plugin-contacts/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Microsoft Open Technologies, Inc. (http://msopentech.com/).
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/README.md b/plugins/cordova-plugin-contacts/README.md
deleted file mode 100644
index 77e8c88..0000000
--- a/plugins/cordova-plugin-contacts/README.md
+++ /dev/null
@@ -1,847 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-This plugin defines a global `navigator.contacts` object, which provides access to the device contacts database.
-
-Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-__WARNING__: Collection and use of contact data raises
-important privacy issues. Your app's privacy policy should discuss
-how the app uses contact data and whether it is shared with any other
-parties. Contact information is considered sensitive because it
-reveals the people with whom a person communicates. Therefore, in
-addition to the app's privacy policy, you should strongly consider
-providing a just-in-time notice before the app accesses or uses
-contact data, if the device operating system doesn't do so
-already. That notice should provide the same information noted above,
-as well as obtaining the user's permission (e.g., by presenting
-choices for __OK__ and __No Thanks__). Note that some app
-marketplaces may require the app to provide a just-in-time notice and
-obtain the user's permission before accessing contact data. A
-clear and easy-to-understand user experience surrounding the use of
-contact data helps avoid user confusion and perceived misuse of
-contact data. For more information, please see the Privacy Guide.
-
-:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Contacts%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
-
-## Installation
-
-This requires cordova 5.0+ ( current stable v1.0.0 )
-
- cordova plugin add cordova-plugin-contacts
-Older versions of cordova can still install via the __deprecated__ id ( stale v0.2.16 )
-
- cordova plugin add org.apache.cordova.contacts
-It is also possible to install via repo url directly ( unstable )
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS Quirks
-
-Create __www/manifest.webapp__ as described in
-[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest).
-Add relevant permisions.
-There is also a need to change the webapp type to "privileged" - [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type).
-__WARNING__: All privileged apps enforce [Content Security Policy](https://developer.mozilla.org/en-US/Apps/CSP) which forbids inline script. Initialize your application in another way.
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-### Windows Quirks
-
-**Prior to Windows 10:** Any contacts returned from `find` and `pickContact` methods are readonly, so your application cannot modify them.
-`find` method available only on Windows Phone 8.1 devices.
-
-**Windows 10 and above:** Contacts may be saved and will be saved to app-local contacts storage. Contacts may also be deleted.
-
-### Windows 8 Quirks
-
-Windows 8 Contacts are readonly. Via the Cordova API Contacts are not queryable/searchable, you should inform the user to pick a contact as a call to contacts.pickContact which will open the 'People' app where the user must choose a contact.
-Any contacts returned are readonly, so your application cannot modify them.
-
-## navigator.contacts
-
-### Methods
-
-- navigator.contacts.create
-- navigator.contacts.find
-- navigator.contacts.pickContact
-
-### Objects
-
-- Contact
-- ContactName
-- ContactField
-- ContactAddress
-- ContactOrganization
-- ContactFindOptions
-- ContactError
-- ContactFieldType
-
-## navigator.contacts.create
-
-The `navigator.contacts.create` method is synchronous, and returns a new `Contact` object.
-
-This method does not retain the Contact object in the device contacts
-database, for which you need to invoke the `Contact.save` method.
-
-### Supported Platforms
-
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-
-### Example
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-## navigator.contacts.find
-
-The `navigator.contacts.find` method executes asynchronously, querying the
-device contacts database and returning an array of `Contact` objects.
-The resulting objects are passed to the `contactSuccess` callback
-function specified by the __contactSuccess__ parameter.
-
-The __contactFields__ parameter specifies the fields to be used as a
-search qualifier. A zero-length __contactFields__ parameter is invalid and results in
-`ContactError.INVALID_ARGUMENT_ERROR`. A __contactFields__ value of
-`"*"` searches all contact fields.
-
-The __contactFindOptions.filter__ string can be used as a search
-filter when querying the contacts database. If provided, a
-case-insensitive, partial value match is applied to each field
-specified in the __contactFields__ parameter. If there's a match for
-_any_ of the specified fields, the contact is returned. Use __contactFindOptions.desiredFields__
-parameter to control which contact properties must be returned back.
-
-Supported values for both __contactFields__ and __contactFindOptions.desiredFields__ parameters are enumerated in [`ContactFieldType`](#contactfieldtype) object.
-
-### Parameters
-
-- __contactFields__: Contact fields to use as a search qualifier. _(DOMString[])_ [Required]
-
-- __contactSuccess__: Success callback function invoked with the array of Contact objects returned from the database. [Required]
-
-- __contactError__: Error callback function, invoked when an error occurs. [Optional]
-
-- __contactFindOptions__: Search options to filter navigator.contacts. [Optional]
-
- Keys include:
-
- - __filter__: The search string used to find navigator.contacts. _(DOMString)_ (Default: `""`)
-
- - __multiple__: Determines if the find operation returns multiple navigator.contacts. _(Boolean)_ (Default: `false`)
-
- - __desiredFields__: Contact fields to be returned back. If specified, the resulting `Contact` object only features values for these fields. _(DOMString[])_ [Optional]
-
- - __hasPhoneNumber__(Android only): Filters the search to only return contacts with a phone number informed. _(Boolean)_ (Default: `false`)
-
-### Supported Platforms
-
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-- Windows (Windows Phone 8.1 and Windows 10)
-
-### Example
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- options.hasPhoneNumber = true;
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-### Windows Quirks
-
-- `__contactFields__` is not supported and will be ignored. `find` method will always attempt to match the name, email address, or phone number of a contact.
-
-## navigator.contacts.pickContact
-
-The `navigator.contacts.pickContact` method launches the Contact Picker to select a single contact.
-The resulting object is passed to the `contactSuccess` callback
-function specified by the __contactSuccess__ parameter.
-
-### Parameters
-
-- __contactSuccess__: Success callback function invoked with the single Contact object. [Required]
-
-- __contactError__: Error callback function, invoked when an error occurs. [Optional]
-
-### Supported Platforms
-
-- Android
-- iOS
-- Windows Phone 8
-- Windows 8
-- Windows
-
-### Example
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-### Android Quirks
-
-This plugin launches an external Activity for picking contacts. See the
-[Android Lifecycle Guide](http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html)
-for an explanation of how this affects your application. If the plugin returns
-its result in the `resume` event, then you must first wrap the returned object
-in a `Contact` object before using it. Here is an example:
-
-```javascript
-function onResume(resumeEvent) {
- if(resumeEvent.pendingResult) {
- if(resumeEvent.pendingResult.pluginStatus === "OK") {
- var contact = navigator.contacts.create(resumeEvent.pendingResult.result);
- successCallback(contact);
- } else {
- failCallback(resumeEvent.pendingResult.result);
- }
- }
-}
-```
-
-## Contact
-
-The `Contact` object represents a user's contact. Contacts can be
-created, stored, or removed from the device contacts database.
-Contacts can also be retrieved (individually or in bulk) from the
-database by invoking the `navigator.contacts.find` method.
-
-__NOTE__: Not all of the contact fields listed above are supported on
-every device platform. Please check each platform's _Quirks_ section
-for details.
-
-
-### Properties
-
-- __id__: A globally unique identifier. _(DOMString)_
-
-- __displayName__: The name of this Contact, suitable for display to end users. _(DOMString)_
-
-- __name__: An object containing all components of a persons name. _(ContactName)_
-
-- __nickname__: A casual name by which to address the contact. _(DOMString)_
-
-- __phoneNumbers__: An array of all the contact's phone numbers. _(ContactField[])_
-
-- __emails__: An array of all the contact's email addresses. _(ContactField[])_
-
-- __addresses__: An array of all the contact's addresses. _(ContactAddress[])_
-
-- __ims__: An array of all the contact's IM addresses. _(ContactField[])_
-
-- __organizations__: An array of all the contact's organizations. _(ContactOrganization[])_
-
-- __birthday__: The birthday of the contact. _(Date)_
-
-- __note__: A note about the contact. _(DOMString)_
-
-- __photos__: An array of the contact's photos. _(ContactField[])_
-
-- __categories__: An array of all the user-defined categories associated with the contact. _(ContactField[])_
-
-- __urls__: An array of web pages associated with the contact. _(ContactField[])_
-
-### Methods
-
-- __clone__: Returns a new `Contact` object that is a deep copy of the calling object, with the `id` property set to `null`.
-
-- __remove__: Removes the contact from the device contacts database, otherwise executes an error callback with a `ContactError` object.
-
-- __save__: Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same __id__ already exists.
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-- Windows 8
-- Windows
-
-### Save Example
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-### Clone Example
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-### Remove Example
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X Quirks
-
-- __categories__: Not supported on Android 2.X devices, returning `null`.
-
-### BlackBerry 10 Quirks
-
-- __id__: Assigned by the device when saving the contact.
-
-### FirefoxOS Quirks
-
-- __categories__: Partially supported. Fields __pref__ and __type__ are returning `null`
-
-- __ims__: Not supported
-
-- __photos__: Not supported
-
-
-### iOS Quirks
-
-- __displayName__: Not supported on iOS, returning `null` unless there is no `ContactName` specified, in which case it returns the composite name, __nickname__ or `""`, respectively.
-
-- __birthday__: Must be input as a JavaScript `Date` object, the same way it is returned.
-
-- __photos__: Returns a File URL to the image, which is stored in the application's temporary directory. Contents of the temporary directory are removed when the application exits.
-
-- __categories__: This property is currently not supported, returning `null`.
-
-### Windows Phone 8 Quirks
-
-- __displayName__: When creating a contact, the value provided for the display name parameter differs from the display name retrieved when finding the contact.
-
-- __urls__: When creating a contact, users can input and save more than one web address, but only one is available when searching the contact.
-
-- __phoneNumbers__: The _pref_ option is not supported. The _type_ is not supported in a _find_ operation. Only one `phoneNumber` is allowed for each _type_.
-
-- __emails__: The _pref_ option is not supported. Home and personal references same email entry. Only one entry is allowed for each _type_.
-
-- __addresses__: Supports only work, and home/personal _type_. The home and personal _type_ reference the same address entry. Only one entry is allowed for each _type_.
-
-- __organizations__: Only one is allowed, and does not support the _pref_, _type_, and _department_ attributes.
-
-- __note__: Not supported, returning `null`.
-
-- __ims__: Not supported, returning `null`.
-
-- __birthdays__: Not supported, returning `null`.
-
-- __categories__: Not supported, returning `null`.
-
-- __remove__: Method is not supported
-
-### Windows Quirks
-
-- __photos__: Returns a File URL to the image, which is stored in the application's temporary directory.
-
-- __birthdays__: Not supported, returning `null`.
-
-- __categories__: Not supported, returning `null`.
-
-- __remove__: Method is only supported in Windows 10 or above.
-
-## ContactAddress
-
-The `ContactAddress` object stores the properties of a single address
-of a contact. A `Contact` object may include more than one address in
-a `ContactAddress[]` array.
-
-
-### Properties
-
-- __pref__: Set to `true` if this `ContactAddress` contains the user's preferred value. _(boolean)_
-
-- __type__: A string indicating what type of field this is, _home_ for example. _(DOMString)_
-
-- __formatted__: The full address formatted for display. _(DOMString)_
-
-- __streetAddress__: The full street address. _(DOMString)_
-
-- __locality__: The city or locality. _(DOMString)_
-
-- __region__: The state or region. _(DOMString)_
-
-- __postalCode__: The zip code or postal code. _(DOMString)_
-
-- __country__: The country name. _(DOMString)_
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-- Windows 8
-- Windows
-
-### Example
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- options.multiple = true;
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-### Android 2.X Quirks
-
-- __pref__: Not supported, returning `false` on Android 2.X devices.
-
-### BlackBerry 10 Quirks
-
-- __pref__: Not supported on BlackBerry devices, returning `false`.
-
-- __type__: Partially supported. Only one each of _Work_ and _Home_ type addresses can be stored per contact.
-
-- __formatted__: Partially supported. Returns a concatenation of all BlackBerry address fields.
-
-- __streetAddress__: Supported. Returns a concatenation of BlackBerry __address1__ and __address2__ address fields.
-
-- __locality__: Supported. Stored in BlackBerry __city__ address field.
-
-- __region__: Supported. Stored in BlackBerry __stateProvince__ address field.
-
-- __postalCode__: Supported. Stored in BlackBerry __zipPostal__ address field.
-
-- __country__: Supported.
-
-### FirefoxOS Quirks
-
-- __formatted__: Currently not supported
-
-### iOS Quirks
-
-- __pref__: Not supported on iOS devices, returning `false`.
-
-- __formatted__: Currently not supported.
-
-### Windows 8 Quirks
-
-- __pref__: Not supported
-
-### Windows Quirks
-
-- __pref__: Not supported
-
-
-## ContactError
-
-The `ContactError` object is returned to the user through the
-`contactError` callback function when an error occurs.
-
-### Properties
-
-- __code__: One of the predefined error codes listed below.
-
-### Constants
-
-- `ContactError.UNKNOWN_ERROR` (code 0)
-- `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-- `ContactError.TIMEOUT_ERROR` (code 2)
-- `ContactError.PENDING_OPERATION_ERROR` (code 3)
-- `ContactError.IO_ERROR` (code 4)
-- `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-- `ContactError.OPERATION_CANCELLED_ERROR` (code 6)
-- `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-
-## ContactField
-
-The `ContactField` object is a reusable component that represents
-contact fields generically. Each `ContactField` object contains a
-`value`, `type`, and `pref` property. A `Contact` object stores
-several properties in `ContactField[]` arrays, such as phone numbers
-and email addresses.
-
-In most instances, there are no pre-determined values for a
-`ContactField` object's __type__ attribute. For example, a phone
-number can specify __type__ values of _home_, _work_, _mobile_,
-_iPhone_, or any other value that is supported by a particular device
-platform's contact database. However, for the `Contact` __photos__
-field, the __type__ field indicates the format of the returned image:
-__url__ when the __value__ attribute contains a URL to the photo
-image, or _base64_ when the __value__ contains a base64-encoded image
-string.
-
-### Properties
-
-- __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString)_
-
-- __value__: The value of the field, such as a phone number or email address. _(DOMString)_
-
-- __pref__: Set to `true` if this `ContactField` contains the user's preferred value. _(boolean)_
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-- Windows 8
-- Windows
-
-### Example
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-### Android Quirks
-
-- __pref__: Not supported, returning `false`.
-
-### BlackBerry 10 Quirks
-
-- __type__: Partially supported. Used for phone numbers.
-
-- __value__: Supported.
-
-- __pref__: Not supported, returning `false`.
-
-### iOS Quirks
-
-- __pref__: Not supported, returning `false`.
-
-### Windows8 Quirks
-
-- __pref__: Not supported, returning `false`.
-
-### Windows Quirks
-
-- __pref__: Not supported, returning `false`.
-
-
-## ContactName
-
-Contains different kinds of information about a `Contact` object's name.
-
-### Properties
-
-- __formatted__: The complete name of the contact. _(DOMString)_
-
-- __familyName__: The contact's family name. _(DOMString)_
-
-- __givenName__: The contact's given name. _(DOMString)_
-
-- __middleName__: The contact's middle name. _(DOMString)_
-
-- __honorificPrefix__: The contact's prefix (example _Mr._ or _Dr._) _(DOMString)_
-
-- __honorificSuffix__: The contact's suffix (example _Esq._). _(DOMString)_
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-- Windows 8
-- Windows
-
-### Example
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- options.multiple = true;
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-### Android Quirks
-
-- __formatted__: Partially supported, and read-only. Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`.
-
-### BlackBerry 10 Quirks
-
-- __formatted__: Partially supported. Returns a concatenation of BlackBerry __firstName__ and __lastName__ fields.
-
-- __familyName__: Supported. Stored in BlackBerry __lastName__ field.
-
-- __givenName__: Supported. Stored in BlackBerry __firstName__ field.
-
-- __middleName__: Not supported, returning `null`.
-
-- __honorificPrefix__: Not supported, returning `null`.
-
-- __honorificSuffix__: Not supported, returning `null`.
-
-### FirefoxOS Quirks
-
-- __formatted__: Partially supported, and read-only. Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`.
-
-
-### iOS Quirks
-
-- __formatted__: Partially supported. Returns iOS Composite Name, but is read-only.
-
-### Windows 8 Quirks
-
-- __formatted__: This is the only name property, and is identical to `displayName`, and `nickname`
-
-- __familyName__: not supported
-
-- __givenName__: not supported
-
-- __middleName__: not supported
-
-- __honorificPrefix__: not supported
-
-- __honorificSuffix__: not supported
-
-### Windows Quirks
-
-- __formatted__: It is identical to `displayName`
-
-
-## ContactOrganization
-
-The `ContactOrganization` object stores a contact's organization
-properties. A `Contact` object stores one or more
-`ContactOrganization` objects in an array.
-
-### Properties
-
-- __pref__: Set to `true` if this `ContactOrganization` contains the user's preferred value. _(boolean)_
-
-- __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString)
-
-- __name__: The name of the organization. _(DOMString)_
-
-- __department__: The department the contract works for. _(DOMString)_
-
-- __title__: The contact's title at the organization. _(DOMString)_
-
-
-### Supported Platforms
-
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Windows Phone 8
-- Windows (Windows 8.1 and Windows Phone 8.1 devices only)
-
-### Example
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- options.multiple = true;
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-### Android 2.X Quirks
-
-- __pref__: Not supported by Android 2.X devices, returning `false`.
-
-### BlackBerry 10 Quirks
-
-- __pref__: Not supported by BlackBerry devices, returning `false`.
-
-- __type__: Not supported by BlackBerry devices, returning `null`.
-
-- __name__: Partially supported. The first organization name is stored in the BlackBerry __company__ field.
-
-- __department__: Not supported, returning `null`.
-
-- __title__: Partially supported. The first organization title is stored in the BlackBerry __jobTitle__ field.
-
-### Firefox OS Quirks
-
-- __pref__: Not supported
-
-- __type__: Not supported
-
-- __department__: Not supported
-
-- Fields __name__ and __title__ stored in __org__ and __jobTitle__.
-
-### iOS Quirks
-
-- __pref__: Not supported on iOS devices, returning `false`.
-
-- __type__: Not supported on iOS devices, returning `null`.
-
-- __name__: Partially supported. The first organization name is stored in the iOS __kABPersonOrganizationProperty__ field.
-
-- __department__: Partially supported. The first department name is stored in the iOS __kABPersonDepartmentProperty__ field.
-
-- __title__: Partially supported. The first title is stored in the iOS __kABPersonJobTitleProperty__ field.
-
-### Windows Quirks
-
-- __pref__: Not supported, returning `false`.
-
-- __type__: Not supported, returning `null`.
-
-## ContactFieldType
-The `ContactFieldType` object is an enumeration of possible field types, such as `'phoneNumbers'` or `'emails'`, that could be used to control which contact properties must be returned back from `contacts.find()` method (see `contactFindOptions.desiredFields`), or to specify fields to search in (through `contactFields` parameter). Possible values are:
-
-- `navigator.contacts.fieldType.addresses`
-- `navigator.contacts.fieldType.birthday`
-- `navigator.contacts.fieldType.categories`
-- `navigator.contacts.fieldType.country`
-- `navigator.contacts.fieldType.department`
-- `navigator.contacts.fieldType.displayName`
-- `navigator.contacts.fieldType.emails`
-- `navigator.contacts.fieldType.familyName`
-- `navigator.contacts.fieldType.formatted`
-- `navigator.contacts.fieldType.givenName`
-- `navigator.contacts.fieldType.honorificPrefix`
-- `navigator.contacts.fieldType.honorificSuffix`
-- `navigator.contacts.fieldType.id`
-- `navigator.contacts.fieldType.ims`
-- `navigator.contacts.fieldType.locality`
-- `navigator.contacts.fieldType.middleName`
-- `navigator.contacts.fieldType.name`
-- `navigator.contacts.fieldType.nickname`
-- `navigator.contacts.fieldType.note`
-- `navigator.contacts.fieldType.organizations`
-- `navigator.contacts.fieldType.phoneNumbers`
-- `navigator.contacts.fieldType.photos`
-- `navigator.contacts.fieldType.postalCode`
-- `navigator.contacts.fieldType.region`
-- `navigator.contacts.fieldType.streetAddress`
-- `navigator.contacts.fieldType.title`
-- `navigator.contacts.fieldType.urls`
diff --git a/plugins/cordova-plugin-contacts/RELEASENOTES.md b/plugins/cordova-plugin-contacts/RELEASENOTES.md
deleted file mode 100644
index 3d7a6c9..0000000
--- a/plugins/cordova-plugin-contacts/RELEASENOTES.md
+++ /dev/null
@@ -1,208 +0,0 @@
-
-# Release Notes
-
-### 2.0.1 (Jan 15, 2016)
-* CB-10159 **Android** Adding restore callback to handle Activity destruction
-* CB-10319 **Android** Adding reflective helper methods for permission requests
-* CB-10117 Added new tests
-* CB-10131 Fixed null contact creation.
-* CB-10053 Documents `ContactFieldType` enumeration.
-* CB-10148 **Android** Added `READ_CONTACTS` permission request when picking a contact
-* CB-10053 Accept assets `URIs` for contact photos
-* CB-8115 Save contact birthday properly
-* CB-6979 Don't create duplicates for extracted contacts photos
-* CB-5308 Makes contacts save specs passing
-* CB-5308 Return `rawId` instead of id when modifying existing contact
-* CB-4921 Corrects examples by adding missing `multiple` option where multiple contacts are expected
-* CB-10094 **Android** Fixed empty string comparison
-* CB-3950 Adds support for custom labels
-* CB-9770 Request user permissions before picking a contact
-* CB-8156 Call error callback on `pickContact` cancellation
-* CB-7906 Prevent app crash when `desiredFields` option has undefined items
-* CB-7021 Adds manual test for `pickContact`
-
-### 2.0.0 (Nov 18, 2015)
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
-* [CB-9728](https://issues.apache.org/jira/browse/CB-9728) Solving memory leak issues due to opened cursor objects
-* [CB-9940](https://issues.apache.org/jira/browse/CB-9940) Adding namespace declarations for `m3` and uap to `plugin.xml`.
-* [CB-9905](https://issues.apache.org/jira/browse/CB-9905) mark tests as pending if **iOS** permission is blocked.
-* Refactored `ContactManager` after feedback
-* Commit of Contacts Plugin with new `API` for new **MarshMallow** permissions for **Android 6.0**
-* Fixing contribute link.
-* [CB-9823](https://issues.apache.org/jira/browse/CB-9823) Making sure the `photoCursor` is always closed.
-* Shortened multiple references to use `CommonDataKinds` directly
-* removed mulitple calls `toLowerCase(Locale.getDefault())` for the same string, use type Phone `enum` directly.
-* [CB-8537](https://issues.apache.org/jira/browse/CB-8537) Updated source to pass `Fortify` scan.
-* Update `ContactProxy.js`
-* Do not return absolute path for contact images.
-* [CB-9579](https://issues.apache.org/jira/browse/CB-9579) Fixed failed tests when `DeleteMe` contact already exists
-* [CB-9054](https://issues.apache.org/jira/browse/CB-9054): Can't fully reproduce, but we should probably wrap this in an exception anyway.
-
-### 1.1.0 (Jun 17, 2015)
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-contacts documentation translation: cordova-plugin-contacts
-* fix npm md issue
-* Add more install text for legacy versions of cordova tools. This closes #60
-* [CB-9056](https://issues.apache.org/jira/browse/CB-9056) Increased timeout of failing tests
-* [CB-8987](https://issues.apache.org/jira/browse/CB-8987): Support for save and remove for Windows 10
-* [CB-5278](https://issues.apache.org/jira/browse/CB-5278): We must close the cursor or we take down the whole app, and the debugger doesn't catch it.
-
-### 1.0.0 (Apr 15, 2015)
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) updated wp specific references of old id to new id
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
-* Use TRAVIS_BUILD_DIR, install paramedic by npm
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of initWebView method
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of deprecated headers
-* [CB-8604](https://issues.apache.org/jira/browse/CB-8604) Pended unsupported test for wp8, updated documentation
-* [CB-8561](https://issues.apache.org/jira/browse/CB-8561) Integrate TravisCI
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-contacts documentation translation: cordova-plugin-contacts
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
-* windows: pended .remove test as it is not supported on windows
-* [CB-8395](https://issues.apache.org/jira/browse/CB-8395) marked unsupported tests pending on wp8
-
-### 0.2.16 (Feb 04, 2015)
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using (newly) deprecated CordovaLib functions
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
-* android: Update ContactName support
-* Updated the comments for ContactOrganization constructor.
-
-### 0.2.15 (Dec 02, 2014)
-* [CB-7131](https://issues.apache.org/jira/browse/CB-7131) Check for profile photo existance
-* [CB-7896](https://issues.apache.org/jira/browse/CB-7896) Better way to detect **Windows** and **WindowsPhone8.1**
-* [CB-7896](https://issues.apache.org/jira/browse/CB-7896) Pending tests for `Save` and `Find` methods for **Windows** cause they are not supported yet
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
-* [CB-7772](https://issues.apache.org/jira/browse/CB-7772) - [Contacts] Cancelling `pickContact` should call the error callback, not the success callback
-* [CB-7761](https://issues.apache.org/jira/browse/CB-7761) - Misleading text in documentation
-* [CB-7762](https://issues.apache.org/jira/browse/CB-7762) - Parameter list is incorrect for `contacts.find`
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-contacts documentation translation: cordova-plugin-contacts
-
-### 0.2.14 (Oct 03, 2014)
-* [CB-7373](https://issues.apache.org/jira/browse/CB-7373) Removes unnecessary Error object creation
-* [CB-7373](https://issues.apache.org/jira/browse/CB-7373) Adds additional output if method is not supported.
-* [CB-7357](https://issues.apache.org/jira/browse/CB-7357) Adds missing 'capability' element to phone's appxmanifest.
-
-### 0.2.13 (Sep 17, 2014)
-* [CB-7546](https://issues.apache.org/jira/browse/CB-7546) [Contacts][iOS] pickContact shows exception in the console log
-* [CB-6374](https://issues.apache.org/jira/browse/CB-6374) Fix iOS 6 deprecation warnings in Contacts
-* [CB-7544](https://issues.apache.org/jira/browse/CB-7544) [Contacts][iOS 8] Contact picker is read-only in iOS 8
-* [CB-7523](https://issues.apache.org/jira/browse/CB-7523) Fixing "ContactFieldType" error in the config.xml
-* [CB-6724](https://issues.apache.org/jira/browse/CB-6724) Empty may be expected.
-* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-contacts documentation translation
-* Add missing test, skip some specs on wp
-* rm old test folder and merged with renamed tests folder
-* [CB-7290](https://issues.apache.org/jira/browse/CB-7290) Adds support for universal Windows platform.
-* Renamed test dir, added nested plugin.xml
-* [CB-7148](https://issues.apache.org/jira/browse/CB-7148) Added manual tests
-* Removed js-module for tests from plugin.xml
-* Changing cdvtest format to use module exports
-* register tests using new style
-* convert test to new style
-* added documentation for manual tests
-* merged changes for test framework plugin
-
-### 0.2.12 (Aug 06, 2014)
-* fixes .find method when 'options' param is not passed. Will return all contacts on missing 'options' param
-* [FFOS] update ContactsProxy.js
-* Removing a stray unicode character
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
-* [CB-5698](https://issues.apache.org/jira/browse/CB-5698) ios: Check to see if photoData exists before using
-
-### 0.2.11 (Jul 2, 2014)
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #25
-* Remove deprecated symbols for iOS < 6
-* [CB-6797](https://issues.apache.org/jira/browse/CB-6797) Add license
-* [wp8] now pupulates contact photos
-* Update license headers format
-* Add pickContact functionality to cordova contacts plugin
-* [CB-5416](https://issues.apache.org/jira/browse/CB-5416) - Adding support for auto-managing permissions
-* [CB-6682](https://issues.apache.org/jira/browse/CB-6682) move windows8 command proxy into it's missing platform tag. This closes #30
-* Add ContactError codes to index.md doc (closes #28)
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
-* Docs typo: navigator.contacts.length -> contacts.length
-* [CB-5698](https://issues.apache.org/jira/browse/CB-5698) ios: Check to see if photoData exists before using
-* [CB-7003](https://issues.apache.org/jira/browse/CB-7003) android: Make pickContact pick correct contact on Android 4.3 and 4.4.3
-
-### 0.2.10 (Apr 17, 2014)
-* [CB-6126](https://issues.apache.org/jira/browse/CB-6126): [BlackBerry10] Update docs quirks section for fields which are supported
-* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
-* Add NOTICE file
-
-### 0.2.9 (Feb 26, 2014)
-* [CB-6086](https://issues.apache.org/jira/browse/CB-6086) Fix typo in ffos part of plugin.xml: Camera -> Contacts
-* [CB-5994](https://issues.apache.org/jira/browse/CB-5994) Switch Contact ID lookup to use Raw contact id.
-
-### 0.2.8 (Feb 05, 2014)
-* [CB-3208](https://issues.apache.org/jira/browse/CB-3208) FFOS docs updated
-* [CB-4590](https://issues.apache.org/jira/browse/CB-4590) - chooseContact in CDVContacts crashes app
-
-### 0.2.7 (Jan 02, 2014)
-* B-5658 Add doc/index.md for Contacts plugin
-
-### 0.2.6 (Dec 4, 2013)
-* Fix bad commit/merge
-* [CB-3035](https://issues.apache.org/jira/browse/CB-3035) Fix issue with windows new line char \n\r
-* wrong example given
-* docs added
-* FxOS name fields are arrays hackedSearch refactored search based on find commented out
-* search hacked via getAll
-* search added - no idea if this is working
-* createMozillaFromCordova and vice versa are used to translate contact objects from one API to another.
-* add/remove working
-* save is working
-* attempt to save is failing trying to limit the translated contact fields to name and familyName, but still failing
-* save is linked with the proxy contact.name doesn't exist www/Contact.js#Contact.prototype.save check on which side is the error
-* [CB-5214](https://issues.apache.org/jira/browse/CB-5214) Make mobile spec tests on WP8 to run w/o user interaction + Sync with cordova-mobile-spec
-* [CB-5525](https://issues.apache.org/jira/browse/CB-5525) WP8. Contacts Api fails in case of there is special character in contact field
-* fixed ubuntu policy error
-* [ubuntu] specify policy_group
-* add ubuntu platform
-* [CB-3035](https://issues.apache.org/jira/browse/CB-3035) Fix issue with windows new line char \n\r
-* 1. Added amazon-fireos platform. 2. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'.
-* [CB-5198](https://issues.apache.org/jira/browse/CB-5198) [BlackBerry10] Update dependencies to point to registry
-* handle null filter when fields are specified. ( long standing pull-req from @kevfromireland )
-
-### 0.2.5 (Oct 28, 2013)
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tags for contacts
-* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
-
-### 0.2.4 (Oct 9, 2013)
-* [CB-4950](https://issues.apache.org/jira/browse/CB-4950) Remove the dependence on concrete component android.webkit.WebView.
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
-
-### 0.2.3 (Sept 25, 2013)
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
-* [BlackBerry10] removed uneeded permission tags in plugin.xml
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming blackberry10 reference in plugin.xml
-* [CB-4888](https://issues.apache.org/jira/browse/CB-4888) renaming org.apache.cordova.core.contacts to org.apache.cordova.contacts
-* added contacts api for firefoxos
-* Rename CHANGELOG.md -> RELEASENOTES.md
-* [CB-4824](https://issues.apache.org/jira/browse/CB-4824) Fix XCode 5 contacts plugin warnings
-* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
-
-### 0.2.1 (Sept 5, 2013)
-* [CB-4580](https://issues.apache.org/jira/browse/CB-4580) Fixed up duplicate definitions of module id
-* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) Copyright notice change
-
diff --git a/plugins/cordova-plugin-contacts/doc/de/README.md b/plugins/cordova-plugin-contacts/doc/de/README.md
deleted file mode 100644
index 676ca2e..0000000
--- a/plugins/cordova-plugin-contacts/doc/de/README.md
+++ /dev/null
@@ -1,735 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-Dieses Plugin definiert eine globale `navigator.contacts`-Objekt bietet Zugriff auf die Geräte-Kontakte-Datenbank.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**Warnung**: Erhebung und Nutzung von Kontaktdaten löst wichtige Datenschutzprobleme. Ihre app-Datenschutzerklärung sollten besprechen, wie die app Kontaktdaten verwendet und ob es mit irgendwelchen anderen Parteien geteilt wird. Kontaktinformationen ist als vertraulich angesehen, weil es die Menschen zeigt, mit denen eine Person kommuniziert. Daher neben der app-Privacy Policy sollten stark Sie Bereitstellung eine just-in-Time-Bekanntmachung, bevor die app zugreift oder Kontaktdaten verwendet, wenn Betriebssystem des Geräts nicht dies bereits tun. Diese Benachrichtigung sollte der gleichen Informationen, die vorstehend, sowie die Zustimmung des Benutzers (z.B. durch Präsentation Entscheidungen für das **OK** und **Nein danke**). Beachten Sie, dass einige app-Marktplätze die app eine Frist eine just-in-Time und erhalten die Erlaubnis des Benutzers vor dem Zugriff auf Kontaktdaten verlangen können. Eine klare und leicht verständliche Benutzererfahrung rund um die Verwendung der Kontakt-Daten Benutzer Verwirrung zu vermeiden können und wahrgenommene Missbrauch der Kontaktdaten. Weitere Informationen finden Sie in der Datenschutz-Guide.
-
-## Installation
-
-Dies erfordert Cordova 5.0 + (aktuelle stabile v1)
-
- cordova plugin add cordova-plugin-contacts
-
-
-Ältere Versionen von Cordova können noch über die Id **veraltet** (veraltet v0.2.16) installieren.
-
- cordova plugin add org.apache.cordova.contacts
-
-
-Es ist auch möglich, über Repo Url direkt zu installieren (unstable)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS Macken
-
-Erstellen Sie **www/manifest.webapp**, wie in [Docs Manifest](https://developer.mozilla.org/en-US/Apps/Developing/Manifest) beschrieben. Fügen Sie die entsprechenden Permisions. Es muss auch die Webapp um "privileged" - [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type) ändern. **Warnung**: alle privilegierten apps [Content Security Policy](https://developer.mozilla.org/en-US/Apps/CSP), welche Inlineskript verbietet zu erzwingen. Initialisieren Sie die Anwendung auf andere Weise.
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows-Eigenheiten
-
-**Vor Windows 10:** Alle Kontakte von `finden` und `PickContact` -Methoden zurückgegebenen sind Readonly, so dass sie von die Anwendung nicht geändert werden kann. `find`-Methode nur auf Windows Phone 8.1-Geräten verfügbar.
-
-**Windows 10 und höher:** Kontakte können gespeichert werden und in den app-lokale Kontakte-Speicher gespeichert werden. Kontakte können auch gelöscht werden.
-
-### Windows 8 Macken
-
-Windows 8 Kontakte sind Readonly. Über die Cordova-API-Kontakte nicht abgefragt werden/können durchsucht werden, Sie sollten den Benutzer informieren, wählen Sie einen Kontakt als Aufruf an contacts.pickContact, die 'People'-app öffnet, wo muss der Benutzer einen Kontakt auswählen. Alle zurückgegebenen Kontakte sind Readonly, so dass sie von die Anwendung nicht geändert werden kann.
-
-## Navigator.Contacts
-
-### Methoden
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### Objekte
-
- * Kontakt
- * ContactName
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-Die `navigator.contacts.create`-Methode ist synchron und gibt ein neues `Contact` objekt.
-
-Diese Methode behält nicht das Kontakt-Objekt in der Gerät-Kontakte-Datenbank, für die Sie benötigen, um die `Contact.save`-Methode aufzurufen.
-
-### Unterstützte Plattformen
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
-
-### Beispiel
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Die `navigator.contacts.find`-Methode führt asynchron, Abfragen der Gerät-Kontakte-Datenbank und gibt ein Array von `Contact`-Objekte. Die resultierenden Objekte werden an die durch den **contactSuccess**-Parameter angegebenen `contactSuccess`-Callback-Funktion übergeben.
-
-Der **contactFields**-Parameter gibt die Felder als Qualifizierer Suche verwendet werden. Ein leere **contactFields**-Parameter ist ungültig und führt zu `ContactError.INVALID_ARGUMENT_ERROR`. **contactFields** Wert `"*"` sucht alle Kontaktfelder.
-
-Die **contactFindOptions.filter**-Zeichenfolge kann als einen Suchfilter verwendet, wenn die Kontaktdatenbank Abfragen. Wenn angeboten, ein groß-und Kleinschreibung, wird jedes Feld in der **contactFields**-Parameter angegebenen Teilwert Übereinstimmung. Wenn eine Übereinstimmung für *alle* angegebenen Felder vorliegt, wird der Kontakt zurückgegeben. Verwendung **contactFindOptions.desiredFields** Parameter steuern, welche Eigenschaften kontaktieren muss wieder zurückgegeben werden.
-
-### Parameter
-
- * **contactFields**: Kontaktfelder als Qualifizierer Suche verwenden. *(DOMString[])* [Required]
-
- * **contactSuccess**: Erfolg-Callback-Funktion aufgerufen, die mit dem Array von Contact-Objekte aus der Datenbank zurückgegeben. [Required]
-
- * **ContactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt. [Optional]
-
- * **contactFindOptions**: Optionen zum Filtern von navigator.contacts zu suchen. [Optional]
-
- Schlüssel enthalten:
-
- * **filter**: die zu suchende Zeichenfolge verwendet, um navigator.contacts zu finden. *(DOM-String und enthält)* (Standard: `""`)
-
- * **multiple**: bestimmt, ob der Suchvorgang mehrere navigator.contacts gibt. *(Boolesch)* (Standard: `false`)
-
- * **desiredFields**: Kontaktfelder wieder zurückgegeben werden. Wenn angegeben, Objekt der daraus resultierenden `Contact` nur Funktionen Werte für diese Felder. *(DOMString[])* [Optional]
-
-### Unterstützte Plattformen
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows (Windows Phone 8.1 und Windows 10)
-
-### Beispiel
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows-Eigenheiten
-
- * `__contactFields__`wird nicht unterstützt und wird ignoriert. `find`Methode wird immer versucht, die Namen, e-Mail-Adresse oder Telefonnummer eines Kontakts übereinstimmen.
-
-## navigator.contacts.pickContact
-
-Die `navigator.contacts.pickContact`-Methode startet im Kontakt Farbwähler wählen Sie einen einzigen Ansprechpartner. Das resultierende Objekt wird an die durch den **contactSuccess**-Parameter angegebenen `contactSuccess`-Callback-Funktion übergeben.
-
-### Parameter
-
- * **ContactSuccess**: Erfolg-Callback-Funktion, die mit den einzelnen Kontakt-Objekt aufgerufen. [Erforderlich]
-
- * **ContactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt. [Optional]
-
-### Unterstützte Plattformen
-
- * Android
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### Beispiel
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Kontakt
-
-Das `Contact`-Objekt repräsentiert einen Benutzer Kontakt. Kontakte können erstellt, gespeichert oder aus der Gerät-Kontakte-Datenbank entfernt werden. Kontakte können auch (einzeln oder als Gruppe) aus der Datenbank abgerufen werden durch Aufrufen der `navigator.contacts.find`-Methode.
-
-**Hinweis**: nicht alle oben aufgeführten Kontaktfelder werden auf jedes Geräteplattform unterstützt. Bitte überprüfen Sie jede Plattform *Quirks* Abschnitt für Details.
-
-### Eigenschaften
-
- * **ID**: einen globally unique Identifier. *(DOM-String und enthält)*
-
- * **DisplayName**: der Name dieses Kontakts, geeignet für die Anzeige für Endbenutzer. *(DOM-String und enthält)*
-
- * **Name**: ein Objekt, das alle Komponenten eines Personen-Namen enthält. *(Kontaktperson)*
-
- * **Nickname**: einen lässig ein, um den Kontakt zu adressieren. *(DOM-String und enthält)*
-
- * **Telefonnummern**: ein Array von der Kontakt-Telefonnummern. *(ContactField[])*
-
- * **Email**: ein Array von e-Mail-Adressen des Kontakts. *(ContactField[])*
-
- * **Adressen**: ein Array von allen Kontaktadressen. *(ContactAddress[])*
-
- * **IMS**: ein Array von IM-Adressen des Kontakts. *(ContactField[])*
-
- * **Organisationen**: ein Array von Organisationen des Kontakts. *(ContactOrganization[])*
-
- * **Geburtstag**: der Geburtstag des Kontakts. *(Datum)*
-
- * **Anmerkung**: eine Anmerkung über den Kontakt. *(DOM-String und enthält)*
-
- * **Fotos**: ein Array mit den Kontakt-Fotos. *(ContactField[])*
-
- * **Kategorien**: ein Array mit allen benutzerdefinierten Kategorien zugeordnet den Kontakt. *(ContactField[])*
-
- * **URLs**: ein Array von Web-Seiten, die den Kontakt zugeordnet. *(ContactField[])*
-
-### Methoden
-
- * **clone**: gibt eine neue `Contact` Objekt, das eine tiefe Kopie des aufrufenden Objekts, mit der `id` -Eigenschaft festgelegt`null`.
-
- * **remove**: entfernt den Kontakt aus der Gerät-Kontakte-Datenbank, ansonsten führt eine Fehler-Callback mit einem `ContactError` Objekt.
-
- * **save**: speichert einen neuen Kontakt in der Gerätedatenbank Kontakte, oder einen vorhandenen Kontakt aktualisiert, wenn ein Kontakt mit der gleichen **Id** bereits vorhanden ist.
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Speichern Sie Beispiel
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Clone-Beispiel
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Beispiel zu entfernen
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X Macken
-
- * **Kategorien**: Android 2.X Geräten, Rückgabe nicht unterstützt`null`.
-
-### BlackBerry 10 Macken
-
- * **ID**: vom Gerät zugewiesen werden, wenn den Kontakt zu speichern.
-
-### FirefoxOS Macken
-
- * **Kategorien**: teilweise unterstützt. Felder **Pref** und **Typ** kehren zurück`null`
-
- * **IMS**: nicht unterstützt
-
- * **Fotos**: nicht unterstützt
-
-### iOS Macken
-
- * **DisplayName**: nicht auf iOS, Rückkehr unterstützt `null` es sei kein `ContactName` angegeben, in welchem Fall es gibt den zusammengesetzten Namen, **Spitznamen** oder `""` bzw..
-
- * **Geburtstag**: muss eingegeben werden, als JavaScript `Date` Objekt, die gleiche Weise zurückgegeben wird.
-
- * **Fotos**: gibt einen Datei-URL auf das Bild, das im temporären Verzeichnis der Anwendung gespeichert ist. Inhalt des temporären Verzeichnisses werden entfernt, wenn die Anwendung beendet wird.
-
- * **Kategorien**: Diese Eigenschaft wird derzeit nicht unterstützt, Rückgabe`null`.
-
-### Windows Phone 7 und 8 Eigenarten
-
- * **DisplayName**: Wenn Sie einen Kontakt erstellen, der Nutzen für den Anzeigenamen der Display-Name-Parameter unterscheidet abgerufen, wenn den Kontakt zu finden.
-
- * **URLs**: Wenn Sie einen Kontakt erstellen, können Benutzer eingegeben und mehrere Web-Adressen zu speichern, aber nur einer ist verfügbar, wenn Sie den Kontakt zu suchen.
-
- * **Telefonnummern**: die *Pref* -Option wird nicht unterstützt. Der *Typ* wird in eine *find* -Operation nicht unterstützt. Nur ein `phoneNumber` ist erlaubt für jeden *Typ*.
-
- * **Email**: *Pref* -Option wird nicht unterstützt. Haus und persönliche verweist auf dasselbe e-Mail-Eintrag. Nur ein Eintrag ist für jeden *Typ* zulässig..
-
- * **Adressen**: unterstützt nur Arbeit und Home/persönliche *Art*. Den gleichen Adresseintrag auf den privaten und persönlichen *Typ* verweisen. Nur ein Eintrag ist für jeden *Typ* zulässig..
-
- * **Organisationen**: nur zulässig ist, und unterstützt nicht die Attribute *Pref*, *Typ*und *Abteilung* .
-
- * **Hinweis**: nicht unterstützt, Rückgabe`null`.
-
- * **IMS**: nicht unterstützt, Rückgabe`null`.
-
- * **Geburtstage**: nicht unterstützt, Rückgabe`null`.
-
- * **Kategorien**: nicht unterstützt, Rückgabe`null`.
-
- * **remove**: Methode wird nicht unterstützt
-
-### Windows-Eigenheiten
-
- * **Fotos**: gibt einen Datei-URL auf das Bild, das im temporären Verzeichnis der Anwendung gespeichert ist.
-
- * **Geburtstage**: nicht unterstützt, Rückgabe`null`.
-
- * **Kategorien**: nicht unterstützt, Rückgabe`null`.
-
- * **remove**: Methode ist nur in Windows 10 oder höher unterstützt.
-
-## ContactAddress
-
-Das `ContactAddress`-Objekt speichert die Eigenschaften einer einzelnen Adresse eines Kontakts. Ein `Contact` objekt kann mehr als eine Adresse in einem `ContactAddress []`-Array enthalten.
-
-### Eigenschaften
-
- * **Pref**: Legen Sie auf `true` Wenn dieses `ContactAddress` des Benutzers bevorzugten Wert enthält. *(boolesch)*
-
- * **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
-
- * **formatiert**: die vollständige Adresse, die für die Anzeige formatiert. *(DOM-String und enthält)*
-
- * **StreetAddress**: die vollständige Postanschrift. *(DOM-String und enthält)*
-
- * **Ort**: die Stadt oder Gemeinde. *(DOM-String und enthält)*
-
- * **Region**: dem Staat oder der Region. *(DOM-String und enthält)*
-
- * **Postleitzahl**: die Postleitzahl oder Postleitzahl. *(DOM-String und enthält)*
-
- * **Land**: den Ländernamen. *(DOM-String und enthält)*
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Beispiel
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X Macken
-
- * **Pref**: nicht unterstützt, Rückkehr `false` auf Android 2.X Geräten.
-
-### BlackBerry 10 Macken
-
- * **Pref**: BlackBerry-Geräten, Rückgabe nicht unterstützt`false`.
-
- * **Typ**: teilweise unterstützt. Nur eine *Arbeit* und *Home* Typ Adressen kann pro Kontakt gespeichert werden.
-
- * **formatiert**: teilweise unterstützt. Gibt eine Verkettung von allen BlackBerry-Adressfelder.
-
- * **StreetAddress**: unterstützt. Gibt eine Verkettung von BlackBerry **Adresse1** und **Adresse2** Adressfelder.
-
- * **Ort**: unterstützt. Gespeichert in BlackBerry **Stadt** Adressfeld.
-
- * **Region**: unterstützt. Gespeichert in BlackBerry **StateProvince** Adressfeld.
-
- * **Postleitzahl**: unterstützt. Im Feld für die Adresse des BlackBerry- **ZipPostal** gespeichert.
-
- * **Land**: unterstützt.
-
-### FirefoxOS Macken
-
- * **formatiert**: derzeit nicht unterstützt
-
-### iOS Macken
-
- * **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
-
- * **formatiert**: derzeit nicht unterstützt.
-
-### Windows 8 Macken
-
- * **Pref**: nicht unterstützt
-
-### Windows-Eigenheiten
-
- * **Pref**: nicht unterstützt
-
-## ContactError
-
-Das `ContactError`-Objekt wird dem Benutzer über die `contactError`-Callback-Funktion zurückgegeben, wenn ein Fehler auftritt.
-
-### Eigenschaften
-
- * **Code**: einer der vordefinierten Fehlercodes aufgeführt.
-
-### Konstanten
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Das `ContactField`-Objekt ist eine wieder verwendbare Komponenten stellt Felder generisch kontaktieren. Jedes `ContactField`-Objekt enthält eine Eigenschaft `value`, `type` und `pref`. Ein `Contact`-Objekt speichert mehrere Eigenschaften in `ContactField []`-Arrays, wie Telefonnummern und e-Mail-Adressen.
-
-In den meisten Fällen gibt es keine vorher festgelegten Werte für ein `ContactField`-Objekt-**Type**-Attribut. Beispielsweise kann eine Telefonnummer angeben **type** werte von *home*, *work*, *mobile*, *iPhone* oder ein beliebiger anderer Wert, der von einem bestimmten Geräteplattform Kontaktdatenbank unterstützt wird. Jedoch für die `Contact`-**photos**-Feld, das **type**-Feld gibt das Format des zurückgegebenen Bild: **url** Wenn das **value**-Attribut eine URL zu dem Foto Bild oder *base64*, enthält Wenn der **Wert** eine base64-codierte Bild-Zeichenfolge enthält.
-
-### Eigenschaften
-
- * **type**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
-
- * **value**: der Wert des Feldes, wie z. B. eine Telefonnummer oder e-Mail-Adresse. *(DOM-String und enthält)*
-
- * **pref**: Legen Sie auf `true` Wenn dieses `ContactField` des Benutzers bevorzugten Wert enthält. *(boolesch)*
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Beispiel
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Android Eigenarten
-
- * **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### BlackBerry 10 Macken
-
- * **Typ**: teilweise unterstützt. Für Telefonnummern verwendet.
-
- * **Wert**: unterstützt.
-
- * **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### iOS Macken
-
- * **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### Windows8 Macken
-
- * **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### Windows-Eigenheiten
-
- * **Pref**: nicht unterstützt, Rückgabe`false`.
-
-## ContactName
-
-Enthält verschiedene Arten von Informationen über `ein Kontaktobjekt` Namen.
-
-### Eigenschaften
-
- * **formatiert**: den vollständigen Namen des Kontakts. *(DOM-String und enthält)*
-
- * **Nachname**: Familienname des Kontakts. *(DOM-String und enthält)*
-
- * **GivenName**: Given Name des Kontaktes. *(DOM-String und enthält)*
-
- * **MiddleName**: Middle Name des Kontaktes. *(DOM-String und enthält)*
-
- * **HonorificPrefix**: der Kontakt-Präfix (z.B. *Mr.* oder *Dr.*) *(DOM-String und enthält)*
-
- * **HonorificSuffix**: der Kontakt-Suffix (Beispiel *Esq.*). *(DOM-String und enthält)*
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Beispiel
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android Eigenarten
-
- * **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
-
-### BlackBerry 10 Macken
-
- * **formatiert**: teilweise unterstützt. Gibt eine Verkettung von BlackBerry- **FirstName** und **LastName** -Feldern.
-
- * **Nachname**: unterstützt. Im Feld der BlackBerry- **Nachname** gespeichert.
-
- * **GivenName**: unterstützt. Im BlackBerry **FirstName** -Feld gespeichert.
-
- * **MiddleName**: nicht unterstützt, Rückgabe`null`.
-
- * **HonorificPrefix**: nicht unterstützte, Rückgabe`null`.
-
- * **HonorificSuffix**: nicht unterstützte, Rückgabe`null`.
-
-### FirefoxOS Macken
-
- * **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
-
-### iOS Macken
-
- * **formatiert**: teilweise unterstützt. IOS zusammengesetzten Namen gibt, aber ist schreibgeschützt.
-
-### Windows 8 Macken
-
- * **formatiert**: Dies ist die einzige Eigenschaft, und ist identisch mit `displayName` , und`nickname`
-
- * **Nachname**: nicht unterstützt
-
- * **GivenName**: nicht unterstützt
-
- * **MiddleName**: nicht unterstützt
-
- * **HonorificPrefix**: nicht unterstützt
-
- * **HonorificSuffix**: nicht unterstützt
-
-### Windows-Eigenheiten
-
- * **formatiert**: Er ist identisch mit`displayName`
-
-## ContactOrganization
-
-Das `ContactOrganization`-Objekt speichert Organisationseigenschaften eines Kontakts. Ein `Contact` objekt werden ein oder mehrere `ContactOrganization`-Objekte in einem Array gespeichert.
-
-### Eigenschaften
-
- * **Pref**: Legen Sie auf `true` Wenn dieses `ContactOrganization` des Benutzers bevorzugten Wert enthält. *(boolesch)*
-
- * **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. _(DOMString)
-
- * **Name**: der Name der Organisation. *(DOM-String und enthält)*
-
- * **Abteilung**: die Abteilung, die der Vertrag für arbeitet. *(DOM-String und enthält)*
-
- * **Titel**: Titel des Kontakts in der Organisation. *(DOM-String und enthält)*
-
-### Unterstützte Plattformen
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows (nur Windows-8.1 und Windows Phone 8.1-Geräte)
-
-### Beispiel
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X Macken
-
- * **Pref**: von Android 2.X-Geräte, Rückgabe nicht unterstützt`false`.
-
-### BlackBerry 10 Macken
-
- * **Pref**: von BlackBerry-Geräten zurückgeben nicht unterstützt`false`.
-
- * **Typ**: von BlackBerry-Geräten zurückgeben nicht unterstützt`null`.
-
- * **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **Firma** BlackBerry gespeichert.
-
- * **Abteilung**: nicht unterstützt, Rückgabe`null`.
-
- * **Titel**: teilweise unterstützt. Der erste Titel der Organisation wird im Feld **JobTitle** BlackBerry gespeichert.
-
-### Firefox OS Macken
-
- * **Pref**: nicht unterstützt
-
- * **Typ**: nicht unterstützt
-
- * **Abteilung**: nicht unterstützt
-
- * Felder **Name** und **Titel** in **Org** und **JobTitle** gespeichert.
-
-### iOS Macken
-
- * **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
-
- * **Typ**: iOS-Geräten, Rückgabe nicht unterstützt`null`.
-
- * **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **kABPersonOrganizationProperty** iOS gespeichert.
-
- * **Abteilung**: teilweise unterstützt. Die Abteilungsnamen der erste ist im Feld **kABPersonDepartmentProperty** iOS gespeichert.
-
- * **Titel**: teilweise unterstützt. Der erste Titel wird im Feld **kABPersonJobTitleProperty** iOS gespeichert.
-
-### Windows-Eigenheiten
-
- * **Pref**: nicht unterstützt, Rückgabe`false`.
-
- * **Typ**: nicht unterstützt, Rückgabe`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/de/index.md b/plugins/cordova-plugin-contacts/doc/de/index.md
deleted file mode 100644
index 4252e8f..0000000
--- a/plugins/cordova-plugin-contacts/doc/de/index.md
+++ /dev/null
@@ -1,719 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-Dieses Plugin definiert eine globale `navigator.contacts`-Objekt bietet Zugriff auf die Geräte-Kontakte-Datenbank.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**Warnung**: Erhebung und Nutzung von Kontaktdaten löst wichtige Datenschutzprobleme. Ihre app-Datenschutzerklärung sollten besprechen, wie die app Kontaktdaten verwendet und ob es mit irgendwelchen anderen Parteien geteilt wird. Kontaktinformationen ist als vertraulich angesehen, weil es die Menschen zeigt, mit denen eine Person kommuniziert. Daher neben der app-Privacy Policy sollten stark Sie Bereitstellung eine just-in-Time-Bekanntmachung, bevor die app zugreift oder Kontaktdaten verwendet, wenn Betriebssystem des Geräts nicht dies bereits tun. Diese Benachrichtigung sollte der gleichen Informationen, die vorstehend, sowie die Zustimmung des Benutzers (z.B. durch Präsentation Entscheidungen für das **OK** und **Nein danke**). Beachten Sie, dass einige app-Marktplätze die app eine Frist eine just-in-Time und erhalten die Erlaubnis des Benutzers vor dem Zugriff auf Kontaktdaten verlangen können. Eine klare und leicht verständliche Benutzererfahrung rund um die Verwendung der Kontakt-Daten Benutzer Verwirrung zu vermeiden können und wahrgenommene Missbrauch der Kontaktdaten. Weitere Informationen finden Sie in der Datenschutz-Guide.
-
-## Installation
-
- cordova plugin add cordova-plugin-contacts
-
-
-### Firefox OS Macken
-
-Erstellen Sie **www/manifest.webapp**, wie in [Docs Manifest][1] beschrieben. Fügen Sie die entsprechenden Permisions. Es muss auch die Webapp um "privileged" - [Manifest Docs][2] ändern. **Warnung**: alle privilegierten apps [Content Security Policy][3], welche Inlineskript verbietet zu erzwingen. Initialisieren Sie die Anwendung auf andere Weise.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows-Eigenheiten
-
-Keine Kontakte von `find` und `pickContact`-Methoden zurückgegebenen sind schreibgeschützt, so die Anwendung geändert werden kann. `find`-Methode nur auf Windows Phone 8.1-Geräten verfügbar.
-
-### Windows 8 Macken
-
-Windows 8 Kontakte sind Readonly. Über die Cordova-API-Kontakte nicht abgefragt werden/können durchsucht werden, Sie sollten den Benutzer informieren, wählen Sie einen Kontakt als Aufruf an contacts.pickContact, die 'People'-app öffnet, wo muss der Benutzer einen Kontakt auswählen. Alle zurückgegebenen Kontakte sind Readonly, so dass sie von die Anwendung nicht geändert werden kann.
-
-## Navigator.Contacts
-
-### Methoden
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### Objekte
-
-* Kontakt
-* ContactName
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## Navigator.Contacts.Create
-
-Die `navigator.contacts.create`-Methode ist synchron und gibt ein neues `Contact` objekt.
-
-Diese Methode behält nicht das Kontakt-Objekt in der Gerät-Kontakte-Datenbank, für die Sie benötigen, um die `Contact.save`-Methode aufzurufen.
-
-### Unterstützte Plattformen
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-
-### Beispiel
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Die `navigator.contacts.find`-Methode führt asynchron, Abfragen der Gerät-Kontakte-Datenbank und gibt ein Array von `Contact`-Objekte. Die resultierenden Objekte werden an die durch den **contactSuccess**-Parameter angegebenen `contactSuccess`-Callback-Funktion übergeben.
-
-Der **contactFields**-Parameter gibt die Felder als Qualifizierer Suche verwendet werden. Ein leere **contactFields**-Parameter ist ungültig und führt zu `ContactError.INVALID_ARGUMENT_ERROR`. **contactFields** Wert `"*"` sucht alle Kontaktfelder.
-
-Die **contactFindOptions.filter**-Zeichenfolge kann als einen Suchfilter verwendet, wenn die Kontaktdatenbank Abfragen. Wenn angeboten, ein groß-und Kleinschreibung, wird jedes Feld in der **contactFields**-Parameter angegebenen Teilwert Übereinstimmung. Wenn eine Übereinstimmung für *alle* angegebenen Felder vorliegt, wird der Kontakt zurückgegeben. Verwendung **contactFindOptions.desiredFields** Parameter steuern, welche Eigenschaften kontaktieren muss wieder zurückgegeben werden.
-
-### Parameter
-
-* **contactFields**: Kontaktfelder als Qualifizierer Suche verwenden. *(DOMString[])* [Required]
-
-* **contactSuccess**: Erfolg-Callback-Funktion aufgerufen, die mit dem Array von Contact-Objekte aus der Datenbank zurückgegeben. [Required]
-
-* **contactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt.[Optional]
-
-* **contactFindOptions**: Optionen zum Filtern von navigator.contacts zu suchen. [Optional]
-
- Schlüssel enthalten:
-
- * **filter**: die zu suchende Zeichenfolge verwendet, um navigator.contacts zu finden. *(DOM-String und enthält)* (Standard: `""`)
-
- * **multiple**: bestimmt, ob der Suchvorgang mehrere navigator.contacts gibt. *(Boolesch)* (Standard: `false`)
-
- * **desiredFields**: Kontaktfelder wieder zurückgegeben werden. Wenn angegeben, Objekt der daraus resultierenden `Contact` nur Funktionen Werte für diese Felder. *(DOMString[])* [Optional]
-
-### Unterstützte Plattformen
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows (nur Windows Phone 8.1-Geräte)
-
-### Beispiel
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows-Eigenheiten
-
-* `__contactFields__`wird nicht unterstützt und wird ignoriert. `find`Methode wird immer versucht, die Namen, e-Mail-Adresse oder Telefonnummer eines Kontakts übereinstimmen.
-
-## navigator.contacts.pickContact
-
-Die `navigator.contacts.pickContact`-Methode startet im Kontakt Farbwähler wählen Sie einen einzigen Ansprechpartner. Das resultierende Objekt wird an die durch den **contactSuccess**-Parameter angegebenen `contactSuccess`-Callback-Funktion übergeben.
-
-### Parameter
-
-* **ContactSuccess**: Erfolg-Callback-Funktion, die mit den einzelnen Kontakt-Objekt aufgerufen. [Erforderlich]
-
-* **ContactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt. [Optional]
-
-### Unterstützte Plattformen
-
-* Android
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### Beispiel
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Kontakt
-
-Das `Contact`-Objekt repräsentiert einen Benutzer Kontakt. Kontakte können erstellt, gespeichert oder aus der Gerät-Kontakte-Datenbank entfernt werden. Kontakte können auch (einzeln oder als Gruppe) aus der Datenbank abgerufen werden durch Aufrufen der `navigator.contacts.find`-Methode.
-
-**Hinweis**: nicht alle oben aufgeführten Kontaktfelder werden auf jedes Geräteplattform unterstützt. Bitte überprüfen Sie jede Plattform *Quirks* Abschnitt für Details.
-
-### Eigenschaften
-
-* **ID**: einen globally unique Identifier. *(DOM-String und enthält)*
-
-* **DisplayName**: der Name dieses Kontakts, geeignet für die Anzeige für Endbenutzer. *(DOM-String und enthält)*
-
-* **Name**: ein Objekt, das alle Komponenten eines Personen-Namen enthält. *(Kontaktperson)*
-
-* **Nickname**: einen lässig ein, um den Kontakt zu adressieren. *(DOM-String und enthält)*
-
-* **Telefonnummern**: ein Array von der Kontakt-Telefonnummern. *(ContactField[])*
-
-* **Email**: ein Array von e-Mail-Adressen des Kontakts. *(ContactField[])*
-
-* **Adressen**: ein Array von allen Kontaktadressen. *(ContactAddress[])*
-
-* **IMS**: ein Array von IM-Adressen des Kontakts. *(ContactField[])*
-
-* **Organisationen**: ein Array von Organisationen des Kontakts. *(ContactOrganization[])*
-
-* **Geburtstag**: der Geburtstag des Kontakts. *(Datum)*
-
-* **Anmerkung**: eine Anmerkung über den Kontakt. *(DOM-String und enthält)*
-
-* **Fotos**: ein Array mit den Kontakt-Fotos. *(ContactField[])*
-
-* **Kategorien**: ein Array mit allen benutzerdefinierten Kategorien zugeordnet den Kontakt. *(ContactField[])*
-
-* **URLs**: ein Array von Web-Seiten, die den Kontakt zugeordnet. *(ContactField[])*
-
-### Methoden
-
-* **clone**: gibt eine neue `Contact` Objekt, das eine tiefe Kopie des aufrufenden Objekts, mit der `id` -Eigenschaft festgelegt`null`.
-
-* **remove**: entfernt den Kontakt aus der Gerät-Kontakte-Datenbank, ansonsten führt eine Fehler-Callback mit einem `ContactError` Objekt.
-
-* **save**: speichert einen neuen Kontakt in der Gerätedatenbank Kontakte, oder einen vorhandenen Kontakt aktualisiert, wenn ein Kontakt mit der gleichen **Id** bereits vorhanden ist.
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Speichern Sie Beispiel
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Clone-Beispiel
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Beispiel zu entfernen
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X Macken
-
-* **Kategorien**: Android 2.X Geräten, Rückgabe nicht unterstützt`null`.
-
-### BlackBerry 10 Macken
-
-* **ID**: vom Gerät zugewiesen werden, wenn den Kontakt zu speichern.
-
-### FirefoxOS Macken
-
-* **Kategorien**: teilweise unterstützt. Felder **Pref** und **Typ** kehren zurück`null`
-
-* **IMS**: nicht unterstützt
-
-* **Fotos**: nicht unterstützt
-
-### iOS Macken
-
-* **DisplayName**: nicht auf iOS, Rückkehr unterstützt `null` es sei kein `ContactName` angegeben, in welchem Fall es gibt den zusammengesetzten Namen, **Spitznamen** oder `""` bzw..
-
-* **Geburtstag**: muss eingegeben werden, als JavaScript `Date` Objekt, die gleiche Weise zurückgegeben wird.
-
-* **Fotos**: gibt einen Datei-URL auf das Bild, das im temporären Verzeichnis der Anwendung gespeichert ist. Inhalt des temporären Verzeichnisses werden entfernt, wenn die Anwendung beendet wird.
-
-* **Kategorien**: Diese Eigenschaft wird derzeit nicht unterstützt, Rückgabe`null`.
-
-### Windows Phone 7 und 8 Eigenarten
-
-* **DisplayName**: Wenn Sie einen Kontakt erstellen, der Nutzen für den Anzeigenamen der Display-Name-Parameter unterscheidet abgerufen, wenn den Kontakt zu finden.
-
-* **URLs**: Wenn Sie einen Kontakt erstellen, können Benutzer eingegeben und mehrere Web-Adressen zu speichern, aber nur einer ist verfügbar, wenn Sie den Kontakt zu suchen.
-
-* **Telefonnummern**: die *Pref* -Option wird nicht unterstützt. Der *Typ* wird in eine *find* -Operation nicht unterstützt. Nur ein `phoneNumber` ist erlaubt für jeden *Typ*.
-
-* **Email**: *Pref* -Option wird nicht unterstützt. Haus und persönliche verweist auf dasselbe e-Mail-Eintrag. Nur ein Eintrag ist für jeden *Typ* zulässig..
-
-* **Adressen**: unterstützt nur Arbeit und Home/persönliche *Art*. Den gleichen Adresseintrag auf den privaten und persönlichen *Typ* verweisen. Nur ein Eintrag ist für jeden *Typ* zulässig..
-
-* **Organisationen**: nur zulässig ist, und unterstützt nicht die Attribute *Pref*, *Typ*und *Abteilung* .
-
-* **Hinweis**: nicht unterstützt, Rückgabe`null`.
-
-* **IMS**: nicht unterstützt, Rückgabe`null`.
-
-* **Geburtstage**: nicht unterstützt, Rückgabe`null`.
-
-* **Kategorien**: nicht unterstützt, Rückgabe`null`.
-
-### Windows-Eigenheiten
-
-* **Fotos**: gibt einen Datei-URL auf das Bild, das im temporären Verzeichnis der Anwendung gespeichert ist.
-
-* **Geburtstage**: nicht unterstützt, Rückgabe`null`.
-
-* **Kategorien**: nicht unterstützt, Rückgabe`null`.
-
-## ContactAddress
-
-Das `ContactAddress`-Objekt speichert die Eigenschaften einer einzelnen Adresse eines Kontakts. Ein `Contact` objekt kann mehr als eine Adresse in einem `ContactAddress []`-Array enthalten.
-
-### Eigenschaften
-
-* **Pref**: Legen Sie auf `true` Wenn dieses `ContactAddress` des Benutzers bevorzugten Wert enthält. *(boolesch)*
-
-* **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
-
-* **formatiert**: die vollständige Adresse, die für die Anzeige formatiert. *(DOM-String und enthält)*
-
-* **StreetAddress**: die vollständige Postanschrift. *(DOM-String und enthält)*
-
-* **Ort**: die Stadt oder Gemeinde. *(DOM-String und enthält)*
-
-* **Region**: dem Staat oder der Region. *(DOM-String und enthält)*
-
-* **Postleitzahl**: die Postleitzahl oder Postleitzahl. *(DOM-String und enthält)*
-
-* **Land**: den Ländernamen. *(DOM-String und enthält)*
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Beispiel
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X Macken
-
-* **Pref**: nicht unterstützt, Rückkehr `false` auf Android 2.X Geräten.
-
-### BlackBerry 10 Macken
-
-* **Pref**: BlackBerry-Geräten, Rückgabe nicht unterstützt`false`.
-
-* **Typ**: teilweise unterstützt. Nur eine *Arbeit* und *Home* Typ Adressen kann pro Kontakt gespeichert werden.
-
-* **formatiert**: teilweise unterstützt. Gibt eine Verkettung von allen BlackBerry-Adressfelder.
-
-* **StreetAddress**: unterstützt. Gibt eine Verkettung von BlackBerry **Adresse1** und **Adresse2** Adressfelder.
-
-* **Ort**: unterstützt. Gespeichert in BlackBerry **Stadt** Adressfeld.
-
-* **Region**: unterstützt. Gespeichert in BlackBerry **StateProvince** Adressfeld.
-
-* **Postleitzahl**: unterstützt. Im Feld für die Adresse des BlackBerry- **ZipPostal** gespeichert.
-
-* **Land**: unterstützt.
-
-### FirefoxOS Macken
-
-* **formatiert**: derzeit nicht unterstützt
-
-### iOS Macken
-
-* **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
-
-* **formatiert**: derzeit nicht unterstützt.
-
-### Windows 8 Macken
-
-* **Pref**: nicht unterstützt
-
-### Windows-Eigenheiten
-
-* **Pref**: nicht unterstützt
-
-## ContactError
-
-Das `ContactError`-Objekt wird dem Benutzer über die `contactError`-Callback-Funktion zurückgegeben, wenn ein Fehler auftritt.
-
-### Eigenschaften
-
-* **Code**: einer der vordefinierten Fehlercodes aufgeführt.
-
-### Konstanten
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Das `ContactField`-Objekt ist eine wieder verwendbare Komponenten stellt Felder generisch kontaktieren. Jedes `ContactField`-Objekt enthält eine Eigenschaft `value`, `type` und `pref`. Ein `Contact`-Objekt speichert mehrere Eigenschaften in `ContactField []`-Arrays, wie Telefonnummern und e-Mail-Adressen.
-
-In den meisten Fällen gibt es keine vorher festgelegten Werte für ein `ContactField`-Objekt-**Type**-Attribut. Beispielsweise kann eine Telefonnummer angeben **type** werte von *home*, *work*, *mobile*, *iPhone* oder ein beliebiger anderer Wert, der von einem bestimmten Geräteplattform Kontaktdatenbank unterstützt wird. Jedoch für die `Contact`-**photos**-Feld, das **type**-Feld gibt das Format des zurückgegebenen Bild: **url** Wenn das **value**-Attribut eine URL zu dem Foto Bild oder *base64*, enthält Wenn der **Wert** eine base64-codierte Bild-Zeichenfolge enthält.
-
-### Eigenschaften
-
-* **type**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
-
-* **value**: der Wert des Feldes, wie z. B. eine Telefonnummer oder e-Mail-Adresse. *(DOM-String und enthält)*
-
-* **pref**: Legen Sie auf `true` Wenn dieses `ContactField` des Benutzers bevorzugten Wert enthält. *(boolesch)*
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Beispiel
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Android Eigenarten
-
-* **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### BlackBerry 10 Macken
-
-* **Typ**: teilweise unterstützt. Für Telefonnummern verwendet.
-
-* **Wert**: unterstützt.
-
-* **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### iOS Macken
-
-* **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### Windows8 Macken
-
-* **Pref**: nicht unterstützt, Rückgabe`false`.
-
-### Windows-Eigenheiten
-
-* **Pref**: nicht unterstützt, Rückgabe`false`.
-
-## ContactName
-
-Enthält verschiedene Arten von Informationen über `ein Kontaktobjekt` Namen.
-
-### Eigenschaften
-
-* **formatiert**: den vollständigen Namen des Kontakts. *(DOM-String und enthält)*
-
-* **Nachname**: Familienname des Kontakts. *(DOM-String und enthält)*
-
-* **GivenName**: Given Name des Kontaktes. *(DOM-String und enthält)*
-
-* **MiddleName**: Middle Name des Kontaktes. *(DOM-String und enthält)*
-
-* **HonorificPrefix**: der Kontakt-Präfix (z.B. *Mr.* oder *Dr.*) *(DOM-String und enthält)*
-
-* **HonorificSuffix**: der Kontakt-Suffix (Beispiel *Esq.*). *(DOM-String und enthält)*
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Beispiel
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android Eigenarten
-
-* **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
-
-### BlackBerry 10 Macken
-
-* **formatiert**: teilweise unterstützt. Gibt eine Verkettung von BlackBerry- **FirstName** und **LastName** -Feldern.
-
-* **Nachname**: unterstützt. Im Feld der BlackBerry- **Nachname** gespeichert.
-
-* **GivenName**: unterstützt. Im BlackBerry **FirstName** -Feld gespeichert.
-
-* **MiddleName**: nicht unterstützt, Rückgabe`null`.
-
-* **HonorificPrefix**: nicht unterstützte, Rückgabe`null`.
-
-* **HonorificSuffix**: nicht unterstützte, Rückgabe`null`.
-
-### FirefoxOS Macken
-
-* **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
-
-### iOS Macken
-
-* **formatiert**: teilweise unterstützt. IOS zusammengesetzten Namen gibt, aber ist schreibgeschützt.
-
-### Windows 8 Macken
-
-* **formatiert**: Dies ist die einzige Eigenschaft, und ist identisch mit `displayName` , und`nickname`
-
-* **Nachname**: nicht unterstützt
-
-* **GivenName**: nicht unterstützt
-
-* **MiddleName**: nicht unterstützt
-
-* **HonorificPrefix**: nicht unterstützt
-
-* **HonorificSuffix**: nicht unterstützt
-
-### Windows-Eigenheiten
-
-* **formatiert**: Er ist identisch mit`displayName`
-
-## ContactOrganization
-
-Das `ContactOrganization`-Objekt speichert Organisationseigenschaften eines Kontakts. Ein `Contact` objekt werden ein oder mehrere `ContactOrganization`-Objekte in einem Array gespeichert.
-
-### Eigenschaften
-
-* **Pref**: Legen Sie auf `true` Wenn dieses `ContactOrganization` des Benutzers bevorzugten Wert enthält. *(boolesch)*
-
-* **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. _(DOMString)
-
-* **Name**: der Name der Organisation. *(DOM-String und enthält)*
-
-* **Abteilung**: die Abteilung, die der Vertrag für arbeitet. *(DOM-String und enthält)*
-
-* **Titel**: Titel des Kontakts in der Organisation. *(DOM-String und enthält)*
-
-### Unterstützte Plattformen
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows (nur Windows-8.1 und Windows Phone 8.1-Geräte)
-
-### Beispiel
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X Macken
-
-* **Pref**: von Android 2.X-Geräte, Rückgabe nicht unterstützt`false`.
-
-### BlackBerry 10 Macken
-
-* **Pref**: von BlackBerry-Geräten zurückgeben nicht unterstützt`false`.
-
-* **Typ**: von BlackBerry-Geräten zurückgeben nicht unterstützt`null`.
-
-* **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **Firma** BlackBerry gespeichert.
-
-* **Abteilung**: nicht unterstützt, Rückgabe`null`.
-
-* **Titel**: teilweise unterstützt. Der erste Titel der Organisation wird im Feld **JobTitle** BlackBerry gespeichert.
-
-### Firefox OS Macken
-
-* **Pref**: nicht unterstützt
-
-* **Typ**: nicht unterstützt
-
-* **Abteilung**: nicht unterstützt
-
-* Felder **Name** und **Titel** in **Org** und **JobTitle** gespeichert.
-
-### iOS Macken
-
-* **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
-
-* **Typ**: iOS-Geräten, Rückgabe nicht unterstützt`null`.
-
-* **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **kABPersonOrganizationProperty** iOS gespeichert.
-
-* **Abteilung**: teilweise unterstützt. Die Abteilungsnamen der erste ist im Feld **kABPersonDepartmentProperty** iOS gespeichert.
-
-* **Titel**: teilweise unterstützt. Der erste Titel wird im Feld **kABPersonJobTitleProperty** iOS gespeichert.
-
-### Windows-Eigenheiten
-
-* **Pref**: nicht unterstützt, Rückgabe`false`.
-
-* **Typ**: nicht unterstützt, Rückgabe`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/es/README.md b/plugins/cordova-plugin-contacts/doc/es/README.md
deleted file mode 100644
index 9bfe407..0000000
--- a/plugins/cordova-plugin-contacts/doc/es/README.md
+++ /dev/null
@@ -1,732 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-Este plugin define un global `navigator.contacts` objeto que proporciona acceso a la base de datos de contactos de dispositivo.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**ADVERTENCIA**: recopilación y uso de datos plantea cuestiones de privacidad importante. Política de privacidad de su aplicación debe discutir cómo la aplicación utiliza datos de contacto y si es compartida con terceros. Información de contacto se considera sensible porque revela la gente con quien se comunica una persona. Por lo tanto, además de política de privacidad de la app, fuertemente considere dar un aviso de just-in-time antes de la aplicación accede a ellos o utiliza los datos de contacto, si el sistema operativo del dispositivo no hacerlo ya. Que el aviso debe proporcionar la misma información mencionada, además de obtener un permiso del usuario (por ejemplo, presentando opciones para **Aceptar** y **No gracias**). Tenga en cuenta que algunos mercados de aplicación podrán exigir la aplicación para proporcionar un aviso de just-in-time y obtener el permiso del usuario antes de acceder a datos de contacto. Una experiencia de usuario clara y fácil de entender que rodean el uso de contacto datos ayuda a evitar la confusión del usuario y percibe uso indebido de los datos de contacto. Para obtener más información, por favor consulte a la guía de privacidad.
-
-## Instalación
-
-Esto requiere cordova 5.0 + (v1.0.0 estable actual)
-
- cordova plugin add cordova-plugin-contacts
-
-
-Las versiones más antiguas de Córdoba todavía pueden instalar mediante el id de **obsoleto** (viejo v0.2.16)
-
- cordova plugin add org.apache.cordova.contacts
-
-
-También es posible instalar directamente vía url repo (inestable)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS rarezas
-
-Crear **www/manifest.webapp** como se describe en [Manifestar Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). Agregar permisos pertinentes. También hay una necesidad de cambiar el tipo de aplicación a "privilegiados" - [Docs manifiestan](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type). **ADVERTENCIA**: todas las apps privilegiadas aplicar [Política de seguridad de contenidos](https://developer.mozilla.org/en-US/Apps/CSP) que prohíbe en línea de comandos. Inicializar la aplicación de otra manera.
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows rarezas
-
-**Antes de Windows 10:** Contactos `encontrar` y `pickContact` métodos son sólo lectura, por lo que su aplicación no puede modificarlos. método `Find` disponible sólo en dispositivos Windows Phone 8.1.
-
-**Windows 10 y anteriores:** Contactos se pueden guardar y se guarda en almacenamiento local de la aplicación contactos. Contactos también pueden ser eliminados.
-
-### Rarezas de Windows 8
-
-Windows 8 contactos son de sólo lectura. Través de los contactos de la API de Córdoba no son consultables/búsqueda, se debe informar al usuario a buscar un contacto como una llamada a contacts.pickContact que se abrirá la aplicación 'Personas' donde el usuario debe elegir un contacto. Cualquier contacto volvió es readonly, su aplicación no puede modificarlos.
-
-## Navigator.Contacts
-
-### Métodos
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### Objetos
-
- * Contact
- * ContactName
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-El `navigator.contacts.create` método es sincrónico y devuelve una nueva `Contact` objeto.
-
-Este método no retiene el objeto de contacto en la base de contactos de dispositivo, para lo cual necesita invocar el `Contact.save` método.
-
-### Plataformas soportadas
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
-
-### Ejemplo
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-El `navigator.contacts.find` método se ejecuta asincrónicamente, consultando la base de datos de contactos de dispositivo y devolver una matriz de `Contact` objetos. Los objetos resultantes son pasados a la `contactSuccess` función de devolución de llamada especificada por el parámetro **contactSuccess** .
-
-El parámetro **contactFields** especifica los campos para ser utilizado como un calificador de búsqueda. Un parámetro de longitud cero **contactFields** no es válido y resultados en `ContactError.INVALID_ARGUMENT_ERROR` . Un valor de **contactFields** de `"*"` busca campos todo contactos.
-
-La cadena de **contactFindOptions.filter** puede ser usada como un filtro de búsqueda al consultar la base de datos de contactos. Si proporciona, una entre mayúsculas y minúsculas, coincidencia parcial valor se aplica a cada campo especificado en el parámetro **contactFields** . Si hay un partido para *cualquier* de los campos especificados, se devuelve el contacto. Uso **contactFindOptions.desiredFields** parámetro al control que Contacta con propiedades debe devolverse atrás.
-
-### Parámetros
-
- * **contactFields**: póngase en contacto con campos para usar como un calificador de búsqueda. *(DOMString[])* [Required]
-
- * **contactSuccess**: función de callback de éxito se invoca con la matriz de objetos contacto devueltos desde la base de datos. [Required]
-
- * **contactError**: función de callback de Error, se invoca cuando se produce un error. [Opcional]
-
- * **contactFindOptions**: buscar opciones para filtrar navigator.contacts. [Optional]
-
- Claves incluyen:
-
- * **filtro**: la cadena de búsqueda utilizada para encontrar navigator.contacts. *(DOMString)* (Por defecto:`""`)
-
- * **múltiples**: determina si la operación de búsqueda devuelve múltiples navigator.contacts. *(Booleano)* (Por defecto:`false`)
-
- * **desiredFields**: póngase en contacto con campos para volver atrás. Si se especifica, la resultante `Contact` objeto sólo cuenta con los valores de estos campos. *(DOMString[])* [Optional]
-
-### Plataformas soportadas
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows (Windows Phone 8.1 y Windows 10)
-
-### Ejemplo
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows rarezas
-
- * `__contactFields__`No se admite y se ignorará. `find`método siempre tratará de coincidir con el nombre, dirección de correo electrónico o número de teléfono de un contacto.
-
-## navigator.contacts.pickContact
-
-El `navigator.contacts.pickContact` método lanza el selector para seleccionar un único contacto contacto. El objeto resultante se pasa a la `contactSuccess` función de devolución de llamada especificada por el parámetro **contactSuccess** .
-
-### Parámetros
-
- * **contactSuccess**: función de callback de éxito se invoca con el único objeto de contacto. [Obligatorio]
-
- * **contactError**: función de callback de Error, se invoca cuando se produce un error. [Opcional]
-
-### Plataformas soportadas
-
- * Android
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### Ejemplo
-
- navigator.contacts.pickContact(function(contact) {console.log (' se ha seleccionado el siguiente contacto: "+ JSON.stringify(contact));
- }, function(err) {console.log ('Error: ' + err);
- });
-
-
-## Contact
-
-El `Contact` objeto representa el contacto de un usuario. Contactos pueden ser creados, almacenados o eliminados de la base de datos de contactos de dispositivo. Contactos pueden también ser obtenidos (individualmente o a granel) de la base de datos invocando el `navigator.contacts.find` método.
-
-**Nota**: no todos los campos de contacto mencionados son compatibles con la plataforma de cada dispositivo. Consulte sección *peculiaridades* de cada plataforma para más detalles.
-
-### Propiedades
-
- * **ID**: un identificador único global. *(DOMString)*
-
- * **displayName**: el nombre de este contacto, conveniente para la exhibición a los usuarios finales. *(DOMString)*
-
- * **nombre**: un objeto que contiene todos los componentes de un nombre de las personas. *(ContactName)*
-
- * **apodo**: un nombre para abordar el contacto casual. *(DOMString)*
-
- * **números**: una matriz de números de teléfono de contacto. *(ContactField[])*
-
- * **correos electrónicos**: un conjunto de direcciones de correo electrónico del contacto. *(ContactField[])*
-
- * **direcciones**: un conjunto de direcciones de todos los contactos. *(ContactAddress[])*
-
- * **IMS**: un conjunto de direcciones de todos los contactos IM. *(ContactField[])*
-
- * **organizaciones**: un conjunto de organizaciones de todos los contactos. *(ContactOrganization[])*
-
- * **cumpleaños**: el cumpleaños del contacto. *(Fecha)*
-
- * **Nota**: una nota sobre el contacto. *(DOMString)*
-
- * **fotos**: una serie de fotos de los contactos. *(ContactField[])*
-
- * **categorías**: una matriz de todas las categorías definidas por el usuario asociado con el contacto. *(ContactField[])*
-
- * **URL**: un conjunto de páginas web asociadas con el contacto. *(ContactField[])*
-
-### Métodos
-
- * **clon**: devuelve un nuevo `Contact` objeto que es una copia en profundidad del objeto de llamadas con el `id` propiedad establecida en`null`.
-
- * **eliminar**: elimina el contacto de la base de datos de contactos de dispositivo, si no se ejecuta un callback de error con un `ContactError` objeto.
-
- * **Guardar**: guarda un nuevo contacto en la base de datos de contactos de dispositivo o actualiza un contacto existente si ya existe un contacto con el mismo **id** .
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Salvar ejemplo
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Ejemplo de clon
-
- clon del clon de contacto objeto var = contact.clone();
- clone.name.givenName = "John";
- Console.log ("contacto Original nombre =" + contact.name.givenName);
- Console.log ("Cloned contacto nombre =" + clone.name.givenName);
-
-
-### Quitar ejemplo
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Rarezas Android 2.X
-
- * **categories**: no compatible con dispositivos Android 2.X, devolver `null`.
-
-### BlackBerry 10 rarezas
-
- * **ID**: asignado por el dispositivo cuando se guarda el contacto.
-
-### FirefoxOS rarezas
-
- * **categorías**: parcialmente soportado. Campos **pref** y **tipo** regresan`null`
-
- * **IMS**: no se admite
-
- * **fotos**: no se admite
-
-### iOS rarezas
-
- * **displayName**: no compatible con iOS, regresando `null` si no hay ningún `ContactName` especifica, en cuyo caso devuelve el nombre del compuesto, **apodo** o `""` , respectivamente.
-
- * **cumpleaños**: debe ser de entrada como un JavaScript `Date` objeto, del mismo modo que se la devuelvan.
-
- * **fotos**: devuelve una dirección URL del archivo de la imagen, que se almacena en el directorio temporal de la aplicación. Contenidos del directorio temporal se eliminan cuando salga de la aplicación.
-
- * **categorías**: esta propiedad actualmente no es compatible, regresando`null`.
-
-### Windows Phone 7 y 8 rarezas
-
- * **displayName**: cuando se crea un contacto, previsto para el parámetro de nombre pantalla difiere el nombre para mostrar el valor obtenido al encontrar el contacto.
-
- * **URL**: cuando se crea un contacto, los usuarios pueden ingresar y salvar más de una dirección web, pero sólo está disponible cuando busque el contacto.
-
- * **números**: no se admite la opción *pref* . El *tipo* no se admite en una operación de *encontrar* . Solamente un `phoneNumber` está permitido para cada *tipo*.
-
- * **correos electrónicos**: no se admite la opción *pref* . Home y referencias misma entrada de correo electrónico. Se permite solamente una entrada para cada *tipo*.
-
- * **direcciones**: soporta sólo trabajo y hogar/personal *tipo*. La casa y personales de *tipo* referencia la misma entrada de dirección. Se permite solamente una entrada para cada *tipo*.
-
- * **organizaciones**: sólo está permitido y no es compatible con los atributos *pref*, *tipo*y *Departamento* .
-
- * **Nota**: no compatible, regresando`null`.
-
- * **ims**: no soportado, devolver `null`.
-
- * **cumpleaños**: no soportado, regresando`null`.
-
- * **categorías**: no soportado, regresando`null`.
-
- * **remove**: no se admite el método
-
-### Windows rarezas
-
- * **fotos**: devuelve una dirección URL del archivo de la imagen, que se almacena en el directorio temporal de la aplicación.
-
- * **cumpleaños**: no soportado, regresando`null`.
-
- * **categorías**: no soportado, regresando`null`.
-
- * **remove**: el método sólo es soportado en Windows 10 o superior.
-
-## ContactAddress
-
-El `ContactAddress` objeto almacena las propiedades de una única dirección de un contacto. A `Contact` objeto puede incluir más de una dirección en un `ContactAddress[]` matriz.
-
-### Propiedades
-
- * **pref**: establecido en `true` si esta `ContactAddress` contiene el usuario preferido de valor. *(boolean)*
-
- * **type**: una cadena que indica qué tipo de campo es, *home* por ejemplo. *(DOMString)*
-
- * **formatted**: la dirección completa con formato de visualización. *(DOMString)*
-
- * **streetAddress**: la dirección completa. *(DOMString)*
-
- * **locality**: la ciudad o localidad. *(DOMString)*
-
- * **region**: el estado o la región. *(DOMString)*
-
- * **postalCode**: el código postal o código postal. *(DOMString)*
-
- * **country**: el nombre del país. *(DOMString)*
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Ejemplo
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Rarezas Android 2.X
-
- * **pref**: no soportado, devolviendo `false` en dispositivos Android 2.X.
-
-### BlackBerry 10 rarezas
-
- * **pref**: no compatible con dispositivos BlackBerry, devolviendo `false`.
-
- * **type**: parcialmente soportado. Sólo uno de cada *Work* y *Home* tipo direcciones puede ser almacenado por contacto.
-
- * **formatted**: parcialmente soportado. Devuelve una concatenación de todos los campos de dirección de BlackBerry.
-
- * **streetAddress**: soportado. Devuelve una concatenación de BlackBerry **address1** y **2** campos de dirección.
-
- * **locality**: apoyado. Almacenada en el campo de dirección de la **city** de BlackBerry.
-
- * **region**: apoyado. Almacenada en el campo de dirección de BlackBerry **stateProvince**.
-
- * **postalCode**: apoyado. Almacenada en el campo de dirección de BlackBerry **zipPostal**.
-
- * **country**: apoyado.
-
-### FirefoxOS rarezas
-
- * **formato**: actualmente no se admite
-
-### iOS rarezas
-
- * **pref**: no se admite en dispositivos iOS, devolviendo `false`.
-
- * **formatted**: actualmente no se admite.
-
-### Rarezas de Windows 8
-
- * **Pref**: no se admite
-
-### Windows rarezas
-
- * **Pref**: no se admite
-
-## ContactError
-
-El `ContactError` objeto se devuelve al usuario a través de la `contactError` función de devolución de llamada cuando se produce un error.
-
-### Propiedades
-
- * **code**: uno de los códigos de error predefinido enumerados a continuación.
-
-### Constantes
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-El `ContactField` objeto es un componente reutilizable que representa en contacto con campos genéricamente. Cada `ContactField` objeto contiene un `value` , `type` , y `pref` propiedad. A `Contact` objeto almacena varias propiedades en `ContactField[]` arreglos de discos, como las direcciones de teléfono números y correo electrónico.
-
-En la mayoría de los casos, no existen previamente determinados valores para un `ContactField` atributo **type** del objeto. Por ejemplo, un número de teléfono puede especificar valores de **tipo** de *hogar*, *trabajo*, *móvil*, *iPhone*o cualquier otro valor que es apoyado por contacto de base de datos de una plataforma dispositivo determinado. Sin embargo, para el `Contact` **fotos de** campo, el campo **tipo** indica el formato de la imagen devuelta: **url** cuando el atributo de **valor** contiene una dirección URL de la imagen de la foto, o *base64* cuando el **valor** contiene una cadena codificada en base64 imagen.
-
-### Propiedades
-
- * **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. *(DOMString)*
-
- * **valor**: el valor del campo, como un teléfono número o dirección de email. *(DOMString)*
-
- * **Pref**: A `true` si este `ContactField` contiene el valor del usuario preferido. *(booleano)*
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Ejemplo
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Rarezas Android
-
- * **Pref**: no soportado, regresando`false`.
-
-### BlackBerry 10 rarezas
-
- * **tipo**: parcialmente soportado. Utilizado para los números de teléfono.
-
- * **valor**: apoyado.
-
- * **Pref**: no soportado, regresando`false`.
-
-### iOS rarezas
-
- * **Pref**: no soportado, regresando`false`.
-
-### Windows8 rarezas
-
- * **Pref**: no soportado, regresando`false`.
-
-### Windows rarezas
-
- * **Pref**: no soportado, regresando`false`.
-
-## ContactName
-
-Contiene diferentes tipos de información sobre un `Contact` nombre del objeto.
-
-### Propiedades
-
- * **formato**: el nombre completo del contacto. *(DOMString)*
-
- * **familia**: el nombre del contacto familiar. *(DOMString)*
-
- * **givenName**: nombre del contacto. *(DOMString)*
-
- * **middleName**: el nombre del contacto media. *(DOMString)*
-
- * **honorificPrefix**: prefijo del contacto (ejemplo *señor* o *doctor*) *(DOMString)*
-
- * **honorificSuffix**: sufijo de contacto (ejemplo *Esq.*). *(DOMString)*
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Ejemplo
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Rarezas Android
-
- * **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
-
-### BlackBerry 10 rarezas
-
- * **formato**: parcialmente soportado. Devuelve una concatenación de campos **firstName** y **lastName** de BlackBerry.
-
- * **familia**: apoyo. Almacenada en el campo **lastName** BlackBerry.
-
- * **givenName**: apoyado. Almacenados en campo **firstName** BlackBerry.
-
- * **middleName**: no soportado, regresando`null`.
-
- * **honorificPrefix**: no soportado, regresando`null`.
-
- * **honorificSuffix**: no soportado, regresando`null`.
-
-### FirefoxOS rarezas
-
- * **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
-
-### iOS rarezas
-
- * **formato**: parcialmente soportado. Devuelve iOS nombre compuesto, pero es de sólo lectura.
-
-### Rarezas de Windows 8
-
- * **formato**: este es el único nombre de propiedad y es idéntico al `displayName` , y`nickname`
-
- * **familia**: no se admite
-
- * **givenName**: no se admite
-
- * **middleName**: no se admite
-
- * **honorificPrefix**: no se admite
-
- * **honorificSuffix**: no se admite
-
-### Windows rarezas
-
- * **formato**: es idéntica a`displayName`
-
-## ContactOrganization
-
-El `ContactOrganization` objeto almacena las propiedades de organización de un contacto. A `Contact` objeto almacena uno o más `ContactOrganization` los objetos en una matriz.
-
-### Propiedades
-
- * **Pref**: A `true` si este `ContactOrganization` contiene el valor del usuario preferido. *(booleano)*
-
- * **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. _(DOMString)
-
- * **nombre**: el nombre de la organización. *(DOMString)*
-
- * **Departamento**: el contrato de obras para el departamento. *(DOMString)*
-
- * **título**: título del contacto de la organización. *(DOMString)*
-
-### Plataformas soportadas
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows (sólo dispositivos Windows 8.1 y 8.1 de Windows Phone)
-
-### Ejemplo
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Rarezas Android 2.X
-
- * **Pref**: no compatible con dispositivos Android 2.X, regresando`false`.
-
-### BlackBerry 10 rarezas
-
- * **Pref**: no compatible con dispositivos BlackBerry, regresando`false`.
-
- * **tipo**: no compatible con dispositivos BlackBerry, regresando`null`.
-
- * **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de la **empresa** BlackBerry.
-
- * **Departamento**: no soportado, regresando`null`.
-
- * **título**: parcialmente soportado. El primer título de la organización se almacena en el campo de **jobTitle** BlackBerry.
-
-### Firefox OS rarezas
-
- * **Pref**: no se admite
-
- * **tipo**: no se admite
-
- * **Departamento**: no se admite
-
- * Los campos **nombre** y **título** almacenado en **org** y **jobTitle**.
-
-### iOS rarezas
-
- * **pref**: no se admite en dispositivos iOS, devolviendo `false`.
-
- * **tipo**: no se admite en dispositivos iOS, regresando`null`.
-
- * **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de **kABPersonOrganizationProperty** de iOS.
-
- * **Departamento**: parcialmente soportado. El primer nombre de departamento se almacena en el campo de **kABPersonDepartmentProperty** de iOS.
-
- * **título**: parcialmente soportado. El primer título se almacena en el campo de **kABPersonJobTitleProperty** de iOS.
-
-### Windows rarezas
-
- * **Pref**: no soportado, regresando`false`.
-
- * **tipo**: no soportado, regresando`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/es/index.md b/plugins/cordova-plugin-contacts/doc/es/index.md
deleted file mode 100644
index dc1a4a1..0000000
--- a/plugins/cordova-plugin-contacts/doc/es/index.md
+++ /dev/null
@@ -1,652 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-Este plugin define un global `navigator.contacts` objeto que proporciona acceso a la base de datos de contactos de dispositivo.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log(navigator.contacts)};
-
-
-**ADVERTENCIA**: recopilación y uso de datos plantea cuestiones de privacidad importante. Política de privacidad de su aplicación debe discutir cómo la aplicación utiliza datos de contacto y si es compartida con terceros. Información de contacto se considera sensible porque revela la gente con quien se comunica una persona. Por lo tanto, además de política de privacidad de la app, fuertemente considere dar un aviso de just-in-time antes de la aplicación accede a ellos o utiliza los datos de contacto, si el sistema operativo del dispositivo no hacerlo ya. Que el aviso debe proporcionar la misma información mencionada, además de obtener un permiso del usuario (por ejemplo, presentando opciones para **Aceptar** y **No gracias**). Tenga en cuenta que algunos mercados de aplicación podrán exigir la aplicación para proporcionar un aviso de just-in-time y obtener el permiso del usuario antes de acceder a datos de contacto. Una experiencia de usuario clara y fácil de entender que rodean el uso de contacto datos ayuda a evitar la confusión del usuario y percibe uso indebido de los datos de contacto. Para obtener más información, por favor consulte a la guía de privacidad.
-
-## Instalación
-
- Cordova plugin agregar cordova-plugin-contacts
-
-
-### Firefox OS rarezas
-
-Crear **www/manifest.webapp** como se describe en [Manifestar Docs][1]. Agregar permisos pertinentes. También hay una necesidad de cambiar el tipo de aplicación a "privilegiados" - [Docs manifiestan][2]. **ADVERTENCIA**: todas las apps privilegiadas aplicar [Política de seguridad de contenidos][3] que prohíbe en línea de comandos. Inicializar la aplicación de otra manera.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "tipo": "el privilegio", "permisos": {"contactos": {"acceso": "readwrite", "Descripción": "describir por qué hay una necesidad de tal autorización"}}
-
-
-### Windows rarezas
-
-Cualquier contacto regresado de `find` y `pickContact` métodos son readonly, por lo que su aplicación no puede modificarlos. `find`método disponible sólo en dispositivos Windows Phone 8.1.
-
-### Rarezas de Windows 8
-
-Windows 8 contactos son de sólo lectura. Través de los contactos de la API de Córdoba no son consultables/búsqueda, se debe informar al usuario a buscar un contacto como una llamada a contacts.pickContact que se abrirá la aplicación 'Personas' donde el usuario debe elegir un contacto. Cualquier contacto volvió es readonly, su aplicación no puede modificarlos.
-
-## Navigator.Contacts
-
-### Métodos
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### Objetos
-
-* Contact
-* ContactName
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## Navigator.contacts.Create
-
-El `navigator.contacts.create` método es sincrónico y devuelve una nueva `Contact` objeto.
-
-Este método no retiene el objeto de contacto en la base de contactos de dispositivo, para lo cual necesita invocar el `Contact.save` método.
-
-### Plataformas soportadas
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-
-### Ejemplo
-
- var myContact = navigator.contacts.create ({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-El `navigator.contacts.find` método se ejecuta asincrónicamente, consultando la base de datos de contactos de dispositivo y devolver una matriz de `Contact` objetos. Los objetos resultantes son pasados a la `contactSuccess` función de devolución de llamada especificada por el parámetro **contactSuccess** .
-
-El parámetro **contactFields** especifica los campos para ser utilizado como un calificador de búsqueda. Un parámetro de longitud cero **contactFields** no es válido y resultados en `ContactError.INVALID_ARGUMENT_ERROR` . Un valor de **contactFields** de `"*"` busca campos todo contactos.
-
-La cadena de **contactFindOptions.filter** puede ser usada como un filtro de búsqueda al consultar la base de datos de contactos. Si proporciona, una entre mayúsculas y minúsculas, coincidencia parcial valor se aplica a cada campo especificado en el parámetro **contactFields** . Si hay un partido para *cualquier* de los campos especificados, se devuelve el contacto. Uso **contactFindOptions.desiredFields** parámetro al control que Contacta con propiedades debe devolverse atrás.
-
-### Parámetros
-
-* **contactFields**: póngase en contacto con campos para usar como un calificador de búsqueda. *(DOMString[])* [Required]
-
-* **contactSuccess**: función de callback de éxito se invoca con la matriz de objetos contacto devueltos desde la base de datos. [Required]
-
-* **contactError**: función de callback de Error, se invoca cuando se produce un error. [Optional]
-
-* **contactFindOptions**: buscar opciones para filtrar navigator.contacts. [Optional]
-
- Claves incluyen:
-
- * **filtro**: la cadena de búsqueda utilizada para encontrar navigator.contacts. *(DOMString)* (Por defecto:`""`)
-
- * **múltiples**: determina si la operación de búsqueda devuelve múltiples navigator.contacts. *(Booleano)* (Por defecto:`false`)
-
- * **desiredFields**: póngase en contacto con campos para volver atrás. Si se especifica, la resultante `Contact` objeto sólo cuenta con los valores de estos campos. *(DOMString[])* [Optional]
-
-### Plataformas soportadas
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows (sólo dispositivos Windows Phone 8.1)
-
-### Ejemplo
-
- function onSuccess(contacts) {alert ('Encontrados' + contacts.length + 'contactos de.');};
-
- function onError(contactError) {alert('onError!');};
-
- encuentra todos los contactos con 'Bob' en cualquier nombre campo var opciones = new ContactFindOptions();
- options.Filter = "Bob";
- options.Multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- campos var = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- Navigator.contacts.Find (campos, onSuccess, onError, opciones);
-
-
-### Windows rarezas
-
-* `__contactFields__`No se admite y se ignorará. `find`método siempre tratará de coincidir con el nombre, dirección de correo electrónico o número de teléfono de un contacto.
-
-## navigator.contacts.pickContact
-
-El `navigator.contacts.pickContact` método lanza el selector para seleccionar un único contacto contacto. El objeto resultante se pasa a la `contactSuccess` función de devolución de llamada especificada por el parámetro **contactSuccess** .
-
-### Parámetros
-
-* **contactSuccess**: función de callback de éxito se invoca con el único objeto de contacto. [Obligatorio]
-
-* **contactError**: función de callback de Error, se invoca cuando se produce un error. [Opcional]
-
-### Plataformas soportadas
-
-* Android
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### Ejemplo
-
- navigator.contacts.pickContact(function(contact) {console.log (' se ha seleccionado el siguiente contacto: "+ JSON.stringify(contact));
- }, function(err) {console.log ('Error: ' + err);
- });
-
-
-## Contact
-
-El `Contact` objeto representa el contacto de un usuario. Contactos pueden ser creados, almacenados o eliminados de la base de datos de contactos de dispositivo. Contactos pueden también ser obtenidos (individualmente o a granel) de la base de datos invocando el `navigator.contacts.find` método.
-
-**Nota**: no todos los campos de contacto mencionados son compatibles con la plataforma de cada dispositivo. Consulte sección *peculiaridades* de cada plataforma para más detalles.
-
-### Propiedades
-
-* **ID**: un identificador único global. *(DOMString)*
-
-* **displayName**: el nombre de este contacto, conveniente para la exhibición a los usuarios finales. *(DOMString)*
-
-* **nombre**: un objeto que contiene todos los componentes de un nombre de las personas. *(ContactName)*
-
-* **apodo**: un nombre para abordar el contacto casual. *(DOMString)*
-
-* **números**: una matriz de números de teléfono de contacto. *(ContactField[])*
-
-* **correos electrónicos**: un conjunto de direcciones de correo electrónico del contacto. *(ContactField[])*
-
-* **direcciones**: un conjunto de direcciones de todos los contactos. *(ContactAddress[])*
-
-* **IMS**: un conjunto de direcciones de todos los contactos IM. *(ContactField[])*
-
-* **organizaciones**: un conjunto de organizaciones de todos los contactos. *(ContactOrganization[])*
-
-* **cumpleaños**: el cumpleaños del contacto. *(Fecha)*
-
-* **Nota**: una nota sobre el contacto. *(DOMString)*
-
-* **fotos**: una serie de fotos de los contactos. *(ContactField[])*
-
-* **categorías**: una matriz de todas las categorías definidas por el usuario asociado con el contacto. *(ContactField[])*
-
-* **URL**: un conjunto de páginas web asociadas con el contacto. *(ContactField[])*
-
-### Métodos
-
-* **clon**: devuelve un nuevo `Contact` objeto que es una copia en profundidad del objeto de llamadas con el `id` propiedad establecida en`null`.
-
-* **eliminar**: elimina el contacto de la base de datos de contactos de dispositivo, si no se ejecuta un callback de error con un `ContactError` objeto.
-
-* **Guardar**: guarda un nuevo contacto en la base de datos de contactos de dispositivo o actualiza un contacto existente si ya existe un contacto con el mismo **id** .
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Salvar ejemplo
-
- function onSuccess(contact) {alert ("salvar con éxito");};
-
- function onError(contactError) {alert ("Error =" + contactError.code);};
-
- crear un nuevo objeto contacto var contacto = navigator.contacts.create();
- contact.displayName = "Plomero";
- Contact.nickname = "Plomero"; especificar tanto para todos los dispositivos de apoyo / / rellenar algún nombre var campos = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- Contact.name = nombre;
-
- guardar en el dispositivo contact.save(onSuccess,onError);
-
-
-### Ejemplo de clon
-
- clon del clon de contacto objeto var = contact.clone();
- clone.name.givenName = "John";
- Console.log ("contacto Original nombre =" + contact.name.givenName);
- Console.log ("Cloned contacto nombre =" + clone.name.givenName);
-
-
-### Quitar ejemplo
-
- function onSuccess() {alert ("retiro el éxito");};
-
- function onError(contactError) {alert ("Error =" + contactError.code);};
-
- quitar el contacto de la contact.remove(onSuccess,onError) del dispositivo;
-
-
-### Rarezas Android 2.X
-
-* **categories**: no compatible con dispositivos Android 2.X, devolver `null`.
-
-### BlackBerry 10 rarezas
-
-* **ID**: asignado por el dispositivo cuando se guarda el contacto.
-
-### FirefoxOS rarezas
-
-* **categorías**: parcialmente soportado. Campos **pref** y **tipo** regresan`null`
-
-* **IMS**: no se admite
-
-* **fotos**: no se admite
-
-### iOS rarezas
-
-* **displayName**: no compatible con iOS, regresando `null` si no hay ningún `ContactName` especifica, en cuyo caso devuelve el nombre del compuesto, **apodo** o `""` , respectivamente.
-
-* **cumpleaños**: debe ser de entrada como un JavaScript `Date` objeto, del mismo modo que se la devuelvan.
-
-* **fotos**: devuelve una dirección URL del archivo de la imagen, que se almacena en el directorio temporal de la aplicación. Contenidos del directorio temporal se eliminan cuando salga de la aplicación.
-
-* **categorías**: esta propiedad actualmente no es compatible, regresando`null`.
-
-### Windows Phone 7 y 8 rarezas
-
-* **displayName**: cuando se crea un contacto, previsto para el parámetro de nombre pantalla difiere el nombre para mostrar el valor obtenido al encontrar el contacto.
-
-* **URL**: cuando se crea un contacto, los usuarios pueden ingresar y salvar más de una dirección web, pero sólo está disponible cuando busque el contacto.
-
-* **números**: no se admite la opción *pref* . El *tipo* no se admite en una operación de *encontrar* . Solamente un `phoneNumber` está permitido para cada *tipo*.
-
-* **correos electrónicos**: no se admite la opción *pref* . Home y referencias misma entrada de correo electrónico. Se permite solamente una entrada para cada *tipo*.
-
-* **direcciones**: soporta sólo trabajo y hogar/personal *tipo*. La casa y personales de *tipo* referencia la misma entrada de dirección. Se permite solamente una entrada para cada *tipo*.
-
-* **organizaciones**: sólo está permitido y no es compatible con los atributos *pref*, *tipo*y *Departamento* .
-
-* **Nota**: no compatible, regresando`null`.
-
-* **ims**: no soportado, devolver `null`.
-
-* **cumpleaños**: no soportado, regresando`null`.
-
-* **categorías**: no soportado, regresando`null`.
-
-### Windows rarezas
-
-* **fotos**: devuelve una dirección URL del archivo de la imagen, que se almacena en el directorio temporal de la aplicación.
-
-* **cumpleaños**: no soportado, regresando`null`.
-
-* **categorías**: no soportado, regresando`null`.
-
-## ContactAddress
-
-El `ContactAddress` objeto almacena las propiedades de una única dirección de un contacto. A `Contact` objeto puede incluir más de una dirección en un `ContactAddress[]` matriz.
-
-### Propiedades
-
-* **pref**: establecido en `true` si esta `ContactAddress` contiene el usuario preferido de valor. *(boolean)*
-
-* **type**: una cadena que indica qué tipo de campo es, *home* por ejemplo. *(DOMString)*
-
-* **formatted**: la dirección completa con formato de visualización. *(DOMString)*
-
-* **streetAddress**: la dirección completa. *(DOMString)*
-
-* **locality**: la ciudad o localidad. *(DOMString)*
-
-* **region**: el estado o la región. *(DOMString)*
-
-* **postalCode**: el código postal o código postal. *(DOMString)*
-
-* **country**: el nombre del país. *(DOMString)*
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Ejemplo
-
- Mostrar la información de dirección para el funcionan de todos los contactos onSuccess(contacts) {para (var = 0; < contacts.length; i ++) {para (var j = 0; j < contacts[i].addresses.length; j ++) {alert ("Pref:" + contacts[i].addresses[j].pref + "\n" + "tipo:" + contacts[i].addresses[j].type + "\n" + "formato:" + contacts[i].addresses[j].formatted + "\n" + "dirección: "+ contacts[i].addresses[j].streetAddress +"\n"+" localidad: "+ contacts[i].addresses[j].locality +"\n"+" región: "+ contacts[i].addresses[j].region +"\n"+" Código Postal: "+ contacts[i].addresses[j].postalCode +"\n"+" país: "+ contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {alert('onError!');};
-
- encontrar todos los contactos var opciones = new ContactFindOptions();
- options.Filter = "";
- filtro var = ["displayName", "direcciones"];
- Navigator.contacts.Find (filtro, onSuccess, onError, opciones);
-
-
-### Rarezas Android 2.X
-
-* **pref**: no soportado, devolviendo `false` en dispositivos Android 2.X.
-
-### BlackBerry 10 rarezas
-
-* **pref**: no compatible con dispositivos BlackBerry, devolviendo `false`.
-
-* **type**: parcialmente soportado. Sólo uno de cada *Work* y *Home* tipo direcciones puede ser almacenado por contacto.
-
-* **formatted**: parcialmente soportado. Devuelve una concatenación de todos los campos de dirección de BlackBerry.
-
-* **streetAddress**: soportado. Devuelve una concatenación de BlackBerry **address1** y **2** campos de dirección.
-
-* **locality**: apoyado. Almacenada en el campo de dirección de la **city** de BlackBerry.
-
-* **region**: apoyado. Almacenada en el campo de dirección de BlackBerry **stateProvince**.
-
-* **postalCode**: apoyado. Almacenada en el campo de dirección de BlackBerry **zipPostal**.
-
-* **country**: apoyado.
-
-### FirefoxOS rarezas
-
-* **formato**: actualmente no se admite
-
-### iOS rarezas
-
-* **pref**: no se admite en dispositivos iOS, devolviendo `false`.
-
-* **formatted**: actualmente no se admite.
-
-### Rarezas de Windows 8
-
-* **Pref**: no se admite
-
-### Windows rarezas
-
-* **Pref**: no se admite
-
-## ContactError
-
-El `ContactError` objeto se devuelve al usuario a través de la `contactError` función de devolución de llamada cuando se produce un error.
-
-### Propiedades
-
-* **code**: uno de los códigos de error predefinido enumerados a continuación.
-
-### Constantes
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-El `ContactField` objeto es un componente reutilizable que representa en contacto con campos genéricamente. Cada `ContactField` objeto contiene un `value` , `type` , y `pref` propiedad. A `Contact` objeto almacena varias propiedades en `ContactField[]` arreglos de discos, como las direcciones de teléfono números y correo electrónico.
-
-En la mayoría de los casos, no existen previamente determinados valores para un `ContactField` atributo **type** del objeto. Por ejemplo, un número de teléfono puede especificar valores de **tipo** de *hogar*, *trabajo*, *móvil*, *iPhone*o cualquier otro valor que es apoyado por contacto de base de datos de una plataforma dispositivo determinado. Sin embargo, para el `Contact` **fotos de** campo, el campo **tipo** indica el formato de la imagen devuelta: **url** cuando el atributo de **valor** contiene una dirección URL de la imagen de la foto, o *base64* cuando el **valor** contiene una cadena codificada en base64 imagen.
-
-### Propiedades
-
-* **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. *(DOMString)*
-
-* **valor**: el valor del campo, como un teléfono número o dirección de email. *(DOMString)*
-
-* **Pref**: A `true` si este `ContactField` contiene el valor del usuario preferido. *(booleano)*
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Ejemplo
-
- crear un nuevo contacto contacto var = navigator.contacts.create();
-
- almacenar números de teléfono de contacto en números de var ContactField [] = [];
- phoneNumbers[0] = new ContactField ('trabajo', ' 212-555-1234', false);
- phoneNumbers[1] = new ContactField ('móviles', ' 917-555-5432', true); recomendado: número phoneNumbers[2] = new ContactField ('home', ' 203-555-7890', false);
- contact.phoneNumbers = números;
-
- guardar el contacto contact.save();
-
-
-### Rarezas Android
-
-* **Pref**: no soportado, regresando`false`.
-
-### BlackBerry 10 rarezas
-
-* **tipo**: parcialmente soportado. Utilizado para los números de teléfono.
-
-* **valor**: apoyado.
-
-* **Pref**: no soportado, regresando`false`.
-
-### iOS rarezas
-
-* **Pref**: no soportado, regresando`false`.
-
-### Windows8 rarezas
-
-* **Pref**: no soportado, regresando`false`.
-
-### Windows rarezas
-
-* **Pref**: no soportado, regresando`false`.
-
-## ContactName
-
-Contiene diferentes tipos de información sobre un `Contact` nombre del objeto.
-
-### Propiedades
-
-* **formato**: el nombre completo del contacto. *(DOMString)*
-
-* **familia**: el nombre del contacto familiar. *(DOMString)*
-
-* **givenName**: nombre del contacto. *(DOMString)*
-
-* **middleName**: el nombre del contacto media. *(DOMString)*
-
-* **honorificPrefix**: prefijo del contacto (ejemplo *señor* o *doctor*) *(DOMString)*
-
-* **honorificSuffix**: sufijo de contacto (ejemplo *Esq.*). *(DOMString)*
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Ejemplo
-
- función onSuccess(contacts) {para (var = 0; < contacts.length; i ++) {alert ("formateada:" + contacts[i].name.formatted + "\n" + "Apellido:" + contacts[i].name.familyName + "\n" + "nombre:" + contacts[i].name.givenName + "\n" + "segundo nombre:" + contacts[i].name.middleName + "\n" + "sufijo:" + contacts[i].name.honorificSuffix + "\n" + "prefijo:" + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {alert('onError!');};
-
- var opciones = new ContactFindOptions();
- options.Filter = "";
- filtro = ["displayName", "nombre"];
- Navigator.contacts.Find (filtro, onSuccess, onError, opciones);
-
-
-### Rarezas Android
-
-* **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
-
-### BlackBerry 10 rarezas
-
-* **formato**: parcialmente soportado. Devuelve una concatenación de campos **firstName** y **lastName** de BlackBerry.
-
-* **familia**: apoyo. Almacenada en el campo **lastName** BlackBerry.
-
-* **givenName**: apoyado. Almacenados en campo **firstName** BlackBerry.
-
-* **middleName**: no soportado, regresando`null`.
-
-* **honorificPrefix**: no soportado, regresando`null`.
-
-* **honorificSuffix**: no soportado, regresando`null`.
-
-### FirefoxOS rarezas
-
-* **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
-
-### iOS rarezas
-
-* **formato**: parcialmente soportado. Devuelve iOS nombre compuesto, pero es de sólo lectura.
-
-### Rarezas de Windows 8
-
-* **formato**: este es el único nombre de propiedad y es idéntico al `displayName` , y`nickname`
-
-* **familia**: no se admite
-
-* **givenName**: no se admite
-
-* **middleName**: no se admite
-
-* **honorificPrefix**: no se admite
-
-* **honorificSuffix**: no se admite
-
-### Windows rarezas
-
-* **formato**: es idéntica a`displayName`
-
-## ContactOrganization
-
-El `ContactOrganization` objeto almacena las propiedades de organización de un contacto. A `Contact` objeto almacena uno o más `ContactOrganization` los objetos en una matriz.
-
-### Propiedades
-
-* **Pref**: A `true` si este `ContactOrganization` contiene el valor del usuario preferido. *(booleano)*
-
-* **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. _(DOMString)
-
-* **nombre**: el nombre de la organización. *(DOMString)*
-
-* **Departamento**: el contrato de obras para el departamento. *(DOMString)*
-
-* **título**: título del contacto de la organización. *(DOMString)*
-
-### Plataformas soportadas
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows (sólo dispositivos Windows 8.1 y 8.1 de Windows Phone)
-
-### Ejemplo
-
- function onSuccess(contacts) {para (var = 0; < contacts.length; i ++) {para (var j = 0; j < contacts[i].organizations.length; j ++) {alert ("Pref:" + contacts[i].organizations[j].pref + "\n" + "tipo:" + contacts[i].organizations[j].type + "\n" + "nombre:" + contacts[i].organizations[j].name + "\n" + "Departamento:" + contacts[i].organizations[j].department + "\n" + "título: "+ contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {alert('onError!');};
-
- var opciones = new ContactFindOptions();
- options.Filter = "";
- filtro = ["displayName", "organizaciones"];
- Navigator.contacts.Find (filtro, onSuccess, onError, opciones);
-
-
-### Rarezas Android 2.X
-
-* **Pref**: no compatible con dispositivos Android 2.X, regresando`false`.
-
-### BlackBerry 10 rarezas
-
-* **Pref**: no compatible con dispositivos BlackBerry, regresando`false`.
-
-* **tipo**: no compatible con dispositivos BlackBerry, regresando`null`.
-
-* **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de la **empresa** BlackBerry.
-
-* **Departamento**: no soportado, regresando`null`.
-
-* **título**: parcialmente soportado. El primer título de la organización se almacena en el campo de **jobTitle** BlackBerry.
-
-### Firefox OS rarezas
-
-* **Pref**: no se admite
-
-* **tipo**: no se admite
-
-* **Departamento**: no se admite
-
-* Los campos **nombre** y **título** almacenado en **org** y **jobTitle**.
-
-### iOS rarezas
-
-* **pref**: no se admite en dispositivos iOS, devolviendo `false`.
-
-* **tipo**: no se admite en dispositivos iOS, regresando`null`.
-
-* **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de **kABPersonOrganizationProperty** de iOS.
-
-* **Departamento**: parcialmente soportado. El primer nombre de departamento se almacena en el campo de **kABPersonDepartmentProperty** de iOS.
-
-* **título**: parcialmente soportado. El primer título se almacena en el campo de **kABPersonJobTitleProperty** de iOS.
-
-### Windows rarezas
-
-* **Pref**: no soportado, regresando`false`.
-
-* **tipo**: no soportado, regresando`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/fr/README.md b/plugins/cordova-plugin-contacts/doc/fr/README.md
deleted file mode 100644
index cd745ee..0000000
--- a/plugins/cordova-plugin-contacts/doc/fr/README.md
+++ /dev/null
@@ -1,668 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-Ce plugin définit un global `navigator.contacts` objet, ce qui permet d'accéder à la base de données de contacts de dispositif.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.contacts);}
-
-
-**Avertissement**: collecte et utilisation des données de contact soulève des questions importantes de la vie privée. Politique de confidentialité de votre application doit examiner comment l'application utilise les données de contact et si il est partagé avec d'autres parties. Information de contact est considéré comme sensible parce qu'il révèle les gens avec lesquels une personne communique. Par conséquent, en plus de la politique de confidentialité de l'application, vous devez envisager fortement fournissant un avis juste-à-temps, avant que l'application accède ou utilise des données de contact, si le système d'exploitation de périphérique ne fait donc pas déjà. Cet avis doit fournir les mêmes renseignements susmentionnées, ainsi que d'obtenir l'autorisation de l'utilisateur (par exemple, en présentant des choix **OK** et **Non merci**). Notez que certains marchés app peuvent exiger l'application de fournir un avis juste-à-temps et obtenir la permission de l'utilisateur avant d'accéder à des données de contact. Une expérience utilisateur claire et facile à comprendre qui entourent l'utilisation de données permettent d'éviter la confusion des utilisateurs de contact et une utilisation jugée abusive des données de contact. Pour plus d'informations, consultez le Guide de la vie privée.
-
-## Installation
-
-Pour cela, cordova 5.0 + (v1.0.0 stable actuelle)
-
- cordova plugin add cordova-plugin-contacts
-
-
-Anciennes versions de cordova peuvent toujours installer via l'id **déconseillée** (v0.2.16 rassis)
-
- cordova plugin add org.apache.cordova.contacts
-
-
-Il est également possible d'installer directement via l'url de repo (instable)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS Quirks
-
-Créez **www/manifest.webapp** comme décrit dans [Les Docs manifeste](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). Ajouter permisions pertinentes. Il est également nécessaire de changer le type d'application Web de « privilégiés » - [Docs manifeste](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type). **Avertissement**: toutes les applications privilégiées appliquer [Contenu politique de sécurité](https://developer.mozilla.org/en-US/Apps/CSP) qui interdit à un script inline. Initialiser votre application d'une autre manière.
-
- « type »: "le privilège", "autorisations": {« contacts »: {« accès »: "readwrite", "description": "décrire pourquoi il est nécessaire pour obtenir cette permission"}}
-
-
-### Bizarreries de Windows
-
-**Avant Windows 10 :** Tout contact retourné par les méthodes `find` et `pickContact` est en lecture seule, afin que votre application ne puisse les modifier. `find`méthode disponible uniquement sur les appareils Windows Phone 8.1.
-
-**Windows 10 et plus :** Contacts peuvent être enregistrées et seront enregistrées dans le stockage local application contacts. Contacts peuvent également être supprimés.
-
-### Bizarreries de Windows 8
-
-Windows 8 Contacts sont en lecture seule. Via les Contacts d'API Cordova ne sont pas queryable/consultables, vous devez en informer l'utilisateur de choisir un contact comme un appel à contacts.pickContact qui va ouvrir l'application « People » où l'utilisateur doit choisir un contact. Les contacts retournés sont en lecture seule, afin que votre application ne puisse les modifier.
-
-## Navigator.contacts
-
-### Méthodes
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### Objets
-
- * Contact
- * ContactName
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-La `navigator.contacts.create` méthode est synchrone et retourne un nouveau `Contact` objet.
-
-Cette méthode ne conserve pas l'objet de Contact dans la base de données des contacts périphériques, dont vous avez besoin d'appeler le `Contact.save` méthode.
-
-### Plates-formes supportées
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
-
-### Exemple
-
- myContact var = navigator.contacts.create ({« displayName »: « Test User »}) ;
-
-
-## navigator.contacts.find
-
-La `navigator.contacts.find` méthode s'exécute de façon asynchrone, l'interrogation de la base de données de contacts de dispositif et retourne un tableau de `Contact` objets. Les objets résultants sont passés à la `contactSuccess` la fonction de rappel spécifiée par le paramètre **contactSuccess** .
-
-Le paramètre **contactFields** spécifie les champs à utiliser comme un qualificateur de recherche. Un paramètre de longueur nulle **contactFields** n'est pas valide et se traduit par `ContactError.INVALID_ARGUMENT_ERROR` . Une valeur de **contactFields** de `"*"` recherche dans les champs de tout contact.
-
-La chaîne **contactFindOptions.filter** peut servir comme un filtre de recherche lors de l'interrogation de la base de données de contacts. Si fourni, un non-respect de la casse, correspondance de valeur partielle est appliquée à chaque champ spécifié dans le paramètre **contactFields** . S'il y a une correspondance pour *n'importe quel* des champs spécifiés, le contact est retourné. Utilisation **contactFindOptions.desiredFields** paramètre de contrôle qui contacter propriétés doit être retourné au retour.
-
-### Paramètres
-
- * **contactFields**: communiquer avec les champs à utiliser comme un qualificateur de recherche. *(DOMString[])* [Required]
-
- * **contactSuccess**: fonction de rappel de succès avec le tableau d'objets Contact appelée retournée par la base de données. [Required]
-
- * **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Facultatif]
-
- * **contactFindOptions**: recherche d'options pour filtrer navigator.contacts. [Optional]
-
- Clés incluent :
-
- * **filtre**: la chaîne de recherche utilisée pour trouver navigator.contacts. *(DOMString)* (Par défaut :`""`)
-
- * **multiples**: détermine si l'opération find retourne plusieurs navigator.contacts. *(Booléen)* (Par défaut :`false`)
-
- * **desiredFields**: Contactez champs soit retourné en arrière. Si spécifié, l'entraînant `Contact` objet dispose seulement des valeurs de ces champs. *(DOMString[])* [Optional]
-
-### Plates-formes supportées
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows (Windows Phone, 8.1 et Windows 10)
-
-### Exemple
-
- function onSuccess(contacts) {alert (« Found » + contacts.length + « contacts. »);} ;
-
- function onError(contactError) {alert('onError!');} ;
-
- trouver tous les contacts avec « Bob » dans toute option de var de champ nom = new ContactFindOptions() ;
- options.Filter = « Bob » ;
- options.multiple = true ;
- options.desiredFields = [navigator.contacts.fieldType.id] ;
- champs var = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name] ;
- Navigator.contacts.Find (champs, onSuccess, onError, options) ;
-
-
-### Bizarreries de Windows
-
- * `__contactFields__`n'est pas prise en charge et sera ignorée. `find`méthode toujours tenter de faire correspondre le nom, adresse e-mail ou numéro de téléphone d'un contact.
-
-## navigator.contacts.pickContact
-
-La `navigator.contacts.pickContact` méthode lance le sélecteur de Contact pour sélectionner un contact unique. L'objet qui en résulte est passé à la `contactSuccess` la fonction de rappel spécifiée par le paramètre **contactSuccess** .
-
-### Paramètres
-
- * **contactSuccess**: fonction de rappel de succès appelée avec l'objet de Contact unique. [Obligatoire]
-
- * **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Facultatif]
-
-### Plates-formes supportées
-
- * Android
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### Exemple
-
- navigator.contacts.pickContact(function(contact) {console.log ("le contact suivant a été retenu:" + JSON.stringify(contact)) ;
- }, function(err) {console.log ("Error:" + err) ;
- });
-
-
-## Contact
-
-Le `Contact` objet représente le contact de l'utilisateur. Contacts peuvent être créés, conservés ou supprimés de la base de données de contacts de dispositif. Contacts peuvent également être récupérées (individuellement ou en vrac) de la base de données en appelant le `navigator.contacts.find` méthode.
-
-**NOTE**: tous les champs de contact susmentionnés ne sont pris en charge sur chaque plate-forme de périphérique. S'il vous plaît vérifier la section *bizarreries* de chaque plate-forme pour plus de détails.
-
-### Propriétés
-
- * **ID**: un identificateur global unique. *(DOMString)*
-
- * **displayName**: le nom de ce Contact, approprié pour l'affichage à l'utilisateur final. *(DOMString)*
-
- * **nom**: un objet contenant tous les composants d'un nom de personnes. *(ContactName)*
-
- * **Pseudo**: un nom occasionnel permettant de régler le contact. *(DOMString)*
-
- * **phoneNumbers**: un tableau des numéros de téléphone du contact. *(ContactField[])*
-
- * **courriels**: un tableau d'adresses de courriel du contact. *(ContactField[])*
-
- * **adresses**: un tableau d'adresses tous les contacts. *(ContactAddress[])*
-
- * **IMS**: un tableau d'adresses IM tout le contact. *(ContactField[])*
-
- * **organisations**: un tableau des organisations de tout le contact. *(ContactOrganization[])*
-
- * **anniversaire**: l'anniversaire du contact. *(Date)*
-
- * **Remarque**: une remarque sur le contact. *(DOMString)*
-
- * **photos**: un tableau de photos du contact. *(ContactField[])*
-
- * **catégories**: un tableau de toutes les catégories définies par l'utilisateur attribuée au contact. *(ContactField[])*
-
- * **URL**: un tableau des pages web attribuée au contact. *(ContactField[])*
-
-### Méthodes
-
- * **Clone**: retourne un nouveau `Contact` objet qui est une copie complète de l'objet appelant, avec le `id` propriété la valeur`null`.
-
- * **supprimer**: supprime le contact de la base de données de contacts de dispositif, sinon exécute un rappel d'erreur avec un `ContactError` objet.
-
- * **Enregistrer**: enregistre un nouveau contact dans la base de données de contacts de périphérique, ou met à jour un contact existant, si un contact avec le même **id** existe déjà.
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Enregistrez l'exemple
-
- function onSuccess(contact) {alert ("sauver succès");} ;
-
- function onError(contactError) {alert ("erreur =" + contactError.code);} ;
-
- créer un objet contact contact var = navigator.contacts.create() ;
- contact.displayName = « Plombier » ;
- contact.Nickname = « Plombier » ; spécifier à la fois pour prendre en charge tous les périphériques / / renseigner certains champs var nom = new ContactName() ;
- name.givenName = « Jane » ;
- name.familyName = « Doe » ;
- contact.name = nom ;
-
- enregistrer dans contact.save(onSuccess,onError) de l'appareil ;
-
-
-### Exemple de clone
-
- Clone clone objet contact var = contact.clone() ;
- clone.name.givenName = « John » ;
- Console.log ("contact Original nom =" + contact.name.givenName) ;
- Console.log ("nom de contact clonés =" + clone.name.givenName) ;
-
-
-### Supprimer l'exemple
-
- fonction onSuccess() {alert ("succès");} ;
-
- function onError(contactError) {alert ("erreur =" + contactError.code);} ;
-
- supprimer le contact de l'appareil contact.remove(onSuccess,onError) ;
-
-
-### Android 2.X Quirks
-
- * **catégories**: non pris en charge sur les périphériques Android 2.X, retour`null`.
-
-### BlackBerry 10 Quirks
-
- * **ID**: assignés par l'appareil lors de l'enregistrement du contact.
-
-### Bizarreries de FirefoxOS
-
- * **catégories**: partiellement pris en charge. Champs **pref** et **type** sont de retour`null`
-
- * **IMS**: non pris en charge
-
- * **photos**: ne pas pris en charge
-
-### Notes au sujet d'iOS
-
- * **displayName**: ne pas possible sur iOS, retour `null` à moins qu'il n'y a aucun `ContactName` spécifié, auquel cas, il renvoie le nom composite, **Pseudo** ou `""` , respectivement.
-
- * **anniversaire**: doit être entré comme un JavaScript `Date` objet, de la même façon qu'il soit retourné.
-
- * **photos**: retourne une URL de fichier de l'image, qui est stocké dans le répertoire temporaire de l'application. Contenu du répertoire temporaire est supprimés lorsque l'application se ferme.
-
- * **catégories**: cette propriété n'est actuellement pas supportée, retour`null`.
-
-### Notes au sujet de Windows Phone 7 et 8
-
- * **displayName**: lorsque vous créez un contact, la valeur fournie pour le paramètre de nom d'affichage est différent de l'affichage nom Récupérée lors de la recherche du contact.
-
- * **URL**: lorsque vous créez un contact, les utilisateurs peuvent entrer et enregistrer plus d'une adresse web, mais seulement un est disponible lors de la recherche du contact.
-
- * **phoneNumbers**: l'option de *pref* n'est pas pris en charge. Le *type* n'est pas pris en charge lors d'une opération de *trouver* . Seul `phoneNumber` est autorisé pour chaque *type*.
-
- * **courriels**: l'option de *pref* n'est pas pris en charge. Accueil et personnels références même courriel entrée. Une seule participation est autorisée pour chaque *type*.
-
- * **adresses**: prend en charge seulement travail et accueil/personal *type*. La maison et personnels de *type* référence la même entrée d'adresse. Une seule participation est autorisée pour chaque *type*.
-
- * **organisations**: seul est autorisé et ne supporte pas les attributs *pref*, *type*et *Département* .
-
- * **Remarque**: ne pas pris en charge, retour`null`.
-
- * **IMS**: ne pas pris en charge, retour`null`.
-
- * **anniversaires**: ne pas pris en charge, retour`null`.
-
- * **catégories**: ne pas pris en charge, retour`null`.
-
- * **remove**: méthode n'est pas prise en charge
-
-### Bizarreries de Windows
-
- * **photos**: retourne une URL de fichier de l'image, qui est stocké dans le répertoire temporaire de l'application.
-
- * **anniversaires**: ne pas pris en charge, retour`null`.
-
- * **catégories**: ne pas pris en charge, retour`null`.
-
- * **remove**: méthode est uniquement pris en charge dans Windows 10 ou supérieur.
-
-## ContactAddress
-
-Le `ContactAddress` objet Stocke les propriétés d'une seule adresse d'un contact. A `Contact` objet peut inclure plusieurs adresses dans un `ContactAddress[]` tableau.
-
-### Propriétés
-
- * **pref**: la valeur `true` si ce `ContactAddress` contient la valeur de préférence de l'utilisateur. *(booléen)*
-
- * **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
-
- * **mise en forme**: l'adresse complète au format pour l'affichage. *(DOMString)*
-
- * **adresse**: l'adresse complète. *(DOMString)*
-
- * **localité**: la ville ou la localité. *(DOMString)*
-
- * **région**: l'État ou la région. *(DOMString)*
-
- * **Code postal**: le code zip ou code postal. *(DOMString)*
-
- * **pays**: le nom du pays. *(DOMString)*
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Exemple
-
- Affichez les informations d'adresse pour tous les contacts fonctionnent onSuccess(contacts) {pour (var j'ai = 0; j'ai < contacts.length; i ++) {pour (var j = 0; j < contacts[i].addresses.length; j ++) {alert ("Pref:" + contacts[i].addresses[j].pref + « \n » + "Type:" + contacts[i].addresses[j].type + « \n » + "au format:" + contacts[i].addresses[j].formatted + « \n » + "adresse de rue: "+ contacts[i].addresses[j].streetAddress +"\n"+" localité: "+ contacts[i].addresses[j].locality +"\n"+" région: "+ contacts[i].addresses[j].region +"\n"+" Code Postal: "+ contacts[i].addresses[j].postalCode +"\n"+" pays: "+ contacts[i].addresses[j].country) ;
- }
- }
- };
-
- function onError(contactError) {alert('onError!');} ;
-
- trouver tous les contacts options var = new ContactFindOptions() ;
- options.Filter = "" ;
- filtre var = ["name", « adresses »] ;
- Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
-
-
-### Android 2.X Quirks
-
- * **pref**: ne pas pris en charge, retour `false` sur les appareils Android 2.X.
-
-### BlackBerry 10 Quirks
-
- * **pref**: non pris en charge sur les appareils BlackBerry, retour`false`.
-
- * **type**: partiellement pris en charge. Seule chaque de *travail* et tapez les adresses de *la maison* peut être stockée par contact.
-
- * **au format**: partiellement pris en charge. Retourne la concaténation de tous les champs d'adresse BlackBerry.
-
- * **streetAddress**: prise en charge. Retourne la concaténation de BlackBerry **address1** et **address2** champs d'adresse.
-
- * **localité**: prise en charge. Stockée dans le champ d'adresse BlackBerry **ville** .
-
- * **région**: pris en charge. Stockée dans le champ d'adresse BlackBerry **stateProvince** .
-
- * **Code postal**: prise en charge. Stockée dans le champ d'adresse BlackBerry **zipPostal** .
-
- * **pays**: prise en charge.
-
-### Bizarreries de FirefoxOS
-
- * **au format**: actuellement ne pas pris en charge
-
-### Notes au sujet d'iOS
-
- * **pref**: non pris en charge sur les appareils iOS, retour`false`.
-
- * **au format**: actuellement ne pas pris en charge.
-
-### Bizarreries de Windows 8
-
- * **pref**: non pris en charge
-
-### Bizarreries de Windows
-
- * **pref**: non pris en charge
-
-## ContactError
-
-Le `ContactError` objet est retourné à l'utilisateur via le `contactError` fonction de rappel lorsqu'une erreur survient.
-
-### Propriétés
-
- * **code**: l'un des codes d'erreur prédéfinis énumérés ci-dessous.
-
-### Constantes
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Le `ContactField` objet est un composant réutilisable que représente contacter champs génériquement. Chaque `ContactField` objet contient un `value` , `type` , et `pref` propriété. A `Contact` objet stocke plusieurs propriétés dans `ContactField[]` tableaux, tels que téléphone numéros et adresses e-mail.
-
-Dans la plupart des cas, il n'y a pas de valeurs prédéterminées pour une `ContactField` l'attribut **type** de l'objet. Par exemple, un numéro de téléphone peut spécifier des valeurs de **type** de la *maison*, *travail*, *mobile*, *iPhone*ou toute autre valeur qui est pris en charge par la base de contacts de la plate-forme un périphérique particulier. Toutefois, pour les `Contact` **photos** champ, le champ **type** indique le format de l'image retournée : **url** lorsque l'attribut **value** contient une URL vers l'image photo ou *base64* lorsque la **valeur** contient une chaîne codée en base64 image.
-
-### Propriétés
-
- * **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
-
- * **valeur**: la valeur du champ, comme un téléphone numéro ou adresse e-mail. *(DOMString)*
-
- * **pref**: la valeur `true` si ce `ContactField` contient la valeur de préférence de l'utilisateur. *(booléen)*
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Exemple
-
- créer un nouveau contact contact var = navigator.contacts.create() ;
-
- stocker des numéros de téléphone de contact en ContactField [] var phoneNumbers = [] ;
- phoneNumbers[0] = new ContactField (« travail », ' 212-555-1234', false) ;
- phoneNumbers[1] = new ContactField (« mobile », ' 917-555-5432', true) ; phoneNumbers[2] numéro préféré = new ContactField (« home », ' 203-555-7890', false) ;
- contact.phoneNumbers = phoneNumbers ;
-
- enregistrer le contact contact.save() ;
-
-
-### Quirks Android
-
- * **pref**: ne pas pris en charge, retour`false`.
-
-### BlackBerry 10 Quirks
-
- * **type**: partiellement pris en charge. Utilisé pour les numéros de téléphone.
-
- * **valeur**: prise en charge.
-
- * **pref**: ne pas pris en charge, retour`false`.
-
-### Notes au sujet d'iOS
-
- * **pref**: ne pas pris en charge, retour`false`.
-
-### Quirks Windows8
-
- * **pref**: ne pas pris en charge, retour`false`.
-
-### Bizarreries de Windows
-
- * **pref**: ne pas pris en charge, retour`false`.
-
-## ContactName
-
-Contient différents types d'informations sur un `Contact` nom de l'objet.
-
-### Propriétés
-
- * **mise en forme**: le nom complet du contact. *(DOMString)*
-
- * **familyName**: nom de famille du contact. *(DOMString)*
-
- * **givenName**: prénom du contact. *(DOMString)*
-
- * **middleName**: deuxième prénom du contact. *(DOMString)*
-
- * **honorificPrefix**: préfixe du contact (exemple *M.* ou *Mme*) *(DOMString)*
-
- * **honorificSuffix**: suffixe du contact (exemple *Esq.*). *(DOMString)*
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Exemple
-
- function onSuccess(contacts) {pour (var j'ai = 0; j'ai < contacts.length; i ++) {alert ("Formatted:" + contacts[i].name.formatted + « \n » + "patronyme:" + contacts[i].name.familyName + « \n » + "Prénom:" + contacts[i].name.givenName + « \n » + "Prénom:" + contacts[i].name.middleName + « \n » + "suffixe:" + contacts[i].name.honorificSuffix + « \n » + "préfixe:" + contacts[i].name.honorificSuffix) ;
- }
- };
-
- function onError(contactError) {alert('onError!');} ;
-
- options de var = new ContactFindOptions() ;
- options.Filter = "" ;
- filtre = ["name", « nom »] ;
- Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
-
-
-### Quirks Android
-
- * **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
-
-### BlackBerry 10 Quirks
-
- * **au format**: partiellement pris en charge. Retourne la concaténation de champs **firstName** et **lastName** de BlackBerry.
-
- * **familyName**: prise en charge. Stockée dans le champ **lastName** BlackBerry.
-
- * **givenName**: prise en charge. Stockée dans le champ **firstName** BlackBerry.
-
- * **middleName**: ne pas pris en charge, retour`null`.
-
- * **honorificPrefix**: ne pas pris en charge, retour`null`.
-
- * **honorificSuffix**: ne pas pris en charge, retour`null`.
-
-### Bizarreries de FirefoxOS
-
- * **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
-
-### Notes au sujet d'iOS
-
- * **au format**: partiellement pris en charge. Retourne la dénomination composée d'iOS, mais est en lecture seule.
-
-### Bizarreries de Windows 8
-
- * **au format**: c'est le seul nom de propriété et est identique à `displayName` , et`nickname`
-
- * **familyName**: non pris en charge
-
- * **givenName**: non pris en charge
-
- * **middleName**: non pris en charge
-
- * **honorificPrefix**: non pris en charge
-
- * **honorificSuffix**: non pris en charge
-
-### Bizarreries de Windows
-
- * **mise en forme**: il est identique à`displayName`
-
-## ContactOrganization
-
-Le `ContactOrganization` objet Stocke des propriétés un contact de l'organisation. A `Contact` objet contient un ou plusieurs `ContactOrganization` des objets dans un tableau.
-
-### Propriétés
-
- * **pref**: la valeur `true` si ce `ContactOrganization` contient la valeur de préférence de l'utilisateur. *(booléen)*
-
- * **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. _(DOMString)
-
- * **nom**: le nom de l'organisation. *(DOMString)*
-
- * **Département**: le département et le contrat de travaille pour. *(DOMString)*
-
- * **titre**: titre du contact auprès de l'organisation. *(DOMString)*
-
-### Plates-formes supportées
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows (Windows 8.1 et Windows Phone 8.1 dispositifs seulement)
-
-### Exemple
-
- function onSuccess(contacts) {pour (var j'ai = 0; j'ai < contacts.length; i ++) {pour (var j = 0; j < contacts[i].organizations.length; j ++) {alert ("Pref:" + contacts[i].organizations[j].pref + « \n » + "Type:" + contacts[i].organizations[j].type + « \n » + "nom:" + contacts[i].organizations[j].name + « \n » + "Département:" + contacts[i].organizations[j].department + « \n » + "Title: "+ contacts[i].organizations[j].title) ;
- }
- }
- };
-
- function onError(contactError) {alert('onError!');} ;
-
- options de var = new ContactFindOptions() ;
- options.Filter = "" ;
- filtre = ["displayName", « organisations »] ;
- Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
-
-
-### Android 2.X Quirks
-
- * **pref**: ne pas pris en charge par des dispositifs Android 2.X, retour`false`.
-
-### BlackBerry 10 Quirks
-
- * **pref**: ne pas pris en charge par les appareils BlackBerry, retour`false`.
-
- * **type**: ne pas pris en charge par les appareils BlackBerry, retour`null`.
-
- * **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ **company** de BlackBerry.
-
- * **Département**: ne pas pris en charge, retour`null`.
-
- * **titre**: partiellement pris en charge. Le premier titre de l'organisation est stocké dans le champ de **jobTitle** BlackBerry.
-
-### Firefox OS Quirks
-
- * **pref**: non pris en charge
-
- * **type**: non pris en charge
-
- * **Département**: non pris en charge
-
- * Les champs **nom** et **titre** stocké dans **org** et **jobTitle**.
-
-### Notes au sujet d'iOS
-
- * **pref**: non pris en charge sur les appareils iOS, retour`false`.
-
- * **type**: non pris en charge sur les appareils iOS, retour`null`.
-
- * **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ de **kABPersonOrganizationProperty** iOS.
-
- * **Département**: partiellement pris en charge. Le premier nom de département est stocké dans le champ de **kABPersonDepartmentProperty** iOS.
-
- * **titre**: partiellement pris en charge. Le premier titre est stocké dans le champ de **kABPersonJobTitleProperty** iOS.
-
-### Bizarreries de Windows
-
- * **pref**: ne pas pris en charge, retour`false`.
-
- * **type**: ne pas pris en charge, retour`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/fr/index.md b/plugins/cordova-plugin-contacts/doc/fr/index.md
deleted file mode 100644
index ba2fb47..0000000
--- a/plugins/cordova-plugin-contacts/doc/fr/index.md
+++ /dev/null
@@ -1,652 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-Ce plugin définit un global `navigator.contacts` objet, ce qui permet d'accéder à la base de données de contacts de dispositif.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.contacts);}
-
-
-**Avertissement**: collecte et utilisation des données de contact soulève des questions importantes de la vie privée. Politique de confidentialité de votre application doit examiner comment l'application utilise les données de contact et si il est partagé avec d'autres parties. Information de contact est considéré comme sensible parce qu'il révèle les gens avec lesquels une personne communique. Par conséquent, en plus de la politique de confidentialité de l'application, vous devez envisager fortement fournissant un avis juste-à-temps, avant que l'application accède ou utilise des données de contact, si le système d'exploitation de périphérique ne fait donc pas déjà. Cet avis doit fournir les mêmes renseignements susmentionnées, ainsi que d'obtenir l'autorisation de l'utilisateur (par exemple, en présentant des choix **OK** et **Non merci**). Notez que certains marchés app peuvent exiger l'application de fournir un avis juste-à-temps et obtenir la permission de l'utilisateur avant d'accéder à des données de contact. Une expérience utilisateur claire et facile à comprendre qui entourent l'utilisation de données permettent d'éviter la confusion des utilisateurs de contact et une utilisation jugée abusive des données de contact. Pour plus d'informations, consultez le Guide de la vie privée.
-
-## Installation
-
- Cordova plugin ajouter cordova-plugin-contacts
-
-
-### Firefox OS Quirks
-
-Créez **www/manifest.webapp** comme décrit dans [Les Docs manifeste][1]. Ajouter permisions pertinentes. Il est également nécessaire de changer le type d'application Web de « privilégiés » - [Docs manifeste][2]. **Avertissement**: toutes les applications privilégiées appliquer [Contenu politique de sécurité][3] qui interdit à un script inline. Initialiser votre application d'une autre manière.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- « type »: "le privilège", "autorisations": {« contacts »: {« accès »: "readwrite", "description": "décrire pourquoi il est nécessaire pour obtenir cette permission"}}
-
-
-### Bizarreries de Windows
-
-Contacts éventuellement retournés par `find` et `pickContact` méthodes sont en lecture seule, afin que votre application ne puisse les modifier. `find`méthode disponible uniquement sur les appareils Windows Phone 8.1.
-
-### Bizarreries de Windows 8
-
-Windows 8 Contacts sont en lecture seule. Via les Contacts d'API Cordova ne sont pas queryable/consultables, vous devez en informer l'utilisateur de choisir un contact comme un appel à contacts.pickContact qui va ouvrir l'application « People » où l'utilisateur doit choisir un contact. Les contacts retournés sont en lecture seule, afin que votre application ne puisse les modifier.
-
-## Navigator.contacts
-
-### Méthodes
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### Objets
-
-* Contact
-* ContactName
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## Navigator.contacts.Create
-
-La `navigator.contacts.create` méthode est synchrone et retourne un nouveau `Contact` objet.
-
-Cette méthode ne conserve pas l'objet de Contact dans la base de données des contacts périphériques, dont vous avez besoin d'appeler le `Contact.save` méthode.
-
-### Plates-formes prises en charge
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-
-### Exemple
-
- myContact var = navigator.contacts.create ({« displayName »: « Test User »}) ;
-
-
-## navigator.contacts.find
-
-La `navigator.contacts.find` méthode s'exécute de façon asynchrone, l'interrogation de la base de données de contacts de dispositif et retourne un tableau de `Contact` objets. Les objets résultants sont passés à la `contactSuccess` la fonction de rappel spécifiée par le paramètre **contactSuccess** .
-
-Le paramètre **contactFields** spécifie les champs à utiliser comme un qualificateur de recherche. Un paramètre de longueur nulle **contactFields** n'est pas valide et se traduit par `ContactError.INVALID_ARGUMENT_ERROR` . Une valeur de **contactFields** de `"*"` recherche dans les champs de tout contact.
-
-La chaîne **contactFindOptions.filter** peut servir comme un filtre de recherche lors de l'interrogation de la base de données de contacts. Si fourni, un non-respect de la casse, correspondance de valeur partielle est appliquée à chaque champ spécifié dans le paramètre **contactFields** . S'il y a une correspondance pour *n'importe quel* des champs spécifiés, le contact est retourné. Utilisation **contactFindOptions.desiredFields** paramètre de contrôle qui contacter propriétés doit être retourné au retour.
-
-### Paramètres
-
-* **contactFields**: communiquer avec les champs à utiliser comme un qualificateur de recherche. *(DOMString[])* [Required]
-
-* **contactSuccess**: fonction de rappel de succès avec le tableau d'objets Contact appelée retournée par la base de données. [Required]
-
-* **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Optional]
-
-* **contactFindOptions**: recherche d'options pour filtrer navigator.contacts. [Optional]
-
- Clés incluent :
-
- * **filtre**: la chaîne de recherche utilisée pour trouver navigator.contacts. *(DOMString)* (Par défaut :`""`)
-
- * **multiples**: détermine si l'opération find retourne plusieurs navigator.contacts. *(Booléen)* (Par défaut :`false`)
-
- * **desiredFields**: Contactez champs soit retourné en arrière. Si spécifié, l'entraînant `Contact` objet dispose seulement des valeurs de ces champs. *(DOMString[])* [Optional]
-
-### Plates-formes prises en charge
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows (Windows Phone 8.1 dispositifs seulement)
-
-### Exemple
-
- function onSuccess(contacts) {alert (« Found » + contacts.length + « contacts. »);} ;
-
- function onError(contactError) {alert('onError!');} ;
-
- trouver tous les contacts avec « Bob » dans toute option de var de champ nom = new ContactFindOptions() ;
- options.Filter = « Bob » ;
- options.multiple = true ;
- options.desiredFields = [navigator.contacts.fieldType.id] ;
- champs var = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name] ;
- Navigator.contacts.Find (champs, onSuccess, onError, options) ;
-
-
-### Bizarreries de Windows
-
-* `__contactFields__`n'est pas prise en charge et sera ignorée. `find`méthode toujours tenter de faire correspondre le nom, adresse e-mail ou numéro de téléphone d'un contact.
-
-## navigator.contacts.pickContact
-
-La `navigator.contacts.pickContact` méthode lance le sélecteur de Contact pour sélectionner un contact unique. L'objet qui en résulte est passé à la `contactSuccess` la fonction de rappel spécifiée par le paramètre **contactSuccess** .
-
-### Paramètres
-
-* **contactSuccess**: fonction de rappel de succès appelée avec l'objet de Contact unique. [Obligatoire]
-
-* **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Facultatif]
-
-### Plates-formes prises en charge
-
-* Android
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### Exemple
-
- navigator.contacts.pickContact(function(contact) {console.log ("le contact suivant a été retenu:" + JSON.stringify(contact)) ;
- }, function(err) {console.log ("Error:" + err) ;
- });
-
-
-## Contact
-
-Le `Contact` objet représente le contact de l'utilisateur. Contacts peuvent être créés, conservés ou supprimés de la base de données de contacts de dispositif. Contacts peuvent également être récupérées (individuellement ou en vrac) de la base de données en appelant le `navigator.contacts.find` méthode.
-
-**NOTE**: tous les champs de contact susmentionnés ne sont pris en charge sur chaque plate-forme de périphérique. S'il vous plaît vérifier la section *bizarreries* de chaque plate-forme pour plus de détails.
-
-### Propriétés
-
-* **ID**: un identificateur global unique. *(DOMString)*
-
-* **displayName**: le nom de ce Contact, approprié pour l'affichage à l'utilisateur final. *(DOMString)*
-
-* **nom**: un objet contenant tous les composants d'un nom de personnes. *(ContactName)*
-
-* **Pseudo**: un nom occasionnel permettant de régler le contact. *(DOMString)*
-
-* **phoneNumbers**: un tableau des numéros de téléphone du contact. *(ContactField[])*
-
-* **courriels**: un tableau d'adresses de courriel du contact. *(ContactField[])*
-
-* **adresses**: un tableau d'adresses tous les contacts. *(ContactAddress[])*
-
-* **IMS**: un tableau d'adresses IM tout le contact. *(ContactField[])*
-
-* **organisations**: un tableau des organisations de tout le contact. *(ContactOrganization[])*
-
-* **anniversaire**: l'anniversaire du contact. *(Date)*
-
-* **Remarque**: une remarque sur le contact. *(DOMString)*
-
-* **photos**: un tableau de photos du contact. *(ContactField[])*
-
-* **catégories**: un tableau de toutes les catégories définies par l'utilisateur attribuée au contact. *(ContactField[])*
-
-* **URL**: un tableau des pages web attribuée au contact. *(ContactField[])*
-
-### Méthodes
-
-* **Clone**: retourne un nouveau `Contact` objet qui est une copie complète de l'objet appelant, avec le `id` propriété la valeur`null`.
-
-* **supprimer**: supprime le contact de la base de données de contacts de dispositif, sinon exécute un rappel d'erreur avec un `ContactError` objet.
-
-* **Enregistrer**: enregistre un nouveau contact dans la base de données de contacts de périphérique, ou met à jour un contact existant, si un contact avec le même **id** existe déjà.
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Enregistrez l'exemple
-
- function onSuccess(contact) {alert ("sauver succès");} ;
-
- function onError(contactError) {alert ("erreur =" + contactError.code);} ;
-
- créer un objet contact contact var = navigator.contacts.create() ;
- contact.displayName = « Plombier » ;
- contact.Nickname = « Plombier » ; spécifier à la fois pour prendre en charge tous les périphériques / / renseigner certains champs var nom = new ContactName() ;
- name.givenName = « Jane » ;
- name.familyName = « Doe » ;
- contact.name = nom ;
-
- enregistrer dans contact.save(onSuccess,onError) de l'appareil ;
-
-
-### Exemple de clone
-
- Clone clone objet contact var = contact.clone() ;
- clone.name.givenName = « John » ;
- Console.log ("contact Original nom =" + contact.name.givenName) ;
- Console.log ("nom de contact clonés =" + clone.name.givenName) ;
-
-
-### Supprimer l'exemple
-
- fonction onSuccess() {alert ("succès");} ;
-
- function onError(contactError) {alert ("erreur =" + contactError.code);} ;
-
- supprimer le contact de l'appareil contact.remove(onSuccess,onError) ;
-
-
-### Android 2.X Quirks
-
-* **catégories**: non pris en charge sur les périphériques Android 2.X, retour`null`.
-
-### BlackBerry 10 Quirks
-
-* **ID**: assignés par l'appareil lors de l'enregistrement du contact.
-
-### Bizarreries de FirefoxOS
-
-* **catégories**: partiellement pris en charge. Champs **pref** et **type** sont de retour`null`
-
-* **IMS**: non pris en charge
-
-* **photos**: ne pas pris en charge
-
-### iOS Quirks
-
-* **displayName**: ne pas possible sur iOS, retour `null` à moins qu'il n'y a aucun `ContactName` spécifié, auquel cas, il renvoie le nom composite, **Pseudo** ou `""` , respectivement.
-
-* **anniversaire**: doit être entré comme un JavaScript `Date` objet, de la même façon qu'il soit retourné.
-
-* **photos**: retourne une URL de fichier de l'image, qui est stocké dans le répertoire temporaire de l'application. Contenu du répertoire temporaire est supprimés lorsque l'application se ferme.
-
-* **catégories**: cette propriété n'est actuellement pas supportée, retour`null`.
-
-### Windows Phone 7 et 8 Quirks
-
-* **displayName**: lorsque vous créez un contact, la valeur fournie pour le paramètre de nom d'affichage est différent de l'affichage nom Récupérée lors de la recherche du contact.
-
-* **URL**: lorsque vous créez un contact, les utilisateurs peuvent entrer et enregistrer plus d'une adresse web, mais seulement un est disponible lors de la recherche du contact.
-
-* **phoneNumbers**: l'option de *pref* n'est pas pris en charge. Le *type* n'est pas pris en charge lors d'une opération de *trouver* . Seul `phoneNumber` est autorisé pour chaque *type*.
-
-* **courriels**: l'option de *pref* n'est pas pris en charge. Accueil et personnels références même courriel entrée. Une seule participation est autorisée pour chaque *type*.
-
-* **adresses**: prend en charge seulement travail et accueil/personal *type*. La maison et personnels de *type* référence la même entrée d'adresse. Une seule participation est autorisée pour chaque *type*.
-
-* **organisations**: seul est autorisé et ne supporte pas les attributs *pref*, *type*et *Département* .
-
-* **Remarque**: ne pas pris en charge, retour`null`.
-
-* **IMS**: ne pas pris en charge, retour`null`.
-
-* **anniversaires**: ne pas pris en charge, retour`null`.
-
-* **catégories**: ne pas pris en charge, retour`null`.
-
-### Bizarreries de Windows
-
-* **photos**: retourne une URL de fichier de l'image, qui est stocké dans le répertoire temporaire de l'application.
-
-* **anniversaires**: ne pas pris en charge, retour`null`.
-
-* **catégories**: ne pas pris en charge, retour`null`.
-
-## ContactAddress
-
-Le `ContactAddress` objet Stocke les propriétés d'une seule adresse d'un contact. A `Contact` objet peut inclure plusieurs adresses dans un `ContactAddress[]` tableau.
-
-### Propriétés
-
-* **pref**: la valeur `true` si ce `ContactAddress` contient la valeur de préférence de l'utilisateur. *(booléen)*
-
-* **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
-
-* **mise en forme**: l'adresse complète au format pour l'affichage. *(DOMString)*
-
-* **adresse**: l'adresse complète. *(DOMString)*
-
-* **localité**: la ville ou la localité. *(DOMString)*
-
-* **région**: l'État ou la région. *(DOMString)*
-
-* **Code postal**: le code zip ou code postal. *(DOMString)*
-
-* **pays**: le nom du pays. *(DOMString)*
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Exemple
-
- Affichez les informations d'adresse pour tous les contacts fonctionnent onSuccess(contacts) {pour (var j'ai = 0; j'ai < contacts.length; i ++) {pour (var j = 0; j < contacts[i].addresses.length; j ++) {alert ("Pref:" + contacts[i].addresses[j].pref + « \n » + "Type:" + contacts[i].addresses[j].type + « \n » + "au format:" + contacts[i].addresses[j].formatted + « \n » + "adresse de rue: "+ contacts[i].addresses[j].streetAddress +"\n"+" localité: "+ contacts[i].addresses[j].locality +"\n"+" région: "+ contacts[i].addresses[j].region +"\n"+" Code Postal: "+ contacts[i].addresses[j].postalCode +"\n"+" pays: "+ contacts[i].addresses[j].country) ;
- }
- }
- };
-
- function onError(contactError) {alert('onError!');} ;
-
- trouver tous les contacts options var = new ContactFindOptions() ;
- options.Filter = "" ;
- filtre var = ["name", « adresses »] ;
- Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
-
-
-### Android 2.X Quirks
-
-* **pref**: ne pas pris en charge, retour `false` sur les appareils Android 2.X.
-
-### BlackBerry 10 Quirks
-
-* **pref**: non pris en charge sur les appareils BlackBerry, retour`false`.
-
-* **type**: partiellement pris en charge. Seule chaque de *travail* et tapez les adresses de *la maison* peut être stockée par contact.
-
-* **au format**: partiellement pris en charge. Retourne la concaténation de tous les champs d'adresse BlackBerry.
-
-* **streetAddress**: prise en charge. Retourne la concaténation de BlackBerry **address1** et **address2** champs d'adresse.
-
-* **localité**: prise en charge. Stockée dans le champ d'adresse BlackBerry **ville** .
-
-* **région**: pris en charge. Stockée dans le champ d'adresse BlackBerry **stateProvince** .
-
-* **Code postal**: prise en charge. Stockée dans le champ d'adresse BlackBerry **zipPostal** .
-
-* **pays**: prise en charge.
-
-### Bizarreries de FirefoxOS
-
-* **au format**: actuellement ne pas pris en charge
-
-### iOS Quirks
-
-* **pref**: non pris en charge sur les appareils iOS, retour`false`.
-
-* **au format**: actuellement ne pas pris en charge.
-
-### Bizarreries de Windows 8
-
-* **pref**: non pris en charge
-
-### Bizarreries de Windows
-
-* **pref**: non pris en charge
-
-## ContactError
-
-Le `ContactError` objet est retourné à l'utilisateur via le `contactError` fonction de rappel lorsqu'une erreur survient.
-
-### Propriétés
-
-* **code**: l'un des codes d'erreur prédéfinis énumérés ci-dessous.
-
-### Constantes
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Le `ContactField` objet est un composant réutilisable que représente contacter champs génériquement. Chaque `ContactField` objet contient un `value` , `type` , et `pref` propriété. A `Contact` objet stocke plusieurs propriétés dans `ContactField[]` tableaux, tels que téléphone numéros et adresses e-mail.
-
-Dans la plupart des cas, il n'y a pas de valeurs prédéterminées pour une `ContactField` l'attribut **type** de l'objet. Par exemple, un numéro de téléphone peut spécifier des valeurs de **type** de la *maison*, *travail*, *mobile*, *iPhone*ou toute autre valeur qui est pris en charge par la base de contacts de la plate-forme un périphérique particulier. Toutefois, pour les `Contact` **photos** champ, le champ **type** indique le format de l'image retournée : **url** lorsque l'attribut **value** contient une URL vers l'image photo ou *base64* lorsque la **valeur** contient une chaîne codée en base64 image.
-
-### Propriétés
-
-* **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
-
-* **valeur**: la valeur du champ, comme un téléphone numéro ou adresse e-mail. *(DOMString)*
-
-* **pref**: la valeur `true` si ce `ContactField` contient la valeur de préférence de l'utilisateur. *(booléen)*
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Exemple
-
- créer un nouveau contact contact var = navigator.contacts.create() ;
-
- stocker des numéros de téléphone de contact en ContactField [] var phoneNumbers = [] ;
- phoneNumbers[0] = new ContactField (« travail », ' 212-555-1234', false) ;
- phoneNumbers[1] = new ContactField (« mobile », ' 917-555-5432', true) ; phoneNumbers[2] numéro préféré = new ContactField (« home », ' 203-555-7890', false) ;
- contact.phoneNumbers = phoneNumbers ;
-
- enregistrer le contact contact.save() ;
-
-
-### Quirks Android
-
-* **pref**: ne pas pris en charge, retour`false`.
-
-### BlackBerry 10 Quirks
-
-* **type**: partiellement pris en charge. Utilisé pour les numéros de téléphone.
-
-* **valeur**: prise en charge.
-
-* **pref**: ne pas pris en charge, retour`false`.
-
-### iOS Quirks
-
-* **pref**: ne pas pris en charge, retour`false`.
-
-### Quirks Windows8
-
-* **pref**: ne pas pris en charge, retour`false`.
-
-### Bizarreries de Windows
-
-* **pref**: ne pas pris en charge, retour`false`.
-
-## ContactName
-
-Contient différents types d'informations sur un `Contact` nom de l'objet.
-
-### Propriétés
-
-* **mise en forme**: le nom complet du contact. *(DOMString)*
-
-* **familyName**: nom de famille du contact. *(DOMString)*
-
-* **givenName**: prénom du contact. *(DOMString)*
-
-* **middleName**: deuxième prénom du contact. *(DOMString)*
-
-* **honorificPrefix**: préfixe du contact (exemple *M.* ou *Mme*) *(DOMString)*
-
-* **honorificSuffix**: suffixe du contact (exemple *Esq.*). *(DOMString)*
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Exemple
-
- function onSuccess(contacts) {pour (var j'ai = 0; j'ai < contacts.length; i ++) {alert ("Formatted:" + contacts[i].name.formatted + « \n » + "patronyme:" + contacts[i].name.familyName + « \n » + "Prénom:" + contacts[i].name.givenName + « \n » + "Prénom:" + contacts[i].name.middleName + « \n » + "suffixe:" + contacts[i].name.honorificSuffix + « \n » + "préfixe:" + contacts[i].name.honorificSuffix) ;
- }
- };
-
- function onError(contactError) {alert('onError!');} ;
-
- options de var = new ContactFindOptions() ;
- options.Filter = "" ;
- filtre = ["name", « nom »] ;
- Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
-
-
-### Quirks Android
-
-* **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
-
-### BlackBerry 10 Quirks
-
-* **au format**: partiellement pris en charge. Retourne la concaténation de champs **firstName** et **lastName** de BlackBerry.
-
-* **familyName**: prise en charge. Stockée dans le champ **lastName** BlackBerry.
-
-* **givenName**: prise en charge. Stockée dans le champ **firstName** BlackBerry.
-
-* **middleName**: ne pas pris en charge, retour`null`.
-
-* **honorificPrefix**: ne pas pris en charge, retour`null`.
-
-* **honorificSuffix**: ne pas pris en charge, retour`null`.
-
-### Bizarreries de FirefoxOS
-
-* **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
-
-### iOS Quirks
-
-* **au format**: partiellement pris en charge. Retourne la dénomination composée d'iOS, mais est en lecture seule.
-
-### Bizarreries de Windows 8
-
-* **au format**: c'est le seul nom de propriété et est identique à `displayName` , et`nickname`
-
-* **familyName**: non pris en charge
-
-* **givenName**: non pris en charge
-
-* **middleName**: non pris en charge
-
-* **honorificPrefix**: non pris en charge
-
-* **honorificSuffix**: non pris en charge
-
-### Bizarreries de Windows
-
-* **mise en forme**: il est identique à`displayName`
-
-## ContactOrganization
-
-Le `ContactOrganization` objet Stocke des propriétés un contact de l'organisation. A `Contact` objet contient un ou plusieurs `ContactOrganization` des objets dans un tableau.
-
-### Propriétés
-
-* **pref**: la valeur `true` si ce `ContactOrganization` contient la valeur de préférence de l'utilisateur. *(booléen)*
-
-* **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. _(DOMString)
-
-* **nom**: le nom de l'organisation. *(DOMString)*
-
-* **Département**: le département et le contrat de travaille pour. *(DOMString)*
-
-* **titre**: titre du contact auprès de l'organisation. *(DOMString)*
-
-### Plates-formes prises en charge
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows (Windows 8.1 et Windows Phone 8.1 dispositifs seulement)
-
-### Exemple
-
- function onSuccess(contacts) {pour (var j'ai = 0; j'ai < contacts.length; i ++) {pour (var j = 0; j < contacts[i].organizations.length; j ++) {alert ("Pref:" + contacts[i].organizations[j].pref + « \n » + "Type:" + contacts[i].organizations[j].type + « \n » + "nom:" + contacts[i].organizations[j].name + « \n » + "Département:" + contacts[i].organizations[j].department + « \n » + "Title: "+ contacts[i].organizations[j].title) ;
- }
- }
- };
-
- function onError(contactError) {alert('onError!');} ;
-
- options de var = new ContactFindOptions() ;
- options.Filter = "" ;
- filtre = ["displayName", « organisations »] ;
- Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
-
-
-### Android 2.X Quirks
-
-* **pref**: ne pas pris en charge par des dispositifs Android 2.X, retour`false`.
-
-### BlackBerry 10 Quirks
-
-* **pref**: ne pas pris en charge par les appareils BlackBerry, retour`false`.
-
-* **type**: ne pas pris en charge par les appareils BlackBerry, retour`null`.
-
-* **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ **company** de BlackBerry.
-
-* **Département**: ne pas pris en charge, retour`null`.
-
-* **titre**: partiellement pris en charge. Le premier titre de l'organisation est stocké dans le champ de **jobTitle** BlackBerry.
-
-### Firefox OS Quirks
-
-* **pref**: non pris en charge
-
-* **type**: non pris en charge
-
-* **Département**: non pris en charge
-
-* Les champs **nom** et **titre** stocké dans **org** et **jobTitle**.
-
-### iOS Quirks
-
-* **pref**: non pris en charge sur les appareils iOS, retour`false`.
-
-* **type**: non pris en charge sur les appareils iOS, retour`null`.
-
-* **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ de **kABPersonOrganizationProperty** iOS.
-
-* **Département**: partiellement pris en charge. Le premier nom de département est stocké dans le champ de **kABPersonDepartmentProperty** iOS.
-
-* **titre**: partiellement pris en charge. Le premier titre est stocké dans le champ de **kABPersonJobTitleProperty** iOS.
-
-### Bizarreries de Windows
-
-* **pref**: ne pas pris en charge, retour`false`.
-
-* **type**: ne pas pris en charge, retour`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/it/README.md b/plugins/cordova-plugin-contacts/doc/it/README.md
deleted file mode 100644
index 53197b4..0000000
--- a/plugins/cordova-plugin-contacts/doc/it/README.md
+++ /dev/null
@@ -1,735 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-Questo plugin definisce un oggetto globale `navigator.contacts`, che fornisce l'accesso al database di contatti del dispositivo.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**Avviso**: raccolta e utilizzo dei dati di contatto solleva questioni di privacy importante. Politica sulla privacy dell'app dovrebbe discutere come app utilizza i dati di contatto e se è condiviso con altre parti. Informazioni di contatto sono considerate sensibile perché rivela le persone con cui una persona comunica. Pertanto, oltre alla politica di privacy dell'app, è fortemente consigliabile fornendo un preavviso di just-in-time prima app accede o utilizza i dati di contatto, se il sistema operativo del dispositivo non farlo già. Tale comunicazione deve fornire le informazioni stesse notate sopra, oltre ad ottenere l'autorizzazione (ad esempio, presentando scelte per **OK** e **No grazie**). Si noti che alcuni mercati app possono richiedere l'app per fornire un preavviso di just-in-time e ottenere l'autorizzazione dell'utente prima di accedere ai dati di contatto. Un'esperienza utente chiara e facile--capisce che circonda l'uso del contatto dati aiuta a evitare la confusione dell'utente e percepito un uso improprio dei dati di contatto. Per ulteriori informazioni, vedere la guida sulla Privacy.
-
-## Installazione
-
-Ciò richiede cordova 5.0 + (v 1.0.0 stabile corrente)
-
- cordova plugin add cordova-plugin-contacts
-
-
-Versioni precedenti di cordova comunque possono installare tramite l'id **deprecato** (stantio v0.2.16)
-
- cordova plugin add org.apache.cordova.contacts
-
-
-È anche possibile installare direttamente tramite url di repo (instabile)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS stranezze
-
-Creare **www/manifest.webapp** come descritto nel [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). Aggiungi permisions rilevanti. C'è anche la necessità di modificare il tipo di webapp in "privilegiato" - [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type). **AVVERTENZA**: tutte le apps privilegiato applicare [Content Security Policy](https://developer.mozilla.org/en-US/Apps/CSP) che vieta script inline. Inizializzare l'applicazione in un altro modo.
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Stranezze di Windows
-
-**Prima del Windows 10:** Eventuali contatti restituiti dai metodi `trovare` e `pickContact` sono readonly, quindi l'applicazione non può modificarli. Metodo `find` disponibile solo sui dispositivi Windows Phone 8.1.
-
-**Windows 10 e sopra:** Contatti possono essere salvati e deposito di app locale contatti verranno salvate. Contatti possono anche essere eliminati.
-
-### Stranezze di Windows 8
-
-Windows 8 contatti sono readonly. Tramite i contatti di Cordova API non sono queryable/ricerche, si dovrebbe informare l'utente di scegliere un contatto come una chiamata a contacts.pickContact che aprirà l'app 'Persone' dove l'utente deve scegliere un contatto. Eventuali contatti restituiti sono readonly, quindi l'applicazione non può modificarli.
-
-## Navigator.contacts
-
-### Metodi
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### Oggetti
-
- * Contact
- * ContactName
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-Il metodo `navigator.contacts.create` è sincrono e restituisce un nuovo oggetto di `Contact`.
-
-Questo metodo non mantiene l'oggetto contatto nel database contatti dispositivo, per cui è necessario richiamare il metodo `Contact.save`.
-
-### Piattaforme supportate
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
-
-### Esempio
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Il metodo `navigator.contacts.find` in modo asincrono, esegue una query sul database di contatti del dispositivo e restituisce una matrice di oggetti `Contact`. Gli oggetti risultanti vengono passati alla funzione di callback `contactSuccess` specificata dal parametro **contactSuccess**.
-
-Il parametro **contactFields** specifica i campi per essere utilizzato come un qualificatore di ricerca. Un parametro di lunghezza zero, **contactFields** non è valido e si traduce in `ContactError.INVALID_ARGUMENT_ERROR`. Un valore di **contactFields** di `"*"` ricerche campi tutti i contatti.
-
-La stringa di **contactFindOptions.filter** può essere utilizzata come un filtro di ricerca quando una query sul database di contatti. Se fornito, una distinzione, corrispondenza parziale valore viene applicato a ogni campo specificato nel parametro **contactFields**. Se esiste una corrispondenza per *qualsiasi* dei campi specificati, viene restituito il contatto. Uso **contactFindOptions.desiredFields** parametro di controllo quale contattare la proprietà deve essere rispedito indietro.
-
-### Parametri
-
- * **contactFields**: contattare campi da utilizzare come un qualificatore di ricerca. *(DOMString[])* [Required]
-
- * **contactSuccess**: funzione di callback successo richiamato con la matrice di oggetti contatto restituiti dal database. [Required]
-
- * **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
-
- * **contactFindOptions**: opzioni per filtrare navigator.contacts di ricerca. [Optional]
-
- I tasti sono:
-
- * **filter**: la stringa di ricerca utilizzata per trovare navigator.contacts. *(DOMString)* (Default: `""`)
-
- * **multiple**: determina se l'operazione di ricerca restituisce più navigator.contacts. *(Boolean)* (Default: `false`)
-
- * **desiredFields**: contattare i campi per essere tornato indietro. Se specificato, il risultante `contatto` oggetto solo caratteristiche valori per questi campi. *(DOMString[])* [Optional]
-
-### Piattaforme supportate
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows (Windows Phone 8.1 e Windows 10)
-
-### Esempio
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Stranezze di Windows
-
- * `__contactFields__`non è supportato, verrà ignorato. `find`metodo cercherà sempre di abbinare il nome, indirizzo email o numero di telefono di un contatto.
-
-## navigator.contacts.pickContact
-
-Il metodo `navigator.contacts.pickContact` lancia il contatto selettore per selezionare un singolo contatto. L'oggetto risultante viene passato alla funzione di callback `contactSuccess` specificata dal parametro **contactSuccess**.
-
-### Parametri
-
- * **contactSuccess**: funzione di callback di successo viene richiamato con il singolo oggetto di contatto. [Richiesto]
-
- * **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
-
-### Piattaforme supportate
-
- * Android
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### Esempio
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Contact
-
-L'oggetto `Contact` rappresenta il contatto di un utente. Contatti possono essere creati, memorizzati o rimossi dal database di contatti dispositivo. Contatti possono anche essere estratto (singolarmente o in blocco) dal database richiamando il metodo `navigator.contacts.find`.
-
-**Nota**: non tutti i campi di contatto sopra elencati sono supportati su ogni piattaforma del dispositivo. Consultare la sezione di *stranezze* su ogni piattaforma per dettagli.
-
-### Proprietà
-
- * **ID**: un identificatore univoco globale. *(DOMString)*
-
- * **displayName**: il nome di questo contatto, adatto per la visualizzazione a utenti finali. *(DOMString)*
-
- * **nome**: un oggetto che contiene tutti i componenti di un nome di persone. *(ContactName)*
-
- * **Nickname**: un nome informale con cui affrontare il contatto. *(DOMString)*
-
- * **phoneNumbers**: una matrice di numeri di telefono del contatto. *(ContactField[])*
-
- * **email**: una matrice di indirizzi di posta elettronica del contatto. *(ContactField[])*
-
- * **indirizzi**: una matrice di indirizzi di contatto. *(ContactAddress[])*
-
- * **IMS**: una matrice di indirizzi IM tutto il contatto. *(ContactField[])*
-
- * **organizzazioni**: una matrice di organizzazioni di tutto il contatto. *(ContactOrganization[])*
-
- * **compleanno**: il compleanno del contatto. *(Data)*
-
- * **Nota**: una nota sul contatto. *(DOMString)*
-
- * **foto**: una matrice di foto del contatto. *(ContactField[])*
-
- * **categorie**: matrice di tutte le categorie definite dall'utente connesso con il contatto. *(ContactField[])*
-
- * **URL**: matrice di pagine web connesso con il contatto. *(ContactField[])*
-
-### Metodi
-
- * **clone**: restituisce una nuova `Contact` oggetto che è una copia completa dell'oggetto chiamante, con la `id` proprietà impostata`null`.
-
- * **rimuovere**: rimuove il contatto dal database contatti dispositivo, altrimenti esegue un callback di errore con un `ContactError` oggetto.
-
- * **Salva**: salva un nuovo contatto nel database di contatti del dispositivo, o aggiorna un contatto esistente se esiste già un contatto con lo stesso **id** .
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Esempio di salvare
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Esempio di clone
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Rimuovere esempio
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Stranezze di Android 2. x
-
- * **categorie**: non è supportato sui dispositivi Android 2. x, restituendo`null`.
-
-### BlackBerry 10 capricci
-
- * **ID**: assegnate dal dispositivo quando si salva il contatto.
-
-### Capricci di FirefoxOS
-
- * **categorie**: parzialmente supportati. Campi **pref** e **tipo** stanno tornando`null`
-
- * **IMS**: non supportato
-
- * **foto**: non supportato
-
-### iOS stranezze
-
- * **displayName**: non supportata su iOS, tornando `null` se non c'è nessun `ContactName` specificato, nel qual caso restituisce il nome composito, **soprannome** o `""` , rispettivamente.
-
- * **compleanno**: deve essere inserito come un JavaScript `Date` oggetto, allo stesso modo viene restituito.
-
- * **foto**: restituisce un URL del File dell'immagine, che viene memorizzato nella directory temporanea dell'applicazione. Contenuto della directory temporanea vengono rimossi quando l'applicazione termina.
-
- * **categorie**: questa proprietà non è attualmente supportata, restituendo`null`.
-
-### Windows Phone 7 e 8 stranezze
-
- * **displayName**: quando si crea un contatto, il valore specificato per il parametro del nome di visualizzazione è diverso dal nome visualizzato Estratto quando trovare il contatto.
-
- * **URL**: quando si crea un contatto, gli utenti possono inserire e salvare più di un indirizzo web, ma solo uno è disponibile durante la ricerca del contatto.
-
- * **phoneNumbers**: non è supportata l'opzione *pref* . Il *tipo* non è supportato in un'operazione di *trovare* . Un solo `phoneNumber` è consentita per ogni *tipo*.
-
- * **email**: non è supportata l'opzione *pref* . Home e personal fa riferimento la stessa voce di posta elettronica. È consentito un solo ingresso per ogni *tipo*.
-
- * **indirizzi**: supporta solo lavoro e casa/personali *tipo*. Il riferimento principale e personale *tipo* la stessa voce di indirizzo. È consentito un solo ingresso per ogni *tipo*.
-
- * **organizzazioni**: solo uno è consentito e non supporta gli attributi *pref*, *tipo*e *dipartimento* .
-
- * **Nota**: non supportato, restituendo`null`.
-
- * **IMS**: non supportato, restituendo`null`.
-
- * **compleanni**: non supportato, restituendo`null`.
-
- * **categorie**: non supportato, restituendo`null`.
-
- * **remove**: metodo non è supportato
-
-### Stranezze di Windows
-
- * **foto**: restituisce un URL del File dell'immagine, che viene memorizzato nella directory temporanea dell'applicazione.
-
- * **compleanni**: non supportato, restituendo`null`.
-
- * **categorie**: non supportato, restituendo`null`.
-
- * **remove**: metodo è supportato solo in Windows 10 o superiore.
-
-## ContactAddress
-
-L'oggetto `ContactAddress` memorizza le proprietà di un singolo indirizzo di un contatto. Un oggetto `Contact` può includere più di un indirizzo in una matrice `[] ContactAddress`.
-
-### Proprietà
-
- * **pref**: impostare su `true` se questo `ContactAddress` contiene il valore dell'utente preferito. *(booleano)*
-
- * **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
-
- * **formattato**: indirizzo completo formattato per la visualizzazione. *(DOMString)*
-
- * **streetAddress**: l'indirizzo completo. *(DOMString)*
-
- * **località**: la città o località. *(DOMString)*
-
- * **regione**: lo stato o la regione. *(DOMString)*
-
- * **postalCode**: il codice postale o il codice postale. *(DOMString)*
-
- * **paese**: il nome del paese. *(DOMString)*
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Esempio
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Stranezze di Android 2. x
-
- * **pref**: non supportato, tornando `false` su dispositivi Android 2. x.
-
-### BlackBerry 10 capricci
-
- * **pref**: non è supportato sui dispositivi BlackBerry, restituendo`false`.
-
- * **tipo**: parzialmente supportati. Solo uno di *lavoro* e *casa* tipo indirizzi può essere memorizzato per ciascun contatto.
-
- * **formattato**: parzialmente supportati. Restituisce una concatenazione di tutti i campi Indirizzo BlackBerry.
-
- * **streetAddress**: supportato. Restituisce una concatenazione di BlackBerry **Indirizzo1** e **Indirizzo2** campi indirizzo.
-
- * **località**: supportato. Memorizzato nel campo indirizzo **città** di BlackBerry.
-
- * **regione**: supportato. Memorizzato nel campo indirizzo di **stateProvince** BlackBerry.
-
- * **postalCode**: supportato. Memorizzato nel campo dell'indirizzo **zipPostal** BlackBerry.
-
- * **paese**: supportato.
-
-### Capricci di FirefoxOS
-
- * **formattato**: attualmente non supportato
-
-### iOS stranezze
-
- * **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
-
- * **formattato**: attualmente non supportati.
-
-### Stranezze di Windows 8
-
- * **pref**: non supportato
-
-### Stranezze di Windows
-
- * **pref**: non supportato
-
-## ContactError
-
-L'oggetto `ContactError` viene restituito all'utente tramite la funzione di callback `contactError` quando si verifica un errore.
-
-### Proprietà
-
- * **codice**: uno dei codici di errore predefiniti elencati di seguito.
-
-### Costanti
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-L'oggetto `ContactField` è un componente riutilizzabile che rappresenta Contatta campi genericamente. Ogni oggetto `ContactField` contiene una proprietà di `value`, `type` e `pref`. Un oggetto `Contact` memorizza diverse proprietà in matrici `[] ContactField`, come numeri di telefono e indirizzi email.
-
-Nella maggior parte dei casi, esistono pre-determinati valori per l'attributo `type` di un oggetto **ContactField**. Ad esempio, un numero di telefono può specificare valori di **type** di *casa*, *lavoro*, *mobile*, *iPhone* o qualsiasi altro valore che è supportato dal database dei contatti su una piattaforma particolare dispositivo. Tuttavia, per il campo di **photo** del `Contacto`, il campo **type** indica il formato dell'immagine restituita: **url** quando il **value** di attributo contiene un URL per l'immagine fotografica, o *base64*, quando il **value** contiene una stringa con codifica base64 immagine.
-
-### Proprietà
-
- * **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
-
- * **valore**: il valore del campo, ad esempio un telefono numero o indirizzo e-mail. *(DOMString)*
-
- * **pref**: impostare su `true` se questo `ContactField` contiene il valore dell'utente preferito. *(booleano)*
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Esempio
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Stranezze Android
-
- * **pref**: non supportato, restituendo`false`.
-
-### BlackBerry 10 capricci
-
- * **tipo**: parzialmente supportati. Usato per i numeri di telefono.
-
- * **valore**: supportato.
-
- * **pref**: non supportato, restituendo`false`.
-
-### iOS stranezze
-
- * **pref**: non supportato, restituendo`false`.
-
-### Stranezze di Windows8
-
- * **pref**: non supportato, restituendo`false`.
-
-### Stranezze di Windows
-
- * **pref**: non supportato, restituendo`false`.
-
-## ContactName
-
-Contiene diversi tipi di informazioni sul nome di un oggetto `Contact`.
-
-### Proprietà
-
- * **formattato**: il nome completo del contatto. *(DOMString)*
-
- * **familyName**: cognome del contatto. *(DOMString)*
-
- * **givenName**: nome del contatto. *(DOMString)*
-
- * **middleName**: il nome del contatto medio. *(DOMString)*
-
- * **honorificPrefix**: prefisso del contatto (esempio *Mr* o *Dr*) *(DOMString)*
-
- * **honorificSuffix**: suffisso del contatto (esempio *Esq.*). *(DOMString)*
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Esempio
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Stranezze Android
-
- * **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
-
-### BlackBerry 10 capricci
-
- * **formattato**: parzialmente supportati. Restituisce una concatenazione di campi **firstName** e **lastName** BlackBerry.
-
- * **familyName**: supportato. Archiviato in campo **lastName** BlackBerry.
-
- * **givenName**: supportato. Archiviato in campo **firstName** BlackBerry.
-
- * **middleName**: non supportato, restituendo`null`.
-
- * **honorificPrefix**: non supportato, restituendo`null`.
-
- * **honorificSuffix**: non supportato, restituendo`null`.
-
-### Capricci di FirefoxOS
-
- * **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
-
-### iOS stranezze
-
- * **formattato**: parzialmente supportati. Restituisce il nome composito di iOS, ma è di sola lettura.
-
-### Stranezze di Windows 8
-
- * **formattato**: questo è l'unico nome proprietà ed è identico a `displayName` , e`nickname`
-
- * **familyName**: non supportato
-
- * **givenName**: non supportato
-
- * **middleName**: non supportato
-
- * **honorificPrefix**: non supportato
-
- * **honorificSuffix**: non supportato
-
-### Stranezze di Windows
-
- * **formattato**: esso è identico al`displayName`
-
-## ContactOrganization
-
-L'oggetto `ContactOrganization` memorizza la proprietà di organizzazione di un contatto. Un oggetto `Contact` memorizza uno o più oggetti `ContactOrganization` in una matrice.
-
-### Proprietà
-
- * **pref**: impostare su `true` se questo `ContactOrganization` contiene il valore dell'utente preferito. *(booleano)*
-
- * **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. _(DOMString)
-
- * **nome**: il nome dell'organizzazione. *(DOMString)*
-
- * **dipartimento**: contratto lavora per il dipartimento. *(DOMString)*
-
- * **titolo**: titolo del contatto presso l'organizzazione. *(DOMString)*
-
-### Piattaforme supportate
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows (solo dispositivi Windows 8.1 e 8.1 di Windows Phone)
-
-### Esempio
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Stranezze di Android 2. x
-
- * **pref**: non supportato dai dispositivi Android 2. x, restituendo`false`.
-
-### BlackBerry 10 capricci
-
- * **pref**: non supportato dai dispositivi BlackBerry, restituendo`false`.
-
- * **tipo**: non supportato dai dispositivi BlackBerry, restituendo`null`.
-
- * **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **azienda** BlackBerry.
-
- * **dipartimento**: non supportato, restituendo`null`.
-
- * **titolo**: parzialmente supportati. Il primo titolo di organizzazione è memorizzato nel campo **jobTitle** BlackBerry.
-
-### Firefox OS stranezze
-
- * **pref**: non supportato
-
- * **tipo**: non supportato
-
- * **dipartimento**: non supportato
-
- * Campi **nome** e **titolo** memorizzato in **org** e **jobTitle**.
-
-### iOS stranezze
-
- * **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
-
- * **tipo**: non è supportato sui dispositivi iOS, restituendo`null`.
-
- * **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **kABPersonOrganizationProperty** iOS.
-
- * **dipartimento**: parzialmente supportati. Il primo nome del dipartimento è memorizzato nel campo **kABPersonDepartmentProperty** iOS.
-
- * **titolo**: parzialmente supportati. Il primo titolo è memorizzato nel campo **kABPersonJobTitleProperty** iOS.
-
-### Stranezze di Windows
-
- * **pref**: non supportato, restituendo`false`.
-
- * **tipo**: non supportato, restituendo`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/it/index.md b/plugins/cordova-plugin-contacts/doc/it/index.md
deleted file mode 100644
index b7405de..0000000
--- a/plugins/cordova-plugin-contacts/doc/it/index.md
+++ /dev/null
@@ -1,719 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-Questo plugin definisce un oggetto globale `navigator.contacts`, che fornisce l'accesso al database di contatti del dispositivo.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**Avviso**: raccolta e utilizzo dei dati di contatto solleva questioni di privacy importante. Politica sulla privacy dell'app dovrebbe discutere come app utilizza i dati di contatto e se è condiviso con altre parti. Informazioni di contatto sono considerate sensibile perché rivela le persone con cui una persona comunica. Pertanto, oltre alla politica di privacy dell'app, è fortemente consigliabile fornendo un preavviso di just-in-time prima app accede o utilizza i dati di contatto, se il sistema operativo del dispositivo non farlo già. Tale comunicazione deve fornire le informazioni stesse notate sopra, oltre ad ottenere l'autorizzazione (ad esempio, presentando scelte per **OK** e **No grazie**). Si noti che alcuni mercati app possono richiedere l'app per fornire un preavviso di just-in-time e ottenere l'autorizzazione dell'utente prima di accedere ai dati di contatto. Un'esperienza utente chiara e facile--capisce che circonda l'uso del contatto dati aiuta a evitare la confusione dell'utente e percepito un uso improprio dei dati di contatto. Per ulteriori informazioni, vedere la guida sulla Privacy.
-
-## Installazione
-
- cordova plugin add cordova-plugin-contacts
-
-
-### Firefox OS stranezze
-
-Creare **www/manifest.webapp** come descritto nel [Manifest Docs][1]. Aggiungi permisions rilevanti. C'è anche la necessità di modificare il tipo di webapp in "privilegiato" - [Manifest Docs][2]. **AVVERTENZA**: tutte le apps privilegiato applicare [Content Security Policy][3] che vieta script inline. Inizializzare l'applicazione in un altro modo.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Stranezze di Windows
-
-Eventuali contatti restituiti dai metodi `find` e `pickContact` sono readonly, quindi l'applicazione non può modificarli. Metodo `find` disponibile solo sui dispositivi Windows Phone 8.1.
-
-### Stranezze di Windows 8
-
-Windows 8 contatti sono readonly. Tramite i contatti di Cordova API non sono queryable/ricerche, si dovrebbe informare l'utente di scegliere un contatto come una chiamata a contacts.pickContact che aprirà l'app 'Persone' dove l'utente deve scegliere un contatto. Eventuali contatti restituiti sono readonly, quindi l'applicazione non può modificarli.
-
-## Navigator.contacts
-
-### Metodi
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### Oggetti
-
-* Contact
-* ContactName
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## navigator.contacts.create
-
-Il metodo `navigator.contacts.create` è sincrono e restituisce un nuovo oggetto di `Contact`.
-
-Questo metodo non mantiene l'oggetto contatto nel database contatti dispositivo, per cui è necessario richiamare il metodo `Contact.save`.
-
-### Piattaforme supportate
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-
-### Esempio
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Il metodo `navigator.contacts.find` in modo asincrono, esegue una query sul database di contatti del dispositivo e restituisce una matrice di oggetti `Contact`. Gli oggetti risultanti vengono passati alla funzione di callback `contactSuccess` specificata dal parametro **contactSuccess**.
-
-Il parametro **contactFields** specifica i campi per essere utilizzato come un qualificatore di ricerca. Un parametro di lunghezza zero, **contactFields** non è valido e si traduce in `ContactError.INVALID_ARGUMENT_ERROR`. Un valore di **contactFields** di `"*"` ricerche campi tutti i contatti.
-
-La stringa di **contactFindOptions.filter** può essere utilizzata come un filtro di ricerca quando una query sul database di contatti. Se fornito, una distinzione, corrispondenza parziale valore viene applicato a ogni campo specificato nel parametro **contactFields**. Se esiste una corrispondenza per *qualsiasi* dei campi specificati, viene restituito il contatto. Uso **contactFindOptions.desiredFields** parametro di controllo quale contattare la proprietà deve essere rispedito indietro.
-
-### Parametri
-
-* **contactFields**: contattare campi da utilizzare come un qualificatore di ricerca. *(DOMString[])* [Required]
-
-* **contactSuccess**: funzione di callback successo richiamato con la matrice di oggetti contatto restituiti dal database. [Required]
-
-* **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
-
-* **contactFindOptions**: opzioni per filtrare navigator.contacts di ricerca. [Optional]
-
- I tasti sono:
-
- * **filter**: la stringa di ricerca utilizzata per trovare navigator.contacts. *(DOMString)* (Default: `""`)
-
- * **multiple**: determina se l'operazione di ricerca restituisce più navigator.contacts. *(Boolean)* (Default: `false`)
-
- * **desiredFields**: contattare i campi per essere tornato indietro. Se specificato, il risultante `contatto` oggetto solo caratteristiche valori per questi campi. *(DOMString[])* [Optional]
-
-### Piattaforme supportate
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows (solo per dispositivi Windows Phone 8.1)
-
-### Esempio
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Stranezze di Windows
-
-* `__contactFields__`non è supportato, verrà ignorato. `find`metodo cercherà sempre di abbinare il nome, indirizzo email o numero di telefono di un contatto.
-
-## navigator.contacts.pickContact
-
-Il metodo `navigator.contacts.pickContact` lancia il contatto selettore per selezionare un singolo contatto. L'oggetto risultante viene passato alla funzione di callback `contactSuccess` specificata dal parametro **contactSuccess**.
-
-### Parametri
-
-* **contactSuccess**: funzione di callback di successo viene richiamato con il singolo oggetto di contatto. [Richiesto]
-
-* **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
-
-### Piattaforme supportate
-
-* Android
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### Esempio
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Contact
-
-L'oggetto `Contact` rappresenta il contatto di un utente. Contatti possono essere creati, memorizzati o rimossi dal database di contatti dispositivo. Contatti possono anche essere estratto (singolarmente o in blocco) dal database richiamando il metodo `navigator.contacts.find`.
-
-**Nota**: non tutti i campi di contatto sopra elencati sono supportati su ogni piattaforma del dispositivo. Consultare la sezione di *stranezze* su ogni piattaforma per dettagli.
-
-### Proprietà
-
-* **ID**: un identificatore univoco globale. *(DOMString)*
-
-* **displayName**: il nome di questo contatto, adatto per la visualizzazione a utenti finali. *(DOMString)*
-
-* **nome**: un oggetto che contiene tutti i componenti di un nome di persone. *(ContactName)*
-
-* **Nickname**: un nome informale con cui affrontare il contatto. *(DOMString)*
-
-* **phoneNumbers**: una matrice di numeri di telefono del contatto. *(ContactField[])*
-
-* **email**: una matrice di indirizzi di posta elettronica del contatto. *(ContactField[])*
-
-* **indirizzi**: una matrice di indirizzi di contatto. *(ContactAddress[])*
-
-* **IMS**: una matrice di indirizzi IM tutto il contatto. *(ContactField[])*
-
-* **organizzazioni**: una matrice di organizzazioni di tutto il contatto. *(ContactOrganization[])*
-
-* **compleanno**: il compleanno del contatto. *(Data)*
-
-* **Nota**: una nota sul contatto. *(DOMString)*
-
-* **foto**: una matrice di foto del contatto. *(ContactField[])*
-
-* **categorie**: matrice di tutte le categorie definite dall'utente connesso con il contatto. *(ContactField[])*
-
-* **URL**: matrice di pagine web connesso con il contatto. *(ContactField[])*
-
-### Metodi
-
-* **clone**: restituisce una nuova `Contact` oggetto che è una copia completa dell'oggetto chiamante, con la `id` proprietà impostata`null`.
-
-* **rimuovere**: rimuove il contatto dal database contatti dispositivo, altrimenti esegue un callback di errore con un `ContactError` oggetto.
-
-* **Salva**: salva un nuovo contatto nel database di contatti del dispositivo, o aggiorna un contatto esistente se esiste già un contatto con lo stesso **id** .
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Esempio di salvare
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Esempio di clone
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Rimuovere esempio
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Stranezze di Android 2. x
-
-* **categorie**: non è supportato sui dispositivi Android 2. x, restituendo`null`.
-
-### BlackBerry 10 capricci
-
-* **ID**: assegnate dal dispositivo quando si salva il contatto.
-
-### Capricci di FirefoxOS
-
-* **categorie**: parzialmente supportati. Campi **pref** e **tipo** stanno tornando`null`
-
-* **IMS**: non supportato
-
-* **foto**: non supportato
-
-### iOS stranezze
-
-* **displayName**: non supportata su iOS, tornando `null` se non c'è nessun `ContactName` specificato, nel qual caso restituisce il nome composito, **soprannome** o `""` , rispettivamente.
-
-* **compleanno**: deve essere inserito come un JavaScript `Date` oggetto, allo stesso modo viene restituito.
-
-* **foto**: restituisce un URL del File dell'immagine, che viene memorizzato nella directory temporanea dell'applicazione. Contenuto della directory temporanea vengono rimossi quando l'applicazione termina.
-
-* **categorie**: questa proprietà non è attualmente supportata, restituendo`null`.
-
-### Windows Phone 7 e 8 stranezze
-
-* **displayName**: quando si crea un contatto, il valore specificato per il parametro del nome di visualizzazione è diverso dal nome visualizzato Estratto quando trovare il contatto.
-
-* **URL**: quando si crea un contatto, gli utenti possono inserire e salvare più di un indirizzo web, ma solo uno è disponibile durante la ricerca del contatto.
-
-* **phoneNumbers**: non è supportata l'opzione *pref* . Il *tipo* non è supportato in un'operazione di *trovare* . Un solo `phoneNumber` è consentita per ogni *tipo*.
-
-* **email**: non è supportata l'opzione *pref* . Home e personal fa riferimento la stessa voce di posta elettronica. È consentito un solo ingresso per ogni *tipo*.
-
-* **indirizzi**: supporta solo lavoro e casa/personali *tipo*. Il riferimento principale e personale *tipo* la stessa voce di indirizzo. È consentito un solo ingresso per ogni *tipo*.
-
-* **organizzazioni**: solo uno è consentito e non supporta gli attributi *pref*, *tipo*e *dipartimento* .
-
-* **Nota**: non supportato, restituendo`null`.
-
-* **IMS**: non supportato, restituendo`null`.
-
-* **compleanni**: non supportato, restituendo`null`.
-
-* **categorie**: non supportato, restituendo`null`.
-
-### Stranezze di Windows
-
-* **foto**: restituisce un URL del File dell'immagine, che viene memorizzato nella directory temporanea dell'applicazione.
-
-* **compleanni**: non supportato, restituendo`null`.
-
-* **categorie**: non supportato, restituendo`null`.
-
-## ContactAddress
-
-L'oggetto `ContactAddress` memorizza le proprietà di un singolo indirizzo di un contatto. Un oggetto `Contact` può includere più di un indirizzo in una matrice `[] ContactAddress`.
-
-### Proprietà
-
-* **pref**: impostare su `true` se questo `ContactAddress` contiene il valore dell'utente preferito. *(booleano)*
-
-* **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
-
-* **formattato**: indirizzo completo formattato per la visualizzazione. *(DOMString)*
-
-* **streetAddress**: l'indirizzo completo. *(DOMString)*
-
-* **località**: la città o località. *(DOMString)*
-
-* **regione**: lo stato o la regione. *(DOMString)*
-
-* **postalCode**: il codice postale o il codice postale. *(DOMString)*
-
-* **paese**: il nome del paese. *(DOMString)*
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Esempio
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Stranezze di Android 2. x
-
-* **pref**: non supportato, tornando `false` su dispositivi Android 2. x.
-
-### BlackBerry 10 capricci
-
-* **pref**: non è supportato sui dispositivi BlackBerry, restituendo`false`.
-
-* **tipo**: parzialmente supportati. Solo uno di *lavoro* e *casa* tipo indirizzi può essere memorizzato per ciascun contatto.
-
-* **formattato**: parzialmente supportati. Restituisce una concatenazione di tutti i campi Indirizzo BlackBerry.
-
-* **streetAddress**: supportato. Restituisce una concatenazione di BlackBerry **Indirizzo1** e **Indirizzo2** campi indirizzo.
-
-* **località**: supportato. Memorizzato nel campo indirizzo **città** di BlackBerry.
-
-* **regione**: supportato. Memorizzato nel campo indirizzo di **stateProvince** BlackBerry.
-
-* **postalCode**: supportato. Memorizzato nel campo dell'indirizzo **zipPostal** BlackBerry.
-
-* **paese**: supportato.
-
-### Capricci di FirefoxOS
-
-* **formattato**: attualmente non supportato
-
-### iOS stranezze
-
-* **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
-
-* **formattato**: attualmente non supportati.
-
-### Stranezze di Windows 8
-
-* **pref**: non supportato
-
-### Stranezze di Windows
-
-* **pref**: non supportato
-
-## ContactError
-
-L'oggetto `ContactError` viene restituito all'utente tramite la funzione di callback `contactError` quando si verifica un errore.
-
-### Proprietà
-
-* **codice**: uno dei codici di errore predefiniti elencati di seguito.
-
-### Costanti
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-L'oggetto `ContactField` è un componente riutilizzabile che rappresenta Contatta campi genericamente. Ogni oggetto `ContactField` contiene una proprietà di `value`, `type` e `pref`. Un oggetto `Contact` memorizza diverse proprietà in matrici `[] ContactField`, come numeri di telefono e indirizzi email.
-
-Nella maggior parte dei casi, esistono pre-determinati valori per l'attributo `type` di un oggetto **ContactField**. Ad esempio, un numero di telefono può specificare valori di **type** di *casa*, *lavoro*, *mobile*, *iPhone* o qualsiasi altro valore che è supportato dal database dei contatti su una piattaforma particolare dispositivo. Tuttavia, per il campo di **photo** del `Contacto`, il campo **type** indica il formato dell'immagine restituita: **url** quando il **value** di attributo contiene un URL per l'immagine fotografica, o *base64*, quando il **value** contiene una stringa con codifica base64 immagine.
-
-### Proprietà
-
-* **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
-
-* **valore**: il valore del campo, ad esempio un telefono numero o indirizzo e-mail. *(DOMString)*
-
-* **pref**: impostare su `true` se questo `ContactField` contiene il valore dell'utente preferito. *(booleano)*
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Esempio
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Stranezze Android
-
-* **pref**: non supportato, restituendo`false`.
-
-### BlackBerry 10 capricci
-
-* **tipo**: parzialmente supportati. Usato per i numeri di telefono.
-
-* **valore**: supportato.
-
-* **pref**: non supportato, restituendo`false`.
-
-### iOS stranezze
-
-* **pref**: non supportato, restituendo`false`.
-
-### Stranezze di Windows8
-
-* **pref**: non supportato, restituendo`false`.
-
-### Stranezze di Windows
-
-* **pref**: non supportato, restituendo`false`.
-
-## ContactName
-
-Contiene diversi tipi di informazioni sul nome di un oggetto `Contact`.
-
-### Proprietà
-
-* **formattato**: il nome completo del contatto. *(DOMString)*
-
-* **familyName**: cognome del contatto. *(DOMString)*
-
-* **givenName**: nome del contatto. *(DOMString)*
-
-* **middleName**: il nome del contatto medio. *(DOMString)*
-
-* **honorificPrefix**: prefisso del contatto (esempio *Mr* o *Dr*) *(DOMString)*
-
-* **honorificSuffix**: suffisso del contatto (esempio *Esq.*). *(DOMString)*
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Esempio
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Stranezze Android
-
-* **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
-
-### BlackBerry 10 capricci
-
-* **formattato**: parzialmente supportati. Restituisce una concatenazione di campi **firstName** e **lastName** BlackBerry.
-
-* **familyName**: supportato. Archiviato in campo **lastName** BlackBerry.
-
-* **givenName**: supportato. Archiviato in campo **firstName** BlackBerry.
-
-* **middleName**: non supportato, restituendo`null`.
-
-* **honorificPrefix**: non supportato, restituendo`null`.
-
-* **honorificSuffix**: non supportato, restituendo`null`.
-
-### Capricci di FirefoxOS
-
-* **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
-
-### iOS stranezze
-
-* **formattato**: parzialmente supportati. Restituisce il nome composito di iOS, ma è di sola lettura.
-
-### Stranezze di Windows 8
-
-* **formattato**: questo è l'unico nome proprietà ed è identico a `displayName` , e`nickname`
-
-* **familyName**: non supportato
-
-* **givenName**: non supportato
-
-* **middleName**: non supportato
-
-* **honorificPrefix**: non supportato
-
-* **honorificSuffix**: non supportato
-
-### Stranezze di Windows
-
-* **formattato**: esso è identico al`displayName`
-
-## ContactOrganization
-
-L'oggetto `ContactOrganization` memorizza la proprietà di organizzazione di un contatto. Un oggetto `Contact` memorizza uno o più oggetti `ContactOrganization` in una matrice.
-
-### Proprietà
-
-* **pref**: impostare su `true` se questo `ContactOrganization` contiene il valore dell'utente preferito. *(booleano)*
-
-* **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. _(DOMString)
-
-* **nome**: il nome dell'organizzazione. *(DOMString)*
-
-* **dipartimento**: contratto lavora per il dipartimento. *(DOMString)*
-
-* **titolo**: titolo del contatto presso l'organizzazione. *(DOMString)*
-
-### Piattaforme supportate
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows (solo dispositivi Windows 8.1 e 8.1 di Windows Phone)
-
-### Esempio
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Stranezze di Android 2. x
-
-* **pref**: non supportato dai dispositivi Android 2. x, restituendo`false`.
-
-### BlackBerry 10 capricci
-
-* **pref**: non supportato dai dispositivi BlackBerry, restituendo`false`.
-
-* **tipo**: non supportato dai dispositivi BlackBerry, restituendo`null`.
-
-* **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **azienda** BlackBerry.
-
-* **dipartimento**: non supportato, restituendo`null`.
-
-* **titolo**: parzialmente supportati. Il primo titolo di organizzazione è memorizzato nel campo **jobTitle** BlackBerry.
-
-### Firefox OS stranezze
-
-* **pref**: non supportato
-
-* **tipo**: non supportato
-
-* **dipartimento**: non supportato
-
-* Campi **nome** e **titolo** memorizzato in **org** e **jobTitle**.
-
-### iOS stranezze
-
-* **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
-
-* **tipo**: non è supportato sui dispositivi iOS, restituendo`null`.
-
-* **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **kABPersonOrganizationProperty** iOS.
-
-* **dipartimento**: parzialmente supportati. Il primo nome del dipartimento è memorizzato nel campo **kABPersonDepartmentProperty** iOS.
-
-* **titolo**: parzialmente supportati. Il primo titolo è memorizzato nel campo **kABPersonJobTitleProperty** iOS.
-
-### Stranezze di Windows
-
-* **pref**: non supportato, restituendo`false`.
-
-* **tipo**: non supportato, restituendo`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/ja/README.md b/plugins/cordova-plugin-contacts/doc/ja/README.md
deleted file mode 100644
index 5c80bb6..0000000
--- a/plugins/cordova-plugin-contacts/doc/ja/README.md
+++ /dev/null
@@ -1,735 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-このプラグインは、デバイスの連絡先データベースへのアクセスを提供するグローバル `navigator.contacts` オブジェクトを定義します。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**警告**: 連絡先データの収集と利用を重要なプライバシーの問題を発生させます。 アプリのプライバシー ポリシー アプリが連絡先データを使用する方法と、他の当事者では共有されているかどうかを話し合う必要があります。 人誰と通信する人々 を明らかにするために、連絡先情報が機密と見なされます。 したがって、アプリのプライバシー ポリシーに加えて、強くお勧めデバイスのオペレーティング システムが既にしない場合アプリにアクセスまたは連絡先のデータを使用する前に - 時間のお知らせを提供します。 その通知は、上記の (例えば、**[ok]** を **おかげで** 選択肢を提示する) によってユーザーのアクセス許可を取得するだけでなく、同じ情報を提供する必要があります。 いくつかのアプリのマーケットプ レース - 時間の通知を提供して、連絡先データにアクセスする前にユーザーの許可を取得するアプリをする必要がありますに注意してください。 連絡先データは、ユーザーの混乱を避けるのに役立ちますの使用および連絡先データの知覚の誤用を囲む明確でわかりやすいユーザー エクスペリエンス。 詳細については、プライバシーに関するガイドを参照してください。
-
-## インストール
-
-これはコルドバ 5.0 + (現在安定 v1.0.0) を必要とします。
-
- cordova plugin add cordova-plugin-contacts
-
-
-コルドバの古いバージョンでも**非推奨**id (古い v0.2.16) 経由でインストールできます。
-
- cordova plugin add org.apache.cordova.contacts
-
-
-また、レポの url 経由で直接インストールすることが可能だ (不安定)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS 癖
-
-[マニフェストのドキュメント](https://developer.mozilla.org/en-US/Apps/Developing/Manifest) で説明されているように、**www/manifest.webapp** を作成します。 関連する権限を追加します。 [マニフェストのドキュメント](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type)「特権」- に web アプリケーションの種類を変更する必要も。 **警告**: すべての特権を持つアプリケーション インライン スクリプトを禁止している [コンテンツのセキュリティ ポリシー](https://developer.mozilla.org/en-US/Apps/CSP) を適用します。 別の方法で、アプリケーションを初期化します。
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows の癖
-
-**Windows 10 前に:**すべての連絡先を`検索`し、 `pickContact`メソッドから返されるアプリケーションが変更できないように読み取り専用であります。 `find` メソッド 8.1 の Windows Phone デバイスでのみ使用できます。
-
-**Windows 10 以上:**連絡先は、保存可能性があります、連絡先アプリ ローカル記憶域に保存されます。 連絡先も削除されます。
-
-### Windows 8 の癖
-
-Windows 8 の連絡先は、読み取り専用です。 コルドバ API コンタクトを介してされませんクエリ/検索可能で、ユーザーに通知する必要があります連絡先を選択 '人' アプリを開くことが contacts.pickContact への呼び出しとして、ユーザーが連絡先を選択する必要があります。 戻される連絡先は読み取り専用、アプリケーションを変更することはできません。
-
-## navigator.contacts
-
-### メソッド
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### オブジェクト
-
- * お問い合わせ
- * ContactName
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-`navigator.contacts.create` メソッドは同期的に、新しい `連絡先` オブジェクトを返します。
-
-このメソッドは、`Contact.save` メソッドを呼び出す必要があるデバイスの連絡先データベースに連絡先オブジェクトを保持しません。
-
-### サポートされているプラットフォーム
-
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
-
-### 例
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-デバイスの連絡先データベースを照会して、`Contact` オブジェクトの配列を返す `navigator.contacts.find` メソッドを非同期的に実行します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
-
-**contactFields** パラメーター検索の修飾子として使用するフィールドを指定します。 ゼロ長さ **contactFields** パラメーターは有効で、`ContactError.INVALID_ARGUMENT_ERROR` の結果します。 **contactFields** 値 `"*"` すべての連絡先フィールドが検索されます。
-
-**contactFindOptions.filter** 文字列の連絡先データベースを照会するときに検索フィルターとして使用できます。 指定した場合、大文字と小文字、部分的な値の一致する **contactFields** パラメーターで指定されたフィールドごとに適用されます。 一致する *任意* 指定のフィールドがある場合は、連絡先が返されます。 バック連絡先プロパティを制御する **contactFindOptions.desiredFields** パラメーターを使用しますが返される必要があります。
-
-### パラメーター
-
- * **contactFields**: 連絡先検索修飾子として使用するフィールド。*(DOMString[])* [Required]
-
- * **contactSuccess**: Contact オブジェクトの配列に呼び出される成功コールバック関数は、データベースから返されます。[Required]
-
- * **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
-
- * **contactFindOptions**: navigator.contacts をフィルターするオプションを検索します。[Optional]
-
- キーは次のとおりです。
-
- * **filter**: navigator.contacts の検索に使用する検索文字列。*(,)*(デフォルト: `""`)
-
- * **multiple**: 複数 navigator.contacts かどうかは、検索操作に返すを決定します。*(ブール値)*(デフォルト: `false`)
-
- * **desiredFields**: 戻って返されるフィールドに問い合わせてください。指定した場合、結果 `Contact` オブジェクトこれらのフィールドの値でのみ機能します。*(DOMString[])* [Optional]
-
-### サポートされているプラットフォーム
-
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows (Windows Phone 8.1 および Windows 10)
-
-### 例
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows の癖
-
- * `__contactFields__`サポートされていないと無視されます。`find`メソッドは、常に名前、電子メール アドレス、または連絡先の電話番号に一致ましょう。
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact` メソッドは単一の連絡先を選択する連絡先ピッカーを起動します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
-
-### パラメーター
-
- * **contactSuccess**: 1 つの連絡先オブジェクトに呼び出される成功コールバック関数。[必須]
-
- * **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
-
-### サポートされているプラットフォーム
-
- * アンドロイド
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### 例
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## お問い合わせ
-
-`Contact` オブジェクトは、ユーザーの連絡先を表します。 連絡先の作成、格納、またはデバイスの連絡先データベースから削除することができます。 連絡先も取得できます (個別にまたは一括で) データベースから `navigator.contacts.find` メソッドを呼び出すことによって。
-
-**注**: すべて上記の連絡先フィールドのすべてのデバイス プラットフォームでサポートされます。詳細については各プラットフォームの *互換* セクションを確認してください。
-
-### プロパティ
-
- * **id**: グローバルに一意の識別子。*(,)*
-
- * **displayName**: エンド ・ ユーザーへの表示に適した、この連絡先の名前。*(,)*
-
- * **名前**: 人の名前のすべてのコンポーネントを格納するオブジェクト。*(ContactName)*
-
- * **ニックネーム**: 連絡先のアドレスに使用するカジュアルな名前。*(,)*
-
- * **電話番号**: 連絡先の電話番号の配列。*(ContactField[])*
-
- * **メール**: 連絡先の電子メール アドレスの配列。*(ContactField[])*
-
- * **アドレス**: 連絡先のアドレスの配列。*(ContactAddress[])*
-
- * **ims**: 連絡先の IM アドレスの配列。*(ContactField[])*
-
- * **組織**: 連絡先の組織の配列。*(ContactOrganization[])*
-
- * **誕生日**: 連絡先の誕生日。*(日)*
-
- * **注**: 連絡先についてのメモ。*(,)*
-
- * **写真**: 連絡先の写真の配列。*(ContactField[])*
-
- * **カテゴリ**: 取引先担当者に関連付けられているすべてのユーザー定義カテゴリの配列。*(ContactField[])*
-
- * **url**: 取引先担当者に関連付けられている web ページの配列。*(ContactField[])*
-
-### メソッド
-
- * **クローン**: 新しいを返します `Contact` と呼び出し元のオブジェクトのディープ コピーであるオブジェクトの `id` プロパティに設定`null`.
-
- * **削除**: デバイスの連絡先データベースから連絡先を削除します、それ以外の場合のためのエラー コールバックを実行する、 `ContactError` オブジェクト。
-
- * **保存**: デバイスの連絡先データベースに新しい連絡先を保存または同じ**id**を持つ連絡先が既に存在する場合、既存の連絡先を更新します。
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### 保存の例
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### クローンの例
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### 削除の例
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### アンドロイド 2.X 癖
-
- * **カテゴリ**: 返す 2.X の Android デバイスでサポートされていません`null`.
-
-### ブラックベリー 10 癖
-
- * **id**: 連絡先を保存するときに、デバイスによって割り当てられます。
-
-### FirefoxOS の癖
-
- * **カテゴリ**: 部分的にサポートされます。フィールド**県**・**タイプ**を返す`null`
-
- * **ims**: サポートされていません。
-
- * **写真**: サポートされていません。
-
-### iOS の癖
-
- * **displayName**: 返す iOS でサポートされていない `null` がない限り、ない `ContactName` 指定すると、その場合は複合名、**ニックネーム**を返しますまたは `""` 、それぞれ。
-
- * **誕生日**: JavaScript として入力する必要があります `Date` オブジェクト、同じ方法が返されます。
-
- * **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。一時ディレクトリの内容は、アプリケーションの終了時に削除されます。
-
- * **カテゴリ**: このプロパティは現在サポートされていません、返す`null`.
-
-### Windows Phone 7 と 8 癖
-
- * **displayName**: 表示名パラメーターの表示名と異なるために提供値を取得、連絡先を検索するとき、連絡先を作成するとき。
-
- * **url**: 連絡先を作成するときユーザー入力保存でき、1 つ以上の web アドレスが 1 つだけ、連絡先を検索するとき。
-
- * **電話番号**:*県*オプションはサポートされていません。 *型*は、*検索*操作ではサポートされていません。 1 つだけ `phoneNumber` は各*タイプ*の許可.
-
- * **メール**:*県*オプションはサポートされていません。家庭や個人的なメールと同じエントリを参照します。各*タイプ*の 1 つだけのエントリが許可されて.
-
- * **アドレス**: 仕事とホーム/パーソナル*タイプ*のみをサポートしています。家庭や個人*型*参照して同じアドレス エントリ。各*タイプ*の 1 つだけのエントリが許可されて.
-
- * **組織**: 1 つだけが許可され、*県*、*タイプ*、および*部門*の属性をサポートしていません。
-
- * **注**: サポートされていないを返す`null`.
-
- * **ims**: サポートされていないを返す`null`.
-
- * **誕生日**: サポートされていないを返す`null`.
-
- * **カテゴリ**: サポートされていないを返す`null`.
-
- * **remove**: メソッドはサポートされていません
-
-### Windows の癖
-
- * **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。
-
- * **誕生日**: サポートされていないを返す`null`.
-
- * **カテゴリ**: サポートされていないを返す`null`.
-
- * **remove**: Windows 10 以上メソッドはサポートされてのみ。
-
-## ContactAddress
-
-`ContactAddress` オブジェクトは、連絡先の 1 つのアドレスのプロパティを格納します。 `Contact` オブジェクトは、`ContactAddress` 配列の 1 つ以上のアドレスなどがあります。
-
-### プロパティ
-
- * **県**: に設定されている `true` 場合は、この `ContactAddress` ユーザーの推奨値が含まれています。*(ブール値)*
-
- * **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
-
- * **書式設定**: 表示用にフォーマットの完全なアドレス。*(,)*
-
- * **番地**: 完全な住所。*(,)*
-
- * **局所性**: 都市または場所。*(,)*
-
- * **地域**: 状態または地域。*(,)*
-
- * **郵便番号**: 郵便番号または郵便番号。*(,)*
-
- * **国**: 国の名前。*(,)*
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### 例
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### アンドロイド 2.X 癖
-
- * **県**: サポートされていない返す `false` 2.X の Android デバイスで。
-
-### ブラックベリー 10 癖
-
- * **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
-
- * **種類**: 部分的にサポートされます。連絡先ごとの 1 つだけ各*仕事*と*家庭*の種類のアドレスを格納できます。
-
- * **フォーマット**: 部分的にサポートされます。すべての BlackBerry アドレス フィールドの連結を返します。
-
- * **番地**: サポートされています。ブラックベリーの**住所 1** **住所 2**の連結アドレス フィールドを返します。
-
- * **局所性**: サポートされています。ブラックベリー**市**アドレス フィールドに格納されます。
-
- * **地域**: サポートされています。ブラックベリー **stateProvince**アドレス フィールドに格納されます。
-
- * **郵便番号**: サポートされています。ブラックベリー **zipPostal**アドレス フィールドに格納されます。
-
- * **国**: サポートされています。
-
-### FirefoxOS の癖
-
- * **フォーマット**: 現在サポートされていません
-
-### iOS の癖
-
- * **県**: 戻る iOS デバイスでサポートされていません`false`.
-
- * **フォーマット**: 現在サポートされていません。
-
-### Windows 8 の癖
-
- * **県**: サポートされていません。
-
-### Windows の癖
-
- * **県**: サポートされていません。
-
-## ContactError
-
-`ContactError` オブジェクトにエラーが発生したときに `contactError` コールバック関数を通じてユーザーに返されます。
-
-### プロパティ
-
- * **コード**: 次のいずれかの定義済みのエラー コード。
-
-### 定数
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-`ContactField` オブジェクトは連絡先フィールドを総称を表す再利用可能なコンポーネントです。 各 `ContactField` オブジェクトには `値` `型`、および `県` プロパティが含まれています。 `連絡先` オブジェクトは、`ContactField` 配列に、電話番号、メール アドレスなどのいくつかのプロパティを格納します。
-
-ほとんどの場合、`ContactField` オブジェクトの **type** 属性のあらかじめ決められた値はありません。 たとえば、電話番号が *ホーム*、*仕事*、*モバイル*、*iPhone*、または特定のデバイス プラットフォームの連絡先データベースでサポートされている他の値の **型** の値を指定できます。 ただし、`連絡先` **の写真**] のフィールド **の種類**] フィールドを示します返される画像の形式: **url** **値** 属性 **値** を base64 でエンコードされたイメージの文字列が含まれる場合に写真イメージまたは *base64* に URL が含まれる場合。
-
-### プロパティ
-
- * **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
-
- * **値**: 電話番号や電子メール アドレスなど、フィールドの値。*(,)*
-
- * **県**: に設定されている `true` 場合は、この `ContactField` ユーザーの推奨値が含まれています。*(ブール値)*
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### 例
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Android の癖
-
- * **県**: サポートされていないを返す`false`.
-
-### ブラックベリー 10 癖
-
- * **種類**: 部分的にサポートされます。電話番号を使用します。
-
- * **値**: サポートされています。
-
- * **県**: サポートされていないを返す`false`.
-
-### iOS の癖
-
- * **県**: サポートされていないを返す`false`.
-
-### Windows8 の癖
-
- * **県**: サポートされていないを返す`false`.
-
-### Windows の癖
-
- * **県**: サポートされていないを返す`false`.
-
-## ContactName
-
-異なる種類 `Contact` オブジェクトの名前についての情報にはが含まれています。
-
-### プロパティ
-
- * **フォーマット**: 連絡先の完全な名前。*(,)*
-
- * **familyName**: 連絡先の姓。*(,)*
-
- * **givenName**: 連絡先の名前。*(,)*
-
- * **ミドル ネーム**: 連絡先のミドル ネーム。*(,)*
-
- * **honorificPrefix**: 連絡先のプレフィックス (例*氏*または*博士*) *(,)*
-
- * **honorificSuffix**: 連絡先のサフィックス (*弁護士*の例)。*(,)*
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### 例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android の癖
-
- * **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
-
-### ブラックベリー 10 癖
-
- * **フォーマット**: 部分的にサポートされます。ブラックベリー **firstName**と**lastName**フィールドの連結を返します。
-
- * **familyName**: サポートされています。ブラックベリー **[氏名]**フィールドに格納されます。
-
- * **givenName**: サポートされています。ブラックベリーの**firstName**フィールドに格納されます。
-
- * **ミドル ネーム**: サポートされていないを返す`null`.
-
- * **honorificPrefix**: サポートされていないを返す`null`.
-
- * **honorificSuffix**: サポートされていないを返す`null`.
-
-### FirefoxOS の癖
-
- * **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
-
-### iOS の癖
-
- * **フォーマット**: 部分的にサポートされます。IOS 複合名を返しますが、読み取り専用です。
-
-### Windows 8 の癖
-
- * **フォーマット**: これは、プロパティの名前し、同じです `displayName` と`nickname`
-
- * **familyName**: サポートされていません。
-
- * **givenName**: サポートされていません。
-
- * **ミドル ネーム**: サポートされていません。
-
- * **honorificPrefix**: サポートされていません。
-
- * **honorificSuffix**: サポートされていません。
-
-### Windows の癖
-
- * **フォーマット**: と同じです`displayName`
-
-## ContactOrganization
-
-`ContactOrganization` オブジェクトは、連絡先の組織のプロパティを格納します。`連絡先` オブジェクトは、配列の 1 つ以上の `ContactOrganization` オブジェクトを格納します。
-
-### プロパティ
-
- * **県**: に設定されている `true` 場合は、この `ContactOrganization` ユーザーの推奨値が含まれています。*(ブール値)*
-
- * **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。_(DOMString)
-
- * **名前**: 組織の名前。*(,)*
-
- * **部門**: 契約に勤めている部門。*(,)*
-
- * **タイトル**: 組織の連絡先のタイトル。*(,)*
-
-### サポートされているプラットフォーム
-
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows (Windows 8.1 および Windows Phone 8.1 装置のみ)
-
-### 例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### アンドロイド 2.X 癖
-
- * **県**: 返す 2.X の Android デバイスでサポートされていません`false`.
-
-### ブラックベリー 10 癖
-
- * **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
-
- * **タイプ**: 戻る、BlackBerry デバイスでサポートされていません`null`.
-
- * **名前**: 部分的にサポートされます。最初の組織名は、**会社**のブラックベリーのフィールドに格納されます。
-
- * **部門**: サポートされていないを返す`null`.
-
- * **タイトル**: 部分的にサポートされます。組織の最初のタイトルはブラックベリー**氏名**フィールドに格納されます。
-
-### Firefox OS 癖
-
- * **県**: サポートされていません。
-
- * **タイプ**: サポートされていません。
-
- * **部門**: サポートされていません。
-
- * フィールドの**名前**と**組織**、**氏名**に格納された**タイトル**.
-
-### iOS の癖
-
- * **県**: 戻る iOS デバイスでサポートされていません`false`.
-
- * **タイプ**: 戻る iOS デバイスでサポートされていません`null`.
-
- * **名前**: 部分的にサポートされます。最初の組織名は、iOS **kABPersonOrganizationProperty**フィールドに格納されます。
-
- * **部門**: 部分的にサポートされます。最初の部署名は iOS **kABPersonDepartmentProperty**フィールドに格納されます。
-
- * **タイトル**: 部分的にサポートされます。最初のタイトルは、iOS **kABPersonJobTitleProperty**フィールドに格納されます。
-
-### Windows の癖
-
- * **県**: サポートされていないを返す`false`.
-
- * **タイプ**: サポートされていないを返す`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/ja/index.md b/plugins/cordova-plugin-contacts/doc/ja/index.md
deleted file mode 100644
index 3e85bbc..0000000
--- a/plugins/cordova-plugin-contacts/doc/ja/index.md
+++ /dev/null
@@ -1,719 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-このプラグインは、デバイスの連絡先データベースへのアクセスを提供するグローバル `navigator.contacts` オブジェクトを定義します。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**警告**: 連絡先データの収集と利用を重要なプライバシーの問題を発生させます。 アプリのプライバシー ポリシー アプリが連絡先データを使用する方法と、他の当事者では共有されているかどうかを話し合う必要があります。 人誰と通信する人々 を明らかにするために、連絡先情報が機密と見なされます。 したがって、アプリのプライバシー ポリシーに加えて、強くお勧めデバイスのオペレーティング システムが既にしない場合アプリにアクセスまたは連絡先のデータを使用する前に - 時間のお知らせを提供します。 その通知は、上記の (例えば、**[ok]** を **おかげで** 選択肢を提示する) によってユーザーのアクセス許可を取得するだけでなく、同じ情報を提供する必要があります。 いくつかのアプリのマーケットプ レース - 時間の通知を提供して、連絡先データにアクセスする前にユーザーの許可を取得するアプリをする必要がありますに注意してください。 連絡先データは、ユーザーの混乱を避けるのに役立ちますの使用および連絡先データの知覚の誤用を囲む明確でわかりやすいユーザー エクスペリエンス。 詳細については、プライバシーに関するガイドを参照してください。
-
-## インストール
-
- cordova plugin add cordova-plugin-contacts
-
-
-### Firefox OS 癖
-
-[マニフェストのドキュメント][1] で説明されているように、**www/manifest.webapp** を作成します。 関連する権限を追加します。 [マニフェストのドキュメント][2]「特権」- に web アプリケーションの種類を変更する必要も。 **警告**: すべての特権を持つアプリケーション インライン スクリプトを禁止している [コンテンツのセキュリティ ポリシー][3] を適用します。 別の方法で、アプリケーションを初期化します。
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows の癖
-
-`find` し、`pickContact` メソッドから返されるすべての連絡先は readonly、アプリケーションを変更することはできません。 `find` メソッド 8.1 の Windows Phone デバイスでのみ使用できます。
-
-### Windows 8 の癖
-
-Windows 8 の連絡先は、読み取り専用です。 コルドバ API コンタクトを介してされませんクエリ/検索可能で、ユーザーに通知する必要があります連絡先を選択 '人' アプリを開くことが contacts.pickContact への呼び出しとして、ユーザーが連絡先を選択する必要があります。 戻される連絡先は読み取り専用、アプリケーションを変更することはできません。
-
-## navigator.contacts
-
-### メソッド
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### オブジェクト
-
-* お問い合わせ
-* 得意先コード
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## navigator.contacts.create
-
-`navigator.contacts.create` メソッドは同期的に、新しい `連絡先` オブジェクトを返します。
-
-このメソッドは、`Contact.save` メソッドを呼び出す必要があるデバイスの連絡先データベースに連絡先オブジェクトを保持しません。
-
-### サポートされているプラットフォーム
-
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-
-### 例
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-デバイスの連絡先データベースを照会して、`Contact` オブジェクトの配列を返す `navigator.contacts.find` メソッドを非同期的に実行します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
-
-**contactFields** パラメーター検索の修飾子として使用するフィールドを指定します。 ゼロ長さ **contactFields** パラメーターは有効で、`ContactError.INVALID_ARGUMENT_ERROR` の結果します。 **contactFields** 値 `"*"` すべての連絡先フィールドが検索されます。
-
-**contactFindOptions.filter** 文字列の連絡先データベースを照会するときに検索フィルターとして使用できます。 指定した場合、大文字と小文字、部分的な値の一致する **contactFields** パラメーターで指定されたフィールドごとに適用されます。 一致する *任意* 指定のフィールドがある場合は、連絡先が返されます。 バック連絡先プロパティを制御する **contactFindOptions.desiredFields** パラメーターを使用しますが返される必要があります。
-
-### パラメーター
-
-* **contactFields**: 連絡先検索修飾子として使用するフィールド。*(DOMString[])* [Required]
-
-* **contactSuccess**: Contact オブジェクトの配列に呼び出される成功コールバック関数は、データベースから返されます。[Required]
-
-* **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
-
-* **contactFindOptions**: navigator.contacts をフィルターするオプションを検索します。[Optional]
-
- キーは次のとおりです。
-
- * **filter**: navigator.contacts の検索に使用する検索文字列。*(,)*(デフォルト: `""`)
-
- * **multiple**: 複数 navigator.contacts かどうかは、検索操作に返すを決定します。*(ブール値)*(デフォルト: `false`)
-
- * **desiredFields**: 戻って返されるフィールドに問い合わせてください。指定した場合、結果 `Contact` オブジェクトこれらのフィールドの値でのみ機能します。*(DOMString[])* [Optional]
-
-### サポートされているプラットフォーム
-
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows (Windows Phone 8.1 装置のみ)
-
-### 例
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows の癖
-
-* `__contactFields__`サポートされていないと無視されます。`find`メソッドは、常に名前、電子メール アドレス、または連絡先の電話番号に一致ましょう。
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact` メソッドは単一の連絡先を選択する連絡先ピッカーを起動します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
-
-### パラメーター
-
-* **contactSuccess**: 1 つの連絡先オブジェクトに呼び出される成功コールバック関数。[必須]
-
-* **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
-
-### サポートされているプラットフォーム
-
-* アンドロイド
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### 例
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## お問い合わせ
-
-`Contact` オブジェクトは、ユーザーの連絡先を表します。 連絡先の作成、格納、またはデバイスの連絡先データベースから削除することができます。 連絡先も取得できます (個別にまたは一括で) データベースから `navigator.contacts.find` メソッドを呼び出すことによって。
-
-**注**: すべて上記の連絡先フィールドのすべてのデバイス プラットフォームでサポートされます。詳細については各プラットフォームの *互換* セクションを確認してください。
-
-### プロパティ
-
-* **id**: グローバルに一意の識別子。*(,)*
-
-* **displayName**: エンド ・ ユーザーへの表示に適した、この連絡先の名前。*(,)*
-
-* **名前**: 人の名前のすべてのコンポーネントを格納するオブジェクト。*(ContactName)*
-
-* **ニックネーム**: 連絡先のアドレスに使用するカジュアルな名前。*(,)*
-
-* **電話番号**: 連絡先の電話番号の配列。*(ContactField[])*
-
-* **メール**: 連絡先の電子メール アドレスの配列。*(ContactField[])*
-
-* **アドレス**: 連絡先のアドレスの配列。*(ContactAddress[])*
-
-* **ims**: 連絡先の IM アドレスの配列。*(ContactField[])*
-
-* **組織**: 連絡先の組織の配列。*(ContactOrganization[])*
-
-* **誕生日**: 連絡先の誕生日。*(日)*
-
-* **注**: 連絡先についてのメモ。*(,)*
-
-* **写真**: 連絡先の写真の配列。*(ContactField[])*
-
-* **カテゴリ**: 取引先担当者に関連付けられているすべてのユーザー定義カテゴリの配列。*(ContactField[])*
-
-* **url**: 取引先担当者に関連付けられている web ページの配列。*(ContactField[])*
-
-### メソッド
-
-* **クローン**: 新しいを返します `Contact` と呼び出し元のオブジェクトのディープ コピーであるオブジェクトの `id` プロパティに設定`null`.
-
-* **削除**: デバイスの連絡先データベースから連絡先を削除します、それ以外の場合のためのエラー コールバックを実行する、 `ContactError` オブジェクト。
-
-* **保存**: デバイスの連絡先データベースに新しい連絡先を保存または同じ**id**を持つ連絡先が既に存在する場合、既存の連絡先を更新します。
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### 保存の例
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### クローンの例
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### 削除の例
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### アンドロイド 2.X 癖
-
-* **カテゴリ**: 返す 2.X の Android デバイスでサポートされていません`null`.
-
-### ブラックベリー 10 癖
-
-* **id**: 連絡先を保存するときに、デバイスによって割り当てられます。
-
-### FirefoxOS の癖
-
-* **カテゴリ**: 部分的にサポートされます。フィールド**県**・**タイプ**を返す`null`
-
-* **ims**: サポートされていません。
-
-* **写真**: サポートされていません。
-
-### iOS の癖
-
-* **displayName**: 返す iOS でサポートされていない `null` がない限り、ない `ContactName` 指定すると、その場合は複合名、**ニックネーム**を返しますまたは `""` 、それぞれ。
-
-* **誕生日**: JavaScript として入力する必要があります `Date` オブジェクト、同じ方法が返されます。
-
-* **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。一時ディレクトリの内容は、アプリケーションの終了時に削除されます。
-
-* **カテゴリ**: このプロパティは現在サポートされていません、返す`null`.
-
-### Windows Phone 7 と 8 癖
-
-* **displayName**: 表示名パラメーターの表示名と異なるために提供値を取得、連絡先を検索するとき、連絡先を作成するとき。
-
-* **url**: 連絡先を作成するときユーザー入力保存でき、1 つ以上の web アドレスが 1 つだけ、連絡先を検索するとき。
-
-* **電話番号**:*県*オプションはサポートされていません。 *型*は、*検索*操作ではサポートされていません。 1 つだけ `phoneNumber` は各*タイプ*の許可.
-
-* **メール**:*県*オプションはサポートされていません。家庭や個人的なメールと同じエントリを参照します。各*タイプ*の 1 つだけのエントリが許可されて.
-
-* **アドレス**: 仕事とホーム/パーソナル*タイプ*のみをサポートしています。家庭や個人*型*参照して同じアドレス エントリ。各*タイプ*の 1 つだけのエントリが許可されて.
-
-* **組織**: 1 つだけが許可され、*県*、*タイプ*、および*部門*の属性をサポートしていません。
-
-* **注**: サポートされていないを返す`null`.
-
-* **ims**: サポートされていないを返す`null`.
-
-* **誕生日**: サポートされていないを返す`null`.
-
-* **カテゴリ**: サポートされていないを返す`null`.
-
-### Windows の癖
-
-* **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。
-
-* **誕生日**: サポートされていないを返す`null`.
-
-* **カテゴリ**: サポートされていないを返す`null`.
-
-## ContactAddress
-
-`ContactAddress` オブジェクトは、連絡先の 1 つのアドレスのプロパティを格納します。 `Contact` オブジェクトは、`ContactAddress` 配列の 1 つ以上のアドレスなどがあります。
-
-### プロパティ
-
-* **県**: に設定されている `true` 場合は、この `ContactAddress` ユーザーの推奨値が含まれています。*(ブール値)*
-
-* **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
-
-* **書式設定**: 表示用にフォーマットの完全なアドレス。*(,)*
-
-* **番地**: 完全な住所。*(,)*
-
-* **局所性**: 都市または場所。*(,)*
-
-* **地域**: 状態または地域。*(,)*
-
-* **郵便番号**: 郵便番号または郵便番号。*(,)*
-
-* **国**: 国の名前。*(,)*
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### 例
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### アンドロイド 2.X 癖
-
-* **県**: サポートされていない返す `false` 2.X の Android デバイスで。
-
-### ブラックベリー 10 癖
-
-* **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
-
-* **種類**: 部分的にサポートされます。連絡先ごとの 1 つだけ各*仕事*と*家庭*の種類のアドレスを格納できます。
-
-* **フォーマット**: 部分的にサポートされます。すべての BlackBerry アドレス フィールドの連結を返します。
-
-* **番地**: サポートされています。ブラックベリーの**住所 1** **住所 2**の連結アドレス フィールドを返します。
-
-* **局所性**: サポートされています。ブラックベリー**市**アドレス フィールドに格納されます。
-
-* **地域**: サポートされています。ブラックベリー **stateProvince**アドレス フィールドに格納されます。
-
-* **郵便番号**: サポートされています。ブラックベリー **zipPostal**アドレス フィールドに格納されます。
-
-* **国**: サポートされています。
-
-### FirefoxOS の癖
-
-* **フォーマット**: 現在サポートされていません
-
-### iOS の癖
-
-* **県**: 戻る iOS デバイスでサポートされていません`false`.
-
-* **フォーマット**: 現在サポートされていません。
-
-### Windows 8 の癖
-
-* **県**: サポートされていません。
-
-### Windows の癖
-
-* **県**: サポートされていません。
-
-## ContactError
-
-`ContactError` オブジェクトにエラーが発生したときに `contactError` コールバック関数を通じてユーザーに返されます。
-
-### プロパティ
-
-* **コード**: 次のいずれかの定義済みのエラー コード。
-
-### 定数
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-`ContactField` オブジェクトは連絡先フィールドを総称を表す再利用可能なコンポーネントです。 各 `ContactField` オブジェクトには `値` `型`、および `県` プロパティが含まれています。 `連絡先` オブジェクトは、`ContactField` 配列に、電話番号、メール アドレスなどのいくつかのプロパティを格納します。
-
-ほとんどの場合、`ContactField` オブジェクトの **type** 属性のあらかじめ決められた値はありません。 たとえば、電話番号が *ホーム*、*仕事*、*モバイル*、*iPhone*、または特定のデバイス プラットフォームの連絡先データベースでサポートされている他の値の **型** の値を指定できます。 ただし、`連絡先` **の写真**] のフィールド **の種類**] フィールドを示します返される画像の形式: **url** **値** 属性 **値** を base64 でエンコードされたイメージの文字列が含まれる場合に写真イメージまたは *base64* に URL が含まれる場合。
-
-### プロパティ
-
-* **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
-
-* **値**: 電話番号や電子メール アドレスなど、フィールドの値。*(,)*
-
-* **県**: に設定されている `true` 場合は、この `ContactField` ユーザーの推奨値が含まれています。*(ブール値)*
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### 例
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Android の癖
-
-* **県**: サポートされていないを返す`false`.
-
-### ブラックベリー 10 癖
-
-* **種類**: 部分的にサポートされます。電話番号を使用します。
-
-* **値**: サポートされています。
-
-* **県**: サポートされていないを返す`false`.
-
-### iOS の癖
-
-* **県**: サポートされていないを返す`false`.
-
-### Windows8 の癖
-
-* **県**: サポートされていないを返す`false`.
-
-### Windows の癖
-
-* **県**: サポートされていないを返す`false`.
-
-## 得意先コード
-
-異なる種類 `Contact` オブジェクトの名前についての情報にはが含まれています。
-
-### プロパティ
-
-* **フォーマット**: 連絡先の完全な名前。*(,)*
-
-* **familyName**: 連絡先の姓。*(,)*
-
-* **givenName**: 連絡先の名前。*(,)*
-
-* **ミドル ネーム**: 連絡先のミドル ネーム。*(,)*
-
-* **honorificPrefix**: 連絡先のプレフィックス (例*氏*または*博士*) *(,)*
-
-* **honorificSuffix**: 連絡先のサフィックス (*弁護士*の例)。*(,)*
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### 例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android の癖
-
-* **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
-
-### ブラックベリー 10 癖
-
-* **フォーマット**: 部分的にサポートされます。ブラックベリー **firstName**と**lastName**フィールドの連結を返します。
-
-* **familyName**: サポートされています。ブラックベリー **[氏名]**フィールドに格納されます。
-
-* **givenName**: サポートされています。ブラックベリーの**firstName**フィールドに格納されます。
-
-* **ミドル ネーム**: サポートされていないを返す`null`.
-
-* **honorificPrefix**: サポートされていないを返す`null`.
-
-* **honorificSuffix**: サポートされていないを返す`null`.
-
-### FirefoxOS の癖
-
-* **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
-
-### iOS の癖
-
-* **フォーマット**: 部分的にサポートされます。IOS 複合名を返しますが、読み取り専用です。
-
-### Windows 8 の癖
-
-* **フォーマット**: これは、プロパティの名前し、同じです `displayName` と`nickname`
-
-* **familyName**: サポートされていません。
-
-* **givenName**: サポートされていません。
-
-* **ミドル ネーム**: サポートされていません。
-
-* **honorificPrefix**: サポートされていません。
-
-* **honorificSuffix**: サポートされていません。
-
-### Windows の癖
-
-* **フォーマット**: と同じです`displayName`
-
-## ContactOrganization
-
-`ContactOrganization` オブジェクトは、連絡先の組織のプロパティを格納します。`連絡先` オブジェクトは、配列の 1 つ以上の `ContactOrganization` オブジェクトを格納します。
-
-### プロパティ
-
-* **県**: に設定されている `true` 場合は、この `ContactOrganization` ユーザーの推奨値が含まれています。*(ブール値)*
-
-* **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。_(DOMString)
-
-* **名前**: 組織の名前。*(,)*
-
-* **部門**: 契約に勤めている部門。*(,)*
-
-* **タイトル**: 組織の連絡先のタイトル。*(,)*
-
-### サポートされているプラットフォーム
-
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows (Windows 8.1 および Windows Phone 8.1 装置のみ)
-
-### 例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### アンドロイド 2.X 癖
-
-* **県**: 返す 2.X の Android デバイスでサポートされていません`false`.
-
-### ブラックベリー 10 癖
-
-* **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
-
-* **タイプ**: 戻る、BlackBerry デバイスでサポートされていません`null`.
-
-* **名前**: 部分的にサポートされます。最初の組織名は、**会社**のブラックベリーのフィールドに格納されます。
-
-* **部門**: サポートされていないを返す`null`.
-
-* **タイトル**: 部分的にサポートされます。組織の最初のタイトルはブラックベリー**氏名**フィールドに格納されます。
-
-### Firefox OS 癖
-
-* **県**: サポートされていません。
-
-* **タイプ**: サポートされていません。
-
-* **部門**: サポートされていません。
-
-* フィールドの**名前**と**組織**、**氏名**に格納された**タイトル**.
-
-### iOS の癖
-
-* **県**: 戻る iOS デバイスでサポートされていません`false`.
-
-* **タイプ**: 戻る iOS デバイスでサポートされていません`null`.
-
-* **名前**: 部分的にサポートされます。最初の組織名は、iOS **kABPersonOrganizationProperty**フィールドに格納されます。
-
-* **部門**: 部分的にサポートされます。最初の部署名は iOS **kABPersonDepartmentProperty**フィールドに格納されます。
-
-* **タイトル**: 部分的にサポートされます。最初のタイトルは、iOS **kABPersonJobTitleProperty**フィールドに格納されます。
-
-### Windows の癖
-
-* **県**: サポートされていないを返す`false`.
-
-* **タイプ**: サポートされていないを返す`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/ko/README.md b/plugins/cordova-plugin-contacts/doc/ko/README.md
deleted file mode 100644
index 53e51db..0000000
--- a/plugins/cordova-plugin-contacts/doc/ko/README.md
+++ /dev/null
@@ -1,735 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-이 플러그인 장치 연락처 데이터베이스에 대 한 액세스를 제공 하는 글로벌 `navigator.contacts` 개체를 정의 합니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**경고**: 중요 한 개인 정보 보호 문제를 제기 하는 연락처 데이터의 수집 및 사용 합니다. 응용 프로그램의 개인 정보 보호 정책 응용 프로그램 연락처 데이터를 사용 하는 방법 및 다른 당사자와 함께 공유 하는 여부를 토론 해야 한다. 연락처 정보 누구와 통신 하는 사람이 사람들 보여 때문에 민감한으로 간주 됩니다. 따라서, 애플 리 케이 션의 개인 정보 보호 정책 뿐만 아니라 강력 하 게 고려해 야 장치 운영 체제는 이렇게 이미 하지 않는 경우 응용 프로그램 액세스 또는 연락처 데이터를 사용 하기 전에 그냥--시간 통지를 제공 합니다. 그 통지는 (예를 들어, **확인** 및 **아니오** 선택 제시) 하 여 사용자의 허가 취득 뿐만 아니라, 위에서 언급 된 동일한 정보를 제공 해야 합니다. Note 일부 애플 리 케이 션 장 터 그냥--시간 공지 및 연락처 데이터에 액세스 하기 전에 사용자의 허가 받아야 응용 프로그램에 필요할 수 있습니다. 연락처 데이터는 사용자의 혼동을 방지할 수의 사용 및 연락처 데이터의 인식된 오용 명확 하 고 이해 하기 쉬운 사용자 경험. 자세한 내용은 개인 정보 보호 가이드를 참조 하십시오.
-
-## 설치
-
-코르도바 5.0 + (현재 안정적인 v1.0.0) 필요
-
- cordova plugin add cordova-plugin-contacts
-
-
-코르도바의 이전 버전 **사용** id (오래 된 v0.2.16)를 통해 설치할 수 있습니다.
-
- cordova plugin add org.apache.cordova.contacts
-
-
-그것은 또한 배상 계약 url을 통해 직접 설치할 수 (불안정)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### 파이어 폭스 OS 단점
-
-[참고 문서](https://developer.mozilla.org/en-US/Apps/Developing/Manifest)에 설명 된 대로 **www/manifest.webapp**를 만듭니다. 관련 부여할 추가 합니다. [참고 문서](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type)에 "privileged"-webapp 유형을 변경 하려면 필요가 하다. **경고**: 모든 훌륭한 애플 리 케이 션 인라인 스크립트를 금지 하는 [콘텐츠 보안 정책](https://developer.mozilla.org/en-US/Apps/CSP)을 적용 합니다. 다른 방법으로 응용 프로그램을 초기화 합니다.
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### 윈도우 특수
-
-**이전에 창 10:** `찾기` 및 `pickContact` 메서드에서 반환 하는 모든 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다. `찾을` 방법은 Windows Phone 8.1 장치에만 사용할 수 있습니다.
-
-**윈도우 10 이상:** 연락처 저장 되 고 응용 프로그램 로컬 연락처 저장소에 저장 됩니다. 연락처도 삭제 될 수 있습니다.
-
-### 윈도우 8 단점
-
-윈도우 8 연락처는 읽기 전용입니다. 코르 도우 바 API 연락처를 통해 하지 쿼리/검색할 수 있습니다, 사용자 알려 '사람' 애플 리 케이 션을 열 것 이다 contacts.pickContact에 대 한 호출으로 연락처를 선택 하 여 사용자 연락처를 선택 해야 합니다. 반환 된 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다.
-
-## navigator.contacts
-
-### 메서드
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### 개체
-
- * 연락처
- * 담당자 이름
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-`navigator.contacts.create` 메서드는 동기적 및 새 `연락처` 개체를 반환 합니다.
-
-이 메서드는 `Contact.save` 메서드를 호출 해야 장치 연락처 데이터베이스에 연락처 개체를 유지 하지 않습니다.
-
-### 지원 되는 플랫폼
-
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
-
-### 예를 들어
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-장치 연락처 데이터베이스 쿼리 및 `Contact` 개체의 배열을 반환 `navigator.contacts.find` 메서드를 비동기적으로 실행 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
-
-**contactFields** 매개 변수는 검색 한정자로 사용할 필드를 지정 합니다. 길이가 0 인 **contactFields** 매개 변수가 유효 하 고 `ContactError.INVALID_ARGUMENT_ERROR`에서 결과. **contactFields** 값 `"*"` 모든 연락처 필드를 검색 합니다.
-
-**contactFindOptions.filter** 문자열 연락처 데이터베이스를 쿼리할 때 검색 필터로 사용할 수 있습니다. 제공 된, 대/소문자, 부분 값 일치 **contactFields** 매개 변수에 지정 된 각 필드에 적용 됩니다. *모든* 지정 된 필드의 일치 하는 경우 연락처 반환 됩니다. 사용 하 여 **contactFindOptions.desiredFields** 매개 변수 속성 문의 제어를 다시 반환 해야 합니다.
-
-### 매개 변수
-
- * **contactFields**: 검색 한정자로 사용 하는 필드에 문의. *(DOMString[])* [Required]
-
- * **contactSuccess**: 연락처 개체의 배열에 표시 되는 성공 콜백 함수는 데이터베이스에서 반환 된. [Required]
-
- * **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
-
- * **contactFindOptions**: navigator.contacts 필터링 옵션을 검색 합니다. [Optional]
-
- 키 다음과 같습니다.
-
- * **filter**: 검색 문자열 navigator.contacts를 찾는 데 사용 합니다. *(DOMString)* (기본: `""`)
-
- * **multiple**: 여러 navigator.contacts 찾기 작업을 반환 합니다 경우 결정 합니다. *(부울)* (기본값: `false`)
-
- * **desiredFields**: 연락처 필드를 다시 반환 합니다. 지정 된 경우 결과 `Contact` 기능 값만이 필드 개체입니다. *(DOMString[])* [Optional]
-
-### 지원 되는 플랫폼
-
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도 (Windows Phone 8.1, 윈도 10)
-
-### 예를 들어
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### 윈도우 특수
-
- * `__contactFields__`지원 되지 않으며 무시 됩니다. `find`메서드가 항상 이름, 이메일 주소 또는 연락처의 전화 번호를 일치 하도록 시도 합니다.
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact` 메서드를 사용 하면 단일 연락처 선택 문의 선택 시작 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
-
-### 매개 변수
-
- * **contactSuccess**: 단일 연락처 개체와 호출 되는 성공 콜백 함수. [필수]
-
- * **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
-
-### 지원 되는 플랫폼
-
- * 안 드 로이드
- * iOS
- * Windows Phone 8
- * 윈도우 8
- * 윈도우
-
-### 예를 들어
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## 연락처
-
-`Contact` 개체는 사용자의 연락처를 나타냅니다. 연락처 생성 수, 저장 또는 장치 연락처 데이터베이스에서 제거 합니다. 연락처도 검색할 수 있습니다 (개별적으로 또는 일괄적으로) 데이터베이스에서 `navigator.contacts.find` 메서드를 호출 하 여.
-
-**참고**: 모든 연락처 필드 위에 나열 된 모든 장치 플랫폼에서 지원 됩니다. 자세한 내용은 각 플랫폼의 *단점이* 섹션을 확인 하시기 바랍니다.
-
-### 속성
-
- * **id**: 글로벌 고유 식별자. *(DOMString)*
-
- * **displayName**: 최종 사용자에 게 표시에 적합이 연락처의 이름. *(DOMString)*
-
- * **이름**: 사람 이름의 모든 구성 요소를 포함 하는 개체. *(담당자 이름)*
-
- * **별명**: 캐주얼 이름 연락처 주소입니다. *(DOMString)*
-
- * **phoneNumbers**: 모든 연락처의 전화 번호의 배열. *(ContactField[])*
-
- * **이메일**: 모든 연락처의 전자 메일 주소의 배열. *(ContactField[])*
-
- * **주소**: 모든 연락처의 주소 배열. *(ContactAddress[])*
-
- * **ims**: 모든 연락처의 IM 주소 배열. *(ContactField[])*
-
- * **조직**: 다양 한 모든 연락처의 조직. *(ContactOrganization[])*
-
- * **생일**: 연락처의 생일. *(날짜)*
-
- * **참고**: 연락처에 대 한 참고. *(DOMString)*
-
- * **사진**: 연락처의 사진을 배열. *(ContactField[])*
-
- * **카테고리**: 모든 사용자 정의 범주 연락처에 연결 된 배열. *(ContactField[])*
-
- * **url**: 연락처에 연결 된 웹 페이지의 배열. *(ContactField[])*
-
-### 메서드
-
- * **복제**: 새로운 반환 합니다 `Contact` 으로 호출 하는 개체의 전체 복사본은 개체는 `id` 속성으로 설정`null`.
-
- * **제거**: 장치 연락처 데이터베이스에서 연락처를 제거 합니다, 그렇지 않으면와 오류 콜백을 실행 한 `ContactError` 개체.
-
- * **저장**: 장치 연락처 데이터베이스를 새 연락처를 저장 또는 동일한 **id** 를 가진 연락처가 이미 있는 경우 기존 연락처를 업데이트 합니다.
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### 예를 들어 저장
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### 복제 예제
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### 예제 제거
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### 안 드 로이드 2.X 단점
-
- * **카테고리**: 안 드 로이드 2.X 장치, 반환에서 지원 되지 않습니다`null`.
-
-### 블랙베리 10 단점
-
- * **id**: 연락처를 저장 하면 장치에 할당 합니다.
-
-### FirefoxOS 특수
-
- * **카테고리**: 부분적으로 지원 합니다. 필드 **pref** 및 **형식** 반환`null`
-
- * **ims**: 지원 되지 않음
-
- * **사진**: 지원 되지 않음
-
-### iOS 단점
-
- * **displayName**: 반환 iOS에서 지원 되지 않는 `null` 가 아무 `ContactName` 지정 된,이 경우 복합 이름, **닉네임** 을 반환 합니다 또는 `""` , 각각.
-
- * **생일**: 자바 스크립트로 입력 해야 합니다 `Date` 개체를 같은 방식으로 반환 됩니다.
-
- * **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다. 응용 프로그램이 종료 될 때 임시 디렉터리의 내용은 제거 됩니다.
-
- * **카테고리**:이 속성은 현재 지원 되지 않습니다, 반환`null`.
-
-### Windows Phone 7, 8 특수
-
- * **displayName**: 연락처를 만들 때 표시 이름에서 표시 이름 매개 변수 다릅니다 제공 값 검색 연락처를 찾을 때.
-
- * **url**: 연락처를 만들 때 사용자가 입력을 하나 이상의 웹 주소를 저장 하지만 하나만 사용할 수 있는 연락처를 검색할 때.
-
- * **phoneNumbers**: *pref* 옵션이 지원 되지 않습니다. *형식* *찾기* 작업에서 지원 되지 않습니다. 단 하나 `phoneNumber` 각 *형식* 에 대 한 허용.
-
- * **이메일**: *pref* 옵션이 지원 되지 않습니다. 가정 및 개인 동일한 이메일 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
-
- * **주소**: 직장, 및 가정/개인 *유형*을 지원 합니다. 가정 및 개인 *유형* 동일한 주소 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
-
- * **조직**: 하나만 허용 되 고 *pref*, *유형*및 *부서* 특성을 지원 하지 않습니다.
-
- * **참고**: 지원 되지 않는 반환`null`.
-
- * **ims**: 지원 되지 않는 반환`null`.
-
- * **생일**: 지원 되지 않는 반환`null`.
-
- * **카테고리**: 지원 되지 않는 반환`null`.
-
- * **제거**: 메서드가 지원 되지 않습니다
-
-### 윈도우 특수
-
- * **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다.
-
- * **생일**: 지원 되지 않는 반환`null`.
-
- * **카테고리**: 지원 되지 않는 반환`null`.
-
- * **제거**: 메서드는 Windows 10 이상 에서만 지원 됩니다.
-
-## ContactAddress
-
-`ContactAddress` 개체는 연락처의 단일 주소 속성을 저장합니다. `연락처` 개체는 `ContactAddress` 배열에 있는 하나 이상의 주소를 포함할 수 있습니다.
-
-### 속성
-
- * **pref**: 설정 `true` 이 경우 `ContactAddress` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
-
- * **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열. *(DOMString)*
-
- * **포맷**: 전체 주소 표시를 위해 서식이 지정 된. *(DOMString)*
-
- * **streetAddress**: 전체 주소. *(DOMString)*
-
- * **지역**: 구, 군 또는 도시. *(DOMString)*
-
- * **지역**: 상태 또는 지역. *(DOMString)*
-
- * **postalCode**: 우편 번호 또는 우편 번호. *(DOMString)*
-
- * **국가**: 국가 이름. *(DOMString)*
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### 예를 들어
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### 안 드 로이드 2.X 단점
-
- * **pref**: 지원 되지 않는 반환 `false` 안 드 로이드 2.X 장치에.
-
-### 블랙베리 10 단점
-
- * **pref**: 반환 BlackBerry 장치에서 지원 되지 않습니다`false`.
-
- * **유형**: 부분적으로 지원 합니다. *작업* 및 *홈* 형식 주소 각 단 하나 접촉 당 저장할 수 있습니다.
-
- * **포맷**: 부분적으로 지원 합니다. 모든 검은 딸기 주소 필드의 연결을 반환합니다.
-
- * **streetAddress**: 지원. 블랙베리 **address1** **주소 2** 의 연결 주소 필드를 반환합니다.
-
- * **지역**: 지원. 블랙베리 **시** 주소 필드에 저장 합니다.
-
- * **지역**: 지원. 블랙베리 **stateProvince** 주소 필드에 저장 합니다.
-
- * **postalCode**: 지원. 블랙베리 **zipPostal** 주소 필드에 저장 합니다.
-
- * **국가**: 지원.
-
-### FirefoxOS 특수
-
- * **포맷**: 현재 지원 되지 않습니다
-
-### iOS 단점
-
- * **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
-
- * **포맷**: 현재 지원 되지 않습니다.
-
-### 윈도우 8 단점
-
- * **pref**: 지원 되지 않음
-
-### 윈도우 특수
-
- * **pref**: 지원 되지 않음
-
-## ContactError
-
-`ContactError` 개체는 오류가 발생 하면 `contactError` 콜백 함수를 통해 사용자에 게 반환 됩니다.
-
-### 속성
-
- * **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
-
-### 상수
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-`ContactField` 개체는 재사용 가능한 구성 요소를 나타내는 필드를 일반적으로 문의입니다. 각 `ContactField` 개체에는 `value`, `type` 및 `pref` 속성을 포함 되어 있습니다. `Contact` 개체는 전화 번호 및 이메일 주소와 같은 `ContactField` 배열에서 몇 가지 속성을 저장합니다.
-
-대부분의 경우에서는 `ContactField` 개체의 **type** 속성에 대 한 미리 정해진된 값이 없습니다. 예를 들어 전화 번호 *홈*, *작품*, *모바일*, *아이폰* 또는 특정 장치 플랫폼의 연락처 데이터베이스에서 지원 되는 다른 값의 **유형** 값을 지정할 수 있습니다. 그러나, `연락처` **사진** 필드 **유형** 필드 나타냅니다 반환 된 이미지 형식: **url** **값** 특성 **값** 이미지 base64 인코딩된 문자열을 포함 하는 경우 사진 이미지 또는 *base64* URL이 포함 된 경우.
-
-### 속성
-
- * **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. *(DOMString)*
-
- * **값**: 전화 번호 또는 이메일 주소와 같은 필드 값. *(DOMString)*
-
- * **pref**: 설정 `true` 이 경우 `ContactField` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### 예를 들어
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### 안 드 로이드 단점
-
- * **pref**: 지원 되지 않는 반환`false`.
-
-### 블랙베리 10 단점
-
- * **유형**: 부분적으로 지원 합니다. 전화 번호에 대 한 사용.
-
- * **값**: 지원.
-
- * **pref**: 지원 되지 않는 반환`false`.
-
-### iOS 단점
-
- * **pref**: 지원 되지 않는 반환`false`.
-
-### Windows8 단점
-
- * **pref**: 지원 되지 않는 반환`false`.
-
-### 윈도우 특수
-
- * **pref**: 지원 되지 않는 반환`false`.
-
-## 담당자 이름
-
-여러 종류의 `Contact` 개체의 이름에 대 한 정보를 포함합니다.
-
-### 속성
-
- * **포맷**: 연락처의 전체 이름. *(DOMString)*
-
- * **familyName**: 연락처의 성. *(DOMString)*
-
- * **givenName**: 연락처의 이름. *(DOMString)*
-
- * **middleName**: 연락처의 중간 이름을. *(DOMString)*
-
- * **honorificPrefix**: 연락처의 접두사 (예: *미스터* 또는 *닥터*) *(DOMString)*
-
- * **honorificSuffix**: 연락처의 접미사 ( *esq.*예). *(DOMString)*
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### 예를 들어
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### 안 드 로이드 단점
-
- * **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
-
-### 블랙베리 10 단점
-
- * **포맷**: 부분적으로 지원 합니다. 블랙베리 **firstName** 및 **lastName** 필드의 연결을 반환합니다.
-
- * **familyName**: 지원. 블랙베리 **lastName** 필드에 저장 합니다.
-
- * **givenName**: 지원. 블랙베리 **firstName** 필드에 저장 합니다.
-
- * **middleName**: 지원 되지 않는 반환`null`.
-
- * **honorificPrefix**: 지원 되지 않는 반환`null`.
-
- * **honorificSuffix**: 지원 되지 않는 반환`null`.
-
-### FirefoxOS 특수
-
- * **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
-
-### iOS 단점
-
- * **포맷**: 부분적으로 지원 합니다. IOS 복합 이름 반환 하지만 읽기 전용입니다.
-
-### 윈도우 8 단점
-
- * **형식**: 이것은 유일한 속성 이름과 동일 하다 `displayName` , 및`nickname`
-
- * **familyName**: 지원 되지 않음
-
- * **givenName**: 지원 되지 않음
-
- * **middleName**: 지원 되지 않음
-
- * **honorificPrefix**: 지원 되지 않음
-
- * **honorificSuffix**: 지원 되지 않음
-
-### 윈도우 특수
-
- * **형식**: 그것은 동일`displayName`
-
-## ContactOrganization
-
-`ContactOrganization` 개체는 연락처의 조직 속성을 저장합니다. `Contact` 개체 배열에 하나 이상의 `ContactOrganization` 개체를 저장합니다.
-
-### 속성
-
- * **pref**: 설정 `true` 이 경우 `ContactOrganization` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
-
- * **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. _(DOMString)
-
- * **이름**: 조직 이름. *(DOMString)*
-
- * **부서**: 계약을 위해 일 하는 부서. *(DOMString)*
-
- * **제목**: 조직에서 연락처의 제목. *(DOMString)*
-
-### 지원 되는 플랫폼
-
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도우 (Windows 8.1와 Windows Phone 8.1 소자만 해당)
-
-### 예를 들어
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### 안 드 로이드 2.X 단점
-
- * **pref**: 반환 안 드 로이드 2.X 장치에 의해 지원 되지 않습니다`false`.
-
-### 블랙베리 10 단점
-
- * **pref**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`false`.
-
- * **유형**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`null`.
-
- * **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름 블랙베리 **회사** 필드에 저장 됩니다.
-
- * **부서**: 지원 되지 않는 반환`null`.
-
- * **제목**: 부분적으로 지원 합니다. 첫 번째 조직 제목 블랙베리 **jobTitle** 필드에 저장 됩니다.
-
-### 파이어 폭스 OS 단점
-
- * **pref**: 지원 되지 않음
-
- * **형식**: 지원 되지 않음
-
- * **부서**: 지원 되지 않음
-
- * 필드 **이름** 및 **제목** **org** 및 **jobTitle** 에 저장.
-
-### iOS 단점
-
- * **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
-
- * **유형**: 반환 하는 iOS 장치에서 지원 되지 않습니다`null`.
-
- * **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름은 iOS **kABPersonOrganizationProperty** 필드에 저장 됩니다.
-
- * **부서**: 부분적으로 지원 합니다. 첫 번째 부서 이름은 iOS **kABPersonDepartmentProperty** 필드에 저장 됩니다.
-
- * **제목**: 부분적으로 지원 합니다. 첫 번째 타이틀 iOS **kABPersonJobTitleProperty** 필드에 저장 됩니다.
-
-### 윈도우 특수
-
- * **pref**: 지원 되지 않는 반환`false`.
-
- * **형식**: 지원 되지 않는 반환`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/ko/index.md b/plugins/cordova-plugin-contacts/doc/ko/index.md
deleted file mode 100644
index fff221c..0000000
--- a/plugins/cordova-plugin-contacts/doc/ko/index.md
+++ /dev/null
@@ -1,719 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-이 플러그인 장치 연락처 데이터베이스에 대 한 액세스를 제공 하는 글로벌 `navigator.contacts` 개체를 정의 합니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**경고**: 중요 한 개인 정보 보호 문제를 제기 하는 연락처 데이터의 수집 및 사용 합니다. 응용 프로그램의 개인 정보 보호 정책 응용 프로그램 연락처 데이터를 사용 하는 방법 및 다른 당사자와 함께 공유 하는 여부를 토론 해야 한다. 연락처 정보 누구와 통신 하는 사람이 사람들 보여 때문에 민감한으로 간주 됩니다. 따라서, 애플 리 케이 션의 개인 정보 보호 정책 뿐만 아니라 강력 하 게 고려해 야 장치 운영 체제는 이렇게 이미 하지 않는 경우 응용 프로그램 액세스 또는 연락처 데이터를 사용 하기 전에 그냥--시간 통지를 제공 합니다. 그 통지는 (예를 들어, **확인** 및 **아니오** 선택 제시) 하 여 사용자의 허가 취득 뿐만 아니라, 위에서 언급 된 동일한 정보를 제공 해야 합니다. Note 일부 애플 리 케이 션 장 터 그냥--시간 공지 및 연락처 데이터에 액세스 하기 전에 사용자의 허가 받아야 응용 프로그램에 필요할 수 있습니다. 연락처 데이터는 사용자의 혼동을 방지할 수의 사용 및 연락처 데이터의 인식된 오용 명확 하 고 이해 하기 쉬운 사용자 경험. 자세한 내용은 개인 정보 보호 가이드를 참조 하십시오.
-
-## 설치
-
- cordova plugin add cordova-plugin-contacts
-
-
-### 파이어 폭스 OS 단점
-
-[참고 문서][1]에 설명 된 대로 **www/manifest.webapp**를 만듭니다. 관련 부여할 추가 합니다. [참고 문서][2]에 "privileged"-webapp 유형을 변경 하려면 필요가 하다. **경고**: 모든 훌륭한 애플 리 케이 션 인라인 스크립트를 금지 하는 [콘텐츠 보안 정책][3]을 적용 합니다. 다른 방법으로 응용 프로그램을 초기화 합니다.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### 윈도우 특수
-
-`find` 및 `pickContact` 메서드에서 반환 하는 모든 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다. `찾을` 방법은 Windows Phone 8.1 장치에만 사용할 수 있습니다.
-
-### 윈도우 8 단점
-
-윈도우 8 연락처는 읽기 전용입니다. 코르 도우 바 API 연락처를 통해 하지 쿼리/검색할 수 있습니다, 사용자 알려 '사람' 애플 리 케이 션을 열 것 이다 contacts.pickContact에 대 한 호출으로 연락처를 선택 하 여 사용자 연락처를 선택 해야 합니다. 반환 된 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다.
-
-## navigator.contacts
-
-### 메서드
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### 개체
-
-* 연락처
-* 담당자 이름
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## navigator.contacts.create
-
-`navigator.contacts.create` 메서드는 동기적 및 새 `연락처` 개체를 반환 합니다.
-
-이 메서드는 `Contact.save` 메서드를 호출 해야 장치 연락처 데이터베이스에 연락처 개체를 유지 하지 않습니다.
-
-### 지원 되는 플랫폼
-
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-
-### 예를 들어
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-장치 연락처 데이터베이스 쿼리 및 `Contact` 개체의 배열을 반환 `navigator.contacts.find` 메서드를 비동기적으로 실행 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
-
-**contactFields** 매개 변수는 검색 한정자로 사용할 필드를 지정 합니다. 길이가 0 인 **contactFields** 매개 변수가 유효 하 고 `ContactError.INVALID_ARGUMENT_ERROR`에서 결과. **contactFields** 값 `"*"` 모든 연락처 필드를 검색 합니다.
-
-**contactFindOptions.filter** 문자열 연락처 데이터베이스를 쿼리할 때 검색 필터로 사용할 수 있습니다. 제공 된, 대/소문자, 부분 값 일치 **contactFields** 매개 변수에 지정 된 각 필드에 적용 됩니다. *모든* 지정 된 필드의 일치 하는 경우 연락처 반환 됩니다. 사용 하 여 **contactFindOptions.desiredFields** 매개 변수 속성 문의 제어를 다시 반환 해야 합니다.
-
-### 매개 변수
-
-* **contactFields**: 검색 한정자로 사용 하는 필드에 문의. *(DOMString[])* [Required]
-
-* **contactSuccess**: 연락처 개체의 배열에 표시 되는 성공 콜백 함수는 데이터베이스에서 반환 된. [Required]
-
-* **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
-
-* **contactFindOptions**: navigator.contacts 필터링 옵션을 검색 합니다. [Optional]
-
- 키 다음과 같습니다.
-
- * **filter**: 검색 문자열 navigator.contacts를 찾는 데 사용 합니다. *(DOMString)* (기본: `""`)
-
- * **multiple**: 여러 navigator.contacts 찾기 작업을 반환 합니다 경우 결정 합니다. *(부울)* (기본값: `false`)
-
- * **desiredFields**: 연락처 필드를 다시 반환 합니다. 지정 된 경우 결과 `Contact` 기능 값만이 필드 개체입니다. *(DOMString[])* [Optional]
-
-### 지원 되는 플랫폼
-
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 (Windows Phone 8.1 소자만 해당)
-
-### 예를 들어
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### 윈도우 특수
-
-* `__contactFields__`지원 되지 않으며 무시 됩니다. `find`메서드가 항상 이름, 이메일 주소 또는 연락처의 전화 번호를 일치 하도록 시도 합니다.
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact` 메서드를 사용 하면 단일 연락처 선택 문의 선택 시작 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
-
-### 매개 변수
-
-* **contactSuccess**: 단일 연락처 개체와 호출 되는 성공 콜백 함수. [필수]
-
-* **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
-
-### 지원 되는 플랫폼
-
-* 안 드 로이드
-* iOS
-* Windows Phone 8
-* 윈도우 8
-* 윈도우
-
-### 예를 들어
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## 연락처
-
-`Contact` 개체는 사용자의 연락처를 나타냅니다. 연락처 생성 수, 저장 또는 장치 연락처 데이터베이스에서 제거 합니다. 연락처도 검색할 수 있습니다 (개별적으로 또는 일괄적으로) 데이터베이스에서 `navigator.contacts.find` 메서드를 호출 하 여.
-
-**참고**: 모든 연락처 필드 위에 나열 된 모든 장치 플랫폼에서 지원 됩니다. 자세한 내용은 각 플랫폼의 *단점이* 섹션을 확인 하시기 바랍니다.
-
-### 속성
-
-* **id**: 글로벌 고유 식별자. *(DOMString)*
-
-* **displayName**: 최종 사용자에 게 표시에 적합이 연락처의 이름. *(DOMString)*
-
-* **이름**: 사람 이름의 모든 구성 요소를 포함 하는 개체. *(담당자 이름)*
-
-* **별명**: 캐주얼 이름 연락처 주소입니다. *(DOMString)*
-
-* **phoneNumbers**: 모든 연락처의 전화 번호의 배열. *(ContactField[])*
-
-* **이메일**: 모든 연락처의 전자 메일 주소의 배열. *(ContactField[])*
-
-* **주소**: 모든 연락처의 주소 배열. *(ContactAddress[])*
-
-* **ims**: 모든 연락처의 IM 주소 배열. *(ContactField[])*
-
-* **조직**: 다양 한 모든 연락처의 조직. *(ContactOrganization[])*
-
-* **생일**: 연락처의 생일. *(날짜)*
-
-* **참고**: 연락처에 대 한 참고. *(DOMString)*
-
-* **사진**: 연락처의 사진을 배열. *(ContactField[])*
-
-* **카테고리**: 모든 사용자 정의 범주 연락처에 연결 된 배열. *(ContactField[])*
-
-* **url**: 연락처에 연결 된 웹 페이지의 배열. *(ContactField[])*
-
-### 메서드
-
-* **복제**: 새로운 반환 합니다 `Contact` 으로 호출 하는 개체의 전체 복사본은 개체는 `id` 속성으로 설정`null`.
-
-* **제거**: 장치 연락처 데이터베이스에서 연락처를 제거 합니다, 그렇지 않으면와 오류 콜백을 실행 한 `ContactError` 개체.
-
-* **저장**: 장치 연락처 데이터베이스를 새 연락처를 저장 또는 동일한 **id** 를 가진 연락처가 이미 있는 경우 기존 연락처를 업데이트 합니다.
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### 예를 들어 저장
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### 복제 예제
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### 예제 제거
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### 안 드 로이드 2.X 단점
-
-* **카테고리**: 안 드 로이드 2.X 장치, 반환에서 지원 되지 않습니다`null`.
-
-### 블랙베리 10 단점
-
-* **id**: 연락처를 저장 하면 장치에 할당 합니다.
-
-### FirefoxOS 특수
-
-* **카테고리**: 부분적으로 지원 합니다. 필드 **pref** 및 **형식** 반환`null`
-
-* **ims**: 지원 되지 않음
-
-* **사진**: 지원 되지 않음
-
-### iOS 단점
-
-* **displayName**: 반환 iOS에서 지원 되지 않는 `null` 가 아무 `ContactName` 지정 된,이 경우 복합 이름, **닉네임** 을 반환 합니다 또는 `""` , 각각.
-
-* **생일**: 자바 스크립트로 입력 해야 합니다 `Date` 개체를 같은 방식으로 반환 됩니다.
-
-* **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다. 응용 프로그램이 종료 될 때 임시 디렉터리의 내용은 제거 됩니다.
-
-* **카테고리**:이 속성은 현재 지원 되지 않습니다, 반환`null`.
-
-### Windows Phone 7, 8 특수
-
-* **displayName**: 연락처를 만들 때 표시 이름에서 표시 이름 매개 변수 다릅니다 제공 값 검색 연락처를 찾을 때.
-
-* **url**: 연락처를 만들 때 사용자가 입력을 하나 이상의 웹 주소를 저장 하지만 하나만 사용할 수 있는 연락처를 검색할 때.
-
-* **phoneNumbers**: *pref* 옵션이 지원 되지 않습니다. *형식* *찾기* 작업에서 지원 되지 않습니다. 단 하나 `phoneNumber` 각 *형식* 에 대 한 허용.
-
-* **이메일**: *pref* 옵션이 지원 되지 않습니다. 가정 및 개인 동일한 이메일 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
-
-* **주소**: 직장, 및 가정/개인 *유형*을 지원 합니다. 가정 및 개인 *유형* 동일한 주소 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
-
-* **조직**: 하나만 허용 되 고 *pref*, *유형*및 *부서* 특성을 지원 하지 않습니다.
-
-* **참고**: 지원 되지 않는 반환`null`.
-
-* **ims**: 지원 되지 않는 반환`null`.
-
-* **생일**: 지원 되지 않는 반환`null`.
-
-* **카테고리**: 지원 되지 않는 반환`null`.
-
-### 윈도우 특수
-
-* **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다.
-
-* **생일**: 지원 되지 않는 반환`null`.
-
-* **카테고리**: 지원 되지 않는 반환`null`.
-
-## ContactAddress
-
-`ContactAddress` 개체는 연락처의 단일 주소 속성을 저장합니다. `연락처` 개체는 `ContactAddress` 배열에 있는 하나 이상의 주소를 포함할 수 있습니다.
-
-### 속성
-
-* **pref**: 설정 `true` 이 경우 `ContactAddress` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
-
-* **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열. *(DOMString)*
-
-* **포맷**: 전체 주소 표시를 위해 서식이 지정 된. *(DOMString)*
-
-* **streetAddress**: 전체 주소. *(DOMString)*
-
-* **지역**: 구, 군 또는 도시. *(DOMString)*
-
-* **지역**: 상태 또는 지역. *(DOMString)*
-
-* **postalCode**: 우편 번호 또는 우편 번호. *(DOMString)*
-
-* **국가**: 국가 이름. *(DOMString)*
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### 예를 들어
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### 안 드 로이드 2.X 단점
-
-* **pref**: 지원 되지 않는 반환 `false` 안 드 로이드 2.X 장치에.
-
-### 블랙베리 10 단점
-
-* **pref**: 반환 BlackBerry 장치에서 지원 되지 않습니다`false`.
-
-* **유형**: 부분적으로 지원 합니다. *작업* 및 *홈* 형식 주소 각 단 하나 접촉 당 저장할 수 있습니다.
-
-* **포맷**: 부분적으로 지원 합니다. 모든 검은 딸기 주소 필드의 연결을 반환합니다.
-
-* **streetAddress**: 지원. 블랙베리 **address1** **주소 2** 의 연결 주소 필드를 반환합니다.
-
-* **지역**: 지원. 블랙베리 **시** 주소 필드에 저장 합니다.
-
-* **지역**: 지원. 블랙베리 **stateProvince** 주소 필드에 저장 합니다.
-
-* **postalCode**: 지원. 블랙베리 **zipPostal** 주소 필드에 저장 합니다.
-
-* **국가**: 지원.
-
-### FirefoxOS 특수
-
-* **포맷**: 현재 지원 되지 않습니다
-
-### iOS 단점
-
-* **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
-
-* **포맷**: 현재 지원 되지 않습니다.
-
-### 윈도우 8 단점
-
-* **pref**: 지원 되지 않음
-
-### 윈도우 특수
-
-* **pref**: 지원 되지 않음
-
-## ContactError
-
-`ContactError` 개체는 오류가 발생 하면 `contactError` 콜백 함수를 통해 사용자에 게 반환 됩니다.
-
-### 속성
-
-* **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
-
-### 상수
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-`ContactField` 개체는 재사용 가능한 구성 요소를 나타내는 필드를 일반적으로 문의입니다. 각 `ContactField` 개체에는 `value`, `type` 및 `pref` 속성을 포함 되어 있습니다. `Contact` 개체는 전화 번호 및 이메일 주소와 같은 `ContactField` 배열에서 몇 가지 속성을 저장합니다.
-
-대부분의 경우에서는 `ContactField` 개체의 **type** 속성에 대 한 미리 정해진된 값이 없습니다. 예를 들어 전화 번호 *홈*, *작품*, *모바일*, *아이폰* 또는 특정 장치 플랫폼의 연락처 데이터베이스에서 지원 되는 다른 값의 **유형** 값을 지정할 수 있습니다. 그러나, `연락처` **사진** 필드 **유형** 필드 나타냅니다 반환 된 이미지 형식: **url** **값** 특성 **값** 이미지 base64 인코딩된 문자열을 포함 하는 경우 사진 이미지 또는 *base64* URL이 포함 된 경우.
-
-### 속성
-
-* **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. *(DOMString)*
-
-* **값**: 전화 번호 또는 이메일 주소와 같은 필드 값. *(DOMString)*
-
-* **pref**: 설정 `true` 이 경우 `ContactField` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### 예를 들어
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### 안 드 로이드 단점
-
-* **pref**: 지원 되지 않는 반환`false`.
-
-### 블랙베리 10 단점
-
-* **유형**: 부분적으로 지원 합니다. 전화 번호에 대 한 사용.
-
-* **값**: 지원.
-
-* **pref**: 지원 되지 않는 반환`false`.
-
-### iOS 단점
-
-* **pref**: 지원 되지 않는 반환`false`.
-
-### Windows8 단점
-
-* **pref**: 지원 되지 않는 반환`false`.
-
-### 윈도우 특수
-
-* **pref**: 지원 되지 않는 반환`false`.
-
-## 담당자 이름
-
-여러 종류의 `Contact` 개체의 이름에 대 한 정보를 포함합니다.
-
-### 속성
-
-* **포맷**: 연락처의 전체 이름. *(DOMString)*
-
-* **familyName**: 연락처의 성. *(DOMString)*
-
-* **givenName**: 연락처의 이름. *(DOMString)*
-
-* **middleName**: 연락처의 중간 이름을. *(DOMString)*
-
-* **honorificPrefix**: 연락처의 접두사 (예: *미스터* 또는 *닥터*) *(DOMString)*
-
-* **honorificSuffix**: 연락처의 접미사 ( *esq.*예). *(DOMString)*
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### 예를 들어
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### 안 드 로이드 단점
-
-* **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
-
-### 블랙베리 10 단점
-
-* **포맷**: 부분적으로 지원 합니다. 블랙베리 **firstName** 및 **lastName** 필드의 연결을 반환합니다.
-
-* **familyName**: 지원. 블랙베리 **lastName** 필드에 저장 합니다.
-
-* **givenName**: 지원. 블랙베리 **firstName** 필드에 저장 합니다.
-
-* **middleName**: 지원 되지 않는 반환`null`.
-
-* **honorificPrefix**: 지원 되지 않는 반환`null`.
-
-* **honorificSuffix**: 지원 되지 않는 반환`null`.
-
-### FirefoxOS 특수
-
-* **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
-
-### iOS 단점
-
-* **포맷**: 부분적으로 지원 합니다. IOS 복합 이름 반환 하지만 읽기 전용입니다.
-
-### 윈도우 8 단점
-
-* **형식**: 이것은 유일한 속성 이름과 동일 하다 `displayName` , 및`nickname`
-
-* **familyName**: 지원 되지 않음
-
-* **givenName**: 지원 되지 않음
-
-* **middleName**: 지원 되지 않음
-
-* **honorificPrefix**: 지원 되지 않음
-
-* **honorificSuffix**: 지원 되지 않음
-
-### 윈도우 특수
-
-* **형식**: 그것은 동일`displayName`
-
-## ContactOrganization
-
-`ContactOrganization` 개체는 연락처의 조직 속성을 저장합니다. `Contact` 개체 배열에 하나 이상의 `ContactOrganization` 개체를 저장합니다.
-
-### 속성
-
-* **pref**: 설정 `true` 이 경우 `ContactOrganization` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
-
-* **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. _(DOMString)
-
-* **이름**: 조직 이름. *(DOMString)*
-
-* **부서**: 계약을 위해 일 하는 부서. *(DOMString)*
-
-* **제목**: 조직에서 연락처의 제목. *(DOMString)*
-
-### 지원 되는 플랫폼
-
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 (Windows 8.1와 Windows Phone 8.1 소자만 해당)
-
-### 예를 들어
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### 안 드 로이드 2.X 단점
-
-* **pref**: 반환 안 드 로이드 2.X 장치에 의해 지원 되지 않습니다`false`.
-
-### 블랙베리 10 단점
-
-* **pref**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`false`.
-
-* **유형**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`null`.
-
-* **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름 블랙베리 **회사** 필드에 저장 됩니다.
-
-* **부서**: 지원 되지 않는 반환`null`.
-
-* **제목**: 부분적으로 지원 합니다. 첫 번째 조직 제목 블랙베리 **jobTitle** 필드에 저장 됩니다.
-
-### 파이어 폭스 OS 단점
-
-* **pref**: 지원 되지 않음
-
-* **형식**: 지원 되지 않음
-
-* **부서**: 지원 되지 않음
-
-* 필드 **이름** 및 **제목** **org** 및 **jobTitle** 에 저장.
-
-### iOS 단점
-
-* **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
-
-* **유형**: 반환 하는 iOS 장치에서 지원 되지 않습니다`null`.
-
-* **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름은 iOS **kABPersonOrganizationProperty** 필드에 저장 됩니다.
-
-* **부서**: 부분적으로 지원 합니다. 첫 번째 부서 이름은 iOS **kABPersonDepartmentProperty** 필드에 저장 됩니다.
-
-* **제목**: 부분적으로 지원 합니다. 첫 번째 타이틀 iOS **kABPersonJobTitleProperty** 필드에 저장 됩니다.
-
-### 윈도우 특수
-
-* **pref**: 지원 되지 않는 반환`false`.
-
-* **형식**: 지원 되지 않는 반환`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/pl/README.md b/plugins/cordova-plugin-contacts/doc/pl/README.md
deleted file mode 100644
index 43111ca..0000000
--- a/plugins/cordova-plugin-contacts/doc/pl/README.md
+++ /dev/null
@@ -1,735 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-Ten plugin definiuje obiekt globalny `navigator.contacts`, która zapewnia dostęp do bazy danych kontaktów urządzenia.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**Ostrzeżenie**: zbierania i wykorzystywania danych kontaktowych podnosi kwestie prywatności ważne. Polityka prywatności danej aplikacji należy Dyskutować, jak aplikacja używa danych kontaktowych i czy jest on dzielony z innymi stronami. Informacje kontaktowe uznaje wrażliwych, ponieważ ukazuje ludzi, z którymi osoba komunikuje się. W związku z tym oprócz aplikacji prywatności, zdecydowanie zaleca się zapewnienie just-in czas wypowiedzenia zanim aplikacja uzyskuje dostęp do lub używa danych kontaktowych, jeśli system operacyjny urządzenia nie robi już. Że ogłoszenie powinno zawierać te same informacje, o których wspomniano powyżej, jak również uzyskanie uprawnienia użytkownika (np. poprzez przedstawianie wyborów **OK** i **Nie dzięki**). Należy pamiętać, że niektóre platformy aplikacji może wymagać aplikacji powiadomienia just-in czas i uzyskać uprawnienia użytkownika przed uzyskaniem dostępu do danych kontaktowych. Jasne i łatwe do zrozumienia użytkownika doświadczenie, wykorzystanie kontaktów danych pomaga uniknąć nieporozumień użytkownik i postrzegane nadużycia danych kontaktowych. Aby uzyskać więcej informacji zobacz przewodnik prywatności.
-
-## Instalacja
-
-Wymaga to cordova 5.0 + (obecny v1.0.0 stabilne)
-
- cordova plugin add cordova-plugin-contacts
-
-
-Starsze wersje cordova nadal można zainstalować za pomocą identyfikatora **przestarzałe** (starych v0.2.16)
-
- cordova plugin add org.apache.cordova.contacts
-
-
-Jest również możliwość instalacji za pośrednictwem repo url bezpośrednio (niestabilny)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### Firefox OS dziwactwa
-
-Tworzenie **www/manifest.webapp**, jak opisano w [Dokumentach Manifest](https://developer.mozilla.org/en-US/Apps/Developing/Manifest). Dodaj odpowiednie permisions. Istnieje również potrzeba zmienić typ webapp do "privileged" - [Manifest dokumenty](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type). **Ostrzeżenie**: wszystkie uprzywilejowany apps egzekwowania [Treści polityki bezpieczeństwa](https://developer.mozilla.org/en-US/Apps/CSP), który zabrania skrypt. Zainicjować aplikacji w inny sposób.
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows dziwactwa
-
-**Przed Windows 10:** Wszelkie kontakty wrócił z metody `znaleźć` i `pickContact` są tylko do odczytu, więc aplikacja nie mogą ich modyfikować. `find` metody dostępne tylko na urządzenia Windows Phone 8.1.
-
-**Windows 10 i powyżej:** Kontakty mogą być zapisane i zostaną zapisane do pamięci lokalnej aplikacji Kontakty. Kontakty mogą również zostaną usunięte.
-
-### Windows 8 dziwactwa
-
-Windows 8 kontaktów są tylko do odczytu. Poprzez kontakty Cordova API są nie queryable/wyszukiwania, należy poinformować użytkownika wybrać kontakt jako wezwanie do contacts.pickContact, która zostanie otwarta aplikacja 'Ludzie', gdzie użytkownik musi wybrać kontakt. Wszelkie kontakty, zwracane są tylko do odczytu, więc aplikacja nie mogą ich modyfikować.
-
-## Navigator.Contacts
-
-### Metody
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### Obiekty
-
- * Contact
- * ContactName
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-Metoda `navigator.contacts.create` jest synchroniczna i zwraca nowy obiekt `Contact`.
-
-Ta metoda nie zachowuje kontakt obiektu bazy danych kontaktów urządzenie, dla którego należy wywołać metodę `Contact.save`.
-
-### Obsługiwane platformy
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
-
-### Przykład
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Metoda `navigator.contacts.find` asynchronicznie, wykonuje kwerendy bazy danych kontaktów urządzenia i tablicę obiektów `kontaktów`. Wynikowe obiekty są przekazywane do funkcji wywołania zwrotnego `contactSuccess`, określony przez parametr **contactSuccess**.
-
-Parametr **contactFields** Określa pola, które mają być używane jako kwalifikator Szukaj. Zerowej długości **contactFields** parametr jest nieprawidłowy i wyniki w `ContactError.INVALID_ARGUMENT_ERROR`. **ContactFields** wartość `"*"` przeszukuje wszystkie kontakt z pola.
-
-Ciąg **contactFindOptions.filter** może służyć jako filtr wyszukiwania, gdy kwerenda bazy danych kontaktów. Jeśli dostarczone, przypadek-niewrażliwe, częściowej wartości mecz jest stosowane do każdego pola określony w parametrze **contactFields**. Jeśli ma odpowiednika dla *każdego* pola określony, zwracany jest kontakt. Użycie **contactFindOptions.desiredFields** parametr do kontroli, które kontakt właściwości muszą zostać zwrócone ponownie.
-
-### Parametry
-
- * **contactFields**: kontakt z pól do wykorzystania jako kwalifikator Szukaj. *(DOMString[])* [Required]
-
- * **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z tablicy obiektów kontaktów zwracane z bazy danych. [Required]
-
- * **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
-
- * **contactFindOptions**: Szukaj opcji filtrowania navigator.contacts. [Optional]
-
- Klucze obejmuje:
-
- * **filter**: ciąg wyszukiwania umożliwia znalezienie navigator.contacts. *(DOMString)* (Domyślnie: `""`)
-
- * **multiple**: określa, czy operacja Znajdź zwraca wiele navigator.contacts. *(Wartość logiczna)* (Domyślnie: `false`)
-
- * **desiredFields**: kontakt z pola, aby być zwrócona. Jeśli określony, wynikowy `kontakt` obiekt tylko funkcje wartości tych pól. *(DOMString[])* [Optional]
-
-### Obsługiwane platformy
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Systemu Windows (Windows Phone 8.1 i Windows 10)
-
-### Przykład
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows dziwactwa
-
- * `__contactFields__`nie jest obsługiwane i zostanie zignorowana. `find`Metoda zawsze będzie próbował dopasować nazwę, adres e-mail lub numer telefonu kontaktu.
-
-## navigator.contacts.pickContact
-
-Metoda `navigator.contacts.pickContact` uruchamia próbnika kontakt, wybierz jeden kontaktem. Wynikowy obiekt jest przekazywany do funkcji wywołania zwrotnego `contactSuccess`, określony przez parametr **contactSuccess**.
-
-### Parametry
-
- * **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z jednego obiektu kontakt. [Wymagane]
-
- * **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
-
-### Obsługiwane platformy
-
- * Android
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### Przykład
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Contact
-
-`Contact` obiekt reprezentuje informacje kontaktowe. Kontakty mogą być tworzone, przechowywane lub usunięte z bazy danych kontaktów urządzenia. Kontakty można również pobrać (pojedynczo lub zbiorczo) bazy danych przez wywołanie metody `navigator.contacts.find`.
-
-**Uwaga**: nie wszystkie pola kontaktowe wymienione powyżej są obsługiwane na każdej platformie urządzenia. Proszę sprawdzić każdej platformy *dziwactw* sekcji szczegółów.
-
-### Właściwości
-
- * **Identyfikator**: unikatowy identyfikator globalny. *(DOMString)*
-
- * **displayName**: Nazwa tego kontaktu, nadaje się do wyświetlania użytkownikom końcowym. *(DOMString)*
-
- * **Nazwa**: obiekt zawierający wszystkie składniki nazwy osób. *(Przedstawiciel)*
-
- * **nick**: dorywczo nazwy na adres kontakt. *(DOMString)*
-
- * **numery telefon≤w**: tablica numerów telefonów kontaktowych. *(ContactField[])*
-
- * **e-maile**: tablica adresów e-mail kontakt. *(ContactField[])*
-
- * **adresy**: tablica wszystkie adresy. *(ContactAddress[])*
-
- * **IMS**: tablica kontakt IM adresy. *(ContactField[])*
-
- * **organizacje**: tablicy wszystkie kontakty organizacji. *(ContactOrganization[])*
-
- * **urodziny**: urodziny kontakt. *(Data)*
-
- * **Uwaga**: Uwaga o kontakt. *(DOMString)*
-
- * **zdjęcia**: tablica zdjęcia kontaktu. *(ContactField[])*
-
- * **Kategorie**: tablica wszystkie zdefiniowane przez użytkownika kategorie związane z kontaktem. *(ContactField[])*
-
- * **adresy URL**: tablicy stron internetowych związanych z kontaktem. *(ContactField[])*
-
-### Metody
-
- * **klon**: Zwraca nowy `Contact` obiekt, który jest kopią głęboko obiektu wywołującego, z `id` Właściwość zestaw`null`.
-
- * **Usuń**: usuwa kontakt z bazy danych kontaktów urządzenia, w przeciwnym razie wykonuje błąd wywołania zwrotnego z `ContactError` obiektu.
-
- * **Zapisz**: zapisuje nowy kontakt do bazy kontaktów urządzenia, lub aktualizacje już istniejący kontakt, jeśli istnieje już kontakt o tym samym **identyfikatorze** .
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Zapisz przykład
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Przykład klon
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Remove przykład
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X dziwactwa
-
- * **Kategorie**: nie obsługiwane na urządzeniach Android 2.X, powrót`null`.
-
-### Jeżyna 10 dziwactwa
-
- * **Identyfikator**: przypisany przez urządzenie podczas zapisywania kontaktu.
-
-### Osobliwości FirefoxOS
-
- * **Kategorie**: częściowo obsługiwane. Pola **pref** i **Typ** wracają`null`
-
- * **IMS**: nie obsługiwane
-
- * **zdjęcia**: nie obsługiwane
-
-### Dziwactwa iOS
-
- * **displayName**: nie obsługiwane na iOS, powrót `null` chyba jest nie `ContactName` określony, w którym to przypadku zwraca nazwę kompozytowe, **nick** lub `""` , odpowiednio.
-
- * **urodziny**: należy wpisać jako JavaScript `Date` obiektu, tak samo jest zwracany.
-
- * **zdjęcia**: zwraca adres URL pliku obrazu, który jest przechowywany w katalogu tymczasowego stosowania. Zawartość katalogu tymczasowe są usuwane, kiedy kończy pracę aplikacji.
-
- * **Kategorie**: Ta właściwość obecnie jest nie obsługiwane, powrót`null`.
-
-### Windows Phone 7 i 8 dziwactwa
-
- * **displayName**: podczas tworzenia kontaktu, Źródło wartość podana dla parametru nazwy wyświetlania różni się od nazwy wyświetlanej, gdy znalezienie kontaktu.
-
- * **adresy URL**: podczas tworzenia kontaktu, użytkownicy mogą wpisać i zapisać więcej niż jeden adres sieci web, ale tylko jeden jest dostępne podczas wyszukiwania kontaktów.
-
- * **numery telefon≤w**: *pref* opcja nie jest obsługiwana. *Typ* nie jest obsługiwany w operacji *znaleźć* . Jedynym `phoneNumber` jest dozwolone dla każdego *typu*.
-
- * **e-maile**: *pref* opcja nie jest obsługiwana. Domu i osobiste odwołuje się w tym samym wpisu email. Dla każdego *typu* dozwolone jest tylko jeden wpis.
-
- * **adresy**: obsługuje tylko pracy i domu/osobisty *typu*. Domowych i osobistych *typu* odwołania tej samej pozycji adres. Dla każdego *typu* dozwolone jest tylko jeden wpis.
-
- * **organizacje**: tylko jeden jest dozwolone, a nie obsługuje * *pref*, *Typ*i* atrybuty.
-
- * **Uwaga**: nie obsługiwane, powrót`null`.
-
- * **IMS**: nie obsługiwane, powrót`null`.
-
- * **urodziny**: nie obsługiwane, powrót`null`.
-
- * **Kategorie**: nie obsługiwane, powrót`null`.
-
- * **remove**: Metoda nie jest obsługiwana
-
-### Windows dziwactwa
-
- * **zdjęcia**: zwraca adres URL pliku obrazu, który jest przechowywany w katalogu tymczasowego stosowania.
-
- * **urodziny**: nie obsługiwane, powrót`null`.
-
- * **Kategorie**: nie obsługiwane, powrót`null`.
-
- * **remove**: Metoda jest obsługiwana tylko w systemie Windows 10 lub wyżej.
-
-## ContactAddress
-
-Obiekt `ContactAddress` przechowuje właściwości pojedynczego adresu kontaktu. Obiekt `Contact` może zawierać więcej niż jeden adres w tablicy `[ContactAddress]`.
-
-### Właściwości
-
- * **Pref**: zestaw `true` Jeśli `ContactAddress` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
-
- * **Typ**: string wskazującą typ pola, *do domu* na przykład. *(DOMString)*
-
- * **w formacie**: pełny adres w formacie wyświetlania. *(DOMString)*
-
- * **adres**: pełny adres. *(DOMString)*
-
- * **miejscowości**: miasta lub miejscowości. *(DOMString)*
-
- * **region**: Państwo lub region. *(DOMString)*
-
- * **Kod pocztowy**: kod pocztowy lub kod pocztowy. *(DOMString)*
-
- * **kraj**: nazwę kraju. *(DOMString)*
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Przykład
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X dziwactwa
-
- * **Pref**: nie obsługiwane, powrót `false` na urządzeniach Android 2.X.
-
-### Jeżyna 10 dziwactwa
-
- * **Pref**: nie obsługiwane na urządzenia BlackBerry, powrót`false`.
-
- * **Typ**: częściowo obsługiwane. Tylko jeden z *pracy* i *Strona główna* wpisz adresy mogą być przechowywane na kontakt.
-
- * **w formacie**: częściowo obsługiwane. Zwraca łączenie wszystkich pól adres BlackBerry.
-
- * **adres**: obsługiwane. Zwraca łączenie BlackBerry **address1** i **Adres2** pola adresu.
-
- * **miejscowości**: obsługiwane. Przechowywane w polu adres **miasto** BlackBerry.
-
- * **region**: obsługiwane. Przechowywane w polu adres **stateProvince** BlackBerry.
-
- * **Kod pocztowy**: obsługiwane. Przechowywane w polu adres **zipPostal** BlackBerry.
-
- * **kraj**: obsługiwane.
-
-### Osobliwości FirefoxOS
-
- * **w formacie**: aktualnie nieobsługiwane
-
-### Dziwactwa iOS
-
- * **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
-
- * **w formacie**: obecnie nie jest obsługiwane.
-
-### Windows 8 dziwactwa
-
- * **Pref**: nie obsługiwane
-
-### Windows dziwactwa
-
- * **Pref**: nie obsługiwane
-
-## ContactError
-
-`ContactError` obiekt jest zwracany użytkownikowi za pośrednictwem funkcji wywołania zwrotnego `contactError`, gdy wystąpi błąd.
-
-### Właściwości
-
- * **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
-
-### Stałe
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Obiekt `ContactField` jest składnikiem wielokrotnego użytku, że reprezentuje kontakt pola ogólnie. Każdy obiekt `ContactField` zawiera `wartość`, `Typ` i `pref` Właściwość. Obiekt `Contact` sklepy kilku właściwości w tablicach `[ContactField]`, takich jak numery telefonów i adresy e-mail.
-
-W większości przypadków są nie wcześniej ustalonych wartości atrybutu **type** obiektu `ContactField`. Na przykład numer telefonu można określić **type** wartości *home*, *work*, *mobile*, *iPhone*, lub jakąkolwiek inną wartość, który jest obsługiwany przez platformę danego urządzenia bazy danych kontaktów. Jednak `Contact` **photos** pola, pole **type** wskazuje format zwrócone obrazu: **url**, gdy **value** atrybut zawiera adres URL, do zdjęć, lub *base64*, gdy **value** zawiera ciąg zakodowany base64 obrazu.
-
-### Właściwości
-
- * **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. *(DOMString)*
-
- * **wartości**: wartość pola, na przykład adresu e-mail lub numer telefonu. *(DOMString)*
-
- * **Pref**: zestaw `true` Jeśli `ContactField` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Przykład
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Dziwactwa Androida
-
- * **Pref**: nie obsługiwane, powrót`false`.
-
-### Jeżyna 10 dziwactwa
-
- * **Typ**: częściowo obsługiwane. Używane numery telefonów.
-
- * **wartość**: obsługiwane.
-
- * **Pref**: nie obsługiwane, powrót`false`.
-
-### Dziwactwa iOS
-
- * **Pref**: nie obsługiwane, powrót`false`.
-
-### Osobliwości Windows8
-
- * **Pref**: nie obsługiwane, powrót`false`.
-
-### Windows dziwactwa
-
- * **Pref**: nie obsługiwane, powrót`false`.
-
-## ContactName
-
-Zawiera różne rodzaje informacji o nazwę obiektu `Contact`.
-
-### Właściwości
-
- * **w formacie**: pełną nazwę kontaktu. *(DOMString)*
-
- * **danych**: nazwisko kontaktu. *(DOMString)*
-
- * **imię**: imię kontaktu. *(DOMString)*
-
- * **middleName**: nazwy bliskiego kontaktu. *(DOMString)*
-
- * **honorificPrefix**: kontakt prefiks (przykład *Pan* lub *Dr*) *(DOMString)*
-
- * **honorificSuffix**: kontakt sufiks (przykład *Esq.*). *(DOMString)*
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Przykład
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Dziwactwa Androida
-
- * **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
-
-### Jeżyna 10 dziwactwa
-
- * **w formacie**: częściowo obsługiwane. Zwraca łączenie pól **imię** i **nazwisko** BlackBerry.
-
- * **danych**: obsługiwane. Przechowywane w BlackBerry pola **nazwisko** .
-
- * **imię**: obsługiwane. Przechowywane w polu **imię** BlackBerry.
-
- * **middleName**: nie obsługiwane, powrót`null`.
-
- * **honorificPrefix**: nie obsługiwane, powrót`null`.
-
- * **honorificSuffix**: nie obsługiwane, powrót`null`.
-
-### Osobliwości FirefoxOS
-
- * **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
-
-### Dziwactwa iOS
-
- * **w formacie**: częściowo obsługiwane. Zwraca iOS nazwy, ale jest tylko do odczytu.
-
-### Windows 8 dziwactwa
-
- * **w formacie**: to jest tylko nazwa właściwość i jest taka sama, jak `displayName` , i`nickname`
-
- * **danych**: nie obsługiwane
-
- * **imię**: nie obsługiwane
-
- * **middleName**: nie obsługiwane
-
- * **honorificPrefix**: nie obsługiwane
-
- * **honorificSuffix**: nie obsługiwane
-
-### Windows dziwactwa
-
- * **w formacie**: jest identyczny z`displayName`
-
-## ContactOrganization
-
-Obiekt `ContactOrganization` przechowuje właściwości organizacji kontaktu. Obiekt `Contact` sklepy jeden lub więcej obiektów `ContactOrganization` w tablicy.
-
-### Właściwości
-
- * **Pref**: zestaw `true` Jeśli `ContactOrganization` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
-
- * **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. _(DOMString)
-
- * **Nazwa**: nazwa organizacji. *(DOMString)*
-
- * **w departamencie**: dziale umowy działa. *(DOMString)*
-
- * **tytuł**: tytuł kontaktu w organizacji. *(DOMString)*
-
-### Obsługiwane platformy
-
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Windows (tylko urządzenia Windows 8.1 i Windows Phone 8.1)
-
-### Przykład
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X dziwactwa
-
- * **Pref**: nie obsługiwane przez urządzenia Android 2.X, powrót`false`.
-
-### Jeżyna 10 dziwactwa
-
- * **Pref**: nie obsługiwane przez urządzenia BlackBerry, powrót`false`.
-
- * **Typ**: nie obsługiwane przez urządzenia BlackBerry, powrót`null`.
-
- * **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **firma** BlackBerry.
-
- * **w departamencie**: nie obsługiwane, powrót`null`.
-
- * **tytuł**: częściowo obsługiwane. Pierwszy tytuł organizacji są przechowywane w polu **jobTitle** BlackBerry.
-
-### Firefox OS dziwactwa
-
- * **Pref**: nie obsługiwane
-
- * **Typ**: nie obsługiwane
-
- * **w departamencie**: nie obsługiwane
-
- * Pola **Nazwa** i **tytuł** przechowywane w **org** i **jobTitle**.
-
-### Dziwactwa iOS
-
- * **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
-
- * **Typ**: nie obsługiwane urządzenia iOS, powrót`null`.
-
- * **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **kABPersonOrganizationProperty** iOS.
-
- * **w departamencie**: częściowo obsługiwane. Pierwsza nazwa jest przechowywana w polu **kABPersonDepartmentProperty** iOS.
-
- * **tytuł**: częściowo obsługiwane. Pierwszy tytuł jest przechowywany w polu **kABPersonJobTitleProperty** iOS.
-
-### Windows dziwactwa
-
- * **Pref**: nie obsługiwane, powrót`false`.
-
- * **Typ**: nie obsługiwane, powrót`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/pl/index.md b/plugins/cordova-plugin-contacts/doc/pl/index.md
deleted file mode 100644
index 49890c7..0000000
--- a/plugins/cordova-plugin-contacts/doc/pl/index.md
+++ /dev/null
@@ -1,719 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-Ten plugin definiuje obiekt globalny `navigator.contacts`, która zapewnia dostęp do bazy danych kontaktów urządzenia.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**Ostrzeżenie**: zbierania i wykorzystywania danych kontaktowych podnosi kwestie prywatności ważne. Polityka prywatności danej aplikacji należy Dyskutować, jak aplikacja używa danych kontaktowych i czy jest on dzielony z innymi stronami. Informacje kontaktowe uznaje wrażliwych, ponieważ ukazuje ludzi, z którymi osoba komunikuje się. W związku z tym oprócz aplikacji prywatności, zdecydowanie zaleca się zapewnienie just-in czas wypowiedzenia zanim aplikacja uzyskuje dostęp do lub używa danych kontaktowych, jeśli system operacyjny urządzenia nie robi już. Że ogłoszenie powinno zawierać te same informacje, o których wspomniano powyżej, jak również uzyskanie uprawnienia użytkownika (np. poprzez przedstawianie wyborów **OK** i **Nie dzięki**). Należy pamiętać, że niektóre platformy aplikacji może wymagać aplikacji powiadomienia just-in czas i uzyskać uprawnienia użytkownika przed uzyskaniem dostępu do danych kontaktowych. Jasne i łatwe do zrozumienia użytkownika doświadczenie, wykorzystanie kontaktów danych pomaga uniknąć nieporozumień użytkownik i postrzegane nadużycia danych kontaktowych. Aby uzyskać więcej informacji zobacz przewodnik prywatności.
-
-## Instalacja
-
- cordova plugin add cordova-plugin-contacts
-
-
-### Firefox OS dziwactwa
-
-Tworzenie **www/manifest.webapp**, jak opisano w [Dokumentach Manifest][1]. Dodaj odpowiednie permisions. Istnieje również potrzeba zmienić typ webapp do "privileged" - [Manifest dokumenty][2]. **Ostrzeżenie**: wszystkie uprzywilejowany apps egzekwowania [Treści polityki bezpieczeństwa][3], który zabrania skrypt. Zainicjować aplikacji w inny sposób.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows dziwactwa
-
-Wszelkie kontakty wrócił z `pickContact` i `find` metody są tylko do odczytu, więc aplikacja nie mogą ich modyfikować. `find` metody dostępne tylko na urządzenia Windows Phone 8.1.
-
-### Windows 8 dziwactwa
-
-Windows 8 kontaktów są tylko do odczytu. Poprzez kontakty Cordova API są nie queryable/wyszukiwania, należy poinformować użytkownika wybrać kontakt jako wezwanie do contacts.pickContact, która zostanie otwarta aplikacja 'Ludzie', gdzie użytkownik musi wybrać kontakt. Wszelkie kontakty, zwracane są tylko do odczytu, więc aplikacja nie mogą ich modyfikować.
-
-## Navigator.Contacts
-
-### Metody
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### Obiekty
-
-* Kontakt
-* Przedstawiciel
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## Navigator.Contacts.Create
-
-Metoda `navigator.contacts.create` jest synchroniczna i zwraca nowy obiekt `Contact`.
-
-Ta metoda nie zachowuje kontakt obiektu bazy danych kontaktów urządzenie, dla którego należy wywołać metodę `Contact.save`.
-
-### Obsługiwane platformy
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-
-### Przykład
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Metoda `navigator.contacts.find` asynchronicznie, wykonuje kwerendy bazy danych kontaktów urządzenia i tablicę obiektów `kontaktów`. Wynikowe obiekty są przekazywane do funkcji wywołania zwrotnego `contactSuccess`, określony przez parametr **contactSuccess**.
-
-Parametr **contactFields** Określa pola, które mają być używane jako kwalifikator Szukaj. Zerowej długości **contactFields** parametr jest nieprawidłowy i wyniki w `ContactError.INVALID_ARGUMENT_ERROR`. **ContactFields** wartość `"*"` przeszukuje wszystkie kontakt z pola.
-
-Ciąg **contactFindOptions.filter** może służyć jako filtr wyszukiwania, gdy kwerenda bazy danych kontaktów. Jeśli dostarczone, przypadek-niewrażliwe, częściowej wartości mecz jest stosowane do każdego pola określony w parametrze **contactFields**. Jeśli ma odpowiednika dla *każdego* pola określony, zwracany jest kontakt. Użycie **contactFindOptions.desiredFields** parametr do kontroli, które kontakt właściwości muszą zostać zwrócone ponownie.
-
-### Parametry
-
-* **contactFields**: kontakt z pól do wykorzystania jako kwalifikator Szukaj. *(DOMString[])* [Required]
-
-* **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z tablicy obiektów kontaktów zwracane z bazy danych. [Required]
-
-* **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
-
-* **contactFindOptions**: Szukaj opcji filtrowania navigator.contacts. [Optional]
-
- Klucze obejmuje:
-
- * **filter**: ciąg wyszukiwania umożliwia znalezienie navigator.contacts. *(DOMString)* (Domyślnie: `""`)
-
- * **multiple**: określa, czy operacja Znajdź zwraca wiele navigator.contacts. *(Wartość logiczna)* (Domyślnie: `false`)
-
- * **desiredFields**: kontakt z pola, aby być zwrócona. Jeśli określony, wynikowy `kontakt` obiekt tylko funkcje wartości tych pól. *(DOMString[])* [Optional]
-
-### Obsługiwane platformy
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows (tylko urządzenia Windows Phone 8.1)
-
-### Przykład
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows dziwactwa
-
-* `__contactFields__`nie jest obsługiwane i zostanie zignorowana. `find`Metoda zawsze będzie próbował dopasować nazwę, adres e-mail lub numer telefonu kontaktu.
-
-## navigator.contacts.pickContact
-
-Metoda `navigator.contacts.pickContact` uruchamia próbnika kontakt, wybierz jeden kontaktem. Wynikowy obiekt jest przekazywany do funkcji wywołania zwrotnego `contactSuccess`, określony przez parametr **contactSuccess**.
-
-### Parametry
-
-* **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z jednego obiektu kontakt. [Wymagane]
-
-* **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
-
-### Obsługiwane platformy
-
-* Android
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### Przykład
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Kontakt
-
-`Contact` obiekt reprezentuje informacje kontaktowe. Kontakty mogą być tworzone, przechowywane lub usunięte z bazy danych kontaktów urządzenia. Kontakty można również pobrać (pojedynczo lub zbiorczo) bazy danych przez wywołanie metody `navigator.contacts.find`.
-
-**Uwaga**: nie wszystkie pola kontaktowe wymienione powyżej są obsługiwane na każdej platformie urządzenia. Proszę sprawdzić każdej platformy *dziwactw* sekcji szczegółów.
-
-### Właściwości
-
-* **Identyfikator**: unikatowy identyfikator globalny. *(DOMString)*
-
-* **displayName**: Nazwa tego kontaktu, nadaje się do wyświetlania użytkownikom końcowym. *(DOMString)*
-
-* **Nazwa**: obiekt zawierający wszystkie składniki nazwy osób. *(Przedstawiciel)*
-
-* **nick**: dorywczo nazwy na adres kontakt. *(DOMString)*
-
-* **numery telefon≤w**: tablica numerów telefonów kontaktowych. *(ContactField[])*
-
-* **e-maile**: tablica adresów e-mail kontakt. *(ContactField[])*
-
-* **adresy**: tablica wszystkie adresy. *(ContactAddress[])*
-
-* **IMS**: tablica kontakt IM adresy. *(ContactField[])*
-
-* **organizacje**: tablicy wszystkie kontakty organizacji. *(ContactOrganization[])*
-
-* **urodziny**: urodziny kontakt. *(Data)*
-
-* **Uwaga**: Uwaga o kontakt. *(DOMString)*
-
-* **zdjęcia**: tablica zdjęcia kontaktu. *(ContactField[])*
-
-* **Kategorie**: tablica wszystkie zdefiniowane przez użytkownika kategorie związane z kontaktem. *(ContactField[])*
-
-* **adresy URL**: tablicy stron internetowych związanych z kontaktem. *(ContactField[])*
-
-### Metody
-
-* **klon**: Zwraca nowy `Contact` obiekt, który jest kopią głęboko obiektu wywołującego, z `id` Właściwość zestaw`null`.
-
-* **Usuń**: usuwa kontakt z bazy danych kontaktów urządzenia, w przeciwnym razie wykonuje błąd wywołania zwrotnego z `ContactError` obiektu.
-
-* **Zapisz**: zapisuje nowy kontakt do bazy kontaktów urządzenia, lub aktualizacje już istniejący kontakt, jeśli istnieje już kontakt o tym samym **identyfikatorze** .
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Zapisz przykład
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Przykład klon
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Remove przykład
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X dziwactwa
-
-* **Kategorie**: nie obsługiwane na urządzeniach Android 2.X, powrót`null`.
-
-### Jeżyna 10 dziwactwa
-
-* **Identyfikator**: przypisany przez urządzenie podczas zapisywania kontaktu.
-
-### Osobliwości FirefoxOS
-
-* **Kategorie**: częściowo obsługiwane. Pola **pref** i **Typ** wracają`null`
-
-* **IMS**: nie obsługiwane
-
-* **zdjęcia**: nie obsługiwane
-
-### Dziwactwa iOS
-
-* **displayName**: nie obsługiwane na iOS, powrót `null` chyba jest nie `ContactName` określony, w którym to przypadku zwraca nazwę kompozytowe, **nick** lub `""` , odpowiednio.
-
-* **urodziny**: należy wpisać jako JavaScript `Date` obiektu, tak samo jest zwracany.
-
-* **zdjęcia**: zwraca adres URL pliku obrazu, który jest przechowywany w katalogu tymczasowego stosowania. Zawartość katalogu tymczasowe są usuwane, kiedy kończy pracę aplikacji.
-
-* **Kategorie**: Ta właściwość obecnie jest nie obsługiwane, powrót`null`.
-
-### Windows Phone 7 i 8 dziwactwa
-
-* **displayName**: podczas tworzenia kontaktu, Źródło wartość podana dla parametru nazwy wyświetlania różni się od nazwy wyświetlanej, gdy znalezienie kontaktu.
-
-* **adresy URL**: podczas tworzenia kontaktu, użytkownicy mogą wpisać i zapisać więcej niż jeden adres sieci web, ale tylko jeden jest dostępne podczas wyszukiwania kontaktów.
-
-* **numery telefon≤w**: *pref* opcja nie jest obsługiwana. *Typ* nie jest obsługiwany w operacji *znaleźć* . Jedynym `phoneNumber` jest dozwolone dla każdego *typu*.
-
-* **e-maile**: *pref* opcja nie jest obsługiwana. Domu i osobiste odwołuje się w tym samym wpisu email. Dla każdego *typu* dozwolone jest tylko jeden wpis.
-
-* **adresy**: obsługuje tylko pracy i domu/osobisty *typu*. Domowych i osobistych *typu* odwołania tej samej pozycji adres. Dla każdego *typu* dozwolone jest tylko jeden wpis.
-
-* **organizacje**: tylko jeden jest dozwolone, a nie obsługuje * *pref*, *Typ*i* atrybuty.
-
-* **Uwaga**: nie obsługiwane, powrót`null`.
-
-* **IMS**: nie obsługiwane, powrót`null`.
-
-* **urodziny**: nie obsługiwane, powrót`null`.
-
-* **Kategorie**: nie obsługiwane, powrót`null`.
-
-### Windows dziwactwa
-
-* **zdjęcia**: zwraca adres URL pliku obrazu, który jest przechowywany w katalogu tymczasowego stosowania.
-
-* **urodziny**: nie obsługiwane, powrót`null`.
-
-* **Kategorie**: nie obsługiwane, powrót`null`.
-
-## ContactAddress
-
-Obiekt `ContactAddress` przechowuje właściwości pojedynczego adresu kontaktu. Obiekt `Contact` może zawierać więcej niż jeden adres w tablicy `[ContactAddress]`.
-
-### Właściwości
-
-* **Pref**: zestaw `true` Jeśli `ContactAddress` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
-
-* **Typ**: string wskazującą typ pola, *do domu* na przykład. *(DOMString)*
-
-* **w formacie**: pełny adres w formacie wyświetlania. *(DOMString)*
-
-* **adres**: pełny adres. *(DOMString)*
-
-* **miejscowości**: miasta lub miejscowości. *(DOMString)*
-
-* **region**: Państwo lub region. *(DOMString)*
-
-* **Kod pocztowy**: kod pocztowy lub kod pocztowy. *(DOMString)*
-
-* **kraj**: nazwę kraju. *(DOMString)*
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Przykład
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X dziwactwa
-
-* **Pref**: nie obsługiwane, powrót `false` na urządzeniach Android 2.X.
-
-### Jeżyna 10 dziwactwa
-
-* **Pref**: nie obsługiwane na urządzenia BlackBerry, powrót`false`.
-
-* **Typ**: częściowo obsługiwane. Tylko jeden z *pracy* i *Strona główna* wpisz adresy mogą być przechowywane na kontakt.
-
-* **w formacie**: częściowo obsługiwane. Zwraca łączenie wszystkich pól adres BlackBerry.
-
-* **adres**: obsługiwane. Zwraca łączenie BlackBerry **address1** i **Adres2** pola adresu.
-
-* **miejscowości**: obsługiwane. Przechowywane w polu adres **miasto** BlackBerry.
-
-* **region**: obsługiwane. Przechowywane w polu adres **stateProvince** BlackBerry.
-
-* **Kod pocztowy**: obsługiwane. Przechowywane w polu adres **zipPostal** BlackBerry.
-
-* **kraj**: obsługiwane.
-
-### Osobliwości FirefoxOS
-
-* **w formacie**: aktualnie nieobsługiwane
-
-### Dziwactwa iOS
-
-* **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
-
-* **w formacie**: obecnie nie jest obsługiwane.
-
-### Windows 8 dziwactwa
-
-* **Pref**: nie obsługiwane
-
-### Windows dziwactwa
-
-* **Pref**: nie obsługiwane
-
-## ContactError
-
-`ContactError` obiekt jest zwracany użytkownikowi za pośrednictwem funkcji wywołania zwrotnego `contactError`, gdy wystąpi błąd.
-
-### Właściwości
-
-* **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
-
-### Stałe
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Obiekt `ContactField` jest składnikiem wielokrotnego użytku, że reprezentuje kontakt pola ogólnie. Każdy obiekt `ContactField` zawiera `wartość`, `Typ` i `pref` Właściwość. Obiekt `Contact` sklepy kilku właściwości w tablicach `[ContactField]`, takich jak numery telefonów i adresy e-mail.
-
-W większości przypadków są nie wcześniej ustalonych wartości atrybutu **type** obiektu `ContactField`. Na przykład numer telefonu można określić **type** wartości *home*, *work*, *mobile*, *iPhone*, lub jakąkolwiek inną wartość, który jest obsługiwany przez platformę danego urządzenia bazy danych kontaktów. Jednak `Contact` **photos** pola, pole **type** wskazuje format zwrócone obrazu: **url**, gdy **value** atrybut zawiera adres URL, do zdjęć, lub *base64*, gdy **value** zawiera ciąg zakodowany base64 obrazu.
-
-### Właściwości
-
-* **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. *(DOMString)*
-
-* **wartości**: wartość pola, na przykład adresu e-mail lub numer telefonu. *(DOMString)*
-
-* **Pref**: zestaw `true` Jeśli `ContactField` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Przykład
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Dziwactwa Androida
-
-* **Pref**: nie obsługiwane, powrót`false`.
-
-### Jeżyna 10 dziwactwa
-
-* **Typ**: częściowo obsługiwane. Używane numery telefonów.
-
-* **wartość**: obsługiwane.
-
-* **Pref**: nie obsługiwane, powrót`false`.
-
-### Dziwactwa iOS
-
-* **Pref**: nie obsługiwane, powrót`false`.
-
-### Osobliwości Windows8
-
-* **Pref**: nie obsługiwane, powrót`false`.
-
-### Windows dziwactwa
-
-* **Pref**: nie obsługiwane, powrót`false`.
-
-## Przedstawiciel
-
-Zawiera różne rodzaje informacji o nazwę obiektu `Contact`.
-
-### Właściwości
-
-* **w formacie**: pełną nazwę kontaktu. *(DOMString)*
-
-* **danych**: nazwisko kontaktu. *(DOMString)*
-
-* **imię**: imię kontaktu. *(DOMString)*
-
-* **middleName**: nazwy bliskiego kontaktu. *(DOMString)*
-
-* **honorificPrefix**: kontakt prefiks (przykład *Pan* lub *Dr*) *(DOMString)*
-
-* **honorificSuffix**: kontakt sufiks (przykład *Esq.*). *(DOMString)*
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Przykład
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Dziwactwa Androida
-
-* **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
-
-### Jeżyna 10 dziwactwa
-
-* **w formacie**: częściowo obsługiwane. Zwraca łączenie pól **imię** i **nazwisko** BlackBerry.
-
-* **danych**: obsługiwane. Przechowywane w BlackBerry pola **nazwisko** .
-
-* **imię**: obsługiwane. Przechowywane w polu **imię** BlackBerry.
-
-* **middleName**: nie obsługiwane, powrót`null`.
-
-* **honorificPrefix**: nie obsługiwane, powrót`null`.
-
-* **honorificSuffix**: nie obsługiwane, powrót`null`.
-
-### Osobliwości FirefoxOS
-
-* **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
-
-### Dziwactwa iOS
-
-* **w formacie**: częściowo obsługiwane. Zwraca iOS nazwy, ale jest tylko do odczytu.
-
-### Windows 8 dziwactwa
-
-* **w formacie**: to jest tylko nazwa właściwość i jest taka sama, jak `displayName` , i`nickname`
-
-* **danych**: nie obsługiwane
-
-* **imię**: nie obsługiwane
-
-* **middleName**: nie obsługiwane
-
-* **honorificPrefix**: nie obsługiwane
-
-* **honorificSuffix**: nie obsługiwane
-
-### Windows dziwactwa
-
-* **w formacie**: jest identyczny z`displayName`
-
-## ContactOrganization
-
-Obiekt `ContactOrganization` przechowuje właściwości organizacji kontaktu. Obiekt `Contact` sklepy jeden lub więcej obiektów `ContactOrganization` w tablicy.
-
-### Właściwości
-
-* **Pref**: zestaw `true` Jeśli `ContactOrganization` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
-
-* **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. _(DOMString)
-
-* **Nazwa**: nazwa organizacji. *(DOMString)*
-
-* **w departamencie**: dziale umowy działa. *(DOMString)*
-
-* **tytuł**: tytuł kontaktu w organizacji. *(DOMString)*
-
-### Obsługiwane platformy
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows (tylko urządzenia Windows 8.1 i Windows Phone 8.1)
-
-### Przykład
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X dziwactwa
-
-* **Pref**: nie obsługiwane przez urządzenia Android 2.X, powrót`false`.
-
-### Jeżyna 10 dziwactwa
-
-* **Pref**: nie obsługiwane przez urządzenia BlackBerry, powrót`false`.
-
-* **Typ**: nie obsługiwane przez urządzenia BlackBerry, powrót`null`.
-
-* **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **firma** BlackBerry.
-
-* **w departamencie**: nie obsługiwane, powrót`null`.
-
-* **tytuł**: częściowo obsługiwane. Pierwszy tytuł organizacji są przechowywane w polu **jobTitle** BlackBerry.
-
-### Firefox OS dziwactwa
-
-* **Pref**: nie obsługiwane
-
-* **Typ**: nie obsługiwane
-
-* **w departamencie**: nie obsługiwane
-
-* Pola **Nazwa** i **tytuł** przechowywane w **org** i **jobTitle**.
-
-### Dziwactwa iOS
-
-* **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
-
-* **Typ**: nie obsługiwane urządzenia iOS, powrót`null`.
-
-* **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **kABPersonOrganizationProperty** iOS.
-
-* **w departamencie**: częściowo obsługiwane. Pierwsza nazwa jest przechowywana w polu **kABPersonDepartmentProperty** iOS.
-
-* **tytuł**: częściowo obsługiwane. Pierwszy tytuł jest przechowywany w polu **kABPersonJobTitleProperty** iOS.
-
-### Windows dziwactwa
-
-* **Pref**: nie obsługiwane, powrót`false`.
-
-* **Typ**: nie obsługiwane, powrót`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/ru/index.md b/plugins/cordova-plugin-contacts/doc/ru/index.md
deleted file mode 100644
index 424f6d9..0000000
--- a/plugins/cordova-plugin-contacts/doc/ru/index.md
+++ /dev/null
@@ -1,709 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-Обеспечивает доступ к базе данных контактов устройства.
-
-**Предупреждение**: сбор и использование данные контактов поднимает важные вопросы конфиденциальности. Политика конфиденциальности вашего приложения должна объяснять, как приложение использует контактные данные и передается ли она третьим лицам. Контактная информация считается конфиденциальной, потому что он показывает людей, с которыми общается человек. Таким образом в дополнение к политике конфиденциальности приложения, вы должны рассмотреть возможность предоставления уведомления в момент времени перед тем как приложение обращается к, или использует контактные данные, если операционная системы устройства не делает этого. Это уведомление должно обеспечивать ту же информацию, указанную выше, а также получение разрешения пользователя (например, путем представления выбора **OK** и **Нет, спасибо**). Обратите внимание, что некоторые магазины приложения могут требовать от приложения уведомления в момент доступа к данным и получить разрешение пользователя перед доступом к контактным данным. Четкая и понятная эргономика использования контактных данных помогает избежать недоразумений и ощущаемых злоупотреблений контактными данными. Для получения дополнительной информации пожалуйста, смотрите в руководстве конфиденциальности.
-
-## Установка
-
- cordova plugin add cordova-plugin-contacts
-
-
-### Особенности Firefox OS
-
-Создайте **www/manifest.webapp** как описано в [Описание Манифеста][1]. Добавление соответствующих разрешений. Существует также необходимость изменить тип веб-приложения на «priviledged» - [Описание Манифеста][2]. **ВНИМАНИЕ**: Все привилегированные приложения применяют [Политику безопасности содержимого][3] которая запрещает встроенные скрипты. Инициализируйте приложение другим способом.
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Совместимости Windows
-
-Любые контакты, вернулся из `find` и `pickContact` методы являются только для чтения, поэтому приложение не может изменять их. `find`метод доступен только на устройствах Windows Phone 8.1.
-
-### Совместимости Windows 8
-
-Windows 8 Контакты являются readonly. Через контакты Cordova API не являются queryable/для поиска, вы должны сообщить пользователю выбрать контакт как вызов contacts.pickContact, который откроет приложение «Люди», где пользователь должен выбрать контакт. Любые контакты вернулся, readonly, поэтому ваше приложение не может изменять их.
-
-## navigator.contacts
-
-### Методы
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### Объекты
-
-* Contact
-* ContactName
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## navigator.contacts.create
-
-Метод `navigator.contacts.create` является синхронным, и возвращает новый объект `Contact`.
-
-Этот метод не сохраняет объект контакта в базе данных контактов устройства, для которого необходимо вызвать метод `Contact.save`.
-
-### Поддерживаемые платформы
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-
-### Пример
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-Метод `navigator.contacts.find` выполняется асинхронно, запрашивая базу контактов устройства и возвращая массив объектов `Contact`. Полученные объекты передаются в функцию обратного вызова `contactSuccess`, указанную в параметре **contactSuccess** .
-
-Параметр **contactFields** указывает поля, чтобы использоваться в качестве квалификатора Поиск. Нулевой длины **contactFields** параметр является недопустимым и приводит к `ContactError.INVALID_ARGUMENT_ERROR` . Значение **contactFields** `"*"` возвращает все поля контактов.
-
-Строка **ContactFindOptions.filter** может использоваться как фильтр поиска при запросах к базе данных контактов. Если указано, то к каждому полю, указанному в параметре **contactFields**, применяется фильтр частичного поиска без учета регистра. Если есть совпадение для *любого* из указанных полей, контакт возвращается. Использование параметра **contactFindOptions.desiredFields** для управления свойства контакта должны быть возвращены обратно.
-
-### Параметры
-
-* **contactSuccess**: Функция обратного вызова вызываемая в случае успешного поиска, с параметром в виде массива объектов Contact возвращенных из базы данных контактов. [Обязательный]
-
-* **contactError**: Функция обратного вызова, вызывается при возникновении ошибки. [Опционально]
-
-* **contactFields**: контакт поля для использования в качестве квалификатора Поиск. *(DOMString[])* [Требуется]
-
-* **contactFindOptions**: Параметры поиска для фильтрации filter navigator.contacts. [Опционально] Ключи включают:
-
-* **filter**: Строка поиска используемая для поиска по navigator.contacts. *(DOMString)* (по умолчанию: `""`)
-
-* **multiple**: Определяет если операция поиска возвращает несколкько navigator.contacts. *(Булевое)* (По умолчанию: `false`)
-
- * **desiredFields**: контакт поля возвращается обратно. Если указан, в результате `Contact` объект только функции значения для этих полей. *(DOMString[])* [Опционально]
-
-### Поддерживаемые платформы
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-* Windows (только для устройств на Windows Phone 8.1)
-
-### Пример
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Совместимости Windows
-
-* `__contactFields__`не поддерживается и будет игнорироваться. `find`метод всегда будет пытаться соответствовать имя, адрес электронной почты или номер телефона контакта.
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact`Метод запускает контакт выбора, чтобы выбрать один контакт. Результирующий объект передается в `contactSuccess` функции обратного вызова, указанный параметром **contactSuccess** .
-
-### Параметры
-
-* **contactSuccess**: успех функция обратного вызова вызывается с одним объектом контакта. [Требуется]
-
-* **contactError**: Функция обратного вызова, вызывается при возникновении ошибки. [Опционально]
-
-### Поддерживаемые платформы
-
-* Android
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### Пример
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## Contact
-
-Объект `Contact` представляет контакт пользователя. Контакты могут быть созданы, сохранены или удалены из базы данных контактов устройства. Контакты также могут быть получены (индивидуально или массово) из базы данных путем вызова метода `navigator.contacts.find`.
-
-**Примечание**: не все поля контактов, перечисленных выше, поддерживаются на каждой платформе устройства. Пожалуйста, проверьте раздел *Особенности* каждой платформы для детальной информации.
-
-### Параметры
-
-* **ID**: глобальный уникальный идентификатор. *(DOMString)*
-
-* **displayName**: имя этого контакта, подходящую для отображения пользователю. *(DOMString)*
-
-* **name**: объект, содержащий все компоненты имени человека. *(ContactName)*
-
-* **nickname**: обычное имя, по которому определяется контакт. *(DOMString)*
-
-* **phoneNumbers**: массив со всеми номерами контактных телефонов. *(ContactField[])*
-
-* **emails**: массив всех адресов электронной почты контакта. *(ContactField[])*
-
-* **addresses**: массив всех адресов контакта. *(ContactAddress[])*
-
-* **IMS**: массив всех IM-адресов контакта. *(ContactField[])*
-
-* **organizations**: массив всех организаций контакта. *(ContactOrganization[])*
-
-* **birthday**: день рождения контакта. *(Дата)*
-
-* **note**: Текстовая заметка о контакте. *(DOMString)*
-
-* **photos**: массив фотографий контакта. *(ContactField[])*
-
-* **categories**: массив всех определенных пользователем категории, связанных с контактом. *(ContactField[])*
-
-* **urls**: массив веб-страниц, связанных с контактом. *(ContactField[])*
-
-### Методы
-
-* **clone**: возвращает новый объект `Contact`, являющийся глубокой копией вызывающего объекта с значением свойства `id` равным `null`.
-
-* **remove**: удаляет контакт из базы данных контактов устройства, в противном случае выполняет обратный вызов ошибки с объектом `ContactError` описывающим ошибку.
-
-* **save**: сохраняет новый контакт в базе данных контактов устройства или обновляет существующий контакт, если контакт с тем же **id** уже существует.
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-* Windows 8
-* Windows
-
-### Пример сохранения
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### Пример клонирования
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### Пример удаления
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Особенности Android 2.X
-
-* **categories**: не поддерживается на устройствах Android 2.X, возвращая `null`.
-
-### Особенности BlackBerry 10
-
-* **ID**: присвоенный устройства при сохранении контакта.
-
-### Особенности Firefox OS
-
-* **categories**: частично поддерживается. Поля **pref** и **type** возвращают `null`
-
-* **ims**: Не поддерживается
-
-* **photos**: Не поддерживается
-
-### Особенности iOS
-
-* **displayName**: не поддерживается на iOS, возвращая `null` Если `ContactName` не указан, в этом случае он возвращает составное имя, **nickname** или `""` , соответственно.
-
-* **birthday**: Должен быть указан как объект JavaScript `Date`, таким же образом, значение этого поля и возвращается.
-
-* **photos**: Возвращает URL-адрес файла изображения, которое хранится во временном каталоге приложения. Содержание временного каталога удаляются при выходе из приложения.
-
-* **categories**: это свойство в настоящее время не поддерживается, возвращая`null`.
-
-### Особенности Windows Phone 7 и 8
-
-* **displayName**: при создании контакта, значение, указанное в параметре отличается от отображаемого имени полученного при поиске контакта.
-
-* **urls**: при создании контакта, пользователи могут ввести и сохранить более чем одного веб-адрес, но только один доступен при поиске контакта.
-
-* **phoneNumbers**: параметр *pref* не поддерживается. *type* не поддерживается в операции *find* . Только один `phoneNumber` допускается для каждого *type*.
-
-* **emails**: параметр *pref* не поддерживается. Домашний и рабочий email ссылаются на одну и ту же запись электронной почты. Разрешена только одна запись для каждого значения *type*.
-
-* **addresses**: поддерживает только рабочий и домашний/личный *type*. Записи типа *type* home и personal ссылаются на одну и ту же запись адреса. Разрешена только одна запись для каждого значения *type*.
-
-* **organizations**: только одна организация разрешена и она не поддерживает атрибуты *pref*, *type*и *department* .
-
-* **note**: не поддерживается, возвращая`null`.
-
-* **ims**: не поддерживается, возвращая `null`.
-
-* **birthdays**: не поддерживается, возвращая`null`.
-
-* **categories**: не поддерживается, возвращая`null`.
-
-### Совместимости Windows
-
-* **фотографии**: Возвращает URL-адрес файла изображения, которое хранится во временном каталоге приложения.
-
-* **birthdays**: не поддерживается, возвращая`null`.
-
-* **categories**: не поддерживается, возвращая`null`.
-
-## ContactAddress
-
-Объект `ContactAddress` хранит свойства для одного адреса контакта. Объект `Contact` может включать более чем один адрес в массиве `ContactAddress[]`.
-
-### Параметры
-
-* **pref**: Установите значение `true` если `ContactAddress` содержит предпочитаемое для пользователя значение. *(логический)*
-
-* **type**: строка, указывающая тип поля, *home*, например. *(DOMString)*
-
-* **formatted**: полный адрес отформатированый для отображения. *(DOMString)*
-
-* **streetAddress**: полный почтовый адрес. *(DOMString)*
-
-* **locality**: город или населенный пункт. *(DOMString)*
-
-* **region**: штат или регион. *(DOMString)*
-
-* **postalCode**: почтовый индекс или почтовый код. *(DOMString)*
-
-* **country**: название страны. *(DOMString)*
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-* Windows 8
-* Windows
-
-### Пример
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Особенности Android 2.X
-
-* **ап**: не поддерживается, возвращая `false` на устройствах Android 2.X.
-
-### Особенности BlackBerry 10
-
-* **ап**: не поддерживается на устройствах BlackBerry, возвращая`false`.
-
-* **тип**: частично поддерживается. Контакт может храниться только один из *работы* и *дома* типа адреса.
-
-* **Формат**: частично поддерживается. Возвращает объединение всех полей адреса BlackBerry.
-
-* **streetAddress**: поддерживается. Возвращает объединение и BlackBerry **Адрес1** **Адрес2** поля адреса.
-
-* **населенный пункт**: поддерживается. Хранится в поле адрес **город** BlackBerry.
-
-* **регион**: поддерживает. Хранится в поле адреса **stateProvince** BlackBerry.
-
-* **postalCode**: поддерживается. Хранится в поле адреса **zipPostal** BlackBerry.
-
-* **страна**: поддерживается.
-
-### Особенности Firefox OS
-
-* **formatted**: На данный момент не поддерживается
-
-### Особенности iOS
-
-* **pref**: не поддерживается на устройствах iOS, возвращая `false`.
-
-* **formatted**: На данный момент не поддерживается.
-
-### Совместимости Windows 8
-
-* **pref**: Не поддерживается
-
-### Совместимости Windows
-
-* **pref**: Не поддерживается
-
-## ContactError
-
-Объект `ContactError` возвращается пользователю через функцию обратного вызова `contactError` в случае возникновении ошибки.
-
-### Параметры
-
-* **code**: один из стандартных кодов ошибок, перечисленных ниже.
-
-### Константы
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-Объект `ContactField` является многократно используемым компонентом, который представляет контактные поля общего назначения. Каждый объект `ContactField` содержит свойства `value` , `type`, и `pref`. Объект `Contact` имеет несколько свойств сохраняющих данные в массиве `ContactField[]`, такие как номера телефонов и адреса электронной почты.
-
-В большинстве случаев не существует заранее определенные значения для атрибута **type** объекта `ContactField`. Например номер телефона можно указать значения **type** *home*, *work*, *mobile*, *iPhone* или любого другого значения, поддерживаемые базы данных контактов на платформе конкретного устройства . Однако, для `Contact` поля **photos**, поле **type** указывает формат возвращаемого изображения: **URL-адрес,** когда атрибут **value** содержит URL-адрес изображения фото или *base64* , если **value** содержит строку изображения в кодировке base64.
-
-### Параметры
-
-* **type**: строка, указывающая тип поля, *home*, например. *(DOMString)*
-
-* **value**: значение поля, например номер телефона или адрес электронной почты. *(DOMString)*
-
-* **pref**: набор `true` Если `ContactField` содержит значение предпочитаемое пользователем. *(логический)*
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-* Windows 8
-* Windows
-
-### Пример
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Особенности Android
-
-* **pref**: не поддерживается, возвращая `false`.
-
-### Особенности BlackBerry 10
-
-* **type**: частично поддерживается. Используется для телефонных номеров.
-
-* **value**: поддерживается.
-
-* **pref**: не поддерживается, возвращая `false`.
-
-### Особенности iOS
-
-* **pref**: не поддерживается, возвращая `false`.
-
-### Причуды Windows8
-
-* **pref**: не поддерживается, возвращая `false`.
-
-### Совместимости Windows
-
-* **pref**: не поддерживается, возвращая `false`.
-
-## ContactName
-
-Содержит различную информации об имени объекта `Contact`.
-
-### Параметры
-
-* **formatted**: полное имя контакта. *(DOMString)*
-
-* **familyName**: семья имя контакта. *(DOMString)*
-
-* **givenName**: имя контакта. *(DOMString)*
-
-* **middleName**: отчество контакта. *(DOMString)*
-
-* **honorificPrefix**: префикс имени контакта (например, *г-н* или *д-р*) *(DOMString)*
-
-* **honorificSuffix**: суффикс имени контакта (например, *эсквайр*). *(DOMString)*
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android 2.X
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-* Windows 8
-* Windows
-
-### Пример
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Особенности Android
-
-* **formatted**: частично поддерживается и только для чтения. Возвращает объединение значений `honorificPrefix`, `givenName`, `middleName`, `familyName`, и `honorificSuffix`.
-
-### Особенности BlackBerry 10
-
-* **formatted**: частично поддерживается. Возвращает объединение полей BlackBerry **firstName** и **lastName** .
-
-* **familyName**: поддерживается. Хранится в поле **lastName** BlackBerry.
-
-* **givenName**: поддерживается. Хранится в поле **firstName** BlackBerry.
-
-* **middleName**: не поддерживается, возвращая `null`.
-
-* **honorificPrefix**: не поддерживается, возвращая `null`.
-
-* **honorificSuffix**: не поддерживается, возвращая `null`.
-
-### Особенности Firefox OS
-
-* **formatted**: частично поддерживается и только для чтения. Возвращает объединение значений `honorificPrefix`, `givenName`, `middleName`, `familyName`, и `honorificSuffix`.
-
-### Особенности iOS
-
-* **formatted**: частично поддерживается. Возвращает составное имя iOS, но только для чтения.
-
-### Совместимости Windows 8
-
-* **Формат**: это единственное имя свойства и идентичен `displayName` , и`nickname`
-
-* **familyName**: не поддерживается
-
-* **givenName**: не поддерживается
-
-* **отчество**: не поддерживается
-
-* **honorificPrefix**: не поддерживается
-
-* **honorificSuffix**: не поддерживается
-
-### Совместимости Windows
-
-* **Формат**: это же`displayName`
-
-## ContactOrganization
-
-Объект `ContactOrganization` сохраняет свойства организации контакта. A объект `Contact` хранит один или больше объектов `ContactOrganization` в массиве.
-
-### Параметры
-
-* **pref**: Установите в `true` если `ContactOrganization` содержит значение предпочитаемое пользователем. *(логический)*
-
-* **type**: строка, указывающая тип поля, *home*, например. _(DOMString)
-
-* **name**: название организации. *(DOMString)*
-
-* **department**: Отдел в котором работает контакт. *(DOMString)*
-
-* **title**: должность контакта в организации. *(DOMString)*
-
-### Поддерживаемые платформы
-
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-* Windows (только Windows 8.1 и 8.1 Windows Phone устройств)
-
-### Пример
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Особенности Android 2.X
-
-* **pref**: не поддерживается устройствами Android 2.X, возвращая `false`.
-
-### Особенности BlackBerry 10
-
-* **pref**: не поддерживается на устройствах BlackBerry, возвращая `false`.
-
-* **type**: не поддерживается на устройствах BlackBerry, возвращая `null`.
-
-* **name**: частично поддерживается. Первый название организации хранится в поле **company** BlackBerry.
-
-* **department**: не поддерживается, возвращая `null`.
-
-* **title**: частично поддерживается. Первый должность в организации хранится в поле **jobTitle** BlackBerry.
-
-### Особенности Firefox OS
-
-* **pref**: Не поддерживается
-
-* **type**: Не поддерживается
-
-* **department**: Не поддерживается
-
-* Поля **name** и **title** хранятся в полях **org** and **jobTitle**.
-
-### Особенности iOS
-
-* **pref**: не поддерживается на устройствах iOS, возвращая `false`.
-
-* **type**: не поддерживается на устройствах iOS, возвращая `null`.
-
-* **name**: частично поддерживается. Первое название организации хранится в поле **kABPersonOrganizationProperty** iOS.
-
-* **department**: частично поддерживается. Имя первого отдела хранится в поле **kABPersonDepartmentProperty** iOS.
-
-* **title**: частично поддерживается. Первая должность хранится в поле **kABPersonJobTitleProperty** iOS.
-
-### Совместимости Windows
-
-* **pref**: не поддерживается, возвращая `false`.
-
-* **тип**: не поддерживается, возвращая`null`.
diff --git a/plugins/cordova-plugin-contacts/doc/zh/README.md b/plugins/cordova-plugin-contacts/doc/zh/README.md
deleted file mode 100644
index 7ac16eb..0000000
--- a/plugins/cordova-plugin-contacts/doc/zh/README.md
+++ /dev/null
@@ -1,735 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
-
-這個外掛程式定義了一個全域 `navigator.contacts` 物件,提供對設備連絡人資料庫的訪問。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**警告**: 連絡人資料的收集和使用提出了重要的隱私問題。 您的應用程式的隱私權原則應該討論應用程式如何使用連絡人資料和它是否被共用與任何其他締約方。 聯繫資訊被認為是敏感,因為它揭示了的人與人溝通了。 因此,除了隱私權原則的應用程式,您應強烈考慮提供時間只是通知之前應用程式訪問或使用連絡人的資料,如果設備作業系統不已經這樣做了。 該通知應提供相同的資訊,如上所述,以及獲取該使用者的許可權 (例如,通過提出選擇 **確定** 並 **不感謝**)。 請注意一些應用程式市場可能需要應用程式提供只是時間的通知,並獲得使用者的許可才能訪問連絡人資料。 周圍的連絡人資料可以説明避免使用者混淆使用和連絡人資料感知的濫用的清楚和容易理解的使用者體驗。 有關詳細資訊,請參閱隱私指南。
-
-## 安裝
-
-這就要求科爾多瓦 5.0 + (當前穩定 v1.0.0)
-
- cordova plugin add cordova-plugin-contacts
-
-
-舊版本的科爾多瓦仍可以安裝通過**棄用**id (陳舊 v0.2.16)
-
- cordova plugin add org.apache.cordova.contacts
-
-
-它也是可以直接通過回購 url 安裝 (不穩定)
-
- cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
-
-
-### 火狐瀏覽器作業系統的怪癖
-
-在 [清單檔](https://developer.mozilla.org/en-US/Apps/Developing/Manifest) 中所述創建 **www/manifest.webapp**。 添加相關的許可權。 也是需要的 web 應用程式類型更改為"privileged"— — [顯化的文檔](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type)。 **警告**: 所有的特權應用程式強制執行禁止內聯腳本的 [內容的安全性原則](https://developer.mozilla.org/en-US/Apps/CSP)。 在另一種方式初始化您的應用程式。
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows 的怪癖
-
-**之前 Windows 10:**從`發現`和`pickContact`方法返回任何連絡人是唯讀,因此您的應用程式不能修改它們。 僅在 Windows Phone 8.1 設備上可用的 `find` 方法。
-
-**Windows 10 及以上:**連絡人可能保存,並將保存到應用程式本地連絡人存儲。 連絡人也會被刪除。
-
-### Windows 8 的怪癖
-
-Windows 8 連絡人是唯讀的。 透過科爾多瓦 API 接觸的不是可查詢/搜索,您應通知使用者挑選連絡人作為調用 contacts.pickContact,將會打開 '人' 的應用程式,使用者必須選擇一個連絡人。 返回任何連絡人是唯讀,因此您的應用程式不能修改它們。
-
-## navigator.contacts
-
-### 方法
-
- * navigator.contacts.create
- * navigator.contacts.find
- * navigator.contacts.pickContact
-
-### 物件
-
- * 連絡人
- * 連絡人姓名
- * ContactField
- * ContactAddress
- * ContactOrganization
- * ContactFindOptions
- * ContactError
- * ContactFieldType
-
-## navigator.contacts.create
-
-`navigator.contacts.create` 方法是同步的並返回一個新的 `Contact` 物件。
-
-此方法將不會保留在設備連絡人資料庫中,需要調用 `Contact.save` 方法的聯繫物件。
-
-### 支援的平臺
-
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
-
-### 示例
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-`navigator.contacts.find` 方法以非同步方式,執行設備連絡人資料庫查詢並返回 `Contact` 物件的陣列。 生成的物件被傳遞到由 **contactSuccess** 參數指定的 `contactSuccess` 回呼函數。
-
-**contactFields** 參數指定的欄位用作搜索限定詞。 長度為零的 **contactFields** 參數是不正確並導致 `ContactError.INVALID_ARGUMENT_ERROR`。 **contactFields** 值為 `"*"` 搜索所有連絡人欄位。
-
-在連絡人資料庫查詢時,**contactFindOptions.filter** 字串可以用作搜索篩選器。 如果提供,不區分大小寫,部分值匹配被適用于在 **contactFields** 參數中指定的每個欄位。 如果存在匹配的 *任何* 指定的欄位,則返回連絡人。 使用 **contactFindOptions.desiredFields** 參數來控制哪些連絡人屬性必須回來。
-
-### 參數
-
- * **contactFields**: '連絡人' 欄位用作搜索限定詞。*(DOMString[])* [Required]
-
- * **contactSuccess**: 從資料庫返回的成功回呼函數調用時使用的連絡人物件的陣列。[Required]
-
- * **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
-
- * **contactFindOptions**: 搜索選項來篩選 navigator.contacts。[Optional]
-
- 鍵包括:
-
- * **filter**: 用來找到 navigator.contacts 的搜索字串。*() DOMString*(預設: `""`)
-
- * **multiple**: 確定是否查找操作返回多個 navigator.contacts。*(布林值)*(預設值: `false`)
-
- * **desiredFields**: '連絡人' 欄位,又折回來。如果指定,由此產生的 `Contact` 物件只有這些欄位的功能值。*(DOMString[])* [Optional]
-
-### 支援的平臺
-
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows (Windows Phone 8.1 和 Windows 10)
-
-### 示例
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows 的怪癖
-
- * `__contactFields__`不受支援,將被忽略。`find`方法將始終嘗試匹配名稱、 電子郵件地址或電話號碼的連絡人。
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact` 方法啟動連絡人選取器來選擇一個連絡人。 將生成的物件傳遞給 **contactSuccess** 參數所指定的 `contactSuccess` 回呼函數。
-
-### 參數
-
- * **contactSuccess**: 成功使用單個連絡人物件調用的回呼函數。[要求]
-
- * **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
-
-### 支援的平臺
-
- * Android 系統
- * iOS
- * Windows Phone 8
- * Windows 8
- * Windows
-
-### 示例
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## 連絡人
-
-`Contact` 物件表示使用者的連絡人。 可以創建、 存儲,或從設備的連絡人資料庫中刪除連絡人。 連絡人可以也被 (單獨或批量) 從資料庫中檢索通過調用 `navigator.contacts.find` 方法。
-
-**注**: 並不是所有上面列出的連絡人欄位支援的每個設備的平臺。請檢查每個平臺 *的怪癖* 節瞭解詳細資訊。
-
-### 屬性
-
- * **id**: 一個全域唯一識別碼。*() DOMString*
-
- * **displayName**: 此連絡人,適合於向最終使用者顯示的名稱。*() DOMString*
-
- * **name**: 一個物件,包含所有元件的一個人的名字。*(連絡人姓名)*
-
- * **nickname**: 休閒的位址連絡人名稱。*() DOMString*
-
- * **phoneNumbers**: 陣列的所有連絡人的電話號碼。*(ContactField[])*
-
- * **emails**: 所有連絡人的電子郵件地址的陣列。*(ContactField[])*
-
- * **addresses**: 該連絡人的所有位址的陣列。*(ContactAddress[])*
-
- * **ims**: 所有連絡人的 IM 位址的陣列。*(ContactField[])*
-
- * **organizations**: 該連絡人的所有組織的陣列。*(ContactOrganization[])*
-
- * **birthday**: 連絡人的生日。*(Date)*
-
- * **note**: 注意有關的聯繫。*() DOMString*
-
- * **photos**: 陣列的連絡人的照片。*(ContactField[])*
-
- * **categories**: 陣列與連絡人關聯的所有使用者定義的類別。*(ContactField[])*
-
- * **url**: 陣列與連絡人關聯的 web 頁。*(ContactField[])*
-
-### 方法
-
- * **clone**: 返回一個新的 `Contact` 物件就是調用物件的深層副本 `id` 屬性設置為`null`.
-
- * **remove**: 從設備的連絡人資料庫中刪除連絡人,否則執行錯誤回檔與 `ContactError` 物件。
-
- * **save**: 將一個新的連絡人保存到設備的連絡人資料庫中,或更新現有的連絡人,如果已存在具有相同 **id** 的連絡人。
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### 保存示例
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### 克隆示例
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### 刪除示例
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X 的怪癖
-
- * **categories**: 不支援 Android 2.X 在設備上,返回`null`.
-
-### 黑莓 10 怪癖
-
- * **id**: 由該設備分配時保存該連絡人。
-
-### FirefoxOS 的怪癖
-
- * **categories**: 部分支援。返回欄位**pref**和**type**`null`
-
- * **ims**: 不支援
-
- * **photos**: 不支援
-
-### iOS 的怪癖
-
- * **displayName**: 上返回的 iOS 不支援 `null` 除非有沒有 `ContactName` 指定,在這種情況下它將返回複合名稱,**nickname**或 `""` ,分別。
-
- * **birthday**: 必須輸入 JavaScript 作為 `Date` 物件,它將返回相同的方式。
-
- * **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。當應用程式退出時刪除臨時目錄的內容。
-
- * **categories**: 目前不支援此屬性,返回`null`.
-
-### Windows Phone 7 和 8 怪癖
-
- * **displayName**: 當創建一個連絡人,提供的顯示名稱參數不同于顯示名稱的值檢索查找連絡人時。
-
- * **url**: 當創建一個連絡人,使用者可以輸入和保存多個 web 位址,但只有一個是可用的搜索連絡人時。
-
- * **phoneNumbers**:*pref*選項不受支援。 在*type*操作中不是支援的*find*。 只有一個 `phoneNumber` 允許的每個*type*.
-
- * **emails**:*pref*選項不受支援。家庭和個人使用引用同一電子郵件項。只有一項是允許的每個*type*.
-
- * **addresses**: 僅支援的工作和家庭/個人*type*。家庭和個人*type*引用相同的位址條目。只有一項是允許的每個*type*.
-
- * **organizations**: 唯一一個允許的和不支援的*pref*、*type*和*department*的屬性。
-
- * **note**: 不支援,返回`null`.
-
- * **ims**: 不受支援,返回`null`.
-
- * **birthdays**: 不受支援,返回`null`.
-
- * **categories**: 不受支援,返回`null`.
-
- * **remove**: 不支援方法
-
-### Windows 的怪癖
-
- * **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。
-
- * **birthdays**: 不受支援,返回`null`.
-
- * **categories**: 不受支援,返回`null`.
-
- * **remove**: 方法只支援 Windows 10 或以上。
-
-## ContactAddress
-
-`ContactAddress` 物件存儲單個位址的連絡人的屬性。 `Contact` 物件可能包括多個位址 `ContactAddress []` 陣列中。
-
-### 屬性
-
- * **pref**: 設置為 `true` 如果這個 `ContactAddress` 包含使用者的首選的價值。*(Boolean)*
-
- * **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
-
- * **formatted**: 顯示格式的完整位址。*() DOMString*
-
- * **streetAddress**: 完整的街道位址。*() DOMString*
-
- * **locality**: 城市或地點。*() DOMString*
-
- * **region**: 國家或地區。*() DOMString*
-
- * **postalCode**: 郵遞區號。*() DOMString*
-
- * **country**: 國家名稱。*() DOMString*
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### 示例
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X 的怪癖
-
- * **pref**: 不受支援,返回 `false` Android 2.X 的設備上。
-
-### 黑莓 10 怪癖
-
- * **pref**: 在返回的黑莓設備上不支援`false`.
-
- * **type**: 部分支援。只有一個*Word*和*Home*類型位址可以存儲每個連絡人。
-
- * **formatted**: 部分支援。返回的串聯的所有黑莓手機位址欄位。
-
- * **streetAddress**: 支援。返回和串聯組成的黑莓**address1** **address2**位址欄位。
-
- * **locality**: 支援。黑莓手機**city**位址欄位中存儲。
-
- * **region**: 支援。黑莓**stateProvince**位址欄位中存儲。
-
- * **postalCode**: 支援。黑莓**zipPostal**位址欄位中存儲。
-
- * **country**: 支援。
-
-### FirefoxOS 的怪癖
-
- * **formatted**: 目前不支援
-
-### iOS 的怪癖
-
- * **pref**: 不支援在 iOS 設備上,返回`false`.
-
- * **formatted**: 目前不支援。
-
-### Windows 8 的怪癖
-
- * **pref**: 不支援
-
-### Windows 的怪癖
-
- * **pref**: 不支援
-
-## ContactError
-
-當發生錯誤時,通過 `contactError` 回呼函數為使用者情況下會返回的 `ContactError` 物件。
-
-### 屬性
-
- * **code**: 下面列出的預定義的錯誤代碼之一。
-
-### 常量
-
- * `ContactError.UNKNOWN_ERROR` (code 0)
- * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
- * `ContactError.TIMEOUT_ERROR` (code 2)
- * `ContactError.PENDING_OPERATION_ERROR` (code 3)
- * `ContactError.IO_ERROR` (code 4)
- * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
- * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-`ContactField` 物件是可重用的元件代表一般連絡人欄位。 每個 `ContactField` 物件包含一個 `value`、 `type` 和 `pref` 的屬性。 `Contacat` 物件將幾個屬性存儲在 `ContactField []` 陣列,例如電話號碼和電子郵件地址。
-
-在大多數情況下,沒有預先確定的 `ContactField` 物件的 **type** 屬性值。 例如,一個電話號碼可以指定 **type** 值的 *home*、 *work*、 *mobile*、 *iPhone* 或由一個特定的設備平臺接觸資料庫系統支援的任何其他值。 然而,為 `photos` **照片** 欄位中,**type** 欄位指示返回圖像的格式: 當 **value** 屬性包含一個指向的照片圖像或 *base64* URL 時的 **value** 包含 string base64 編碼的圖像的 **url**。
-
-### 屬性
-
- * **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
-
- * **value**: 欄位的值,如電話號碼或電子郵件地址。*() DOMString*
-
- * **pref**: 設置為 `true` 如果這個 `ContactField` 包含使用者的首選的價值。*(布林)*
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### 示例
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Android 的怪癖
-
- * **pref**: 不受支援,返回`false`.
-
-### 黑莓 10 怪癖
-
- * **type**: 部分支援。使用的電話號碼。
-
- * **value**: 支援。
-
- * **pref**: 不受支援,返回`false`.
-
-### iOS 的怪癖
-
- * **pref**: 不受支援,返回`false`.
-
-### Windows8 的怪癖
-
- * **pref**: 不受支援,返回`false`.
-
-### Windows 的怪癖
-
- * **pref**: 不受支援,返回`false`.
-
-## 連絡人姓名
-
-包含不同種類的 `Contact` 物件名稱有關的資訊。
-
-### 屬性
-
- * **formatted**: 該連絡人的完整名稱。*() DOMString*
-
- * **familyName**: 連絡人的姓氏。*() DOMString*
-
- * **givenName**: 連絡人的名字。*() DOMString*
-
- * **middleName**: 連絡人的中間名。*() DOMString*
-
- * **honorificPrefix**: 連絡人的首碼 (例如*先生*或*博士*) *(DOMString)*
-
- * **honorificSuffix**: 連絡人的尾碼 (例如*某某某*)。*() DOMString*
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### 示例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 的怪癖
-
- * **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
-
-### 黑莓 10 怪癖
-
- * **formatted**: 部分支援。返回的串聯的黑莓手機**firstName**和**lastName**欄位。
-
- * **familyName**: 支援。黑莓**lastName**欄位中存儲。
-
- * **givenName**: 支援。黑莓**firstName**欄位中存儲。
-
- * **middleName**: 不受支援,返回`null`.
-
- * **honorificPrefix**: 不受支援,返回`null`.
-
- * **honorificSuffix**: 不受支援,返回`null`.
-
-### FirefoxOS 的怪癖
-
- * **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
-
-### iOS 的怪癖
-
- * **formatted**: 部分支援。返回 iOS 複合名稱,但為唯讀。
-
-### Windows 8 的怪癖
-
- * **formatted**: 這是唯一名稱屬性,並且是相同的 `displayName` ,和`nickname`
-
- * **familyName**: 不支援
-
- * **givenName**: 不支援
-
- * **middleName**: 不支援
-
- * **honorificPrefix**: 不支援
-
- * **honorificSuffix**: 不支援
-
-### Windows 的怪癖
-
- * **formatted**: 它是完全相同`displayName`
-
-## ContactOrganization
-
-`ContactOrganization` 物件存儲連絡人的組織屬性。`Contact` 物件將一個或多個 `ContactOrganization` 物件存儲在一個陣列中。
-
-### 屬性
-
- * **pref**: 設置為 `true` 如果這個 `ContactOrganization` 包含使用者的首選的價值。*(布林)*
-
- * **type**: 一個字串,例如指示哪種類型的欄位,這是*回家*。_(DOMString)
-
- * **name**: 組織的名稱。*() DOMString*
-
- * **department**: 合同工作為的部門。*() DOMString*
-
- * **title**: 在組織連絡人的標題。*() DOMString*
-
-### 支援的平臺
-
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows (Windows 8.1 和 Windows Phone 8.1 設備)
-
-### 示例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X 的怪癖
-
- * **pref**: 不支援的 Android 2.X 的設備,返回`false`.
-
-### 黑莓 10 怪癖
-
- * **pref**: 不支援的黑莓手機,返回`false`.
-
- * **type**: 不支援的黑莓手機,返回`null`.
-
- * **name**: 部分支援。第一次組織名稱存儲在黑莓**company**欄位中。
-
- * **department**: 不受支援,返回`null`.
-
- * **title**: 部分支援。第一次組織標題存儲在欄位中黑莓**jobTitle**。
-
-### 火狐瀏覽器作業系統的怪癖
-
- * **pref**: 不支援
-
- * **type**: 不支援
-
- * **department**: 不支援
-
- * 欄位**name**和**title**存儲在**org**和**jobTitle**.
-
-### iOS 的怪癖
-
- * **pref**: 不支援在 iOS 設備上,返回`false`.
-
- * **type**: 不支援在 iOS 設備上,返回`null`.
-
- * **name**: 部分支援。第一次組織名稱存儲在 iOS **kABPersonOrganizationProperty**欄位中。
-
- * **department**: 部分支援。第一部門名稱存儲在 iOS **kABPersonDepartmentProperty**欄位中。
-
- * **title**: 部分支援。第一個標題存儲在 iOS **kABPersonJobTitleProperty**欄位中。
-
-### Windows 的怪癖
-
- * **pref**: 不受支援,返回`false`.
-
- * **type**: 不受支援,返回`null`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/doc/zh/index.md b/plugins/cordova-plugin-contacts/doc/zh/index.md
deleted file mode 100644
index 59d7e43..0000000
--- a/plugins/cordova-plugin-contacts/doc/zh/index.md
+++ /dev/null
@@ -1,719 +0,0 @@
-
-
-# cordova-plugin-contacts
-
-這個外掛程式定義了一個全域 `navigator.contacts` 物件,提供對設備連絡人資料庫的訪問。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.contacts);
- }
-
-
-**警告**: 連絡人資料的收集和使用提出了重要的隱私問題。 您的應用程式的隱私權原則應該討論應用程式如何使用連絡人資料和它是否被共用與任何其他締約方。 聯繫資訊被認為是敏感,因為它揭示了的人與人溝通了。 因此,除了隱私權原則的應用程式,您應強烈考慮提供時間只是通知之前應用程式訪問或使用連絡人的資料,如果設備作業系統不已經這樣做了。 該通知應提供相同的資訊,如上所述,以及獲取該使用者的許可權 (例如,通過提出選擇 **確定** 並 **不感謝**)。 請注意一些應用程式市場可能需要應用程式提供只是時間的通知,並獲得使用者的許可才能訪問連絡人資料。 周圍的連絡人資料可以説明避免使用者混淆使用和連絡人資料感知的濫用的清楚和容易理解的使用者體驗。 有關詳細資訊,請參閱隱私指南。
-
-## 安裝
-
- cordova plugin add cordova-plugin-contacts
-
-
-### 火狐瀏覽器作業系統的怪癖
-
-在 [清單檔][1] 中所述創建 **www/manifest.webapp**。 添加相關的許可權。 也是需要的 web 應用程式類型更改為"privileged"— — [顯化的文檔][2]。 **警告**: 所有的特權應用程式強制執行禁止內聯腳本的 [內容的安全性原則][3]。 在另一種方式初始化您的應用程式。
-
- [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
- [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
- [3]: https://developer.mozilla.org/en-US/Apps/CSP
-
- "type": "privileged",
- "permissions": {
- "contacts": {
- "access": "readwrite",
- "description": "Describe why there is a need for such permission"
- }
- }
-
-
-### Windows 的怪癖
-
-從 `find` 和 `pickContact` 方法返回任何連絡人是唯讀,因此您的應用程式不能修改它們。 僅在 Windows Phone 8.1 設備上可用的 `find` 方法。
-
-### Windows 8 的怪癖
-
-Windows 8 連絡人是唯讀的。 透過科爾多瓦 API 接觸的不是可查詢/搜索,您應通知使用者挑選連絡人作為調用 contacts.pickContact,將會打開 '人' 的應用程式,使用者必須選擇一個連絡人。 返回任何連絡人是唯讀,因此您的應用程式不能修改它們。
-
-## navigator.contacts
-
-### 方法
-
-* navigator.contacts.create
-* navigator.contacts.find
-* navigator.contacts.pickContact
-
-### 物件
-
-* 連絡人
-* 連絡人姓名
-* ContactField
-* ContactAddress
-* ContactOrganization
-* ContactFindOptions
-* ContactError
-* ContactFieldType
-
-## navigator.contacts.create
-
-`navigator.contacts.create` 方法是同步的並返回一個新的 `Contact` 物件。
-
-此方法將不會保留在設備連絡人資料庫中,需要調用 `Contact.save` 方法的聯繫物件。
-
-### 支援的平臺
-
-* Android 系統
-* 黑莓 10
-* 火狐瀏覽器作業系統
-* iOS
-* Windows Phone 7 和 8
-
-### 示例
-
- var myContact = navigator.contacts.create({"displayName": "Test User"});
-
-
-## navigator.contacts.find
-
-`navigator.contacts.find` 方法以非同步方式,執行設備連絡人資料庫查詢並返回 `Contact` 物件的陣列。 生成的物件被傳遞到由 **contactSuccess** 參數指定的 `contactSuccess` 回呼函數。
-
-**contactFields** 參數指定的欄位用作搜索限定詞。 長度為零的 **contactFields** 參數是不正確並導致 `ContactError.INVALID_ARGUMENT_ERROR`。 **contactFields** 值為 `"*"` 搜索所有連絡人欄位。
-
-在連絡人資料庫查詢時,**contactFindOptions.filter** 字串可以用作搜索篩選器。 如果提供,不區分大小寫,部分值匹配被適用于在 **contactFields** 參數中指定的每個欄位。 如果存在匹配的 *任何* 指定的欄位,則返回連絡人。 使用 **contactFindOptions.desiredFields** 參數來控制哪些連絡人屬性必須回來。
-
-### 參數
-
-* **contactFields**: '連絡人' 欄位用作搜索限定詞。*(DOMString[])* [Required]
-
-* **contactSuccess**: 從資料庫返回的成功回呼函數調用時使用的連絡人物件的陣列。[Required]
-
-* **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
-
-* **contactFindOptions**: 搜索選項來篩選 navigator.contacts。[Optional]
-
- 鍵包括:
-
- * **filter**: 用來找到 navigator.contacts 的搜索字串。*() DOMString*(預設: `""`)
-
- * **multiple**: 確定是否查找操作返回多個 navigator.contacts。*(布林值)*(預設值: `false`)
-
- * **desiredFields**: '連絡人' 欄位,又折回來。如果指定,由此產生的 `Contact` 物件只有這些欄位的功能值。*(DOMString[])* [Optional]
-
-### 支援的平臺
-
-* Android 系統
-* 黑莓 10
-* 火狐瀏覽器作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows (僅適用于 Windows Phone 8.1 設備)
-
-### 示例
-
- function onSuccess(contacts) {
- alert('Found ' + contacts.length + ' contacts.');
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts with 'Bob' in any name field
- var options = new ContactFindOptions();
- options.filter = "Bob";
- options.multiple = true;
- options.desiredFields = [navigator.contacts.fieldType.id];
- var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
- navigator.contacts.find(fields, onSuccess, onError, options);
-
-
-### Windows 的怪癖
-
-* `__contactFields__`不受支援,將被忽略。`find`方法將始終嘗試匹配名稱、 電子郵件地址或電話號碼的連絡人。
-
-## navigator.contacts.pickContact
-
-`navigator.contacts.pickContact` 方法啟動連絡人選取器來選擇一個連絡人。 將生成的物件傳遞給 **contactSuccess** 參數所指定的 `contactSuccess` 回呼函數。
-
-### 參數
-
-* **contactSuccess**: 成功使用單個連絡人物件調用的回呼函數。[要求]
-
-* **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
-
-### 支援的平臺
-
-* 安卓系統
-* iOS
-* Windows Phone 8
-* Windows 8
-* Windows
-
-### 示例
-
- navigator.contacts.pickContact(function(contact){
- console.log('The following contact has been selected:' + JSON.stringify(contact));
- },function(err){
- console.log('Error: ' + err);
- });
-
-
-## 連絡人
-
-`Contact` 物件表示使用者的連絡人。 可以創建、 存儲,或從設備的連絡人資料庫中刪除連絡人。 連絡人可以也被 (單獨或批量) 從資料庫中檢索通過調用 `navigator.contacts.find` 方法。
-
-**注**: 並不是所有上面列出的連絡人欄位支援的每個設備的平臺。請檢查每個平臺 *的怪癖* 節瞭解詳細資訊。
-
-### 屬性
-
-* **id**: 一個全域唯一識別碼。*() DOMString*
-
-* **displayName**: 此連絡人,適合於向最終使用者顯示的名稱。*() DOMString*
-
-* **name**: 一個物件,包含所有元件的一個人的名字。*(連絡人姓名)*
-
-* **nickname**: 休閒的位址連絡人名稱。*() DOMString*
-
-* **phoneNumbers**: 陣列的所有連絡人的電話號碼。*(ContactField[])*
-
-* **emails**: 所有連絡人的電子郵件地址的陣列。*(ContactField[])*
-
-* **addresses**: 該連絡人的所有位址的陣列。*(ContactAddress[])*
-
-* **ims**: 所有連絡人的 IM 位址的陣列。*(ContactField[])*
-
-* **organizations**: 該連絡人的所有組織的陣列。*(ContactOrganization[])*
-
-* **birthday**: 連絡人的生日。*(Date)*
-
-* **note**: 注意有關的聯繫。*() DOMString*
-
-* **photos**: 陣列的連絡人的照片。*(ContactField[])*
-
-* **categories**: 陣列與連絡人關聯的所有使用者定義的類別。*(ContactField[])*
-
-* **url**: 陣列與連絡人關聯的 web 頁。*(ContactField[])*
-
-### 方法
-
-* **clone**: 返回一個新的 `Contact` 物件就是調用物件的深層副本 `id` 屬性設置為`null`.
-
-* **remove**: 從設備的連絡人資料庫中刪除連絡人,否則執行錯誤回檔與 `ContactError` 物件。
-
-* **save**: 將一個新的連絡人保存到設備的連絡人資料庫中,或更新現有的連絡人,如果已存在具有相同 **id** 的連絡人。
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* 安卓系統
-* 黑莓 10
-* 火狐瀏覽器的作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### 保存示例
-
- function onSuccess(contact) {
- alert("Save Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // create a new contact object
- var contact = navigator.contacts.create();
- contact.displayName = "Plumber";
- contact.nickname = "Plumber"; // specify both to support all devices
-
- // populate some fields
- var name = new ContactName();
- name.givenName = "Jane";
- name.familyName = "Doe";
- contact.name = name;
-
- // save to device
- contact.save(onSuccess,onError);
-
-
-### 克隆示例
-
- // clone the contact object
- var clone = contact.clone();
- clone.name.givenName = "John";
- console.log("Original contact name = " + contact.name.givenName);
- console.log("Cloned contact name = " + clone.name.givenName);
-
-
-### 刪除示例
-
- function onSuccess() {
- alert("Removal Success");
- };
-
- function onError(contactError) {
- alert("Error = " + contactError.code);
- };
-
- // remove the contact from the device
- contact.remove(onSuccess,onError);
-
-
-### Android 2.X 的怪癖
-
-* **categories**: 不支援 Android 2.X 在設備上,返回`null`.
-
-### 黑莓 10 的怪癖
-
-* **id**: 由該設備分配時保存該連絡人。
-
-### FirefoxOS 的怪癖
-
-* **categories**: 部分支援。返回欄位**pref**和**type**`null`
-
-* **ims**: 不支援
-
-* **photos**: 不支援
-
-### iOS 的怪癖
-
-* **displayName**: 上返回的 iOS 不支援 `null` 除非有沒有 `ContactName` 指定,在這種情況下它將返回複合名稱,**nickname**或 `""` ,分別。
-
-* **birthday**: 必須輸入 JavaScript 作為 `Date` 物件,它將返回相同的方式。
-
-* **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。當應用程式退出時刪除臨時目錄的內容。
-
-* **categories**: 目前不支援此屬性,返回`null`.
-
-### Windows Phone 7 和 8 的怪癖
-
-* **displayName**: 當創建一個連絡人,提供的顯示名稱參數不同于顯示名稱的值檢索查找連絡人時。
-
-* **url**: 當創建一個連絡人,使用者可以輸入和保存多個 web 位址,但只有一個是可用的搜索連絡人時。
-
-* **phoneNumbers**:*pref*選項不受支援。 在*type*操作中不是支援的*find*。 只有一個 `phoneNumber` 允許的每個*type*.
-
-* **emails**:*pref*選項不受支援。家庭和個人使用引用同一電子郵件項。只有一項是允許的每個*type*.
-
-* **addresses**: 僅支援的工作和家庭/個人*type*。家庭和個人*type*引用相同的位址條目。只有一項是允許的每個*type*.
-
-* **organizations**: 唯一一個允許的和不支援的*pref*、*type*和*department*的屬性。
-
-* **note**: 不支援,返回`null`.
-
-* **ims**: 不受支援,返回`null`.
-
-* **birthdays**: 不受支援,返回`null`.
-
-* **categories**: 不受支援,返回`null`.
-
-### Windows 的怪癖
-
-* **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。
-
-* **birthdays**: 不受支援,返回`null`.
-
-* **categories**: 不受支援,返回`null`.
-
-## ContactAddress
-
-`ContactAddress` 物件存儲單個位址的連絡人的屬性。 `Contact` 物件可能包括多個位址 `ContactAddress []` 陣列中。
-
-### 屬性
-
-* **pref**: 設置為 `true` 如果這個 `ContactAddress` 包含使用者的首選的價值。*(Boolean)*
-
-* **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
-
-* **formatted**: 顯示格式的完整位址。*() DOMString*
-
-* **streetAddress**: 完整的街道位址。*() DOMString*
-
-* **locality**: 城市或地點。*() DOMString*
-
-* **region**: 國家或地區。*() DOMString*
-
-* **postalCode**: 郵遞區號。*() DOMString*
-
-* **country**: 國家名稱。*() DOMString*
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* 安卓系統
-* 黑莓 10
-* 火狐瀏覽器的作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### 示例
-
- // display the address information for all contacts
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].addresses.length; j++) {
- alert("Pref: " + contacts[i].addresses[j].pref + "\n" +
- "Type: " + contacts[i].addresses[j].type + "\n" +
- "Formatted: " + contacts[i].addresses[j].formatted + "\n" +
- "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
- "Locality: " + contacts[i].addresses[j].locality + "\n" +
- "Region: " + contacts[i].addresses[j].region + "\n" +
- "Postal Code: " + contacts[i].addresses[j].postalCode + "\n" +
- "Country: " + contacts[i].addresses[j].country);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- // find all contacts
- var options = new ContactFindOptions();
- options.filter = "";
- var filter = ["displayName", "addresses"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X 的怪癖
-
-* **pref**: 不受支援,返回 `false` Android 2.X 的設備上。
-
-### 黑莓 10 的怪癖
-
-* **pref**: 在返回的黑莓設備上不支援`false`.
-
-* **type**: 部分支援。只有一個*Word*和*Home*類型位址可以存儲每個連絡人。
-
-* **formatted**: 部分支援。返回的串聯的所有黑莓手機位址欄位。
-
-* **streetAddress**: 支援。返回和串聯組成的黑莓**address1** **address2**位址欄位。
-
-* **locality**: 支援。黑莓手機**city**位址欄位中存儲。
-
-* **region**: 支援。黑莓**stateProvince**位址欄位中存儲。
-
-* **postalCode**: 支援。黑莓**zipPostal**位址欄位中存儲。
-
-* **country**: 支援。
-
-### FirefoxOS 的怪癖
-
-* **formatted**: 目前不支援
-
-### iOS 的怪癖
-
-* **pref**: 不支援在 iOS 設備上,返回`false`.
-
-* **formatted**: 目前不支援。
-
-### Windows 8 的怪癖
-
-* **pref**: 不支援
-
-### Windows 的怪癖
-
-* **pref**: 不支援
-
-## ContactError
-
-當發生錯誤時,通過 `contactError` 回呼函數為使用者情況下會返回的 `ContactError` 物件。
-
-### 屬性
-
-* **code**: 下面列出的預定義的錯誤代碼之一。
-
-### 常量
-
-* `ContactError.UNKNOWN_ERROR` (code 0)
-* `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
-* `ContactError.TIMEOUT_ERROR` (code 2)
-* `ContactError.PENDING_OPERATION_ERROR` (code 3)
-* `ContactError.IO_ERROR` (code 4)
-* `ContactError.NOT_SUPPORTED_ERROR` (code 5)
-* `ContactError.PERMISSION_DENIED_ERROR` (code 20)
-
-## ContactField
-
-`ContactField` 物件是可重用的元件代表一般連絡人欄位。 每個 `ContactField` 物件包含一個 `value`、 `type` 和 `pref` 的屬性。 `Contacat` 物件將幾個屬性存儲在 `ContactField []` 陣列,例如電話號碼和電子郵件地址。
-
-在大多數情況下,沒有預先確定的 `ContactField` 物件的 **type** 屬性值。 例如,一個電話號碼可以指定 **type** 值的 *home*、 *work*、 *mobile*、 *iPhone* 或由一個特定的設備平臺接觸資料庫系統支援的任何其他值。 然而,為 `photos` **照片** 欄位中,**type** 欄位指示返回圖像的格式: 當 **value** 屬性包含一個指向的照片圖像或 *base64* URL 時的 **value** 包含 string base64 編碼的圖像的 **url**。
-
-### 屬性
-
-* **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
-
-* **value**: 欄位的值,如電話號碼或電子郵件地址。*() DOMString*
-
-* **pref**: 設置為 `true` 如果這個 `ContactField` 包含使用者的首選的價值。*(布林)*
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* 安卓系統
-* 黑莓 10
-* 火狐瀏覽器的作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### 示例
-
- // create a new contact
- var contact = navigator.contacts.create();
-
- // store contact phone numbers in ContactField[]
- var phoneNumbers = [];
- phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
- phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
- phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
- contact.phoneNumbers = phoneNumbers;
-
- // save the contact
- contact.save();
-
-
-### Android 的怪癖
-
-* **pref**: 不受支援,返回`false`.
-
-### 黑莓 10 的怪癖
-
-* **type**: 部分支援。使用的電話號碼。
-
-* **value**: 支援。
-
-* **pref**: 不受支援,返回`false`.
-
-### iOS 的怪癖
-
-* **pref**: 不受支援,返回`false`.
-
-### Windows8 的怪癖
-
-* **pref**: 不受支援,返回`false`.
-
-### Windows 的怪癖
-
-* **pref**: 不受支援,返回`false`.
-
-## ContactName
-
-包含不同種類的 `Contact` 物件名稱有關的資訊。
-
-### 屬性
-
-* **formatted**: 該連絡人的完整名稱。*() DOMString*
-
-* **familyName**: 連絡人的姓氏。*() DOMString*
-
-* **givenName**: 連絡人的名字。*() DOMString*
-
-* **middleName**: 連絡人的中間名。*() DOMString*
-
-* **honorificPrefix**: 連絡人的首碼 (例如*先生*或*博士*) *(DOMString)*
-
-* **honorificSuffix**: 連絡人的尾碼 (例如*某某某*)。*() DOMString*
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* 火狐瀏覽器的作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### 示例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- alert("Formatted: " + contacts[i].name.formatted + "\n" +
- "Family Name: " + contacts[i].name.familyName + "\n" +
- "Given Name: " + contacts[i].name.givenName + "\n" +
- "Middle Name: " + contacts[i].name.middleName + "\n" +
- "Suffix: " + contacts[i].name.honorificSuffix + "\n" +
- "Prefix: " + contacts[i].name.honorificSuffix);
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "name"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 的怪癖
-
-* **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
-
-### 黑莓 10 的怪癖
-
-* **formatted**: 部分支援。返回的串聯的黑莓手機**firstName**和**lastName**欄位。
-
-* **familyName**: 支援。黑莓**lastName**欄位中存儲。
-
-* **givenName**: 支援。黑莓**firstName**欄位中存儲。
-
-* **middleName**: 不受支援,返回`null`.
-
-* **honorificPrefix**: 不受支援,返回`null`.
-
-* **honorificSuffix**: 不受支援,返回`null`.
-
-### FirefoxOS 的怪癖
-
-* **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
-
-### iOS 的怪癖
-
-* **formatted**: 部分支援。返回 iOS 複合名稱,但為唯讀。
-
-### Windows 8 的怪癖
-
-* **formatted**: 這是唯一名稱屬性,並且是相同的 `displayName` ,和`nickname`
-
-* **familyName**: 不支援
-
-* **givenName**: 不支援
-
-* **middleName**: 不支援
-
-* **honorificPrefix**: 不支援
-
-* **honorificSuffix**: 不支援
-
-### Windows 的怪癖
-
-* **formatted**: 它是完全相同`displayName`
-
-## ContactOrganization
-
-`ContactOrganization` 物件存儲連絡人的組織屬性。`Contact` 物件將一個或多個 `ContactOrganization` 物件存儲在一個陣列中。
-
-### 屬性
-
-* **pref**: 設置為 `true` 如果這個 `ContactOrganization` 包含使用者的首選的價值。*(布林)*
-
-* **type**: 一個字串,例如指示哪種類型的欄位,這是*回家*。_(DOMString)
-
-* **name**: 組織的名稱。*() DOMString*
-
-* **department**: 合同工作為的部門。*() DOMString*
-
-* **title**: 在組織連絡人的標題。*() DOMString*
-
-### 支援的平臺
-
-* 安卓系統
-* 黑莓 10
-* 火狐瀏覽器的作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows (Windows 8.1 和 Windows Phone 8.1 設備)
-
-### 示例
-
- function onSuccess(contacts) {
- for (var i = 0; i < contacts.length; i++) {
- for (var j = 0; j < contacts[i].organizations.length; j++) {
- alert("Pref: " + contacts[i].organizations[j].pref + "\n" +
- "Type: " + contacts[i].organizations[j].type + "\n" +
- "Name: " + contacts[i].organizations[j].name + "\n" +
- "Department: " + contacts[i].organizations[j].department + "\n" +
- "Title: " + contacts[i].organizations[j].title);
- }
- }
- };
-
- function onError(contactError) {
- alert('onError!');
- };
-
- var options = new ContactFindOptions();
- options.filter = "";
- filter = ["displayName", "organizations"];
- navigator.contacts.find(filter, onSuccess, onError, options);
-
-
-### Android 2.X 的怪癖
-
-* **pref**: 不支援的 Android 2.X 的設備,返回`false`.
-
-### 黑莓 10 的怪癖
-
-* **pref**: 不支援的黑莓手機,返回`false`.
-
-* **type**: 不支援的黑莓手機,返回`null`.
-
-* **name**: 部分支援。第一次組織名稱存儲在黑莓**company**欄位中。
-
-* **department**: 不受支援,返回`null`.
-
-* **title**: 部分支援。第一次組織標題存儲在欄位中黑莓**jobTitle**。
-
-### 火狐瀏覽器作業系統的怪癖
-
-* **pref**: 不支援
-
-* **type**: 不支援
-
-* **department**: 不支援
-
-* 欄位**name**和**title**存儲在**org**和**jobTitle**.
-
-### iOS 的怪癖
-
-* **pref**: 不支援在 iOS 設備上,返回`false`.
-
-* **type**: 不支援在 iOS 設備上,返回`null`.
-
-* **name**: 部分支援。第一次組織名稱存儲在 iOS **kABPersonOrganizationProperty**欄位中。
-
-* **department**: 部分支援。第一部門名稱存儲在 iOS **kABPersonDepartmentProperty**欄位中。
-
-* **title**: 部分支援。第一個標題存儲在 iOS **kABPersonJobTitleProperty**欄位中。
-
-### Windows 的怪癖
-
-* **pref**: 不受支援,返回`false`.
-
-* **type**: 不受支援,返回`null`.
diff --git a/plugins/cordova-plugin-contacts/package.json b/plugins/cordova-plugin-contacts/package.json
deleted file mode 100644
index 7e1ceb3..0000000
--- a/plugins/cordova-plugin-contacts/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "cordova-plugin-contacts",
- "version": "2.0.1",
- "description": "Cordova Contacts Plugin",
- "cordova": {
- "id": "cordova-plugin-contacts",
- "platforms": [
- "android",
- "amazon-fireos",
- "ubuntu",
- "ios",
- "blackberry10",
- "wp8",
- "firefoxos",
- "windows8",
- "windows"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-plugin-contacts"
- },
- "keywords": [
- "cordova",
- "contacts",
- "ecosystem:cordova",
- "cordova-android",
- "cordova-amazon-fireos",
- "cordova-ubuntu",
- "cordova-ios",
- "cordova-blackberry10",
- "cordova-wp7",
- "cordova-wp8",
- "cordova-firefoxos",
- "cordova-windows8",
- "cordova-windows"
- ],
- "author": "Apache Software Foundation",
- "license": "Apache 2.0"
-}
diff --git a/plugins/cordova-plugin-contacts/plugin.xml b/plugins/cordova-plugin-contacts/plugin.xml
deleted file mode 100644
index d44e466..0000000
--- a/plugins/cordova-plugin-contacts/plugin.xml
+++ /dev/null
@@ -1,224 +0,0 @@
-
-
-
-
-
- Contacts
- Cordova Contacts Plugin
- Apache 2.0
- cordova,contacts
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts.git
- https://issues.apache.org/jira/browse/CB/component/12320652
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- access_pimdomain_contacts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-contacts/src/android/ContactAccessor.java b/plugins/cordova-plugin-contacts/src/android/ContactAccessor.java
deleted file mode 100644
index 2b73d43..0000000
--- a/plugins/cordova-plugin-contacts/src/android/ContactAccessor.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.cordova.contacts;
-
-import java.util.HashMap;
-
-import android.Manifest;
-import android.content.pm.PackageManager;
-import android.util.Log;
-import org.apache.cordova.CordovaInterface;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * This abstract class defines SDK-independent API for communication with
- * Contacts Provider. The actual implementation used by the application depends
- * on the level of API available on the device. If the API level is Cupcake or
- * Donut, we want to use the {@link ContactAccessorSdk3_4} class. If it is
- * Eclair or higher, we want to use {@link ContactAccessorSdk5}.
- */
-public abstract class ContactAccessor {
-
- protected final String LOG_TAG = "ContactsAccessor";
- protected CordovaInterface mApp;
-
- /**
- * Check to see if the data associated with the key is required to
- * be populated in the Contact object.
- * @param key
- * @param map created by running buildPopulationSet.
- * @return true if the key data is required
- */
- protected boolean isRequired(String key, HashMap map) {
- Boolean retVal = map.get(key);
- return (retVal == null) ? false : retVal.booleanValue();
- }
-
- /**
- * Create a hash map of what data needs to be populated in the Contact object
- * @param fields the list of fields to populate
- * @return the hash map of required data
- */
- protected HashMap buildPopulationSet(JSONObject options) {
- HashMap map = new HashMap();
-
- String key;
- try {
- JSONArray desiredFields = null;
- if (options!=null && options.has("desiredFields")) {
- desiredFields = options.getJSONArray("desiredFields");
- }
- if (desiredFields == null || desiredFields.length() == 0) {
- map.put("displayName", true);
- map.put("name", true);
- map.put("nickname", true);
- map.put("phoneNumbers", true);
- map.put("emails", true);
- map.put("addresses", true);
- map.put("ims", true);
- map.put("organizations", true);
- map.put("birthday", true);
- map.put("note", true);
- map.put("urls", true);
- map.put("photos", true);
- map.put("categories", true);
- } else {
- for (int i = 0; i < desiredFields.length(); i++) {
- key = desiredFields.getString(i);
- if (key.startsWith("displayName")) {
- map.put("displayName", true);
- } else if (key.startsWith("name")) {
- map.put("displayName", true);
- map.put("name", true);
- } else if (key.startsWith("nickname")) {
- map.put("nickname", true);
- } else if (key.startsWith("phoneNumbers")) {
- map.put("phoneNumbers", true);
- } else if (key.startsWith("emails")) {
- map.put("emails", true);
- } else if (key.startsWith("addresses")) {
- map.put("addresses", true);
- } else if (key.startsWith("ims")) {
- map.put("ims", true);
- } else if (key.startsWith("organizations")) {
- map.put("organizations", true);
- } else if (key.startsWith("birthday")) {
- map.put("birthday", true);
- } else if (key.startsWith("note")) {
- map.put("note", true);
- } else if (key.startsWith("urls")) {
- map.put("urls", true);
- } else if (key.startsWith("photos")) {
- map.put("photos", true);
- } else if (key.startsWith("categories")) {
- map.put("categories", true);
- }
- }
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return map;
- }
-
- /**
- * Convenience method to get a string from a JSON object. Saves a
- * lot of try/catch writing.
- * If the property is not found in the object null will be returned.
- *
- * @param obj contact object to search
- * @param property to be looked up
- * @return The value of the property
- */
- protected String getJsonString(JSONObject obj, String property) {
- String value = null;
- try {
- if (obj != null) {
- value = obj.getString(property);
- if (value.equals("null")) {
- Log.d(LOG_TAG, property + " is string called 'null'");
- value = null;
- }
- }
- }
- catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get = " + e.getMessage());
- }
- return value;
- }
-
- /**
- * Handles adding a JSON Contact object into the database.
- * @return TODO
- */
- public abstract String save(JSONObject contact);
-
- /**
- * Handles searching through SDK-specific contacts API.
- */
- public abstract JSONArray search(JSONArray filter, JSONObject options);
-
- /**
- * Handles searching through SDK-specific contacts API.
- * @throws JSONException
- */
- public abstract JSONObject getContactById(String id) throws JSONException;
-
- /**
- * Handles searching through SDK-specific contacts API.
- * @param desiredFields fields that will filled. All fields will be filled if null
- * @throws JSONException
- */
- public abstract JSONObject getContactById(String id, JSONArray desiredFields) throws JSONException;
-
- /**
- * Handles removing a contact from the database.
- */
- public abstract boolean remove(String id);
-
- /**
- * A class that represents the where clause to be used in the database query
- */
- class WhereOptions {
- private String where;
- private String[] whereArgs;
- public void setWhere(String where) {
- this.where = where;
- }
- public String getWhere() {
- return where;
- }
- public void setWhereArgs(String[] whereArgs) {
- this.whereArgs = whereArgs;
- }
- public String[] getWhereArgs() {
- return whereArgs;
- }
- }
-}
diff --git a/plugins/cordova-plugin-contacts/src/android/ContactAccessorSdk5.java b/plugins/cordova-plugin-contacts/src/android/ContactAccessorSdk5.java
deleted file mode 100644
index bd43bf1..0000000
--- a/plugins/cordova-plugin-contacts/src/android/ContactAccessorSdk5.java
+++ /dev/null
@@ -1,2293 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.contacts;
-
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.sql.Date;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.cordova.CordovaInterface;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.content.ContentProviderOperation;
-import android.content.ContentProviderResult;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.OperationApplicationException;
-import android.database.Cursor;
-import android.database.sqlite.SQLiteException;
-import android.net.Uri;
-import android.os.RemoteException;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.CommonDataKinds;
-import android.provider.ContactsContract.CommonDataKinds.Phone;
-import android.text.TextUtils;
-import android.util.Log;
-
-/**
- * An implementation of {@link ContactAccessor} that uses current Contacts API.
- * This class should be used on Eclair or beyond, but would not work on any earlier
- * release of Android. As a matter of fact, it could not even be loaded.
- *
- * This implementation has several advantages:
- *
- *
It sees contacts from multiple accounts.
- *
It works with aggregated contacts. So for example, if the contact is the result
- * of aggregation of two raw contacts from different accounts, it may return the name from
- * one and the phone number from the other.
- *
It is efficient because it uses the more efficient current API.
- *
Not obvious in this particular example, but it has access to new kinds
- * of data available exclusively through the new APIs. Exercise for the reader: add support
- * for nickname (see {@link android.provider.ContactsContract.CommonDataKinds.Nickname}) or
- * social status updates (see {@link android.provider.ContactsContract.StatusUpdates}).
- *
- */
-
-public class ContactAccessorSdk5 extends ContactAccessor {
-
- /**
- * Keep the photo size under the 1 MB blog limit.
- */
- private static final long MAX_PHOTO_SIZE = 1048576;
-
- private static final String EMAIL_REGEXP = ".+@.+\\.+.+"; /* @.*/
-
- private static final String ASSET_URL_PREFIX = "file:///android_asset/";
-
- /**
- * A static map that converts the JavaScript property name to Android database column name.
- */
- private static final Map dbMap = new HashMap();
-
- static {
- dbMap.put("id", ContactsContract.Data.CONTACT_ID);
- dbMap.put("displayName", ContactsContract.Contacts.DISPLAY_NAME);
- dbMap.put("name", CommonDataKinds.StructuredName.DISPLAY_NAME);
- dbMap.put("name.formatted", CommonDataKinds.StructuredName.DISPLAY_NAME);
- dbMap.put("name.familyName", CommonDataKinds.StructuredName.FAMILY_NAME);
- dbMap.put("name.givenName", CommonDataKinds.StructuredName.GIVEN_NAME);
- dbMap.put("name.middleName", CommonDataKinds.StructuredName.MIDDLE_NAME);
- dbMap.put("name.honorificPrefix", CommonDataKinds.StructuredName.PREFIX);
- dbMap.put("name.honorificSuffix", CommonDataKinds.StructuredName.SUFFIX);
- dbMap.put("nickname", CommonDataKinds.Nickname.NAME);
- dbMap.put("phoneNumbers", CommonDataKinds.Phone.NUMBER);
- dbMap.put("phoneNumbers.value", CommonDataKinds.Phone.NUMBER);
- dbMap.put("emails", CommonDataKinds.Email.DATA);
- dbMap.put("emails.value", CommonDataKinds.Email.DATA);
- dbMap.put("addresses", CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS);
- dbMap.put("addresses.formatted", CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS);
- dbMap.put("addresses.streetAddress", CommonDataKinds.StructuredPostal.STREET);
- dbMap.put("addresses.locality", CommonDataKinds.StructuredPostal.CITY);
- dbMap.put("addresses.region", CommonDataKinds.StructuredPostal.REGION);
- dbMap.put("addresses.postalCode", CommonDataKinds.StructuredPostal.POSTCODE);
- dbMap.put("addresses.country", CommonDataKinds.StructuredPostal.COUNTRY);
- dbMap.put("ims", CommonDataKinds.Im.DATA);
- dbMap.put("ims.value", CommonDataKinds.Im.DATA);
- dbMap.put("organizations", CommonDataKinds.Organization.COMPANY);
- dbMap.put("organizations.name", CommonDataKinds.Organization.COMPANY);
- dbMap.put("organizations.department", CommonDataKinds.Organization.DEPARTMENT);
- dbMap.put("organizations.title", CommonDataKinds.Organization.TITLE);
- dbMap.put("birthday", CommonDataKinds.Event.CONTENT_ITEM_TYPE);
- dbMap.put("note", CommonDataKinds.Note.NOTE);
- dbMap.put("photos.value", CommonDataKinds.Photo.CONTENT_ITEM_TYPE);
- //dbMap.put("categories.value", null);
- dbMap.put("urls", CommonDataKinds.Website.URL);
- dbMap.put("urls.value", CommonDataKinds.Website.URL);
- }
-
- /**
- * Create an contact accessor.
- */
- public ContactAccessorSdk5(CordovaInterface context) {
- mApp = context;
- }
-
- /**
- * This method takes the fields required and search options in order to produce an
- * array of contacts that matches the criteria provided.
- * @param fields an array of items to be used as search criteria
- * @param options that can be applied to contact searching
- * @return an array of contacts
- */
- @Override
- public JSONArray search(JSONArray fields, JSONObject options) {
- // Get the find options
- String searchTerm = "";
- int limit = Integer.MAX_VALUE;
- boolean multiple = true;
- boolean hasPhoneNumber = false;
-
- if (options != null) {
- searchTerm = options.optString("filter");
- if (searchTerm.length() == 0) {
- searchTerm = "%";
- }
- else {
- searchTerm = "%" + searchTerm + "%";
- }
-
- try {
- multiple = options.getBoolean("multiple");
- if (!multiple) {
- limit = 1;
- }
- } catch (JSONException e) {
- // Multiple was not specified so we assume the default is true.
- Log.e(LOG_TAG, e.getMessage(), e);
- }
-
- try {
- hasPhoneNumber = options.getBoolean("hasPhoneNumber");
- } catch (JSONException e) {
- // hasPhoneNumber was not specified so we assume the default is false.
- }
- }
- else {
- searchTerm = "%";
- }
-
- // Loop through the fields the user provided to see what data should be returned.
- HashMap populate = buildPopulationSet(options);
-
- // Build the ugly where clause and where arguments for one big query.
- WhereOptions whereOptions = buildWhereClause(fields, searchTerm, hasPhoneNumber);
-
- // Get all the id's where the search term matches the fields passed in.
- Cursor idCursor = mApp.getActivity().getContentResolver().query(ContactsContract.Data.CONTENT_URI,
- new String[] { ContactsContract.Data.CONTACT_ID },
- whereOptions.getWhere(),
- whereOptions.getWhereArgs(),
- ContactsContract.Data.CONTACT_ID + " ASC");
-
- // Create a set of unique ids
- Set contactIds = new HashSet();
- int idColumn = -1;
- while (idCursor.moveToNext()) {
- if (idColumn < 0) {
- idColumn = idCursor.getColumnIndex(ContactsContract.Data.CONTACT_ID);
- }
- contactIds.add(idCursor.getString(idColumn));
- }
- idCursor.close();
-
- // Build a query that only looks at ids
- WhereOptions idOptions = buildIdClause(contactIds, searchTerm, hasPhoneNumber);
-
- // Determine which columns we should be fetching.
- HashSet columnsToFetch = new HashSet();
- columnsToFetch.add(ContactsContract.Data.CONTACT_ID);
- columnsToFetch.add(ContactsContract.Data.RAW_CONTACT_ID);
- columnsToFetch.add(ContactsContract.Data.MIMETYPE);
-
- if (isRequired("displayName", populate)) {
- columnsToFetch.add(CommonDataKinds.StructuredName.DISPLAY_NAME);
- }
- if (isRequired("name", populate)) {
- columnsToFetch.add(CommonDataKinds.StructuredName.FAMILY_NAME);
- columnsToFetch.add(CommonDataKinds.StructuredName.GIVEN_NAME);
- columnsToFetch.add(CommonDataKinds.StructuredName.MIDDLE_NAME);
- columnsToFetch.add(CommonDataKinds.StructuredName.PREFIX);
- columnsToFetch.add(CommonDataKinds.StructuredName.SUFFIX);
- }
- if (isRequired("phoneNumbers", populate)) {
- columnsToFetch.add(CommonDataKinds.Phone._ID);
- columnsToFetch.add(CommonDataKinds.Phone.NUMBER);
- columnsToFetch.add(CommonDataKinds.Phone.TYPE);
- }
- if (isRequired("emails", populate)) {
- columnsToFetch.add(CommonDataKinds.Email._ID);
- columnsToFetch.add(CommonDataKinds.Email.DATA);
- columnsToFetch.add(CommonDataKinds.Email.TYPE);
- }
- if (isRequired("addresses", populate)) {
- columnsToFetch.add(CommonDataKinds.StructuredPostal._ID);
- columnsToFetch.add(CommonDataKinds.Organization.TYPE);
- columnsToFetch.add(CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS);
- columnsToFetch.add(CommonDataKinds.StructuredPostal.STREET);
- columnsToFetch.add(CommonDataKinds.StructuredPostal.CITY);
- columnsToFetch.add(CommonDataKinds.StructuredPostal.REGION);
- columnsToFetch.add(CommonDataKinds.StructuredPostal.POSTCODE);
- columnsToFetch.add(CommonDataKinds.StructuredPostal.COUNTRY);
- }
- if (isRequired("organizations", populate)) {
- columnsToFetch.add(CommonDataKinds.Organization._ID);
- columnsToFetch.add(CommonDataKinds.Organization.TYPE);
- columnsToFetch.add(CommonDataKinds.Organization.DEPARTMENT);
- columnsToFetch.add(CommonDataKinds.Organization.COMPANY);
- columnsToFetch.add(CommonDataKinds.Organization.TITLE);
- }
- if (isRequired("ims", populate)) {
- columnsToFetch.add(CommonDataKinds.Im._ID);
- columnsToFetch.add(CommonDataKinds.Im.DATA);
- columnsToFetch.add(CommonDataKinds.Im.TYPE);
- }
- if (isRequired("note", populate)) {
- columnsToFetch.add(CommonDataKinds.Note.NOTE);
- }
- if (isRequired("nickname", populate)) {
- columnsToFetch.add(CommonDataKinds.Nickname.NAME);
- }
- if (isRequired("urls", populate)) {
- columnsToFetch.add(CommonDataKinds.Website._ID);
- columnsToFetch.add(CommonDataKinds.Website.URL);
- columnsToFetch.add(CommonDataKinds.Website.TYPE);
- }
- if (isRequired("birthday", populate)) {
- columnsToFetch.add(CommonDataKinds.Event.START_DATE);
- columnsToFetch.add(CommonDataKinds.Event.TYPE);
- }
- if (isRequired("photos", populate)) {
- columnsToFetch.add(CommonDataKinds.Photo._ID);
- }
-
- // Do the id query
- Cursor c = mApp.getActivity().getContentResolver().query(ContactsContract.Data.CONTENT_URI,
- columnsToFetch.toArray(new String[] {}),
- idOptions.getWhere(),
- idOptions.getWhereArgs(),
- ContactsContract.Data.CONTACT_ID + " ASC");
-
- JSONArray contacts = populateContactArray(limit, populate, c);
-
- if (!c.isClosed()) {
- c.close();
- }
- return contacts;
- }
-
- /**
- * A special search that finds one contact by id
- *
- * @param id contact to find by id
- * @return a JSONObject representing the contact
- * @throws JSONException
- */
- public JSONObject getContactById(String id) throws JSONException {
- // Call overloaded version with no desiredFields
- return getContactById(id, null);
- }
-
- @Override
- public JSONObject getContactById(String id, JSONArray desiredFields) throws JSONException {
- // Do the id query
- Cursor c = mApp.getActivity().getContentResolver().query(
- ContactsContract.Data.CONTENT_URI,
- null,
- ContactsContract.Data.RAW_CONTACT_ID + " = ? ",
- new String[] { id },
- ContactsContract.Data.RAW_CONTACT_ID + " ASC");
-
- HashMap populate = buildPopulationSet(
- new JSONObject().put("desiredFields", desiredFields)
- );
-
- JSONArray contacts = populateContactArray(1, populate, c);
-
- if (!c.isClosed()) {
- c.close();
- }
-
- if (contacts.length() == 1) {
- return contacts.getJSONObject(0);
- } else {
- return null;
- }
- }
-
- /**
- * Creates an array of contacts from the cursor you pass in
- *
- * @param limit max number of contacts for the array
- * @param populate whether or not you should populate a certain value
- * @param c the cursor
- * @return a JSONArray of contacts
- */
- private JSONArray populateContactArray(int limit,
- HashMap populate, Cursor c) {
-
- String contactId = "";
- String rawId = "";
- String oldContactId = "";
- boolean newContact = true;
- String mimetype = "";
-
- JSONArray contacts = new JSONArray();
- JSONObject contact = new JSONObject();
- JSONArray organizations = new JSONArray();
- JSONArray addresses = new JSONArray();
- JSONArray phones = new JSONArray();
- JSONArray emails = new JSONArray();
- JSONArray ims = new JSONArray();
- JSONArray websites = new JSONArray();
- JSONArray photos = new JSONArray();
-
- // Column indices
- int colContactId = c.getColumnIndex(ContactsContract.Data.CONTACT_ID);
- int colRawContactId = c.getColumnIndex(ContactsContract.Data.RAW_CONTACT_ID);
- int colMimetype = c.getColumnIndex(ContactsContract.Data.MIMETYPE);
- int colDisplayName = c.getColumnIndex(CommonDataKinds.StructuredName.DISPLAY_NAME);
- int colNote = c.getColumnIndex(CommonDataKinds.Note.NOTE);
- int colNickname = c.getColumnIndex(CommonDataKinds.Nickname.NAME);
- int colEventType = c.getColumnIndex(CommonDataKinds.Event.TYPE);
-
- if (c.getCount() > 0) {
- while (c.moveToNext() && (contacts.length() <= (limit - 1))) {
- try {
- contactId = c.getString(colContactId);
- rawId = c.getString(colRawContactId);
-
- // If we are in the first row set the oldContactId
- if (c.getPosition() == 0) {
- oldContactId = contactId;
- }
-
- // When the contact ID changes we need to push the Contact object
- // to the array of contacts and create new objects.
- if (!oldContactId.equals(contactId)) {
- // Populate the Contact object with it's arrays
- // and push the contact into the contacts array
- contacts.put(populateContact(contact, organizations, addresses, phones,
- emails, ims, websites, photos));
-
- // Clean up the objects
- contact = new JSONObject();
- organizations = new JSONArray();
- addresses = new JSONArray();
- phones = new JSONArray();
- emails = new JSONArray();
- ims = new JSONArray();
- websites = new JSONArray();
- photos = new JSONArray();
-
- // Set newContact to true as we are starting to populate a new contact
- newContact = true;
- }
-
- // When we detect a new contact set the ID and display name.
- // These fields are available in every row in the result set returned.
- if (newContact) {
- newContact = false;
- contact.put("id", contactId);
- contact.put("rawId", rawId);
- }
-
- // Grab the mimetype of the current row as it will be used in a lot of comparisons
- mimetype = c.getString(colMimetype);
-
- if (mimetype.equals(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE) && isRequired("name", populate)) {
- contact.put("displayName", c.getString(colDisplayName));
- }
-
- if (mimetype.equals(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
- && isRequired("name", populate)) {
- contact.put("name", nameQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
- && isRequired("phoneNumbers", populate)) {
- phones.put(phoneQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.Email.CONTENT_ITEM_TYPE)
- && isRequired("emails", populate)) {
- emails.put(emailQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE)
- && isRequired("addresses", populate)) {
- addresses.put(addressQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.Organization.CONTENT_ITEM_TYPE)
- && isRequired("organizations", populate)) {
- organizations.put(organizationQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.Im.CONTENT_ITEM_TYPE)
- && isRequired("ims", populate)) {
- ims.put(imQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.Note.CONTENT_ITEM_TYPE)
- && isRequired("note", populate)) {
- contact.put("note", c.getString(colNote));
- }
- else if (mimetype.equals(CommonDataKinds.Nickname.CONTENT_ITEM_TYPE)
- && isRequired("nickname", populate)) {
- contact.put("nickname", c.getString(colNickname));
- }
- else if (mimetype.equals(CommonDataKinds.Website.CONTENT_ITEM_TYPE)
- && isRequired("urls", populate)) {
- websites.put(websiteQuery(c));
- }
- else if (mimetype.equals(CommonDataKinds.Event.CONTENT_ITEM_TYPE)) {
- if (isRequired("birthday", populate) &&
- CommonDataKinds.Event.TYPE_BIRTHDAY == c.getInt(colEventType)) {
-
- Date birthday = getBirthday(c);
- if (birthday != null) {
- contact.put("birthday", birthday.getTime());
- }
- }
- }
- else if (mimetype.equals(CommonDataKinds.Photo.CONTENT_ITEM_TYPE)
- && isRequired("photos", populate)) {
- JSONObject photo = photoQuery(c, contactId);
- if (photo != null) {
- photos.put(photo);
- }
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
-
- // Set the old contact ID
- oldContactId = contactId;
-
- }
-
- // Push the last contact into the contacts array
- if (contacts.length() < limit) {
- contacts.put(populateContact(contact, organizations, addresses, phones,
- emails, ims, websites, photos));
- }
- }
- c.close();
- return contacts;
- }
-
- /**
- * Builds a where clause all all the ids passed into the method
- * @param contactIds a set of unique contact ids
- * @param searchTerm what to search for
- * @return an object containing the selection and selection args
- */
- private WhereOptions buildIdClause(Set contactIds, String searchTerm, boolean hasPhoneNumber) {
- WhereOptions options = new WhereOptions();
-
- // If the user is searching for every contact then short circuit the method
- // and return a shorter where clause to be searched.
- if (searchTerm.equals("%") && !hasPhoneNumber) {
- options.setWhere("(" + ContactsContract.Data.CONTACT_ID + " LIKE ? )");
- options.setWhereArgs(new String[] { searchTerm });
- return options;
- }
-
- // This clause means that there are specific ID's to be populated
- Iterator it = contactIds.iterator();
- StringBuffer buffer = new StringBuffer("(");
-
- while (it.hasNext()) {
- buffer.append("'" + it.next() + "'");
- if (it.hasNext()) {
- buffer.append(",");
- }
- }
- buffer.append(")");
-
- options.setWhere(ContactsContract.Data.CONTACT_ID + " IN " + buffer.toString());
- options.setWhereArgs(null);
-
- return options;
- }
-
- /**
- * Create a new contact using a JSONObject to hold all the data.
- * @param contact
- * @param organizations array of organizations
- * @param addresses array of addresses
- * @param phones array of phones
- * @param emails array of emails
- * @param ims array of instant messenger addresses
- * @param websites array of websites
- * @param photos
- * @return
- */
- private JSONObject populateContact(JSONObject contact, JSONArray organizations,
- JSONArray addresses, JSONArray phones, JSONArray emails,
- JSONArray ims, JSONArray websites, JSONArray photos) {
- try {
- // Only return the array if it has at least one entry
- if (organizations.length() > 0) {
- contact.put("organizations", organizations);
- }
- if (addresses.length() > 0) {
- contact.put("addresses", addresses);
- }
- if (phones.length() > 0) {
- contact.put("phoneNumbers", phones);
- }
- if (emails.length() > 0) {
- contact.put("emails", emails);
- }
- if (ims.length() > 0) {
- contact.put("ims", ims);
- }
- if (websites.length() > 0) {
- contact.put("urls", websites);
- }
- if (photos.length() > 0) {
- contact.put("photos", photos);
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return contact;
- }
-
- /**
- * Take the search criteria passed into the method and create a SQL WHERE clause.
- * @param fields the properties to search against
- * @param searchTerm the string to search for
- * @return an object containing the selection and selection args
- */
- private WhereOptions buildWhereClause(JSONArray fields, String searchTerm, boolean hasPhoneNumber) {
-
- ArrayList where = new ArrayList();
- ArrayList whereArgs = new ArrayList();
-
- WhereOptions options = new WhereOptions();
-
- /*
- * Special case where the user wants all fields returned
- */
- if (isWildCardSearch(fields)) {
- // Get all contacts with all properties
- if ("%".equals(searchTerm) && !hasPhoneNumber) {
- options.setWhere("(" + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ? )");
- options.setWhereArgs(new String[] { searchTerm });
- return options;
- } else {
- // Get all contacts that match the filter but return all properties
- where.add("(" + dbMap.get("displayName") + " LIKE ? )");
- whereArgs.add(searchTerm);
- where.add("(" + dbMap.get("name") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("nickname") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Nickname.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("phoneNumbers") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("emails") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Email.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("addresses") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("ims") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Im.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("organizations") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Organization.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("note") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Note.CONTENT_ITEM_TYPE);
- where.add("(" + dbMap.get("urls") + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Website.CONTENT_ITEM_TYPE);
- }
- }
-
- /*
- * Special case for when the user wants all the contacts but
- */
- if ("%".equals(searchTerm) && !hasPhoneNumber) {
- options.setWhere("(" + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ? )");
- options.setWhereArgs(new String[] { searchTerm });
- return options;
- }else if(!("%".equals(searchTerm))){
- String key;
- try {
- //Log.d(LOG_TAG, "How many fields do we have = " + fields.length());
- for (int i = 0; i < fields.length(); i++) {
- key = fields.getString(i);
-
- if (key.equals("id")) {
- where.add("(" + dbMap.get(key) + " = ? )");
- whereArgs.add(searchTerm.substring(1, searchTerm.length() - 1));
- }
- else if (key.startsWith("displayName")) {
- where.add("(" + dbMap.get(key) + " LIKE ? )");
- whereArgs.add(searchTerm);
- }
- else if (key.startsWith("name")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("nickname")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Nickname.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("phoneNumbers")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("emails")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Email.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("addresses")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("ims")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Im.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("organizations")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Organization.CONTENT_ITEM_TYPE);
- }
- // else if (key.startsWith("birthday")) {
- // where.add("(" + dbMap.get(key) + " LIKE ? AND "
- // + ContactsContract.Data.MIMETYPE + " = ? )");
- // }
- else if (key.startsWith("note")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Note.CONTENT_ITEM_TYPE);
- }
- else if (key.startsWith("urls")) {
- where.add("(" + dbMap.get(key) + " LIKE ? AND "
- + ContactsContract.Data.MIMETYPE + " = ? )");
- whereArgs.add(searchTerm);
- whereArgs.add(CommonDataKinds.Website.CONTENT_ITEM_TYPE);
- }
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- }
-
- // Creating the where string
- StringBuffer selection = new StringBuffer();
- for (int i = 0; i < where.size(); i++) {
- selection.append(where.get(i));
- if (i != (where.size() - 1)) {
- selection.append(" OR ");
- }
- }
-
- //Only contacts with phone number informed
- if(hasPhoneNumber){
- if(where.size()>0){
- selection.insert(0,"(");
- selection.append(") AND (" + ContactsContract.Contacts.HAS_PHONE_NUMBER + " = ?)");
- whereArgs.add("1");
- }else{
- selection.append("(" + ContactsContract.Contacts.HAS_PHONE_NUMBER + " = ?)");
- whereArgs.add("1");
- }
- }
-
- options.setWhere(selection.toString());
-
- // Creating the where args array
- String[] selectionArgs = new String[whereArgs.size()];
- for (int i = 0; i < whereArgs.size(); i++) {
- selectionArgs[i] = whereArgs.get(i);
- }
- options.setWhereArgs(selectionArgs);
-
- return options;
- }
-
- /**
- * If the user passes in the '*' wildcard character for search then they want all fields for each contact
- *
- * @param fields
- * @return true if wildcard search requested, false otherwise
- */
- private boolean isWildCardSearch(JSONArray fields) {
- // Only do a wildcard search if we are passed ["*"]
- if (fields.length() == 1) {
- try {
- if ("*".equals(fields.getString(0))) {
- return true;
- }
- } catch (JSONException e) {
- return false;
- }
- }
- return false;
- }
-
- /**
- * Create a ContactOrganization JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactOrganization
- */
- private JSONObject organizationQuery(Cursor cursor) {
- JSONObject organization = new JSONObject();
- try {
- organization.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Organization._ID)));
- organization.put("pref", false); // Android does not store pref attribute
- organization.put("type", getOrgType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Organization.TYPE))));
- organization.put("department", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Organization.DEPARTMENT)));
- organization.put("name", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Organization.COMPANY)));
- organization.put("title", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Organization.TITLE)));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return organization;
- }
-
- /**
- * Create a ContactAddress JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactAddress
- */
- private JSONObject addressQuery(Cursor cursor) {
- JSONObject address = new JSONObject();
- try {
- address.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal._ID)));
- address.put("pref", false); // Android does not store pref attribute
- address.put("type", getAddressType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Organization.TYPE))));
- address.put("formatted", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS)));
- address.put("streetAddress", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal.STREET)));
- address.put("locality", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal.CITY)));
- address.put("region", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal.REGION)));
- address.put("postalCode", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal.POSTCODE)));
- address.put("country", cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredPostal.COUNTRY)));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return address;
- }
-
- /**
- * Create a ContactName JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactName
- */
- private JSONObject nameQuery(Cursor cursor) {
- JSONObject contactName = new JSONObject();
- try {
- String familyName = cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredName.FAMILY_NAME));
- String givenName = cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredName.GIVEN_NAME));
- String middleName = cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredName.MIDDLE_NAME));
- String honorificPrefix = cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredName.PREFIX));
- String honorificSuffix = cursor.getString(cursor.getColumnIndex(CommonDataKinds.StructuredName.SUFFIX));
-
- // Create the formatted name
- StringBuffer formatted = new StringBuffer("");
- if (!TextUtils.isEmpty(honorificPrefix)) {
- formatted.append(honorificPrefix + " ");
- }
- if (!TextUtils.isEmpty(givenName)) {
- formatted.append(givenName + " ");
- }
- if (!TextUtils.isEmpty(middleName)) {
- formatted.append(middleName + " ");
- }
- if (!TextUtils.isEmpty(familyName)) {
- formatted.append(familyName);
- }
- if (!TextUtils.isEmpty(honorificSuffix)) {
- formatted.append(" " + honorificSuffix);
- }
- if (TextUtils.isEmpty(formatted)) {
- formatted = null;
- }
-
- contactName.put("familyName", familyName);
- contactName.put("givenName", givenName);
- contactName.put("middleName", middleName);
- contactName.put("honorificPrefix", honorificPrefix);
- contactName.put("honorificSuffix", honorificSuffix);
- contactName.put("formatted", formatted);
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return contactName;
- }
-
- /**
- * Create a ContactField JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactField
- */
- private JSONObject phoneQuery(Cursor cursor) {
- JSONObject phoneNumber = new JSONObject();
- try {
- phoneNumber.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Phone._ID)));
- phoneNumber.put("pref", false); // Android does not store pref attribute
- phoneNumber.put("value", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Phone.NUMBER)));
- phoneNumber.put("type", getPhoneType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Phone.TYPE))));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- } catch (Exception excp) {
- Log.e(LOG_TAG, excp.getMessage(), excp);
- }
- return phoneNumber;
- }
-
- /**
- * Create a ContactField JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactField
- */
- private JSONObject emailQuery(Cursor cursor) {
- JSONObject email = new JSONObject();
- try {
- email.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Email._ID)));
- email.put("pref", false); // Android does not store pref attribute
- email.put("value", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Email.DATA)));
- email.put("type", getContactType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Email.TYPE))));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return email;
- }
-
- /**
- * Create a ContactField JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactField
- */
- private JSONObject imQuery(Cursor cursor) {
- JSONObject im = new JSONObject();
- try {
- im.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Im._ID)));
- im.put("pref", false); // Android does not store pref attribute
- im.put("value", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Im.DATA)));
- im.put("type", getImType(cursor.getString(cursor.getColumnIndex(CommonDataKinds.Im.PROTOCOL))));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return im;
- }
-
- /**
- * Create a ContactField JSONObject
- * @param cursor the current database row
- * @return a JSONObject representing a ContactField
- */
- private JSONObject websiteQuery(Cursor cursor) {
- JSONObject website = new JSONObject();
- try {
- website.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Website._ID)));
- website.put("pref", false); // Android does not store pref attribute
- website.put("value", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Website.URL)));
- website.put("type", getContactType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Website.TYPE))));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return website;
- }
-
- /**
- * Create a ContactField JSONObject
- * @param contactId
- * @return a JSONObject representing a ContactField
- */
- private JSONObject photoQuery(Cursor cursor, String contactId) {
- JSONObject photo = new JSONObject();
- Cursor photoCursor = null;
- try {
- photo.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Photo._ID)));
- photo.put("pref", false);
- photo.put("type", "url");
- Uri person = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, (Long.valueOf(contactId)));
- Uri photoUri = Uri.withAppendedPath(person, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
- photo.put("value", photoUri.toString());
-
- // Query photo existance
- photoCursor = mApp.getActivity().getContentResolver().query(photoUri, new String[] {ContactsContract.Contacts.Photo.PHOTO}, null, null, null);
- if (photoCursor == null) return null;
- if (!photoCursor.moveToFirst()) {
- photoCursor.close();
- return null;
- }
- photoCursor.close();
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- } catch (SQLiteException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- } finally {
- if(photoCursor != null && !photoCursor.isClosed()) {
- photoCursor.close();
- }
- }
- return photo;
- }
-
- @Override
- /**
- * This method will save a contact object into the devices contacts database.
- *
- * @param contact the contact to be saved.
- * @returns the id if the contact is successfully saved, null otherwise.
- */
- public String save(JSONObject contact) {
- AccountManager mgr = AccountManager.get(mApp.getActivity());
- Account[] accounts = mgr.getAccounts();
- String accountName = null;
- String accountType = null;
-
- if (accounts.length == 1) {
- accountName = accounts[0].name;
- accountType = accounts[0].type;
- }
- else if (accounts.length > 1) {
- for (Account a : accounts) {
- if (a.type.contains("eas") && a.name.matches(EMAIL_REGEXP)) /*Exchange ActiveSync*/{
- accountName = a.name;
- accountType = a.type;
- break;
- }
- }
- if (accountName == null) {
- for (Account a : accounts) {
- if (a.type.contains("com.google") && a.name.matches(EMAIL_REGEXP)) /*Google sync provider*/{
- accountName = a.name;
- accountType = a.type;
- break;
- }
- }
- }
- if (accountName == null) {
- for (Account a : accounts) {
- if (a.name.matches(EMAIL_REGEXP)) /*Last resort, just look for an email address...*/{
- accountName = a.name;
- accountType = a.type;
- break;
- }
- }
- }
- }
-
- String id = getJsonString(contact, "id");
- if (id == null) {
- // Create new contact
- return createNewContact(contact, accountType, accountName);
- } else {
- // Modify existing contact
- return modifyContact(id, contact, accountType, accountName);
- }
- }
-
- /**
- * Creates a new contact and stores it in the database
- *
- * @param id the raw contact id which is required for linking items to the contact
- * @param contact the contact to be saved
- * @param account the account to be saved under
- */
- private String modifyContact(String id, JSONObject contact, String accountType, String accountName) {
- // Get the RAW_CONTACT_ID which is needed to insert new values in an already existing contact.
- // But not needed to update existing values.
- String rawId = getJsonString(contact, "rawId");
-
- // Create a list of attributes to add to the contact database
- ArrayList ops = new ArrayList();
-
- //Add contact type
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.RawContacts.CONTENT_URI)
- .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType)
- .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName)
- .build());
-
- // Modify name
- JSONObject name;
- try {
- String displayName = getJsonString(contact, "displayName");
- name = contact.getJSONObject("name");
- if (displayName != null || name != null) {
- ContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { id, CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE });
-
- if (displayName != null) {
- builder.withValue(CommonDataKinds.StructuredName.DISPLAY_NAME, displayName);
- }
-
- String familyName = getJsonString(name, "familyName");
- if (familyName != null) {
- builder.withValue(CommonDataKinds.StructuredName.FAMILY_NAME, familyName);
- }
- String middleName = getJsonString(name, "middleName");
- if (middleName != null) {
- builder.withValue(CommonDataKinds.StructuredName.MIDDLE_NAME, middleName);
- }
- String givenName = getJsonString(name, "givenName");
- if (givenName != null) {
- builder.withValue(CommonDataKinds.StructuredName.GIVEN_NAME, givenName);
- }
- String honorificPrefix = getJsonString(name, "honorificPrefix");
- if (honorificPrefix != null) {
- builder.withValue(CommonDataKinds.StructuredName.PREFIX, honorificPrefix);
- }
- String honorificSuffix = getJsonString(name, "honorificSuffix");
- if (honorificSuffix != null) {
- builder.withValue(CommonDataKinds.StructuredName.SUFFIX, honorificSuffix);
- }
-
- ops.add(builder.build());
- }
- } catch (JSONException e1) {
- Log.d(LOG_TAG, "Could not get name");
- }
-
- // Modify phone numbers
- JSONArray phones = null;
- try {
- phones = contact.getJSONArray("phoneNumbers");
- if (phones != null) {
- // Delete all the phones
- if (phones.length() == 0) {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.Phone.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a phone
- else {
- for (int i = 0; i < phones.length(); i++) {
- JSONObject phone = (JSONObject) phones.get(i);
- String phoneId = getJsonString(phone, "id");
- // This is a new phone so do a DB insert
- if (phoneId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
- contentValues.put(CommonDataKinds.Phone.NUMBER, getJsonString(phone, "value"));
- contentValues.put(CommonDataKinds.Phone.TYPE, getPhoneType(getJsonString(phone, "type")));
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing phone so do a DB update
- else {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Phone._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { phoneId, CommonDataKinds.Phone.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Phone.NUMBER, getJsonString(phone, "value"))
- .withValue(CommonDataKinds.Phone.TYPE, getPhoneType(getJsonString(phone, "type")))
- .build());
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get phone numbers");
- }
-
- // Modify emails
- JSONArray emails = null;
- try {
- emails = contact.getJSONArray("emails");
- if (emails != null) {
- // Delete all the emails
- if (emails.length() == 0) {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.Email.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a email
- else {
- for (int i = 0; i < emails.length(); i++) {
- JSONObject email = (JSONObject) emails.get(i);
- String emailId = getJsonString(email, "id");
- // This is a new email so do a DB insert
- if (emailId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.Email.CONTENT_ITEM_TYPE);
- contentValues.put(CommonDataKinds.Email.DATA, getJsonString(email, "value"));
- contentValues.put(CommonDataKinds.Email.TYPE, getContactType(getJsonString(email, "type")));
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing email so do a DB update
- else {
- String emailValue=getJsonString(email, "value");
- if(!emailValue.isEmpty()) {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Email._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { emailId, CommonDataKinds.Email.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Email.DATA, getJsonString(email, "value"))
- .withValue(CommonDataKinds.Email.TYPE, getContactType(getJsonString(email, "type")))
- .build());
- } else {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Email._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { emailId, CommonDataKinds.Email.CONTENT_ITEM_TYPE })
- .build());
- }
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get emails");
- }
-
- // Modify addresses
- JSONArray addresses = null;
- try {
- addresses = contact.getJSONArray("addresses");
- if (addresses != null) {
- // Delete all the addresses
- if (addresses.length() == 0) {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a address
- else {
- for (int i = 0; i < addresses.length(); i++) {
- JSONObject address = (JSONObject) addresses.get(i);
- String addressId = getJsonString(address, "id");
- // This is a new address so do a DB insert
- if (addressId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE);
- contentValues.put(CommonDataKinds.StructuredPostal.TYPE, getAddressType(getJsonString(address, "type")));
- contentValues.put(CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS, getJsonString(address, "formatted"));
- contentValues.put(CommonDataKinds.StructuredPostal.STREET, getJsonString(address, "streetAddress"));
- contentValues.put(CommonDataKinds.StructuredPostal.CITY, getJsonString(address, "locality"));
- contentValues.put(CommonDataKinds.StructuredPostal.REGION, getJsonString(address, "region"));
- contentValues.put(CommonDataKinds.StructuredPostal.POSTCODE, getJsonString(address, "postalCode"));
- contentValues.put(CommonDataKinds.StructuredPostal.COUNTRY, getJsonString(address, "country"));
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing address so do a DB update
- else {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.StructuredPostal._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { addressId, CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.StructuredPostal.TYPE, getAddressType(getJsonString(address, "type")))
- .withValue(CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS, getJsonString(address, "formatted"))
- .withValue(CommonDataKinds.StructuredPostal.STREET, getJsonString(address, "streetAddress"))
- .withValue(CommonDataKinds.StructuredPostal.CITY, getJsonString(address, "locality"))
- .withValue(CommonDataKinds.StructuredPostal.REGION, getJsonString(address, "region"))
- .withValue(CommonDataKinds.StructuredPostal.POSTCODE, getJsonString(address, "postalCode"))
- .withValue(CommonDataKinds.StructuredPostal.COUNTRY, getJsonString(address, "country"))
- .build());
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get addresses");
- }
-
- // Modify organizations
- JSONArray organizations = null;
- try {
- organizations = contact.getJSONArray("organizations");
- if (organizations != null) {
- // Delete all the organizations
- if (organizations.length() == 0) {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.Organization.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a organization
- else {
- for (int i = 0; i < organizations.length(); i++) {
- JSONObject org = (JSONObject) organizations.get(i);
- String orgId = getJsonString(org, "id");
- // This is a new organization so do a DB insert
- if (orgId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.Organization.CONTENT_ITEM_TYPE);
- contentValues.put(CommonDataKinds.Organization.TYPE, getOrgType(getJsonString(org, "type")));
- contentValues.put(CommonDataKinds.Organization.DEPARTMENT, getJsonString(org, "department"));
- contentValues.put(CommonDataKinds.Organization.COMPANY, getJsonString(org, "name"));
- contentValues.put(CommonDataKinds.Organization.TITLE, getJsonString(org, "title"));
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing organization so do a DB update
- else {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Organization._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { orgId, CommonDataKinds.Organization.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Organization.TYPE, getOrgType(getJsonString(org, "type")))
- .withValue(CommonDataKinds.Organization.DEPARTMENT, getJsonString(org, "department"))
- .withValue(CommonDataKinds.Organization.COMPANY, getJsonString(org, "name"))
- .withValue(CommonDataKinds.Organization.TITLE, getJsonString(org, "title"))
- .build());
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get organizations");
- }
-
- // Modify IMs
- JSONArray ims = null;
- try {
- ims = contact.getJSONArray("ims");
- if (ims != null) {
- // Delete all the ims
- if (ims.length() == 0) {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.Im.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a im
- else {
- for (int i = 0; i < ims.length(); i++) {
- JSONObject im = (JSONObject) ims.get(i);
- String imId = getJsonString(im, "id");
- // This is a new IM so do a DB insert
- if (imId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.Im.CONTENT_ITEM_TYPE);
- contentValues.put(CommonDataKinds.Im.DATA, getJsonString(im, "value"));
- contentValues.put(CommonDataKinds.Im.TYPE, getImType(getJsonString(im, "type")));
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing IM so do a DB update
- else {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Im._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { imId, CommonDataKinds.Im.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Im.DATA, getJsonString(im, "value"))
- .withValue(CommonDataKinds.Im.TYPE, getContactType(getJsonString(im, "type")))
- .build());
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get emails");
- }
-
- // Modify note
- String note = getJsonString(contact, "note");
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { id, CommonDataKinds.Note.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Note.NOTE, note)
- .build());
-
- // Modify nickname
- String nickname = getJsonString(contact, "nickname");
- if (nickname != null) {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { id, CommonDataKinds.Nickname.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Nickname.NAME, nickname)
- .build());
- }
-
- // Modify urls
- JSONArray websites = null;
- try {
- websites = contact.getJSONArray("urls");
- if (websites != null) {
- // Delete all the websites
- if (websites.length() == 0) {
- Log.d(LOG_TAG, "This means we should be deleting all the phone numbers.");
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.Website.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a website
- else {
- for (int i = 0; i < websites.length(); i++) {
- JSONObject website = (JSONObject) websites.get(i);
- String websiteId = getJsonString(website, "id");
- // This is a new website so do a DB insert
- if (websiteId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.Website.CONTENT_ITEM_TYPE);
- contentValues.put(CommonDataKinds.Website.DATA, getJsonString(website, "value"));
- contentValues.put(CommonDataKinds.Website.TYPE, getContactType(getJsonString(website, "type")));
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing website so do a DB update
- else {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Website._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { websiteId, CommonDataKinds.Website.CONTENT_ITEM_TYPE })
- .withValue(CommonDataKinds.Website.DATA, getJsonString(website, "value"))
- .withValue(CommonDataKinds.Website.TYPE, getContactType(getJsonString(website, "type")))
- .build());
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get websites");
- }
-
- // Modify birthday
- Date birthday = getBirthday(contact);
- if (birthday != null) {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=? AND " +
- CommonDataKinds.Event.TYPE + "=?",
- new String[]{id, CommonDataKinds.Event.CONTENT_ITEM_TYPE, "" + CommonDataKinds.Event.TYPE_BIRTHDAY})
- .withValue(CommonDataKinds.Event.TYPE, CommonDataKinds.Event.TYPE_BIRTHDAY)
- .withValue(CommonDataKinds.Event.START_DATE, birthday.toString())
- .build());
- }
-
- // Modify photos
- JSONArray photos = null;
- try {
- photos = contact.getJSONArray("photos");
- if (photos != null) {
- // Delete all the photos
- if (photos.length() == 0) {
- ops.add(ContentProviderOperation.newDelete(ContactsContract.Data.CONTENT_URI)
- .withSelection(ContactsContract.Data.RAW_CONTACT_ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { "" + rawId, CommonDataKinds.Photo.CONTENT_ITEM_TYPE })
- .build());
- }
- // Modify or add a photo
- else {
- for (int i = 0; i < photos.length(); i++) {
- JSONObject photo = (JSONObject) photos.get(i);
- String photoId = getJsonString(photo, "id");
- byte[] bytes = getPhotoBytes(getJsonString(photo, "value"));
- // This is a new photo so do a DB insert
- if (photoId == null) {
- ContentValues contentValues = new ContentValues();
- contentValues.put(ContactsContract.Data.RAW_CONTACT_ID, rawId);
- contentValues.put(ContactsContract.Data.MIMETYPE, CommonDataKinds.Photo.CONTENT_ITEM_TYPE);
- contentValues.put(ContactsContract.Data.IS_SUPER_PRIMARY, 1);
- contentValues.put(CommonDataKinds.Photo.PHOTO, bytes);
-
- ops.add(ContentProviderOperation.newInsert(
- ContactsContract.Data.CONTENT_URI).withValues(contentValues).build());
- }
- // This is an existing photo so do a DB update
- else {
- ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
- .withSelection(CommonDataKinds.Photo._ID + "=? AND " +
- ContactsContract.Data.MIMETYPE + "=?",
- new String[] { photoId, CommonDataKinds.Photo.CONTENT_ITEM_TYPE })
- .withValue(ContactsContract.Data.IS_SUPER_PRIMARY, 1)
- .withValue(CommonDataKinds.Photo.PHOTO, bytes)
- .build());
- }
- }
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get photos");
- }
-
- boolean retVal = true;
-
- //Modify contact
- try {
- mApp.getActivity().getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
- } catch (RemoteException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- Log.e(LOG_TAG, Log.getStackTraceString(e), e);
- retVal = false;
- } catch (OperationApplicationException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- Log.e(LOG_TAG, Log.getStackTraceString(e), e);
- retVal = false;
- }
-
- // if the save was a success return the contact ID
- if (retVal) {
- return rawId;
- } else {
- return null;
- }
- }
-
- /**
- * Add a website to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param website the item to be inserted
- */
- private void insertWebsite(ArrayList ops,
- JSONObject website) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Website.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Website.DATA, getJsonString(website, "value"))
- .withValue(CommonDataKinds.Website.TYPE, getContactType(getJsonString(website, "type")))
- .build());
- }
-
- /**
- * Add an im to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param im the item to be inserted
- */
- private void insertIm(ArrayList ops, JSONObject im) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Im.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Im.DATA, getJsonString(im, "value"))
- .withValue(CommonDataKinds.Im.TYPE, getImType(getJsonString(im, "type")))
- .build());
- }
-
- /**
- * Add an organization to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param org the item to be inserted
- */
- private void insertOrganization(ArrayList ops,
- JSONObject org) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Organization.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Organization.TYPE, getOrgType(getJsonString(org, "type")))
- .withValue(CommonDataKinds.Organization.DEPARTMENT, getJsonString(org, "department"))
- .withValue(CommonDataKinds.Organization.COMPANY, getJsonString(org, "name"))
- .withValue(CommonDataKinds.Organization.TITLE, getJsonString(org, "title"))
- .build());
- }
-
- /**
- * Add an address to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param address the item to be inserted
- */
- private void insertAddress(ArrayList ops,
- JSONObject address) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.StructuredPostal.TYPE, getAddressType(getJsonString(address, "type")))
- .withValue(CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS, getJsonString(address, "formatted"))
- .withValue(CommonDataKinds.StructuredPostal.STREET, getJsonString(address, "streetAddress"))
- .withValue(CommonDataKinds.StructuredPostal.CITY, getJsonString(address, "locality"))
- .withValue(CommonDataKinds.StructuredPostal.REGION, getJsonString(address, "region"))
- .withValue(CommonDataKinds.StructuredPostal.POSTCODE, getJsonString(address, "postalCode"))
- .withValue(CommonDataKinds.StructuredPostal.COUNTRY, getJsonString(address, "country"))
- .build());
- }
-
- /**
- * Add an email to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param email the item to be inserted
- */
- private void insertEmail(ArrayList ops,
- JSONObject email) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Email.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Email.DATA, getJsonString(email, "value"))
- .withValue(CommonDataKinds.Email.TYPE, getContactType(getJsonString(email, "type")))
- .build());
- }
-
- /**
- * Add a phone to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param phone the item to be inserted
- */
- private void insertPhone(ArrayList ops,
- JSONObject phone) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Phone.NUMBER, getJsonString(phone, "value"))
- .withValue(CommonDataKinds.Phone.TYPE, getPhoneType(getJsonString(phone, "type")))
- .build());
- }
-
- /**
- * Add a phone to a list of database actions to be performed
- *
- * @param ops the list of database actions
- * @param phone the item to be inserted
- */
- private void insertPhoto(ArrayList ops,
- JSONObject photo) {
- byte[] bytes = getPhotoBytes(getJsonString(photo, "value"));
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.IS_SUPER_PRIMARY, 1)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Photo.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Photo.PHOTO, bytes)
- .build());
- }
-
- /**
- * Gets the raw bytes from the supplied filename
- *
- * @param filename the file to read the bytes from
- * @return a byte array
- * @throws IOException
- */
- private byte[] getPhotoBytes(String filename) {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- try {
- int bytesRead = 0;
- long totalBytesRead = 0;
- byte[] data = new byte[8192];
- InputStream in = getPathFromUri(filename);
-
- while ((bytesRead = in.read(data, 0, data.length)) != -1 && totalBytesRead <= MAX_PHOTO_SIZE) {
- buffer.write(data, 0, bytesRead);
- totalBytesRead += bytesRead;
- }
-
- in.close();
- buffer.flush();
- } catch (FileNotFoundException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- } catch (IOException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return buffer.toByteArray();
- }
-
- /**
- * Get an input stream based on file path or uri content://, http://, file://
- *
- * @param path path to file
- * @return an input stream
- * @throws IOException
- */
- private InputStream getPathFromUri(String path) throws IOException {
- if (path.startsWith("content:")) {
- Uri uri = Uri.parse(path);
- return mApp.getActivity().getContentResolver().openInputStream(uri);
- }
-
- if (path.startsWith(ASSET_URL_PREFIX)) {
- String assetRelativePath = path.replace(ASSET_URL_PREFIX, "");
- return mApp.getActivity().getAssets().open(assetRelativePath);
- }
-
- if (path.startsWith("http:") || path.startsWith("https:") || path.startsWith("file:")) {
- URL url = new URL(path);
- return url.openStream();
- }
-
- return new FileInputStream(path);
- }
-
- /**
- * Creates a new contact and stores it in the database
- *
- * @param contact the contact to be saved
- * @param account the account to be saved under
- */
- private String createNewContact(JSONObject contact, String accountType, String accountName) {
- // Create a list of attributes to add to the contact database
- ArrayList ops = new ArrayList();
-
- //Add contact type
- ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
- .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, accountType)
- .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, accountName)
- .build());
-
- // Add name
- JSONObject name = contact.optJSONObject("name");
- String displayName = getJsonString(contact, "displayName");
- if (displayName != null || name != null) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.StructuredName.DISPLAY_NAME, displayName)
- .withValue(CommonDataKinds.StructuredName.FAMILY_NAME, getJsonString(name, "familyName"))
- .withValue(CommonDataKinds.StructuredName.MIDDLE_NAME, getJsonString(name, "middleName"))
- .withValue(CommonDataKinds.StructuredName.GIVEN_NAME, getJsonString(name, "givenName"))
- .withValue(CommonDataKinds.StructuredName.PREFIX, getJsonString(name, "honorificPrefix"))
- .withValue(CommonDataKinds.StructuredName.SUFFIX, getJsonString(name, "honorificSuffix"))
- .build());
- } else {
- Log.d(LOG_TAG, "Both \"name\" and \"displayName\" properties are empty");
- }
-
- //Add phone numbers
- JSONArray phones = null;
- try {
- phones = contact.getJSONArray("phoneNumbers");
- if (phones != null) {
- for (int i = 0; i < phones.length(); i++) {
- JSONObject phone = (JSONObject) phones.get(i);
- insertPhone(ops, phone);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get phone numbers");
- }
-
- // Add emails
- JSONArray emails = null;
- try {
- emails = contact.getJSONArray("emails");
- if (emails != null) {
- for (int i = 0; i < emails.length(); i++) {
- JSONObject email = (JSONObject) emails.get(i);
- insertEmail(ops, email);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get emails");
- }
-
- // Add addresses
- JSONArray addresses = null;
- try {
- addresses = contact.getJSONArray("addresses");
- if (addresses != null) {
- for (int i = 0; i < addresses.length(); i++) {
- JSONObject address = (JSONObject) addresses.get(i);
- insertAddress(ops, address);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get addresses");
- }
-
- // Add organizations
- JSONArray organizations = null;
- try {
- organizations = contact.getJSONArray("organizations");
- if (organizations != null) {
- for (int i = 0; i < organizations.length(); i++) {
- JSONObject org = (JSONObject) organizations.get(i);
- insertOrganization(ops, org);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get organizations");
- }
-
- // Add IMs
- JSONArray ims = null;
- try {
- ims = contact.getJSONArray("ims");
- if (ims != null) {
- for (int i = 0; i < ims.length(); i++) {
- JSONObject im = (JSONObject) ims.get(i);
- insertIm(ops, im);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get emails");
- }
-
- // Add note
- String note = getJsonString(contact, "note");
- if (note != null) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Note.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Note.NOTE, note)
- .build());
- }
-
- // Add nickname
- String nickname = getJsonString(contact, "nickname");
- if (nickname != null) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Nickname.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Nickname.NAME, nickname)
- .build());
- }
-
- // Add urls
- JSONArray websites = null;
- try {
- websites = contact.getJSONArray("urls");
- if (websites != null) {
- for (int i = 0; i < websites.length(); i++) {
- JSONObject website = (JSONObject) websites.get(i);
- insertWebsite(ops, website);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get websites");
- }
-
- // Add birthday
- Date birthday = getBirthday(contact);
- if (birthday != null) {
- ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
- .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
- .withValue(ContactsContract.Data.MIMETYPE, CommonDataKinds.Event.CONTENT_ITEM_TYPE)
- .withValue(CommonDataKinds.Event.TYPE, CommonDataKinds.Event.TYPE_BIRTHDAY)
- .withValue(CommonDataKinds.Event.START_DATE, birthday.toString())
- .build());
- }
-
- // Add photos
- JSONArray photos = null;
- try {
- photos = contact.getJSONArray("photos");
- if (photos != null) {
- for (int i = 0; i < photos.length(); i++) {
- JSONObject photo = (JSONObject) photos.get(i);
- insertPhoto(ops, photo);
- }
- }
- } catch (JSONException e) {
- Log.d(LOG_TAG, "Could not get photos");
- }
-
- String newId = null;
- //Add contact
- try {
- ContentProviderResult[] cpResults = mApp.getActivity().getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
- if (cpResults.length >= 0) {
- newId = cpResults[0].uri.getLastPathSegment();
- }
- } catch (RemoteException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- } catch (OperationApplicationException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return newId;
- }
-
- @Override
- /**
- * This method will remove a Contact from the database based on ID.
- * @param id the unique ID of the contact to remove
- */
- public boolean remove(String id) {
- int result = 0;
- Cursor cursor = mApp.getActivity().getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,
- null,
- ContactsContract.Contacts._ID + " = ?",
- new String[] { id }, null);
-
- if (cursor.getCount() == 1) {
- cursor.moveToFirst();
- String lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
- Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);
- result = mApp.getActivity().getContentResolver().delete(uri, null, null);
- } else {
- Log.d(LOG_TAG, "Could not find contact with ID");
- }
-
- return (result > 0) ? true : false;
- }
-
- /**
- * Gets birthday date from contact JSON object
- * @param contact an object to get birthday from
- * @return birthday or null, if the field isn't present or
- * is malformed in the contact
- */
- private Date getBirthday(JSONObject contact) {
- try {
- Long timestamp = contact.getLong("birthday");
- return new Date(timestamp);
- } catch (JSONException e) {
- Log.e(LOG_TAG, "Could not get birthday from JSON object", e);
- return null;
- }
- }
-
- /**
- * Gets birthday from contacts database cursor object
- * @param c cursor for the contact
- * @return birthday or null, if birthday column is empty or
- * the value can't be parsed into valid date object
- */
- private Date getBirthday(Cursor c) {
- int colBirthday = c.getColumnIndex(CommonDataKinds.Event.START_DATE);
-
- try {
- return Date.valueOf(c.getString(colBirthday));
- } catch (IllegalArgumentException e) {
- Log.e(LOG_TAG, "Failed to get birthday for contact from cursor", e);
- return null;
- }
- }
-
- /**************************************************************************
- *
- * All methods below this comment are used to convert from JavaScript
- * text types to Android integer types and vice versa.
- *
- *************************************************************************/
-
- /**
- * Converts a string from the W3C Contact API to it's Android int value.
- * @param string
- * @return Android int value
- */
- private int getPhoneType(String string) {
-
- int type = Phone.TYPE_OTHER;
-
- if (string != null) {
- String lowerType = string.toLowerCase(Locale.getDefault());
-
- if ("home".equals(lowerType)) {
- return Phone.TYPE_HOME;
- }
- else if ("mobile".equals(lowerType)) {
- return Phone.TYPE_MOBILE;
- }
- else if ("work".equals(lowerType)) {
- return Phone.TYPE_WORK;
- }
- else if ("work fax".equals(lowerType)) {
- return Phone.TYPE_FAX_WORK;
- }
- else if ("home fax".equals(lowerType)) {
- return Phone.TYPE_FAX_HOME;
- }
- else if ("fax".equals(lowerType)) {
- return Phone.TYPE_FAX_WORK;
- }
- else if ("pager".equals(lowerType)) {
- return Phone.TYPE_PAGER;
- }
- else if ("other".equals(lowerType)) {
- return Phone.TYPE_OTHER;
- }
- else if ("car".equals(lowerType)) {
- return Phone.TYPE_CAR;
- }
- else if ("company main".equals(lowerType)) {
- return Phone.TYPE_COMPANY_MAIN;
- }
- else if ("isdn".equals(lowerType)) {
- return Phone.TYPE_ISDN;
- }
- else if ("main".equals(lowerType)) {
- return Phone.TYPE_MAIN;
- }
- else if ("other fax".equals(lowerType)) {
- return Phone.TYPE_OTHER_FAX;
- }
- else if ("radio".equals(lowerType)) {
- return Phone.TYPE_RADIO;
- }
- else if ("telex".equals(lowerType)) {
- return Phone.TYPE_TELEX;
- }
- else if ("work mobile".equals(lowerType)) {
- return Phone.TYPE_WORK_MOBILE;
- }
- else if ("work pager".equals(lowerType)) {
- return Phone.TYPE_WORK_PAGER;
- }
- else if ("assistant".equals(lowerType)) {
- return Phone.TYPE_ASSISTANT;
- }
- else if ("mms".equals(lowerType)) {
- return Phone.TYPE_MMS;
- }
- else if ("callback".equals(lowerType)) {
- return Phone.TYPE_CALLBACK;
- }
- else if ("tty ttd".equals(lowerType)) {
- return Phone.TYPE_TTY_TDD;
- }
- else if ("custom".equals(lowerType)) {
- return Phone.TYPE_CUSTOM;
- }
- }
- return type;
- }
-
- /**
- * getPhoneType converts an Android phone type into a string
- * @param type
- * @return phone type as string.
- */
- private String getPhoneType(int type) {
- String stringType;
-
- switch (type) {
- case Phone.TYPE_CUSTOM:
- stringType = "custom";
- break;
- case Phone.TYPE_FAX_HOME:
- stringType = "home fax";
- break;
- case Phone.TYPE_FAX_WORK:
- stringType = "work fax";
- break;
- case Phone.TYPE_HOME:
- stringType = "home";
- break;
- case Phone.TYPE_MOBILE:
- stringType = "mobile";
- break;
- case Phone.TYPE_PAGER:
- stringType = "pager";
- break;
- case Phone.TYPE_WORK:
- stringType = "work";
- break;
- case Phone.TYPE_CALLBACK:
- stringType = "callback";
- break;
- case Phone.TYPE_CAR:
- stringType = "car";
- break;
- case Phone.TYPE_COMPANY_MAIN:
- stringType = "company main";
- break;
- case Phone.TYPE_OTHER_FAX:
- stringType = "other fax";
- break;
- case Phone.TYPE_RADIO:
- stringType = "radio";
- break;
- case Phone.TYPE_TELEX:
- stringType = "telex";
- break;
- case Phone.TYPE_TTY_TDD:
- stringType = "tty tdd";
- break;
- case Phone.TYPE_WORK_MOBILE:
- stringType = "work mobile";
- break;
- case Phone.TYPE_WORK_PAGER:
- stringType = "work pager";
- break;
- case Phone.TYPE_ASSISTANT:
- stringType = "assistant";
- break;
- case Phone.TYPE_MMS:
- stringType = "mms";
- break;
- case Phone.TYPE_ISDN:
- stringType = "isdn";
- break;
- case Phone.TYPE_OTHER:
- default:
- stringType = "other";
- break;
- }
- return stringType;
- }
-
- /**
- * Converts a string from the W3C Contact API to it's Android int value.
- * @param string
- * @return Android int value
- */
- private int getContactType(String string) {
- int type = CommonDataKinds.Email.TYPE_OTHER;
- if (string != null) {
-
- String lowerType = string.toLowerCase(Locale.getDefault());
-
- if ("home".equals(lowerType)) {
- return CommonDataKinds.Email.TYPE_HOME;
- }
- else if ("work".equals(lowerType)) {
- return CommonDataKinds.Email.TYPE_WORK;
- }
- else if ("other".equals(lowerType)) {
- return CommonDataKinds.Email.TYPE_OTHER;
- }
- else if ("mobile".equals(lowerType)) {
- return CommonDataKinds.Email.TYPE_MOBILE;
- }
- else if ("custom".equals(lowerType)) {
- return CommonDataKinds.Email.TYPE_CUSTOM;
- }
- }
- return type;
- }
-
- /**
- * getPhoneType converts an Android phone type into a string
- * @param type
- * @return phone type as string.
- */
- private String getContactType(int type) {
- String stringType;
- switch (type) {
- case CommonDataKinds.Email.TYPE_CUSTOM:
- stringType = "custom";
- break;
- case CommonDataKinds.Email.TYPE_HOME:
- stringType = "home";
- break;
- case CommonDataKinds.Email.TYPE_WORK:
- stringType = "work";
- break;
- case CommonDataKinds.Email.TYPE_MOBILE:
- stringType = "mobile";
- break;
- case CommonDataKinds.Email.TYPE_OTHER:
- default:
- stringType = "other";
- break;
- }
- return stringType;
- }
-
- /**
- * Converts a string from the W3C Contact API to it's Android int value.
- * @param string
- * @return Android int value
- */
- private int getOrgType(String string) {
- int type = CommonDataKinds.Organization.TYPE_OTHER;
- if (string != null) {
- String lowerType = string.toLowerCase(Locale.getDefault());
- if ("work".equals(lowerType)) {
- return CommonDataKinds.Organization.TYPE_WORK;
- }
- else if ("other".equals(lowerType)) {
- return CommonDataKinds.Organization.TYPE_OTHER;
- }
- else if ("custom".equals(lowerType)) {
- return CommonDataKinds.Organization.TYPE_CUSTOM;
- }
- }
- return type;
- }
-
- /**
- * getPhoneType converts an Android phone type into a string
- * @param type
- * @return phone type as string.
- */
- private String getOrgType(int type) {
- String stringType;
- switch (type) {
- case CommonDataKinds.Organization.TYPE_CUSTOM:
- stringType = "custom";
- break;
- case CommonDataKinds.Organization.TYPE_WORK:
- stringType = "work";
- break;
- case CommonDataKinds.Organization.TYPE_OTHER:
- default:
- stringType = "other";
- break;
- }
- return stringType;
- }
-
- /**
- * Converts a string from the W3C Contact API to it's Android int value.
- * @param string
- * @return Android int value
- */
- private int getAddressType(String string) {
- int type = CommonDataKinds.StructuredPostal.TYPE_OTHER;
- if (string != null) {
- String lowerType = string.toLowerCase(Locale.getDefault());
-
- if ("work".equals(lowerType)) {
- return CommonDataKinds.StructuredPostal.TYPE_WORK;
- }
- else if ("other".equals(lowerType)) {
- return CommonDataKinds.StructuredPostal.TYPE_OTHER;
- }
- else if ("home".equals(lowerType)) {
- return CommonDataKinds.StructuredPostal.TYPE_HOME;
- }
- }
- return type;
- }
-
- /**
- * getPhoneType converts an Android phone type into a string
- * @param type
- * @return phone type as string.
- */
- private String getAddressType(int type) {
- String stringType;
- switch (type) {
- case CommonDataKinds.StructuredPostal.TYPE_HOME:
- stringType = "home";
- break;
- case CommonDataKinds.StructuredPostal.TYPE_WORK:
- stringType = "work";
- break;
- case CommonDataKinds.StructuredPostal.TYPE_OTHER:
- default:
- stringType = "other";
- break;
- }
- return stringType;
- }
-
- /**
- * Converts a string from the W3C Contact API to it's Android int value.
- * @param string
- * @return Android int value
- */
- private int getImType(String string) {
- int type = CommonDataKinds.Im.PROTOCOL_CUSTOM;
- if (string != null) {
- String lowerType = string.toLowerCase(Locale.getDefault());
-
- if ("aim".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_AIM;
- }
- else if ("google talk".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_GOOGLE_TALK;
- }
- else if ("icq".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_ICQ;
- }
- else if ("jabber".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_JABBER;
- }
- else if ("msn".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_MSN;
- }
- else if ("netmeeting".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_NETMEETING;
- }
- else if ("qq".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_QQ;
- }
- else if ("skype".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_SKYPE;
- }
- else if ("yahoo".equals(lowerType)) {
- return CommonDataKinds.Im.PROTOCOL_YAHOO;
- }
- }
- return type;
- }
-
- /**
- * getPhoneType converts an Android phone type into a string
- * @param type
- * @return phone type as string.
- */
- @SuppressWarnings("unused")
- private String getImType(int type) {
- String stringType;
- switch (type) {
- case CommonDataKinds.Im.PROTOCOL_AIM:
- stringType = "AIM";
- break;
- case CommonDataKinds.Im.PROTOCOL_GOOGLE_TALK:
- stringType = "Google Talk";
- break;
- case CommonDataKinds.Im.PROTOCOL_ICQ:
- stringType = "ICQ";
- break;
- case CommonDataKinds.Im.PROTOCOL_JABBER:
- stringType = "Jabber";
- break;
- case CommonDataKinds.Im.PROTOCOL_MSN:
- stringType = "MSN";
- break;
- case CommonDataKinds.Im.PROTOCOL_NETMEETING:
- stringType = "NetMeeting";
- break;
- case CommonDataKinds.Im.PROTOCOL_QQ:
- stringType = "QQ";
- break;
- case CommonDataKinds.Im.PROTOCOL_SKYPE:
- stringType = "Skype";
- break;
- case CommonDataKinds.Im.PROTOCOL_YAHOO:
- stringType = "Yahoo";
- break;
- default:
- stringType = "custom";
- break;
- }
- return stringType;
- }
-
-}
diff --git a/plugins/cordova-plugin-contacts/src/android/ContactInfoDTO.java b/plugins/cordova-plugin-contacts/src/android/ContactInfoDTO.java
deleted file mode 100644
index a61b6e7..0000000
--- a/plugins/cordova-plugin-contacts/src/android/ContactInfoDTO.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-package org.apache.cordova.contacts;
-
-import java.util.HashMap;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-public class ContactInfoDTO {
-
- String displayName;
- JSONObject name;
- JSONArray organizations;
- JSONArray addresses;
- JSONArray phones;
- JSONArray emails;
- JSONArray ims;
- JSONArray websites;
- JSONArray photos;
- String note;
- String nickname;
- String birthday;
- HashMap desiredFieldsWithVals;
-
- public ContactInfoDTO() {
-
- displayName = "";
- name = new JSONObject();
- organizations = new JSONArray();
- addresses = new JSONArray();
- phones = new JSONArray();
- emails = new JSONArray();
- ims = new JSONArray();
- websites = new JSONArray();
- photos = new JSONArray();
- note = "";
- nickname = "";
- desiredFieldsWithVals = new HashMap();
- }
-
-}
diff --git a/plugins/cordova-plugin-contacts/src/android/ContactManager.java b/plugins/cordova-plugin-contacts/src/android/ContactManager.java
deleted file mode 100644
index 448302d..0000000
--- a/plugins/cordova-plugin-contacts/src/android/ContactManager.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.contacts;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaActivity;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.database.Cursor;
-import android.os.Build;
-import android.os.Bundle;
-import android.provider.ContactsContract.Contacts;
-import android.provider.ContactsContract.RawContacts;
-import android.util.Log;
-
-import java.lang.reflect.Method;
-
-public class ContactManager extends CordovaPlugin {
-
- private ContactAccessor contactAccessor;
- private CallbackContext callbackContext; // The callback context from which we were invoked.
- private JSONArray executeArgs;
-
- private static final String LOG_TAG = "Contact Query";
-
- public static final int UNKNOWN_ERROR = 0;
- public static final int INVALID_ARGUMENT_ERROR = 1;
- public static final int TIMEOUT_ERROR = 2;
- public static final int PENDING_OPERATION_ERROR = 3;
- public static final int IO_ERROR = 4;
- public static final int NOT_SUPPORTED_ERROR = 5;
- public static final int OPERATION_CANCELLED_ERROR = 6;
- public static final int PERMISSION_DENIED_ERROR = 20;
- private static final int CONTACT_PICKER_RESULT = 1000;
- public static String [] permissions;
-
-
- //Request code for the permissions picker (Pick is async and uses intents)
- public static final int SEARCH_REQ_CODE = 0;
- public static final int SAVE_REQ_CODE = 1;
- public static final int REMOVE_REQ_CODE = 2;
- public static final int PICK_REQ_CODE = 3;
-
- public static final String READ = Manifest.permission.READ_CONTACTS;
- public static final String WRITE = Manifest.permission.WRITE_CONTACTS;
-
-
- /**
- * Constructor.
- */
- public ContactManager() {
-
- }
-
-
- protected void getReadPermission(int requestCode)
- {
- PermissionHelper.requestPermission(this, requestCode, READ);
- }
-
-
- protected void getWritePermission(int requestCode)
- {
- PermissionHelper.requestPermission(this, requestCode, WRITE);
- }
-
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArray of arguments for the plugin.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return True if the action was valid, false otherwise.
- */
- public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
-
- this.callbackContext = callbackContext;
- this.executeArgs = args;
-
- /**
- * Check to see if we are on an Android 1.X device. If we are return an error as we
- * do not support this as of Cordova 1.0.
- */
- if (android.os.Build.VERSION.RELEASE.startsWith("1.")) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, ContactManager.NOT_SUPPORTED_ERROR));
- return true;
- }
-
- /**
- * Only create the contactAccessor after we check the Android version or the program will crash
- * older phones.
- */
- if (this.contactAccessor == null) {
- this.contactAccessor = new ContactAccessorSdk5(this.cordova);
- }
-
- if (action.equals("search")) {
- if(PermissionHelper.hasPermission(this, READ)) {
- search(executeArgs);
- }
- else
- {
- getReadPermission(SEARCH_REQ_CODE);
- }
- }
- else if (action.equals("save")) {
- if(PermissionHelper.hasPermission(this, WRITE))
- {
- save(executeArgs);
- }
- else
- {
- getWritePermission(SAVE_REQ_CODE);
- }
- }
- else if (action.equals("remove")) {
- if(PermissionHelper.hasPermission(this, WRITE))
- {
- remove(executeArgs);
- }
- else
- {
- getWritePermission(REMOVE_REQ_CODE);
- }
- }
- else if (action.equals("pickContact")) {
- if(PermissionHelper.hasPermission(this, READ))
- {
- pickContactAsync();
- }
- else
- {
- getReadPermission(PICK_REQ_CODE);
- }
- }
- else {
- return false;
- }
- return true;
- }
-
- private void remove(JSONArray args) throws JSONException {
- final String contactId = args.getString(0);
- this.cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- if (contactAccessor.remove(contactId)) {
- callbackContext.success();
- } else {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, UNKNOWN_ERROR));
- }
- }
- });
- }
-
- private void save(JSONArray args) throws JSONException {
- final JSONObject contact = args.getJSONObject(0);
- this.cordova.getThreadPool().execute(new Runnable(){
- public void run() {
- JSONObject res = null;
- String id = contactAccessor.save(contact);
- if (id != null) {
- try {
- res = contactAccessor.getContactById(id);
- } catch (JSONException e) {
- Log.e(LOG_TAG, "JSON fail.", e);
- }
- }
- if (res != null) {
- callbackContext.success(res);
- } else {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, UNKNOWN_ERROR));
- }
- }
- });
- }
-
- private void search(JSONArray args) throws JSONException
- {
- final JSONArray filter = args.getJSONArray(0);
- final JSONObject options = args.get(1) == null ? null : args.getJSONObject(1);
- this.cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- JSONArray res = contactAccessor.search(filter, options);
- callbackContext.success(res);
- }
- });
- }
-
-
- /**
- * Launches the Contact Picker to select a single contact.
- */
- private void pickContactAsync() {
- final CordovaPlugin plugin = (CordovaPlugin) this;
- Runnable worker = new Runnable() {
- public void run() {
- Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
- plugin.cordova.startActivityForResult(plugin, contactPickerIntent, CONTACT_PICKER_RESULT);
- }
- };
- this.cordova.getThreadPool().execute(worker);
- }
-
- /**
- * Called when user picks contact.
- * @param requestCode The request code originally supplied to startActivityForResult(),
- * allowing you to identify who this result came from.
- * @param resultCode The integer result code returned by the child activity through its setResult().
- * @param intent An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
- * @throws JSONException
- */
- public void onActivityResult(int requestCode, int resultCode, final Intent intent) {
- if (requestCode == CONTACT_PICKER_RESULT) {
- if (resultCode == Activity.RESULT_OK) {
- String contactId = intent.getData().getLastPathSegment();
- // to populate contact data we require Raw Contact ID
- // so we do look up for contact raw id first
- Cursor c = this.cordova.getActivity().getContentResolver().query(RawContacts.CONTENT_URI,
- new String[] {RawContacts._ID}, RawContacts.CONTACT_ID + " = " + contactId, null, null);
- if (!c.moveToFirst()) {
- this.callbackContext.error("Error occured while retrieving contact raw id");
- return;
- }
- String id = c.getString(c.getColumnIndex(RawContacts._ID));
- c.close();
-
- try {
- JSONObject contact = contactAccessor.getContactById(id);
- this.callbackContext.success(contact);
- return;
- } catch (JSONException e) {
- Log.e(LOG_TAG, "JSON fail.", e);
- }
- } else if (resultCode == Activity.RESULT_CANCELED) {
- callbackContext.error(OPERATION_CANCELLED_ERROR);
- return;
- }
-
- this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, UNKNOWN_ERROR));
- }
- }
-
- public void onRequestPermissionResult(int requestCode, String[] permissions,
- int[] grantResults) throws JSONException
- {
- for(int r:grantResults)
- {
- if(r == PackageManager.PERMISSION_DENIED)
- {
- this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, PERMISSION_DENIED_ERROR));
- return;
- }
- }
- switch(requestCode)
- {
- case SEARCH_REQ_CODE:
- search(executeArgs);
- break;
- case SAVE_REQ_CODE:
- save(executeArgs);
- break;
- case REMOVE_REQ_CODE:
- remove(executeArgs);
- break;
- case PICK_REQ_CODE:
- pickContactAsync();
- break;
- }
- }
-
- /**
- * This plugin launches an external Activity when a contact is picked, so we
- * need to implement the save/restore API in case the Activity gets killed
- * by the OS while it's in the background. We don't actually save anything
- * because picking a contact doesn't take in any arguments.
- */
- public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {
- this.callbackContext = callbackContext;
- this.contactAccessor = new ContactAccessorSdk5(this.cordova);
- }
-}
diff --git a/plugins/cordova-plugin-contacts/src/android/PermissionHelper.java b/plugins/cordova-plugin-contacts/src/android/PermissionHelper.java
deleted file mode 100644
index 29a7cb1..0000000
--- a/plugins/cordova-plugin-contacts/src/android/PermissionHelper.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.contacts;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-
-import android.content.pm.PackageManager;
-
-/**
- * This class provides reflective methods for permission requesting and checking so that plugins
- * written for cordova-android 5.0.0+ can still compile with earlier cordova-android versions.
- */
-public class PermissionHelper {
- private static final String LOG_TAG = "CordovaPermissionHelper";
-
- /**
- * Requests a "dangerous" permission for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermission() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permission request
- * @param permission The permission to be requested
- */
- public static void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
- PermissionHelper.requestPermissions(plugin, requestCode, new String[] {permission});
- }
-
- /**
- * Requests "dangerous" permissions for the application at runtime. This is a helper method
- * alternative to cordovaInterface.requestPermissions() that does not require the project to be
- * built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permissions are being requested for
- * @param requestCode A requestCode to be passed to the plugin's onRequestPermissionResult()
- * along with the result of the permissions request
- * @param permissions The permissions to be requested
- */
- public static void requestPermissions(CordovaPlugin plugin, int requestCode, String[] permissions) {
- try {
- Method requestPermission = CordovaInterface.class.getDeclaredMethod(
- "requestPermissions", CordovaPlugin.class, int.class, String[].class);
-
- // If there is no exception, then this is cordova-android 5.0.0+
- requestPermission.invoke(plugin.cordova, plugin, requestCode, permissions);
- } catch (NoSuchMethodException noSuchMethodException) {
- // cordova-android version is less than 5.0.0, so permission is implicitly granted
- LOG.d(LOG_TAG, "No need to request permissions " + Arrays.toString(permissions));
-
- // Notify the plugin that all were granted by using more reflection
- deliverPermissionResult(plugin, requestCode, permissions);
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when requesting permissions " + Arrays.toString(permissions), illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method does not throw any exceptions, so this should never be caught
- LOG.e(LOG_TAG, "invocationTargetException when requesting permissions " + Arrays.toString(permissions), invocationTargetException);
- }
- }
-
- /**
- * Checks at runtime to see if the application has been granted a permission. This is a helper
- * method alternative to cordovaInterface.hasPermission() that does not require the project to
- * be built with cordova-android 5.0.0+
- *
- * @param plugin The plugin the permission is being checked against
- * @param permission The permission to be checked
- *
- * @return True if the permission has already been granted and false otherwise
- */
- public static boolean hasPermission(CordovaPlugin plugin, String permission) {
- try {
- Method hasPermission = CordovaInterface.class.getDeclaredMethod("hasPermission", String.class);
-
- // If there is no exception, then this is cordova-android 5.0.0+
- return (Boolean) hasPermission.invoke(plugin.cordova, permission);
- } catch (NoSuchMethodException noSuchMethodException) {
- // cordova-android version is less than 5.0.0, so permission is implicitly granted
- LOG.d(LOG_TAG, "No need to check for permission " + permission);
- return true;
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when checking permission " + permission, illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method does not throw any exceptions, so this should never be caught
- LOG.e(LOG_TAG, "invocationTargetException when checking permission " + permission, invocationTargetException);
- }
- return false;
- }
-
- private static void deliverPermissionResult(CordovaPlugin plugin, int requestCode, String[] permissions) {
- // Generate the request results
- int[] requestResults = new int[permissions.length];
- Arrays.fill(requestResults, PackageManager.PERMISSION_GRANTED);
-
- try {
- Method onRequestPermissionResult = CordovaPlugin.class.getDeclaredMethod(
- "onRequestPermissionResult", int.class, String[].class, int[].class);
-
- onRequestPermissionResult.invoke(plugin, requestCode, permissions, requestResults);
- } catch (NoSuchMethodException noSuchMethodException) {
- // Should never be caught since the plugin must be written for cordova-android 5.0.0+ if it
- // made it to this point
- LOG.e(LOG_TAG, "NoSuchMethodException when delivering permissions results", noSuchMethodException);
- } catch (IllegalAccessException illegalAccessException) {
- // Should never be caught; this is a public method
- LOG.e(LOG_TAG, "IllegalAccessException when delivering permissions results", illegalAccessException);
- } catch(InvocationTargetException invocationTargetException) {
- // This method may throw a JSONException. We are just duplicating cordova-android's
- // exception handling behavior here; all it does is log the exception in CordovaActivity,
- // print the stacktrace, and ignore it
- LOG.e(LOG_TAG, "InvocationTargetException when delivering permissions results", invocationTargetException);
- }
- }
-}
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactActivity.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactActivity.js
deleted file mode 100644
index 0205194..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactActivity.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactActivity = function (args) {
- this.direction = args.direction || null;
- this.description = args.description || "";
- this.mimeType = args.mimeType || "";
- this.timestamp = new Date(parseInt(args.timestamp, 10)) || null;
-};
-
-Object.defineProperty(ContactActivity, "INCOMING", {"value": true});
-Object.defineProperty(ContactActivity, "OUTGOING", {"value": false});
-
-module.exports = ContactActivity;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactAddress.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactAddress.js
deleted file mode 100644
index 30e9cbd..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactAddress.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactAddress = function (properties) {
- this.type = properties && properties.type ? properties.type : "";
- this.streetAddress = properties && properties.streetAddress ? properties.streetAddress : "";
- this.streetOther = properties && properties.streetOther ? properties.streetOther : "";
- this.locality = properties && properties.locality ? properties.locality : "";
- this.region = properties && properties.region ? properties.region : "";
- this.postalCode = properties && properties.postalCode ? properties.postalCode : "";
- this.country = properties && properties.country ? properties.country : "";
-};
-
-Object.defineProperty(ContactAddress, "HOME", {"value": "home"});
-Object.defineProperty(ContactAddress, "WORK", {"value": "work"});
-Object.defineProperty(ContactAddress, "OTHER", {"value": "other"});
-
-module.exports = ContactAddress;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactError.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactError.js
deleted file mode 100644
index a44a546..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactError.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactError = function (code, msg) {
- this.code = code;
- this.message = msg;
-};
-
-Object.defineProperty(ContactError, "UNKNOWN_ERROR", { "value": 0 });
-Object.defineProperty(ContactError, "INVALID_ARGUMENT_ERROR", { "value": 1 });
-Object.defineProperty(ContactError, "TIMEOUT_ERROR", { "value": 2 });
-Object.defineProperty(ContactError, "PENDING_OPERATION_ERROR", { "value": 3 });
-Object.defineProperty(ContactError, "IO_ERROR", { "value": 4 });
-Object.defineProperty(ContactError, "NOT_SUPPORTED_ERROR", { "value": 5 });
-Object.defineProperty(ContactError, "PERMISSION_DENIED_ERROR", { "value": 20 });
-
-module.exports = ContactError;
-
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactField.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactField.js
deleted file mode 100644
index 9651700..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactField.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactField = function (type, value) {
- this.type = type || "";
- this.value = value || "";
-};
-
-Object.defineProperty(ContactField, "HOME", {"value": "home"});
-Object.defineProperty(ContactField, "WORK", {"value": "work"});
-Object.defineProperty(ContactField, "OTHER", {"value": "other"});
-Object.defineProperty(ContactField, "MOBILE", {"value": "mobile"});
-Object.defineProperty(ContactField, "DIRECT", {"value": "direct"});
-
-module.exports = ContactField;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactFindOptions.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactFindOptions.js
deleted file mode 100644
index 6f8ccfe..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactFindOptions.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * ContactFindOptions.
- * @constructor
- * @param filter search fields
- * @param sort sort fields and order
- * @param limit max number of contacts to return
- * @param favorite if set, only favorite contacts will be returned
- */
-
-var ContactFindOptions = function (filter, sort, limit, favorite) {
- this.filter = filter || null;
- this.sort = sort || null;
- this.limit = limit || -1; // -1 for returning all results
- this.favorite = favorite || false;
- this.includeAccounts = [];
- this.excludeAccounts = [];
-};
-
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_GIVEN_NAME", { "value": 0 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_FAMILY_NAME", { "value": 1 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_ORGANIZATION_NAME", { "value": 2 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_PHONE", { "value": 3 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_EMAIL", { "value": 4 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_BBMPIN", { "value": 5 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_LINKEDIN", { "value": 6 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_TWITTER", { "value": 7 });
-Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_VIDEO_CHAT", { "value": 8 });
-
-Object.defineProperty(ContactFindOptions, "SORT_FIELD_GIVEN_NAME", { "value": 0 });
-Object.defineProperty(ContactFindOptions, "SORT_FIELD_FAMILY_NAME", { "value": 1 });
-Object.defineProperty(ContactFindOptions, "SORT_FIELD_ORGANIZATION_NAME", { "value": 2 });
-
-module.exports = ContactFindOptions;
-
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactName.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactName.js
deleted file mode 100644
index 80136c9..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactName.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-function toFormattedName(properties) {
- var formatted = "";
- if (properties && properties.givenName) {
- formatted = properties.givenName;
- if (properties && properties.familyName) {
- formatted += " " + properties.familyName;
- }
- }
- return formatted;
-}
-
-var ContactName = function (properties) {
- this.familyName = properties && properties.familyName ? properties.familyName : "";
- this.givenName = properties && properties.givenName ? properties.givenName : "";
- this.formatted = toFormattedName(properties);
- this.middleName = properties && properties.middleName ? properties.middleName : "";
- this.honorificPrefix = properties && properties.honorificPrefix ? properties.honorificPrefix : "";
- this.honorificSuffix = properties && properties.honorificSuffix ? properties.honorificSuffix : "";
- this.phoneticFamilyName = properties && properties.phoneticFamilyName ? properties.phoneticFamilyName : "";
- this.phoneticGivenName = properties && properties.phoneticGivenName ? properties.phoneticGivenName : "";
-};
-
-module.exports = ContactName;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactNews.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactNews.js
deleted file mode 100644
index e47a4cd..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactNews.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactNews = function (args) {
- this.title = args.title || "";
- this.body = args.body || "";
- this.articleSource = args.articleSource || "";
- this.companies = args.companies || [];
- this.publishedAt = new Date(parseInt(args.publishedAt, 10)) || null;
- this.uri = args.uri || "";
- this.type = args.type || "";
-};
-
-module.exports = ContactNews;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactOrganization.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactOrganization.js
deleted file mode 100644
index fc953f2..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactOrganization.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactOrganization = function (properties) {
- this.name = properties && properties.name ? properties.name : "";
- this.department = properties && properties.department ? properties.department : "";
- this.title = properties && properties.title ? properties.title : "";
-};
-
-module.exports = ContactOrganization;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/ContactPhoto.js b/plugins/cordova-plugin-contacts/src/blackberry10/ContactPhoto.js
deleted file mode 100644
index 4604710..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/ContactPhoto.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-var ContactPhoto = function (originalFilePath, pref) {
- this.originalFilePath = originalFilePath || "";
- this.pref = pref || false;
- this.largeFilePath = "";
- this.smallFilePath = "";
-};
-
-module.exports = ContactPhoto;
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/contactConsts.js b/plugins/cordova-plugin-contacts/src/blackberry10/contactConsts.js
deleted file mode 100644
index ef25206..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/contactConsts.js
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
-* Copyright 2012 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-var ATTRIBUTE_KIND,
- ATTRIBUTE_SUBKIND,
- kindAttributeMap = {},
- subKindAttributeMap = {},
- _TITLE = 26,
- _START_DATE = 43,
- _END_DATE = 44;
-
-function populateKindAttributeMap() {
- ATTRIBUTE_KIND = {
- Invalid: 0,
- Phone: 1,
- Fax: 2,
- Pager: 3,
- Email: 4,
- Website: 5,
- Feed: 6,
- Profile: 7,
- Family: 8,
- Person: 9,
- Date: 10,
- Group: 11,
- Name: 12,
- StockSymbol: 13,
- Ranking: 14,
- OrganizationAffiliation: 15,
- Education: 16,
- Note: 17,
- InstantMessaging: 18,
- VideoChat: 19,
- ConnectionCount: 20,
- Hidden: 21,
- Biography: 22,
- Sound: 23,
- Notification: 24,
- MessageSound: 25,
- MessageNotification: 26
- };
-
- kindAttributeMap[ATTRIBUTE_KIND.Phone] = "phoneNumbers";
- kindAttributeMap[ATTRIBUTE_KIND.Fax] = "faxNumbers";
- kindAttributeMap[ATTRIBUTE_KIND.Pager] = "pagerNumber";
- kindAttributeMap[ATTRIBUTE_KIND.Email] = "emails";
- kindAttributeMap[ATTRIBUTE_KIND.Website] = "urls";
- kindAttributeMap[ATTRIBUTE_KIND.Profile] = "socialNetworks";
- kindAttributeMap[ATTRIBUTE_KIND.OrganizationAffiliation] = "organizations";
- kindAttributeMap[ATTRIBUTE_KIND.Education] = "education";
- kindAttributeMap[ATTRIBUTE_KIND.Note] = "note";
- kindAttributeMap[ATTRIBUTE_KIND.InstantMessaging] = "ims";
- kindAttributeMap[ATTRIBUTE_KIND.VideoChat] = "videoChat";
- kindAttributeMap[ATTRIBUTE_KIND.Sound] = "ringtone";
-}
-
-function populateSubKindAttributeMap() {
- ATTRIBUTE_SUBKIND = {
- Invalid: 0,
- Other: 1,
- Home: 2,
- Work: 3,
- PhoneMobile: 4,
- FaxDirect: 5,
- Blog: 6,
- WebsiteResume: 7,
- WebsitePortfolio: 8,
- WebsitePersonal: 9,
- WebsiteCompany: 10,
- ProfileFacebook: 11,
- ProfileTwitter: 12,
- ProfileLinkedIn: 13,
- ProfileGist: 14,
- ProfileTungle: 15,
- FamilySpouse: 16,
- FamilyChild: 17,
- FamilyParent: 18,
- PersonManager: 19,
- PersonAssistant: 20,
- DateBirthday: 21,
- DateAnniversary: 22,
- GroupDepartment: 23,
- NameGiven: 24,
- NameSurname: 25,
- Title: _TITLE,
- NameSuffix: 27,
- NameMiddle: 28,
- NameNickname: 29,
- NameAlias: 30,
- NameDisplayName: 31,
- NamePhoneticGiven: 32,
- NamePhoneticSurname: 33,
- StockSymbolNyse: 34,
- StockSymbolNasdaq: 35,
- StockSymbolTse: 36,
- StockSymbolLse: 37,
- StockSymbolTsx: 38,
- RankingKlout: 39,
- RankingTrstRank: 40,
- OrganizationAffiliationName: 41,
- OrganizationAffiliationPhoneticName: 42,
- OrganizationAffiliationTitle: _TITLE,
- StartDate: _START_DATE,
- EndDate: _END_DATE,
- OrganizationAffiliationDetails: 45,
- EducationInstitutionName: 46,
- EducationStartDate: _START_DATE,
- EducationEndDate: _END_DATE,
- EducationDegree: 47,
- EducationConcentration: 48,
- EducationActivities: 49,
- EducationNotes: 50,
- InstantMessagingBbmPin: 51,
- InstantMessagingAim: 52,
- InstantMessagingAliwangwang: 53,
- InstantMessagingGoogleTalk: 54,
- InstantMessagingSametime: 55,
- InstantMessagingIcq: 56,
- InstantMessagingIrc: 57,
- InstantMessagingJabber: 58,
- InstantMessagingMsLcs: 59,
- InstantMessagingMsn: 60,
- InstantMessagingQq: 61,
- InstantMessagingSkype: 62,
- InstantMessagingYahooMessenger: 63,
- InstantMessagingYahooMessengerJapan: 64,
- VideoChatBbPlaybook: 65,
- HiddenLinkedIn: 66,
- HiddenFacebook: 67,
- HiddenTwitter: 68,
- ConnectionCountLinkedIn: 69,
- ConnectionCountFacebook: 70,
- ConnectionCountTwitter: 71,
- HiddenChecksum: 72,
- HiddenSpeedDial: 73,
- BiographyFacebook: 74,
- BiographyTwitter: 75,
- BiographyLinkedIn: 76,
- SoundRingtone: 77,
- SimContactType: 78,
- EcoID: 79,
- Personal: 80,
- StockSymbolAll: 81,
- NotificationVibration: 82,
- NotificationLED: 83,
- MessageNotificationVibration: 84,
- MessageNotificationLED: 85,
- MessageNotificationDuringCall: 86,
- VideoChatPin: 87
- };
-
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Other] = "other";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Home] = "home";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Work] = "work";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.PhoneMobile] = "mobile";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.FaxDirect] = "direct";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Blog] = "blog";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsiteResume] = "resume";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsitePortfolio] = "portfolio";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsitePersonal] = "personal";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsiteCompany] = "company";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileFacebook] = "facebook";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileTwitter] = "twitter";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileLinkedIn] = "linkedin";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileGist] = "gist";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileTungle] = "tungle";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.DateBirthday] = "birthday";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.DateAnniversary] = "anniversary";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NameGiven] = "givenName";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NameSurname] = "familyName";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Title] = "honorificPrefix";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NameSuffix] = "honorificSuffix";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NameMiddle] = "middleName";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NamePhoneticGiven] = "phoneticGivenName";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NamePhoneticSurname] = "phoneticFamilyName";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NameNickname] = "nickname";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.NameDisplayName] = "displayName";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.OrganizationAffiliationName] = "name";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.OrganizationAffiliationDetails] = "department";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Title] = "title";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingBbmPin] = "BbmPin";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingAim] = "Aim";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingAliwangwang] = "Aliwangwang";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingGoogleTalk] = "GoogleTalk";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingSametime] = "Sametime";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingIcq] = "Icq";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingJabber] = "Jabber";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingMsLcs] = "MsLcs";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingSkype] = "Skype";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingYahooMessenger] = "YahooMessenger";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingYahooMessengerJapan] = "YahooMessegerJapan";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.VideoChatBbPlaybook] = "BbPlaybook";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.SoundRingtone] = "ringtone";
- subKindAttributeMap[ATTRIBUTE_SUBKIND.Personal] = "personal";
-}
-
-module.exports = {
- getKindAttributeMap: function () {
- if (!ATTRIBUTE_KIND) {
- populateKindAttributeMap();
- }
-
- return kindAttributeMap;
- },
- getSubKindAttributeMap: function () {
- if (!ATTRIBUTE_SUBKIND) {
- populateSubKindAttributeMap();
- }
-
- return subKindAttributeMap;
- }
-};
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/contactUtils.js b/plugins/cordova-plugin-contacts/src/blackberry10/contactUtils.js
deleted file mode 100644
index e1f7d67..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/contactUtils.js
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var self,
- ContactFindOptions = require("./ContactFindOptions"),
- ContactError = require("./ContactError"),
- ContactName = require("./ContactName"),
- ContactOrganization = require("./ContactOrganization"),
- ContactAddress = require("./ContactAddress"),
- ContactField = require("./ContactField"),
- contactConsts = require("./contactConsts"),
- ContactPhoto = require("./ContactPhoto"),
- ContactNews = require("./ContactNews"),
- ContactActivity = require("./ContactActivity");
-
-function populateFieldArray(contactProps, field, ClassName) {
- if (contactProps[field]) {
- var list = [],
- obj;
-
- contactProps[field].forEach(function (args) {
- if (ClassName === ContactField) {
- list.push(new ClassName(args.type, args.value));
- } else if (ClassName === ContactPhoto) {
- obj = new ContactPhoto(args.originalFilePath, args.pref);
- obj.largeFilePath = args.largeFilePath;
- obj.smallFilePath = args.smallFilePath;
- list.push(obj);
- } else if (ClassName === ContactNews) {
- obj = new ContactNews(args);
- list.push(obj);
- } else if (ClassName === ContactActivity) {
- obj = new ContactActivity(args);
- list.push(obj);
- } else {
- list.push(new ClassName(args));
- }
- });
- contactProps[field] = list;
- }
-}
-
-function populateDate(contactProps, field) {
- if (contactProps[field]) {
- contactProps[field] = new Date(contactProps[field]);
- }
-}
-
-function validateFindArguments(findOptions) {
- var error = false;
-
- // findOptions is mandatory
- if (!findOptions) {
- error = true;
- } else {
- // findOptions.filter is optional
- if (findOptions.filter) {
- findOptions.filter.forEach(function (f) {
- switch (f.fieldName) {
- case ContactFindOptions.SEARCH_FIELD_GIVEN_NAME:
- case ContactFindOptions.SEARCH_FIELD_FAMILY_NAME:
- case ContactFindOptions.SEARCH_FIELD_ORGANIZATION_NAME:
- case ContactFindOptions.SEARCH_FIELD_PHONE:
- case ContactFindOptions.SEARCH_FIELD_EMAIL:
- case ContactFindOptions.SEARCH_FIELD_BBMPIN:
- case ContactFindOptions.SEARCH_FIELD_LINKEDIN:
- case ContactFindOptions.SEARCH_FIELD_TWITTER:
- case ContactFindOptions.SEARCH_FIELD_VIDEO_CHAT:
- break;
- default:
- error = true;
- }
-
- if (!f.fieldValue) {
- error = true;
- }
- });
- }
-
- //findOptions.limit is optional
- if (findOptions.limit) {
- if (typeof findOptions.limit !== "number") {
- error = true;
- }
- }
-
- //findOptions.favorite is optional
- if (findOptions.favorite) {
- if (typeof findOptions.favorite !== "boolean") {
- error = true;
- }
- }
-
- // findOptions.sort is optional
- if (!error && findOptions.sort && Array.isArray(findOptions.sort)) {
- findOptions.sort.forEach(function (s) {
- switch (s.fieldName) {
- case ContactFindOptions.SORT_FIELD_GIVEN_NAME:
- case ContactFindOptions.SORT_FIELD_FAMILY_NAME:
- case ContactFindOptions.SORT_FIELD_ORGANIZATION_NAME:
- break;
- default:
- error = true;
- }
-
- if (s.desc === undefined || typeof s.desc !== "boolean") {
- error = true;
- }
- });
- }
-
- if (!error && findOptions.includeAccounts) {
- if (!Array.isArray(findOptions.includeAccounts)) {
- error = true;
- } else {
- findOptions.includeAccounts.forEach(function (acct) {
- if (!error && (!acct.id || window.isNaN(window.parseInt(acct.id, 10)))) {
- error = true;
- }
- });
- }
- }
-
- if (!error && findOptions.excludeAccounts) {
- if (!Array.isArray(findOptions.excludeAccounts)) {
- error = true;
- } else {
- findOptions.excludeAccounts.forEach(function (acct) {
- if (!error && (!acct.id || window.isNaN(window.parseInt(acct.id, 10)))) {
- error = true;
- }
- });
- }
- }
- }
- return !error;
-}
-
-function validateContactsPickerFilter(filter) {
- var isValid = true,
- availableFields = {};
-
- if (typeof(filter) === "undefined") {
- isValid = false;
- } else {
- if (filter && Array.isArray(filter)) {
- availableFields = contactConsts.getKindAttributeMap();
- filter.forEach(function (e) {
- isValid = isValid && Object.getOwnPropertyNames(availableFields).reduce(
- function (found, key) {
- return found || availableFields[key] === e;
- }, false);
- });
- }
- }
-
- return isValid;
-}
-
-function validateContactsPickerOptions(options) {
- var isValid = false,
- mode = options.mode;
-
- if (typeof(options) === "undefined") {
- isValid = false;
- } else {
- isValid = mode === ContactPickerOptions.MODE_SINGLE || mode === ContactPickerOptions.MODE_MULTIPLE || mode === ContactPickerOptions.MODE_ATTRIBUTE;
-
- // if mode is attribute, fields must be defined
- if (mode === ContactPickerOptions.MODE_ATTRIBUTE && !validateContactsPickerFilter(options.fields)) {
- isValid = false;
- }
- }
-
- return isValid;
-}
-
-self = module.exports = {
- populateContact: function (contact) {
- if (contact.name) {
- contact.name = new ContactName(contact.name);
- }
-
- populateFieldArray(contact, "addresses", ContactAddress);
- populateFieldArray(contact, "organizations", ContactOrganization);
- populateFieldArray(contact, "emails", ContactField);
- populateFieldArray(contact, "phoneNumbers", ContactField);
- populateFieldArray(contact, "faxNumbers", ContactField);
- populateFieldArray(contact, "pagerNumbers", ContactField);
- populateFieldArray(contact, "ims", ContactField);
- populateFieldArray(contact, "socialNetworks", ContactField);
- populateFieldArray(contact, "urls", ContactField);
- populateFieldArray(contact, "photos", ContactPhoto);
- populateFieldArray(contact, "news", ContactNews);
- populateFieldArray(contact, "activities", ContactActivity);
- // TODO categories
-
- populateDate(contact, "birthday");
- populateDate(contact, "anniversary");
- },
- invokeErrorCallback: function (errorCallback, code) {
- if (errorCallback) {
- errorCallback(new ContactError(code));
- }
- },
- validateFindArguments: validateFindArguments,
- validateContactsPickerFilter: validateContactsPickerFilter,
- validateContactsPickerOptions: validateContactsPickerOptions
-};
-
diff --git a/plugins/cordova-plugin-contacts/src/blackberry10/index.js b/plugins/cordova-plugin-contacts/src/blackberry10/index.js
deleted file mode 100644
index 09a4bd2..0000000
--- a/plugins/cordova-plugin-contacts/src/blackberry10/index.js
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright 2013 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var pimContacts,
- contactUtils = require("./contactUtils"),
- contactConsts = require("./contactConsts"),
- ContactError = require("./ContactError"),
- ContactName = require("./ContactName"),
- ContactFindOptions = require("./ContactFindOptions"),
- noop = function () {};
-
-function getAccountFilters(options) {
- if (options.includeAccounts) {
- options.includeAccounts = options.includeAccounts.map(function (acct) {
- return acct.id.toString();
- });
- }
-
- if (options.excludeAccounts) {
- options.excludeAccounts = options.excludeAccounts.map(function (acct) {
- return acct.id.toString();
- });
- }
-}
-
-function populateSearchFields(fields) {
- var i,
- l,
- key,
- searchFieldsObject = {},
- searchFields = [];
-
- for (i = 0, l = fields.length; i < l; i++) {
- if (fields[i] === "*") {
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_GIVEN_NAME] = true;
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_FAMILY_NAME] = true;
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_PHONE] = true;
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_EMAIL] = true;
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_ORGANIZATION_NAME] = true;
- } else if (fields[i] === "displayName" || fields[i] === "name") {
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_GIVEN_NAME] = true;
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_FAMILY_NAME] = true;
- } else if (fields[i] === "nickname") {
- // not supported by Cascades
- } else if (fields[i] === "phoneNumbers") {
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_PHONE] = true;
- } else if (fields[i] === "emails") {
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_EMAIL] = true;
- } else if (field === "addresses") {
- // not supported by Cascades
- } else if (field === "ims") {
- // not supported by Cascades
- } else if (field === "organizations") {
- searchFieldsObject[ContactFindOptions.SEARCH_FIELD_ORGANIZATION_NAME] = true;
- } else if (field === "birthday") {
- // not supported by Cascades
- } else if (field === "note") {
- // not supported by Cascades
- } else if (field === "photos") {
- // not supported by Cascades
- } else if (field === "categories") {
- // not supported by Cascades
- } else if (field === "urls") {
- // not supported by Cascades
- }
- }
-
- for (key in searchFieldsObject) {
- if (searchFieldsObject.hasOwnProperty(key)) {
- searchFields.push(window.parseInt(key));
- }
- }
-
- return searchFields;
-}
-
-function convertBirthday(birthday) {
- //Convert date string from native to milliseconds since epoch for cordova-js
- var birthdayInfo;
- if (birthday) {
- birthdayInfo = birthday.split("-");
- return new Date(birthdayInfo[0], birthdayInfo[1] - 1, birthdayInfo[2]).getTime();
- } else {
- return null;
- }
-}
-
-function processJnextSaveData(result, JnextData) {
- var data = JnextData,
- birthdayInfo;
-
- if (data._success === true) {
- data.birthday = convertBirthday(data.birthday);
- result.callbackOk(data, false);
- } else {
- result.callbackError(data.code, false);
- }
-}
-
-function processJnextRemoveData(result, JnextData) {
- var data = JnextData;
-
- if (data._success === true) {
- result.callbackOk(data);
- } else {
- result.callbackError(ContactError.UNKNOWN_ERROR, false);
- }
-}
-
-function processJnextFindData(eventId, eventHandler, JnextData) {
- var data = JnextData,
- i,
- l,
- more = false,
- resultsObject = {},
- birthdayInfo;
-
- if (data.contacts) {
- for (i = 0, l = data.contacts.length; i < l; i++) {
- data.contacts[i].birthday = convertBirthday(data.contacts[i].birthday);
- data.contacts[i].name = new ContactName(data.contacts[i].name);
- }
- } else {
- data.contacts = []; // if JnextData.contacts return null, return an empty array
- }
-
- if (data._success === true) {
- eventHandler.error = false;
- }
-
- if (eventHandler.multiple) {
- // Concatenate results; do not add the same contacts
- for (i = 0, l = eventHandler.searchResult.length; i < l; i++) {
- resultsObject[eventHandler.searchResult[i].id] = true;
- }
-
- for (i = 0, l = data.contacts.length; i < l; i++) {
- if (resultsObject[data.contacts[i].id]) {
- // Already existing
- } else {
- eventHandler.searchResult.push(data.contacts[i]);
- }
- }
-
- // check if more search is required
- eventHandler.searchFieldIndex++;
- if (eventHandler.searchFieldIndex < eventHandler.searchFields.length) {
- more = true;
- }
- } else {
- eventHandler.searchResult = data.contacts;
- }
-
- if (more) {
- pimContacts.getInstance().invokeJnextSearch(eventId);
- } else {
- if (eventHandler.error) {
- eventHandler.result.callbackError(data.code, false);
- } else {
- eventHandler.result.callbackOk(eventHandler.searchResult, false);
- }
- }
-}
-
-module.exports = {
- search: function (successCb, failCb, args, env) {
- var cordovaFindOptions = {},
- result = new PluginResult(args, env),
- key;
-
- for (key in args) {
- if (args.hasOwnProperty(key)) {
- cordovaFindOptions[key] = JSON.parse(decodeURIComponent(args[key]));
- }
- }
-
- pimContacts.getInstance().find(cordovaFindOptions, result, processJnextFindData);
- result.noResult(true);
- },
- save: function (successCb, failCb, args, env) {
- var attributes = {},
- result = new PluginResult(args, env),
- key,
- nativeEmails = [];
-
- attributes = JSON.parse(decodeURIComponent(args[0]));
-
- //convert birthday format for our native .so file
- if (attributes.birthday) {
- attributes.birthday = new Date(attributes.birthday).toDateString();
- }
-
- if (attributes.emails) {
- attributes.emails.forEach(function (email) {
- if (email.value) {
- if (email.type) {
- nativeEmails.push({ "type" : email.type, "value" : email.value });
- } else {
- nativeEmails.push({ "type" : "home", "value" : email.value });
- }
- }
- });
- attributes.emails = nativeEmails;
- }
-
- if (attributes.id !== null) {
- attributes.id = window.parseInt(attributes.id);
- }
-
- attributes._eventId = result.callbackId;
- pimContacts.getInstance().save(attributes, result, processJnextSaveData);
- result.noResult(true);
- },
- remove: function (successCb, failCb, args, env) {
- var result = new PluginResult(args, env),
- attributes = {
- "contactId": window.parseInt(JSON.parse(decodeURIComponent(args[0]))),
- "_eventId": result.callbackId
- };
-
- if (!window.isNaN(attributes.contactId)) {
- pimContacts.getInstance().remove(attributes, result, processJnextRemoveData);
- result.noResult(true);
- } else {
- result.error(ContactError.UNKNOWN_ERROR);
- result.noResult(false);
- }
- }
-};
-
-///////////////////////////////////////////////////////////////////
-// JavaScript wrapper for JNEXT plugin
-///////////////////////////////////////////////////////////////////
-
-JNEXT.PimContacts = function ()
-{
- var self = this,
- hasInstance = false;
-
- self.find = function (cordovaFindOptions, pluginResult, handler) {
- //register find eventHandler for when JNEXT onEvent fires
- self.eventHandlers[cordovaFindOptions.callbackId] = {
- "result" : pluginResult,
- "action" : "find",
- "multiple" : cordovaFindOptions[1].filter ? true : false,
- "fields" : cordovaFindOptions[0],
- "searchFilter" : cordovaFindOptions[1].filter,
- "searchFields" : cordovaFindOptions[1].filter ? populateSearchFields(cordovaFindOptions[0]) : null,
- "searchFieldIndex" : 0,
- "searchResult" : [],
- "handler" : handler,
- "error" : true
- };
-
- self.invokeJnextSearch(cordovaFindOptions.callbackId);
- return "";
- };
-
- self.invokeJnextSearch = function(eventId) {
- var jnextArgs = {},
- findHandler = self.eventHandlers[eventId];
-
- jnextArgs._eventId = eventId;
- jnextArgs.fields = findHandler.fields;
- jnextArgs.options = {};
- jnextArgs.options.filter = [];
-
- if (findHandler.multiple) {
- jnextArgs.options.filter.push({
- "fieldName" : findHandler.searchFields[findHandler.searchFieldIndex],
- "fieldValue" : findHandler.searchFilter
- });
- //findHandler.searchFieldIndex++;
- }
-
- JNEXT.invoke(self.m_id, "find " + JSON.stringify(jnextArgs));
- }
-
- self.getContact = function (args) {
- return JSON.parse(JNEXT.invoke(self.m_id, "getContact " + JSON.stringify(args)));
- };
-
- self.save = function (args, pluginResult, handler) {
- //register save eventHandler for when JNEXT onEvent fires
- self.eventHandlers[args._eventId] = {
- "result" : pluginResult,
- "action" : "save",
- "handler" : handler
- };
- JNEXT.invoke(self.m_id, "save " + JSON.stringify(args));
- return "";
- };
-
- self.remove = function (args, pluginResult, handler) {
- //register remove eventHandler for when JNEXT onEvent fires
- self.eventHandlers[args._eventId] = {
- "result" : pluginResult,
- "action" : "remove",
- "handler" : handler
- };
- JNEXT.invoke(self.m_id, "remove " + JSON.stringify(args));
- return "";
- };
-
- self.getId = function () {
- return self.m_id;
- };
-
- self.getContactAccounts = function () {
- var value = JNEXT.invoke(self.m_id, "getContactAccounts");
- return JSON.parse(value);
- };
-
- self.init = function () {
- if (!JNEXT.require("libpimcontacts")) {
- return false;
- }
-
- self.m_id = JNEXT.createObject("libpimcontacts.PimContacts");
-
- if (self.m_id === "") {
- return false;
- }
-
- JNEXT.registerEvents(self);
- };
-
- // Handle data coming back from JNEXT native layer. Each async function registers a handler and a PluginResult object.
- // When JNEXT fires onEvent we parse the result string back into JSON and trigger the appropriate handler (eventHandlers map
- // uses callbackId as key), along with the actual data coming back from the native layer. Each function may have its own way of
- // processing native data so we do not do any processing here.
-
- self.onEvent = function (strData) {
- var arData = strData.split(" "),
- strEventDesc = arData[0],
- eventHandler,
- args = {};
-
- if (strEventDesc === "result") {
- args.result = escape(strData.split(" ").slice(2).join(" "));
- eventHandler = self.eventHandlers[arData[1]];
- if (eventHandler.action === "save" || eventHandler.action === "remove") {
- eventHandler.handler(eventHandler.result, JSON.parse(decodeURIComponent(args.result)));
- } else if (eventHandler.action === "find") {
- eventHandler.handler(arData[1], eventHandler, JSON.parse(decodeURIComponent(args.result)));
- }
- }
- };
-
- self.m_id = "";
- self.eventHandlers = {};
-
- self.getInstance = function () {
- if (!hasInstance) {
- self.init();
- hasInstance = true;
- }
- return self;
- };
-};
-
-pimContacts = new JNEXT.PimContacts();
diff --git a/plugins/cordova-plugin-contacts/src/firefoxos/ContactsProxy.js b/plugins/cordova-plugin-contacts/src/firefoxos/ContactsProxy.js
deleted file mode 100644
index 6be8d8c..0000000
--- a/plugins/cordova-plugin-contacts/src/firefoxos/ContactsProxy.js
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Cordova contact definition:
-// http://cordova.apache.org/docs/en/2.5.0/cordova_contacts_contacts.md.html#Contact
-// FxOS contact definition:
-// https://developer.mozilla.org/en-US/docs/Web/API/mozContact
-
-
-var Contact = require('./Contact');
-var ContactField = require('./ContactField');
-var ContactAddress = require('./ContactAddress');
-var ContactName = require('./ContactName');
-
-// XXX: a hack to check if id is "empty". Cordova inserts a
-// string "this string is supposed to be a unique identifier that will
-// never show up on a device" if id is empty
-function _hasId(id) {
- if (!id || id.indexOf(' ') >= 0) {
- return false;
- }
- return true;
-}
-
-// Extend mozContact prototype to provide update from Cordova
-function updateFromCordova(contact, fromContact) {
-
- function exportContactFieldArray(contactFieldArray, key) {
- if (!key) {
- key = 'value';
- }
- var arr = [];
- for (var i=0; i < contactFieldArray.length; i++) {
- arr.push(contactFieldArray[i][key]);
- };
- return arr;
- }
-
- function exportAddress(addresses) {
- // TODO: check moz address format
- var arr = [];
-
- for (var i=0; i < addresses.length; i++) {
- var addr = {};
- for (var key in addresses[i]) {
- if (key == 'formatted' || key == 'id') {
- continue;
- } else if (key == 'type') {
- addr[key] = [addresses[i][key]];
- } else if (key == 'country') {
- addr['countryName'] = addresses[i][key];
- } else {
- addr[key] = addresses[i][key];
- }
- }
- arr.push(addr);
- }
- return arr;
- }
-
- function exportContactField(data) {
- var contactFields = [];
- for (var i=0; i < data.length; i++) {
- var item = data[i];
- if (item.value) {
- var itemData = {value: item.value};
- if (item.type) {
- itemData.type = [item.type];
- }
- if (item.pref) {
- itemData.pref = item.pref;
- }
- contactFields.push(itemData);
- }
- }
- return contactFields;
- }
- // adding simple fields [contactField, eventualMozContactField]
- var nameFields = [['givenName'], ['familyName'],
- ['honorificPrefix'], ['honorificSuffix'],
- ['middleName', 'additionalName']];
- var baseArrayFields = [['displayName', 'name'], ['nickname']];
- var baseStringFields = [];
- var j = 0; while(field = nameFields[j++]) {
- if (fromContact.name[field[0]]) {
- contact[field[1] || field[0]] = fromContact.name[field[0]].split(' ');
- }
- }
- j = 0; while(field = baseArrayFields[j++]) {
- if (fromContact[field[0]]) {
- contact[field[1] || field[0]] = fromContact[field[0]].split(' ');
- }
- }
- j = 0; while(field = baseStringFields[j++]) {
- if (fromContact[field[0]]) {
- contact[field[1] || field[0]] = fromContact[field[0]];
- }
- }
- if (fromContact.birthday) {
- contact.bday = new Date(fromContact.birthday);
- }
- if (fromContact.emails) {
- var emails = exportContactField(fromContact.emails)
- contact.email = emails;
- }
- if (fromContact.categories) {
- contact.category = exportContactFieldArray(fromContact.categories);
- }
- if (fromContact.addresses) {
- contact.adr = exportAddress(fromContact.addresses);
- }
- if (fromContact.phoneNumbers) {
- contact.tel = exportContactField(fromContact.phoneNumbers);
- }
- if (fromContact.organizations) {
- // XXX: organizations are saved in 2 arrays - org and jobTitle
- // depending on the usecase it might generate issues
- // where wrong title will be added to an organization
- contact.org = exportContactFieldArray(fromContact.organizations, 'name');
- contact.jobTitle = exportContactFieldArray(fromContact.organizations, 'title');
- }
- if (fromContact.note) {
- contact.note = [fromContact.note];
- }
-}
-
-
-// Extend Cordova Contact prototype to provide update from FFOS contact
-Contact.prototype.updateFromMozilla = function(moz) {
- function exportContactField(data) {
- var contactFields = [];
- for (var i=0; i < data.length; i++) {
- var item = data[i];
- var itemData = new ContactField(item.type, item.value, item.pref);
- contactFields.push(itemData);
- }
- return contactFields;
- }
-
- function makeContactFieldFromArray(data) {
- var contactFields = [];
- for (var i=0; i < data.length; i++) {
- var itemData = new ContactField(null, data[i]);
- contactFields.push(itemData);
- }
- return contactFields;
- }
-
- function exportAddresses(addresses) {
- // TODO: check moz address format
- var arr = [];
-
- for (var i=0; i < addresses.length; i++) {
- var addr = {};
- for (var key in addresses[i]) {
- if (key == 'countryName') {
- addr['country'] = addresses[i][key];
- } else if (key == 'type') {
- addr[key] = addresses[i][key].join(' ');
- } else {
- addr[key] = addresses[i][key];
- }
- }
- arr.push(addr);
- }
- return arr;
- }
-
- function createOrganizations(orgs, jobs) {
- orgs = (orgs) ? orgs : [];
- jobs = (jobs) ? jobs : [];
- var max_length = Math.max(orgs.length, jobs.length);
- var organizations = [];
- for (var i=0; i < max_length; i++) {
- organizations.push(new ContactOrganization(
- null, null, orgs[i] || null, null, jobs[i] || null));
- }
- return organizations;
- }
-
- function createFormatted(name) {
- var fields = ['honorificPrefix', 'givenName', 'middleName',
- 'familyName', 'honorificSuffix'];
- var f = '';
- for (var i = 0; i < fields.length; i++) {
- if (name[fields[i]]) {
- if (f) {
- f += ' ';
- }
- f += name[fields[i]];
- }
- }
- return f;
- }
-
-
- if (moz.id) {
- this.id = moz.id;
- }
- var nameFields = [['givenName'], ['familyName'],
- ['honorificPrefix'], ['honorificSuffix'],
- ['additionalName', 'middleName']];
- var baseArrayFields = [['name', 'displayName'], 'nickname', ['note']];
- var baseStringFields = [];
- var name = new ContactName();
- var j = 0; while(field = nameFields[j++]) {
- if (moz[field[0]]) {
- name[field[1] || field[0]] = moz[field[0]].join(' ');
- }
- }
- this.name = name;
- j = 0; while(field = baseArrayFields[j++]) {
- if (moz[field[0]]) {
- this[field[1] || field[0]] = moz[field[0]].join(' ');
- }
- }
- j = 0; while(field = baseStringFields[j++]) {
- if (moz[field[0]]) {
- this[field[1] || field[0]] = moz[field[0]];
- }
- }
- // emails
- if (moz.email) {
- this.emails = exportContactField(moz.email);
- }
- // categories
- if (moz.category) {
- this.categories = makeContactFieldFromArray(moz.category);
- }
-
- // addresses
- if (moz.adr) {
- this.addresses = exportAddresses(moz.adr);
- }
-
- // phoneNumbers
- if (moz.tel) {
- this.phoneNumbers = exportContactField(moz.tel);
- }
- // birthday
- if (moz.bday) {
- this.birthday = Date.parse(moz.bday);
- }
- // organizations
- if (moz.org || moz.jobTitle) {
- // XXX: organizations array is created from org and jobTitle
- this.organizations = createOrganizations(moz.org, moz.jobTitle);
- }
- // construct a read-only formatted value
- this.name.formatted = createFormatted(this.name);
-
- /* Find out how to translate these parameters
- // photo: Blob
- // url: Array with metadata (?)
- // impp: exportIM(contact.ims), TODO: find the moz impp definition
- // anniversary
- // sex
- // genderIdentity
- // key
- */
-}
-
-
-function createMozillaFromCordova(successCB, errorCB, contact) {
- var moz;
- // get contact if exists
- if (_hasId(contact.id)) {
- var search = navigator.mozContacts.find({
- filterBy: ['id'], filterValue: contact.id, filterOp: 'equals'});
- search.onsuccess = function() {
- moz = search.result[0];
- updateFromCordova(moz, contact);
- successCB(moz);
- };
- search.onerror = errorCB;
- return;
- }
-
- // create empty contact
- moz = new mozContact();
- // if ('init' in moz) {
- // 1.2 and below compatibility
- // moz.init();
- // }
- updateFromCordova(moz, contact);
- successCB(moz);
-}
-
-
-function createCordovaFromMozilla(moz) {
- var contact = new Contact();
- contact.updateFromMozilla(moz);
- return contact;
-}
-
-
-// However API requires the ability to save multiple contacts, it is
-// used to save only one element array
-function saveContacts(successCB, errorCB, contacts) {
- // a closure which is holding the right moz contact
- function makeSaveSuccessCB(moz) {
- return function(result) {
- // create contact from FXOS contact (might be different than
- // the original one due to differences in API)
- var contact = createCordovaFromMozilla(moz);
- // call callback
- successCB(contact);
- }
- }
- var i=0;
- var contact;
- while(contact = contacts[i++]){
- var moz = createMozillaFromCordova(function(moz) {
- var request = navigator.mozContacts.save(moz);
- // success and/or fail will be called every time a contact is saved
- request.onsuccess = makeSaveSuccessCB(moz);
- request.onerror = errorCB;
- }, function() {}, contact);
- }
-}
-
-
-// API provides a list of ids to be removed
-function remove(successCB, errorCB, ids) {
- var i=0;
- var id;
- for (var i=0; i < ids.length; i++){
- // throw an error if no id provided
- if (!_hasId(ids[i])) {
- console.error('FFOS: Attempt to remove unsaved contact');
- errorCB(0);
- return;
- }
- // check if provided id actually exists
- var search = navigator.mozContacts.find({
- filterBy: ['id'], filterValue: ids[i], filterOp: 'equals'});
- search.onsuccess = function() {
- if (search.result.length === 0) {
- console.error('FFOS: Attempt to remove a non existing contact');
- errorCB(0);
- return;
- }
- var moz = search.result[0];
- var request = navigator.mozContacts.remove(moz);
- request.onsuccess = successCB;
- request.onerror = errorCB;
- };
- search.onerror = errorCB;
- }
-}
-
-
-var mozContactSearchFields = [['name', 'displayName'], ['givenName'],
- ['familyName'], ['email'], ['tel'], ['jobTitle'], ['note'],
- ['tel', 'phoneNumbers'], ['email', 'emails']];
-// Searching by nickname and additionalName is forbidden in 1.3 and below
-// Searching by name is forbidden in 1.2 and below
-
-// finds if a key is allowed and returns FFOS name if different
-function getMozSearchField(key) {
- if (mozContactSearchFields.indexOf([key]) >= 0) {
- return key;
- }
- for (var i=0; i < mozContactSearchFields.length; i++) {
- if (mozContactSearchFields[i].length > 1) {
- if (mozContactSearchFields[i][1] === key) {
- return mozContactSearchFields[i][0];
- }
- }
- }
- return false;
-}
-
-
-function _getAll(successCB, errorCB, params) {
- // [contactField, eventualMozContactField]
- var getall = navigator.mozContacts.getAll({});
- var contacts = [];
-
- getall.onsuccess = function() {
- if (getall.result) {
- contacts.push(createCordovaFromMozilla(getall.result));
- getall.continue();
- } else {
- successCB(contacts);
- }
- };
- getall.onerror = errorCB;
-}
-
-
-function search(successCB, errorCB, params) {
- var options = params[1] || {};
- if (!options.filter) {
- return _getAll(successCB, errorCB, params);
- }
- var filterBy = [];
- // filter and translate fields
- for (var i=0; i < params[0].length; i++) {
- var searchField = params[0][i];
- var mozField = getMozSearchField(searchField);
- if (searchField === 'name') {
- // Cordova uses name for search by all name fields.
- filterBy.push('givenName');
- filterBy.push('familyName');
- continue;
- }
- if (searchField === 'displayName' && 'init' in new mozContact()) {
- // ``init`` in ``mozContact`` indicates FFOS version 1.2 or below
- // Searching by name (in moz) is then forbidden
- console.log('FFOS ContactProxy: Unable to search by displayName on FFOS 1.2');
- continue;
- }
- if (mozField) {
- filterBy.push(mozField);
- } else {
- console.log('FXOS ContactProxy: inallowed field passed to search filtered out: ' + searchField);
- }
- }
-
- var mozOptions = {filterBy: filterBy, filterOp: 'startsWith'};
- if (!options.multiple) {
- mozOptions.filterLimit = 1;
- }
- mozOptions.filterValue = options.filter;
- var request = navigator.mozContacts.find(mozOptions);
- request.onsuccess = function() {
- var contacts = [];
- var mozContacts = request.result;
- var moz = mozContacts[0];
- for (var i=0; i < mozContacts.length; i++) {
- contacts.push(createCordovaFromMozilla(mozContacts[i]));
- }
- successCB(contacts);
- };
- request.onerror = errorCB;
-}
-
-
-module.exports = {
- save: saveContacts,
- remove: remove,
- search: search
-};
-
-require("cordova/exec/proxy").add("Contacts", module.exports);
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/src/ios/CDVContact.h b/plugins/cordova-plugin-contacts/src/ios/CDVContact.h
deleted file mode 100644
index 47aa764..0000000
--- a/plugins/cordova-plugin-contacts/src/ios/CDVContact.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import
-
-enum CDVContactError {
- UNKNOWN_ERROR = 0,
- INVALID_ARGUMENT_ERROR = 1,
- TIMEOUT_ERROR = 2,
- PENDING_OPERATION_ERROR = 3,
- IO_ERROR = 4,
- NOT_SUPPORTED_ERROR = 5,
- OPERATION_CANCELLED_ERROR = 6,
- PERMISSION_DENIED_ERROR = 20
-};
-typedef NSUInteger CDVContactError;
-
-@interface CDVContact : NSObject {
- ABRecordRef record; // the ABRecord associated with this contact
- NSDictionary* returnFields; // dictionary of fields to return when performing search
-}
-
-@property (nonatomic, assign) ABRecordRef record;
-@property (nonatomic, strong) NSDictionary* returnFields;
-
-+ (NSDictionary*)defaultABtoW3C;
-+ (NSDictionary*)defaultW3CtoAB;
-+ (NSSet*)defaultW3CtoNull;
-+ (NSDictionary*)defaultObjectAndProperties;
-+ (NSDictionary*)defaultFields;
-
-+ (NSDictionary*)calcReturnFields:(NSArray*)fields;
-- (id)init;
-- (id)initFromABRecord:(ABRecordRef)aRecord;
-- (bool)setFromContactDict:(NSDictionary*)aContact asUpdate:(BOOL)bUpdate;
-
-+ (BOOL)needsConversion:(NSString*)W3Label;
-+ (CFStringRef)convertContactTypeToPropertyLabel:(NSString*)label;
-+ (NSString*)convertPropertyLabelToContactType:(NSString*)label;
-+ (BOOL)isValidW3ContactType:(NSString*)label;
-- (bool)setValue:(id)aValue forProperty:(ABPropertyID)aProperty inRecord:(ABRecordRef)aRecord asUpdate:(BOOL)bUpdate;
-
-- (NSDictionary*)toDictionary:(NSDictionary*)withFields;
-- (NSNumber*)getDateAsNumber:(ABPropertyID)datePropId;
-- (NSObject*)extractName;
-- (NSObject*)extractMultiValue:(NSString*)propertyId;
-- (NSObject*)extractAddresses;
-- (NSObject*)extractIms;
-- (NSObject*)extractOrganizations;
-- (NSObject*)extractPhotos;
-
-- (NSMutableDictionary*)translateW3Dict:(NSDictionary*)dict forProperty:(ABPropertyID)prop;
-- (bool)setMultiValueStrings:(NSArray*)fieldArray forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person asUpdate:(BOOL)bUpdate;
-- (bool)setMultiValueDictionary:(NSArray*)array forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person asUpdate:(BOOL)bUpdate;
-- (ABMultiValueRef)allocStringMultiValueFromArray:array;
-- (ABMultiValueRef)allocDictMultiValueFromArray:array forProperty:(ABPropertyID)prop;
-- (BOOL)foundValue:(NSString*)testValue inFields:(NSDictionary*)searchFields;
-- (BOOL)testStringValue:(NSString*)testValue forW3CProperty:(NSString*)property;
-- (BOOL)testDateValue:(NSString*)testValue forW3CProperty:(NSString*)property;
-- (BOOL)searchContactFields:(NSArray*)fields forMVStringProperty:(ABPropertyID)propId withValue:testValue;
-- (BOOL)testMultiValueStrings:(NSString*)testValue forProperty:(ABPropertyID)propId ofType:(NSString*)type;
-- (NSArray*)valuesForProperty:(ABPropertyID)propId inRecord:(ABRecordRef)aRecord;
-- (NSArray*)labelsForProperty:(ABPropertyID)propId inRecord:(ABRecordRef)aRecord;
-- (BOOL)searchContactFields:(NSArray*)fields forMVDictionaryProperty:(ABPropertyID)propId withValue:(NSString*)testValue;
-
-@end
-
-// generic ContactField types
-#define kW3ContactFieldType @"type"
-#define kW3ContactFieldValue @"value"
-#define kW3ContactFieldPrimary @"pref"
-// Various labels for ContactField types
-#define kW3ContactWorkLabel @"work"
-#define kW3ContactHomeLabel @"home"
-#define kW3ContactOtherLabel @"other"
-#define kW3ContactPhoneFaxLabel @"fax"
-#define kW3ContactPhoneMobileLabel @"mobile"
-#define kW3ContactPhonePagerLabel @"pager"
-#define kW3ContactUrlBlog @"blog"
-#define kW3ContactUrlProfile @"profile"
-#define kW3ContactImAIMLabel @"aim"
-#define kW3ContactImICQLabel @"icq"
-#define kW3ContactImMSNLabel @"msn"
-#define kW3ContactImYahooLabel @"yahoo"
-#define kW3ContactFieldId @"id"
-// special translation for IM field value and type
-#define kW3ContactImType @"type"
-#define kW3ContactImValue @"value"
-
-// Contact object
-#define kW3ContactId @"id"
-#define kW3ContactName @"name"
-#define kW3ContactFormattedName @"formatted"
-#define kW3ContactGivenName @"givenName"
-#define kW3ContactFamilyName @"familyName"
-#define kW3ContactMiddleName @"middleName"
-#define kW3ContactHonorificPrefix @"honorificPrefix"
-#define kW3ContactHonorificSuffix @"honorificSuffix"
-#define kW3ContactDisplayName @"displayName"
-#define kW3ContactNickname @"nickname"
-#define kW3ContactPhoneNumbers @"phoneNumbers"
-#define kW3ContactAddresses @"addresses"
-#define kW3ContactAddressFormatted @"formatted"
-#define kW3ContactStreetAddress @"streetAddress"
-#define kW3ContactLocality @"locality"
-#define kW3ContactRegion @"region"
-#define kW3ContactPostalCode @"postalCode"
-#define kW3ContactCountry @"country"
-#define kW3ContactEmails @"emails"
-#define kW3ContactIms @"ims"
-#define kW3ContactOrganizations @"organizations"
-#define kW3ContactOrganizationName @"name"
-#define kW3ContactTitle @"title"
-#define kW3ContactDepartment @"department"
-#define kW3ContactBirthday @"birthday"
-#define kW3ContactNote @"note"
-#define kW3ContactPhotos @"photos"
-#define kW3ContactCategories @"categories"
-#define kW3ContactUrls @"urls"
diff --git a/plugins/cordova-plugin-contacts/src/ios/CDVContact.m b/plugins/cordova-plugin-contacts/src/ios/CDVContact.m
deleted file mode 100644
index a1dd85d..0000000
--- a/plugins/cordova-plugin-contacts/src/ios/CDVContact.m
+++ /dev/null
@@ -1,1781 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVContact.h"
-
-#define DATE_OR_NULL(dateObj) ((aDate != nil) ? (id)([aDate descriptionWithLocale:[NSLocale currentLocale]]) : (id)([NSNull null]))
-#define IS_VALID_VALUE(value) ((value != nil) && (![value isKindOfClass:[NSNull class]]))
-
-static NSDictionary* org_apache_cordova_contacts_W3CtoAB = nil;
-static NSDictionary* org_apache_cordova_contacts_ABtoW3C = nil;
-static NSSet* org_apache_cordova_contacts_W3CtoNull = nil;
-static NSDictionary* org_apache_cordova_contacts_objectAndProperties = nil;
-static NSDictionary* org_apache_cordova_contacts_defaultFields = nil;
-
-@implementation CDVContact : NSObject
-
- @synthesize returnFields;
-
-- (id)init
-{
- if ((self = [super init]) != nil) {
- ABRecordRef rec = ABPersonCreate();
- self.record = rec;
- if (rec) {
- CFRelease(rec);
- }
- }
- return self;
-}
-
-- (id)initFromABRecord:(ABRecordRef)aRecord
-{
- if ((self = [super init]) != nil) {
- self.record = aRecord;
- }
- return self;
-}
-
-/* synthesize 'record' ourselves to have retain properties for CF types */
-
-- (void)setRecord:(ABRecordRef)aRecord
-{
- if (record != NULL) {
- CFRelease(record);
- }
- if (aRecord != NULL) {
- record = CFRetain(aRecord);
- }
-}
-
-- (ABRecordRef)record
-{
- return record;
-}
-
-/* Rather than creating getters and setters for each AddressBook (AB) Property, generic methods are used to deal with
- * simple properties, MultiValue properties( phone numbers and emails) and MultiValueDictionary properties (Ims and addresses).
- * The dictionaries below are used to translate between the W3C identifiers and the AB properties. Using the dictionaries,
- * allows looping through sets of properties to extract from or set into the W3C dictionary to/from the ABRecord.
- */
-
-/* The two following dictionaries translate between W3C properties and AB properties. It currently mixes both
- * Properties (kABPersonAddressProperty for example) and Strings (kABPersonAddressStreetKey) so users should be aware of
- * what types of values are expected.
- * a bit.
-*/
-+ (NSDictionary*)defaultABtoW3C
-{
- if (org_apache_cordova_contacts_ABtoW3C == nil) {
- org_apache_cordova_contacts_ABtoW3C = [NSDictionary dictionaryWithObjectsAndKeys:
- kW3ContactNickname, [NSNumber numberWithInt:kABPersonNicknameProperty],
- kW3ContactGivenName, [NSNumber numberWithInt:kABPersonFirstNameProperty],
- kW3ContactFamilyName, [NSNumber numberWithInt:kABPersonLastNameProperty],
- kW3ContactMiddleName, [NSNumber numberWithInt:kABPersonMiddleNameProperty],
- kW3ContactHonorificPrefix, [NSNumber numberWithInt:kABPersonPrefixProperty],
- kW3ContactHonorificSuffix, [NSNumber numberWithInt:kABPersonSuffixProperty],
- kW3ContactPhoneNumbers, [NSNumber numberWithInt:kABPersonPhoneProperty],
- kW3ContactAddresses, [NSNumber numberWithInt:kABPersonAddressProperty],
- kW3ContactStreetAddress, kABPersonAddressStreetKey,
- kW3ContactLocality, kABPersonAddressCityKey,
- kW3ContactRegion, kABPersonAddressStateKey,
- kW3ContactPostalCode, kABPersonAddressZIPKey,
- kW3ContactCountry, kABPersonAddressCountryKey,
- kW3ContactEmails, [NSNumber numberWithInt:kABPersonEmailProperty],
- kW3ContactIms, [NSNumber numberWithInt:kABPersonInstantMessageProperty],
- kW3ContactOrganizations, [NSNumber numberWithInt:kABPersonOrganizationProperty],
- kW3ContactOrganizationName, [NSNumber numberWithInt:kABPersonOrganizationProperty],
- kW3ContactTitle, [NSNumber numberWithInt:kABPersonJobTitleProperty],
- kW3ContactDepartment, [NSNumber numberWithInt:kABPersonDepartmentProperty],
- kW3ContactBirthday, [NSNumber numberWithInt:kABPersonBirthdayProperty],
- kW3ContactUrls, [NSNumber numberWithInt:kABPersonURLProperty],
- kW3ContactNote, [NSNumber numberWithInt:kABPersonNoteProperty],
- nil];
- }
-
- return org_apache_cordova_contacts_ABtoW3C;
-}
-
-+ (NSDictionary*)defaultW3CtoAB
-{
- if (org_apache_cordova_contacts_W3CtoAB == nil) {
- org_apache_cordova_contacts_W3CtoAB = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:kABPersonNicknameProperty], kW3ContactNickname,
- [NSNumber numberWithInt:kABPersonFirstNameProperty], kW3ContactGivenName,
- [NSNumber numberWithInt:kABPersonLastNameProperty], kW3ContactFamilyName,
- [NSNumber numberWithInt:kABPersonMiddleNameProperty], kW3ContactMiddleName,
- [NSNumber numberWithInt:kABPersonPrefixProperty], kW3ContactHonorificPrefix,
- [NSNumber numberWithInt:kABPersonSuffixProperty], kW3ContactHonorificSuffix,
- [NSNumber numberWithInt:kABPersonPhoneProperty], kW3ContactPhoneNumbers,
- [NSNumber numberWithInt:kABPersonAddressProperty], kW3ContactAddresses,
- kABPersonAddressStreetKey, kW3ContactStreetAddress,
- kABPersonAddressCityKey, kW3ContactLocality,
- kABPersonAddressStateKey, kW3ContactRegion,
- kABPersonAddressZIPKey, kW3ContactPostalCode,
- kABPersonAddressCountryKey, kW3ContactCountry,
- [NSNumber numberWithInt:kABPersonEmailProperty], kW3ContactEmails,
- [NSNumber numberWithInt:kABPersonInstantMessageProperty], kW3ContactIms,
- [NSNumber numberWithInt:kABPersonOrganizationProperty], kW3ContactOrganizations,
- [NSNumber numberWithInt:kABPersonJobTitleProperty], kW3ContactTitle,
- [NSNumber numberWithInt:kABPersonDepartmentProperty], kW3ContactDepartment,
- [NSNumber numberWithInt:kABPersonBirthdayProperty], kW3ContactBirthday,
- [NSNumber numberWithInt:kABPersonNoteProperty], kW3ContactNote,
- [NSNumber numberWithInt:kABPersonURLProperty], kW3ContactUrls,
- kABPersonInstantMessageUsernameKey, kW3ContactImValue,
- kABPersonInstantMessageServiceKey, kW3ContactImType,
- [NSNull null], kW3ContactFieldType, /* include entries in dictionary to indicate ContactField properties */
- [NSNull null], kW3ContactFieldValue,
- [NSNull null], kW3ContactFieldPrimary,
- [NSNull null], kW3ContactFieldId,
- [NSNumber numberWithInt:kABPersonOrganizationProperty], kW3ContactOrganizationName, /* careful, name is used multiple times*/
- nil];
- }
- return org_apache_cordova_contacts_W3CtoAB;
-}
-
-+ (NSSet*)defaultW3CtoNull
-{
- // these are values that have no AddressBook Equivalent OR have not been implemented yet
- if (org_apache_cordova_contacts_W3CtoNull == nil) {
- org_apache_cordova_contacts_W3CtoNull = [NSSet setWithObjects:kW3ContactDisplayName,
- kW3ContactCategories, kW3ContactFormattedName, nil];
- }
- return org_apache_cordova_contacts_W3CtoNull;
-}
-
-/*
- * The objectAndProperties dictionary contains the all of the properties of the W3C Contact Objects specified by the key
- * Used in calcReturnFields, and various extract methods
- */
-+ (NSDictionary*)defaultObjectAndProperties
-{
- if (org_apache_cordova_contacts_objectAndProperties == nil) {
- org_apache_cordova_contacts_objectAndProperties = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSArray arrayWithObjects:kW3ContactGivenName, kW3ContactFamilyName,
- kW3ContactMiddleName, kW3ContactHonorificPrefix, kW3ContactHonorificSuffix, kW3ContactFormattedName, nil], kW3ContactName,
- [NSArray arrayWithObjects:kW3ContactStreetAddress, kW3ContactLocality, kW3ContactRegion,
- kW3ContactPostalCode, kW3ContactCountry, /*kW3ContactAddressFormatted,*/ nil], kW3ContactAddresses,
- [NSArray arrayWithObjects:kW3ContactOrganizationName, kW3ContactTitle, kW3ContactDepartment, nil], kW3ContactOrganizations,
- [NSArray arrayWithObjects:kW3ContactFieldType, kW3ContactFieldValue, kW3ContactFieldPrimary, nil], kW3ContactPhoneNumbers,
- [NSArray arrayWithObjects:kW3ContactFieldType, kW3ContactFieldValue, kW3ContactFieldPrimary, nil], kW3ContactEmails,
- [NSArray arrayWithObjects:kW3ContactFieldType, kW3ContactFieldValue, kW3ContactFieldPrimary, nil], kW3ContactPhotos,
- [NSArray arrayWithObjects:kW3ContactFieldType, kW3ContactFieldValue, kW3ContactFieldPrimary, nil], kW3ContactUrls,
- [NSArray arrayWithObjects:kW3ContactImValue, kW3ContactImType, nil], kW3ContactIms,
- nil];
- }
- return org_apache_cordova_contacts_objectAndProperties;
-}
-
-+ (NSDictionary*)defaultFields
-{
- if (org_apache_cordova_contacts_defaultFields == nil) {
- org_apache_cordova_contacts_defaultFields = [NSDictionary dictionaryWithObjectsAndKeys:
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactName], kW3ContactName,
- [NSNull null], kW3ContactNickname,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactAddresses], kW3ContactAddresses,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactOrganizations], kW3ContactOrganizations,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactPhoneNumbers], kW3ContactPhoneNumbers,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactEmails], kW3ContactEmails,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactIms], kW3ContactIms,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactPhotos], kW3ContactPhotos,
- [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactUrls], kW3ContactUrls,
- [NSNull null], kW3ContactBirthday,
- [NSNull null], kW3ContactNote,
- nil];
- }
- return org_apache_cordova_contacts_defaultFields;
-}
-
-/* Translate W3C Contact data into ABRecordRef
- *
- * New contact information comes in as a NSMutableDictionary. All Null entries in Contact object are set
- * as [NSNull null] in the dictionary when translating from the JSON input string of Contact data. However, if
- * user did not set a value within a Contact object or sub-object (by not using the object constructor) some data
- * may not exist.
- * bUpdate = YES indicates this is a save of an existing record
- */
-- (bool)setFromContactDict:(NSDictionary*)aContact asUpdate:(BOOL)bUpdate
-{
- if (![aContact isKindOfClass:[NSDictionary class]]) {
- return FALSE; // can't do anything if no dictionary!
- }
-
- ABRecordRef person = self.record;
- bool bSuccess = TRUE;
- CFErrorRef error;
-
- // set name info
- // iOS doesn't have displayName - might have to pull parts from it to create name
- bool bName = false;
- NSDictionary* dict = [aContact valueForKey:kW3ContactName];
- if ([dict isKindOfClass:[NSDictionary class]]) {
- bName = true;
- NSArray* propArray = [[CDVContact defaultObjectAndProperties] objectForKey:kW3ContactName];
-
- for (id i in propArray) {
- if (![(NSString*)i isEqualToString : kW3ContactFormattedName]) { // kW3ContactFormattedName is generated from ABRecordCopyCompositeName() and can't be set
- [self setValue:[dict valueForKey:i] forProperty:(ABPropertyID)[(NSNumber*)[[CDVContact defaultW3CtoAB] objectForKey:i] intValue]
- inRecord:person asUpdate:bUpdate];
- }
- }
- }
-
- id nn = [aContact valueForKey:kW3ContactNickname];
- if (![nn isKindOfClass:[NSNull class]]) {
- bName = true;
- [self setValue:nn forProperty:kABPersonNicknameProperty inRecord:person asUpdate:bUpdate];
- }
- if (!bName) {
- // if no name or nickname - try and use displayName as W3Contact must have displayName or ContactName
- [self setValue:[aContact valueForKey:kW3ContactDisplayName] forProperty:kABPersonNicknameProperty
- inRecord:person asUpdate:bUpdate];
- }
-
- // set phoneNumbers
- // NSLog(@"setting phoneNumbers");
- NSArray* array = [aContact valueForKey:kW3ContactPhoneNumbers];
- if ([array isKindOfClass:[NSArray class]]) {
- [self setMultiValueStrings:array forProperty:kABPersonPhoneProperty inRecord:person asUpdate:bUpdate];
- }
- // set Emails
- // NSLog(@"setting emails");
- array = [aContact valueForKey:kW3ContactEmails];
- if ([array isKindOfClass:[NSArray class]]) {
- [self setMultiValueStrings:array forProperty:kABPersonEmailProperty inRecord:person asUpdate:bUpdate];
- }
- // set Urls
- // NSLog(@"setting urls");
- array = [aContact valueForKey:kW3ContactUrls];
- if ([array isKindOfClass:[NSArray class]]) {
- [self setMultiValueStrings:array forProperty:kABPersonURLProperty inRecord:person asUpdate:bUpdate];
- }
-
- // set multivalue dictionary properties
- // set addresses: streetAddress, locality, region, postalCode, country
- // set ims: value = username, type = servicetype
- // iOS addresses and im are a MultiValue Properties with label, value=dictionary of info, and id
- // NSLog(@"setting addresses");
- error = nil;
- array = [aContact valueForKey:kW3ContactAddresses];
- if ([array isKindOfClass:[NSArray class]]) {
- [self setMultiValueDictionary:array forProperty:kABPersonAddressProperty inRecord:person asUpdate:bUpdate];
- }
- // ims
- // NSLog(@"setting ims");
- array = [aContact valueForKey:kW3ContactIms];
- if ([array isKindOfClass:[NSArray class]]) {
- [self setMultiValueDictionary:array forProperty:kABPersonInstantMessageProperty inRecord:person asUpdate:bUpdate];
- }
-
- // organizations
- // W3C ContactOrganization has pref, type, name, title, department
- // iOS only supports name, title, department
- // NSLog(@"setting organizations");
- // TODO this may need work - should Organization information be removed when array is empty??
- array = [aContact valueForKey:kW3ContactOrganizations]; // iOS only supports one organization - use first one
- if ([array isKindOfClass:[NSArray class]]) {
- BOOL bRemove = NO;
- NSDictionary* dict = nil;
- if ([array count] > 0) {
- dict = [array objectAtIndex:0];
- } else {
- // remove the organization info entirely
- bRemove = YES;
- }
- if ([dict isKindOfClass:[NSDictionary class]] || (bRemove == YES)) {
- [self setValue:(bRemove ? @"" : [dict valueForKey:@"name"]) forProperty:kABPersonOrganizationProperty inRecord:person asUpdate:bUpdate];
- [self setValue:(bRemove ? @"" : [dict valueForKey:kW3ContactTitle]) forProperty:kABPersonJobTitleProperty inRecord:person asUpdate:bUpdate];
- [self setValue:(bRemove ? @"" : [dict valueForKey:kW3ContactDepartment]) forProperty:kABPersonDepartmentProperty inRecord:person asUpdate:bUpdate];
- }
- }
- // add dates
- // Dates come in as milliseconds in NSNumber Object
- id ms = [aContact valueForKey:kW3ContactBirthday];
- NSDate* aDate = nil;
- if (ms && [ms isKindOfClass:[NSNumber class]]) {
- double msValue = [ms doubleValue];
- msValue = msValue / 1000;
- aDate = [NSDate dateWithTimeIntervalSince1970:msValue];
- }
- if ((aDate != nil) || [ms isKindOfClass:[NSString class]]) {
- [self setValue:aDate != nil ? aDate:ms forProperty:kABPersonBirthdayProperty inRecord:person asUpdate:bUpdate];
- }
- // don't update creation date
- // modification date will get updated when save
- // anniversary is removed from W3C Contact api Dec 9, 2010 spec - don't waste time on it yet
-
- // kABPersonDateProperty
-
- // kABPersonAnniversaryLabel
-
- // iOS doesn't have gender - ignore
- // note
- [self setValue:[aContact valueForKey:kW3ContactNote] forProperty:kABPersonNoteProperty inRecord:person asUpdate:bUpdate];
-
- // iOS doesn't have preferredName- ignore
-
- // photo
- array = [aContact valueForKey:kW3ContactPhotos];
- if ([array isKindOfClass:[NSArray class]]) {
- if (bUpdate && ([array count] == 0)) {
- // remove photo
- bSuccess = ABPersonRemoveImageData(person, &error);
- } else if ([array count] > 0) {
- NSDictionary* dict = [array objectAtIndex:0]; // currently only support one photo
- if ([dict isKindOfClass:[NSDictionary class]]) {
- id value = [dict objectForKey:kW3ContactFieldValue];
- if ([value isKindOfClass:[NSString class]]) {
- if (bUpdate && ([value length] == 0)) {
- // remove the current image
- bSuccess = ABPersonRemoveImageData(person, &error);
- } else {
- // use this image
- // don't know if string is encoded or not so first unencode it then encode it again
- NSString* cleanPath = [value stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSURL* photoUrl = [NSURL URLWithString:[cleanPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
- // caller is responsible for checking for a connection, if no connection this will fail
- NSError* err = nil;
- NSData* data = nil;
- if (photoUrl) {
- data = [NSData dataWithContentsOfURL:photoUrl options:NSDataReadingUncached error:&err];
- }
- if (data && ([data length] > 0)) {
- bSuccess = ABPersonSetImageData(person, (__bridge CFDataRef)data, &error);
- }
- if (!data || !bSuccess) {
- NSLog(@"error setting contact image: %@", (err != nil ? [err localizedDescription] : @""));
- }
- }
- }
- }
- }
- }
-
- // TODO WebURLs
-
- // TODO timezone
-
- return bSuccess;
-}
-
-/* Set item into an AddressBook Record for the specified property.
- * aValue - the value to set into the address book (code checks for null or [NSNull null]
- * aProperty - AddressBook property ID
- * aRecord - the record to update
- * bUpdate - whether this is a possible update vs a new entry
- * RETURN
- * true - property was set (or input value as null)
- * false - property was not set
- */
-- (bool)setValue:(id)aValue forProperty:(ABPropertyID)aProperty inRecord:(ABRecordRef)aRecord asUpdate:(BOOL)bUpdate
-{
- bool bSuccess = true; // if property was null, just ignore and return success
- CFErrorRef error;
-
- if (aValue && ![aValue isKindOfClass:[NSNull class]]) {
- if (bUpdate && ([aValue isKindOfClass:[NSString class]] && ([aValue length] == 0))) { // if updating, empty string means to delete
- aValue = NULL;
- } // really only need to set if different - more efficient to just update value or compare and only set if necessary???
- bSuccess = ABRecordSetValue(aRecord, aProperty, (__bridge CFTypeRef)aValue, &error);
- if (!bSuccess) {
- NSLog(@"error setting %d property", aProperty);
- }
- }
-
- return bSuccess;
-}
-
-- (bool)removeProperty:(ABPropertyID)aProperty inRecord:(ABRecordRef)aRecord
-{
- CFErrorRef err;
- bool bSuccess = ABRecordRemoveValue(aRecord, aProperty, &err);
-
- if (!bSuccess) {
- CFStringRef errDescription = CFErrorCopyDescription(err);
- NSLog(@"Unable to remove property %d: %@", aProperty, errDescription);
- CFRelease(errDescription);
- }
- return bSuccess;
-}
-
-- (bool)addToMultiValue:(ABMultiValueRef)multi fromDictionary:dict
-{
- bool bSuccess = FALSE;
- id value = [dict valueForKey:kW3ContactFieldValue];
-
- if (IS_VALID_VALUE(value)) {
- CFStringRef label = [CDVContact convertContactTypeToPropertyLabel:[dict valueForKey:kW3ContactFieldType]];
- bSuccess = ABMultiValueAddValueAndLabel(multi, (__bridge CFTypeRef)value, label, NULL);
- if (!bSuccess) {
- NSLog(@"Error setting Value: %@ and label: %@", value, label);
- }
- }
- return bSuccess;
-}
-
-- (ABMultiValueRef)allocStringMultiValueFromArray:array
-{
- ABMutableMultiValueRef multi = ABMultiValueCreateMutable(kABMultiStringPropertyType);
-
- for (NSDictionary* dict in array) {
- [self addToMultiValue:multi fromDictionary:dict];
- }
-
- return multi; // caller is responsible for releasing multi
-}
-
-- (bool)setValue:(CFTypeRef)value forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person
-{
- CFErrorRef error;
- bool bSuccess = ABRecordSetValue(person, prop, value, &error);
-
- if (!bSuccess) {
- NSLog(@"Error setting value for property: %d", prop);
- }
- return bSuccess;
-}
-
-/* Set MultiValue string properties into Address Book Record.
- * NSArray* fieldArray - array of dictionaries containing W3C properties to be set into record
- * ABPropertyID prop - the property to be set (generally used for phones and emails)
- * ABRecordRef person - the record to set values into
- * BOOL bUpdate - whether or not to update date or set as new.
- * When updating:
- * empty array indicates to remove entire property
- * empty string indicates to remove
- * [NSNull null] do not modify (keep existing record value)
- * RETURNS
- * bool false indicates error
- *
- * used for phones and emails
- */
-- (bool)setMultiValueStrings:(NSArray*)fieldArray forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person asUpdate:(BOOL)bUpdate
-{
- bool bSuccess = TRUE;
- ABMutableMultiValueRef multi = nil;
-
- if (!bUpdate) {
- multi = [self allocStringMultiValueFromArray:fieldArray];
- bSuccess = [self setValue:multi forProperty:prop inRecord:person];
- } else if (bUpdate && ([fieldArray count] == 0)) {
- // remove entire property
- bSuccess = [self removeProperty:prop inRecord:person];
- } else { // check for and apply changes
- ABMultiValueRef copy = ABRecordCopyValue(person, prop);
- if (copy != nil) {
- multi = ABMultiValueCreateMutableCopy(copy);
- CFRelease(copy);
-
- for (NSDictionary* dict in fieldArray) {
- id val;
- NSString* label = nil;
- val = [dict valueForKey:kW3ContactFieldValue];
- label = (__bridge NSString*)[CDVContact convertContactTypeToPropertyLabel:[dict valueForKey:kW3ContactFieldType]];
- if (IS_VALID_VALUE(val)) {
- // is an update, find index of entry with matching id, if values are different, update.
- id idValue = [dict valueForKey:kW3ContactFieldId];
- int identifier = [idValue isKindOfClass:[NSNumber class]] ? [idValue intValue] : -1;
- CFIndex i = identifier >= 0 ? ABMultiValueGetIndexForIdentifier(multi, identifier) : kCFNotFound;
- if (i != kCFNotFound) {
- if ([val length] == 0) {
- // remove both value and label
- ABMultiValueRemoveValueAndLabelAtIndex(multi, i);
- } else {
- NSString* valueAB = (__bridge_transfer NSString*)ABMultiValueCopyValueAtIndex(multi, i);
- NSString* labelAB = (__bridge_transfer NSString*)ABMultiValueCopyLabelAtIndex(multi, i);
- if ((valueAB == nil) || ![val isEqualToString:valueAB]) {
- ABMultiValueReplaceValueAtIndex(multi, (__bridge CFTypeRef)val, i);
- }
- if ((labelAB == nil) || ![label isEqualToString:labelAB]) {
- ABMultiValueReplaceLabelAtIndex(multi, (__bridge CFStringRef)label, i);
- }
- }
- } else {
- // is a new value - insert
- [self addToMultiValue:multi fromDictionary:dict];
- }
- } // end of if value
- } // end of for
- } else { // adding all new value(s)
- multi = [self allocStringMultiValueFromArray:fieldArray];
- }
- // set the (updated) copy as the new value
- bSuccess = [self setValue:multi forProperty:prop inRecord:person];
- }
-
- if (multi) {
- CFRelease(multi);
- }
-
- return bSuccess;
-}
-
-// used for ims and addresses
-- (ABMultiValueRef)allocDictMultiValueFromArray:array forProperty:(ABPropertyID)prop
-{
- ABMutableMultiValueRef multi = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);
- NSMutableDictionary* newDict;
- NSMutableDictionary* addDict;
-
- for (NSDictionary* dict in array) {
- newDict = [self translateW3Dict:dict forProperty:prop];
- addDict = [NSMutableDictionary dictionaryWithCapacity:2];
- if (newDict) { // create a new dictionary with a Label and Value, value is the dictionary previously created
- // June, 2011 W3C Contact spec adds type into ContactAddress book
- // get the type out of the original dictionary for address
- NSString* addrType = (NSString*)[dict valueForKey:kW3ContactFieldType];
- if (!addrType) {
- addrType = (NSString*)kABOtherLabel;
- }
- NSObject* typeValue = ((prop == kABPersonInstantMessageProperty) ? (NSString*)kABOtherLabel : addrType);
- // NSLog(@"typeValue: %@", typeValue);
- [addDict setObject:typeValue forKey:kW3ContactFieldType]; // im labels will be set as Other and address labels as type from dictionary
- [addDict setObject:newDict forKey:kW3ContactFieldValue];
- [self addToMultiValue:multi fromDictionary:addDict];
- }
- }
-
- return multi; // caller is responsible for releasing
-}
-
-// used for ims and addresses to convert W3 dictionary of values to AB Dictionary
-// got messier when June, 2011 W3C Contact spec added type field into ContactAddress
-- (NSMutableDictionary*)translateW3Dict:(NSDictionary*)dict forProperty:(ABPropertyID)prop
-{
- NSArray* propArray = [[CDVContact defaultObjectAndProperties] valueForKey:[[CDVContact defaultABtoW3C] objectForKey:[NSNumber numberWithInt:prop]]];
-
- NSMutableDictionary* newDict = [NSMutableDictionary dictionaryWithCapacity:1];
- id value;
-
- for (NSString* key in propArray) { // for each W3 Contact key get the value
- if (((value = [dict valueForKey:key]) != nil) && ![value isKindOfClass:[NSNull class]]) {
- // if necessary convert the W3 value to AB Property label
- NSString* setValue = value;
- if ([CDVContact needsConversion:key]) { // IM types must be converted
- setValue = (NSString*)[CDVContact convertContactTypeToPropertyLabel:value];
- // IMs must have a valid AB value!
- if ((prop == kABPersonInstantMessageProperty) && [setValue isEqualToString:(NSString*)kABOtherLabel]) {
- setValue = @""; // try empty string
- }
- }
- // set the AB value into the dictionary
- [newDict setObject:setValue forKey:(NSString*)[[CDVContact defaultW3CtoAB] valueForKey:(NSString*)key]];
- }
- }
-
- if ([newDict count] == 0) {
- newDict = nil; // no items added
- }
- return newDict;
-}
-
-/* set multivalue dictionary properties into an AddressBook Record
- * NSArray* array - array of dictionaries containing the W3C properties to set into the record
- * ABPropertyID prop - the property id for the multivalue dictionary (addresses and ims)
- * ABRecordRef person - the record to set the values into
- * BOOL bUpdate - YES if this is an update to an existing record
- * When updating:
- * empty array indicates to remove entire property
- * value/label == "" indicates to remove
- * value/label == [NSNull null] do not modify (keep existing record value)
- * RETURN
- * bool false indicates fatal error
- *
- * iOS addresses and im are a MultiValue Properties with label, value=dictionary of info, and id
- * set addresses: streetAddress, locality, region, postalCode, country
- * set ims: value = username, type = servicetype
- * there are some special cases in here for ims - needs cleanup / simplification
- *
- */
-- (bool)setMultiValueDictionary:(NSArray*)array forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person asUpdate:(BOOL)bUpdate
-{
- bool bSuccess = FALSE;
- ABMutableMultiValueRef multi = nil;
-
- if (!bUpdate) {
- multi = [self allocDictMultiValueFromArray:array forProperty:prop];
- bSuccess = [self setValue:multi forProperty:prop inRecord:person];
- } else if (bUpdate && ([array count] == 0)) {
- // remove property
- bSuccess = [self removeProperty:prop inRecord:person];
- } else { // check for and apply changes
- ABMultiValueRef copy = ABRecordCopyValue(person, prop);
- if (copy) {
- multi = ABMultiValueCreateMutableCopy(copy);
- CFRelease(copy);
- // get the W3C values for this property
- NSArray* propArray = [[CDVContact defaultObjectAndProperties] valueForKey:[[CDVContact defaultABtoW3C] objectForKey:[NSNumber numberWithInt:prop]]];
- id value;
- id valueAB;
-
- for (NSDictionary* field in array) {
- NSMutableDictionary* dict;
- // find the index for the current property
- id idValue = [field valueForKey:kW3ContactFieldId];
- int identifier = [idValue isKindOfClass:[NSNumber class]] ? [idValue intValue] : -1;
- CFIndex idx = identifier >= 0 ? ABMultiValueGetIndexForIdentifier(multi, identifier) : kCFNotFound;
- BOOL bUpdateLabel = NO;
- if (idx != kCFNotFound) {
- dict = [NSMutableDictionary dictionaryWithCapacity:1];
- // NSDictionary* existingDictionary = (NSDictionary*)ABMultiValueCopyValueAtIndex(multi, idx);
- CFTypeRef existingDictionary = ABMultiValueCopyValueAtIndex(multi, idx);
- NSString* existingABLabel = (__bridge_transfer NSString*)ABMultiValueCopyLabelAtIndex(multi, idx);
- NSString* testLabel = [field valueForKey:kW3ContactFieldType];
- // fixes cb-143 where setting empty label could cause address to not be removed
- // (because empty label would become 'other' in convertContactTypeToPropertyLabel
- // which may not have matched existing label thus resulting in an incorrect updating of the label
- // and the address not getting removed at the end of the for loop)
- if (testLabel && [testLabel isKindOfClass:[NSString class]] && ([testLabel length] > 0)) {
- CFStringRef w3cLabel = [CDVContact convertContactTypeToPropertyLabel:testLabel];
- if (w3cLabel && ![existingABLabel isEqualToString:(__bridge NSString*)w3cLabel]) {
- // replace the label
- ABMultiValueReplaceLabelAtIndex(multi, w3cLabel, idx);
- bUpdateLabel = YES;
- }
- } // else was invalid or empty label string so do not update
-
- for (id k in propArray) {
- value = [field valueForKey:k];
- bool bSet = (value != nil && ![value isKindOfClass:[NSNull class]] && ([value isKindOfClass:[NSString class]] && [value length] > 0));
- // if there is a contact value, put it into dictionary
- if (bSet) {
- NSString* setValue = [CDVContact needsConversion:(NSString*)k] ? (NSString*)[CDVContact convertContactTypeToPropertyLabel:value] : value;
- [dict setObject:setValue forKey:(NSString*)[[CDVContact defaultW3CtoAB] valueForKey:(NSString*)k]];
- } else if ((value == nil) || ([value isKindOfClass:[NSString class]] && ([value length] != 0))) {
- // value not provided in contact dictionary - if prop exists in AB dictionary, preserve it
- valueAB = [(__bridge NSDictionary*)existingDictionary valueForKey : [[CDVContact defaultW3CtoAB] valueForKey:k]];
- if (valueAB != nil) {
- [dict setValue:valueAB forKey:[[CDVContact defaultW3CtoAB] valueForKey:k]];
- }
- } // else if value == "" it will not be added into updated dict and thus removed
- } // end of for loop (moving here fixes cb-143, need to end for loop before replacing or removing multivalue)
-
- if ([dict count] > 0) {
- // something was added into new dict,
- ABMultiValueReplaceValueAtIndex(multi, (__bridge CFTypeRef)dict, idx);
- } else if (!bUpdateLabel) {
- // nothing added into new dict and no label change so remove this property entry
- ABMultiValueRemoveValueAndLabelAtIndex(multi, idx);
- }
-
- CFRelease(existingDictionary);
- } else {
- // not found in multivalue so add it
- dict = [self translateW3Dict:field forProperty:prop];
- if (dict) {
- NSMutableDictionary* addDict = [NSMutableDictionary dictionaryWithCapacity:2];
- // get the type out of the original dictionary for address
- NSObject* typeValue = ((prop == kABPersonInstantMessageProperty) ? (NSString*)kABOtherLabel : (NSString*)[field valueForKey:kW3ContactFieldType]);
- // NSLog(@"typeValue: %@", typeValue);
- [addDict setObject:typeValue forKey:kW3ContactFieldType]; // im labels will be set as Other and address labels as type from dictionary
- [addDict setObject:dict forKey:kW3ContactFieldValue];
- [self addToMultiValue:multi fromDictionary:addDict];
- }
- }
- } // end of looping through dictionaries
-
- // set the (updated) copy as the new value
- bSuccess = [self setValue:multi forProperty:prop inRecord:person];
- }
- } // end of copy and apply changes
- if (multi) {
- CFRelease(multi);
- }
-
- return bSuccess;
-}
-
-/* Determine which W3C labels need to be converted
- */
-+ (BOOL)needsConversion:(NSString*)W3Label
-{
- BOOL bConvert = NO;
-
- if ([W3Label isEqualToString:kW3ContactFieldType] || [W3Label isEqualToString:kW3ContactImType]) {
- bConvert = YES;
- }
- return bConvert;
-}
-
-/* Translation of property type labels contact API ---> iPhone
- *
- * phone: work, home, other, mobile, fax, pager -->
- * kABWorkLabel, kABHomeLabel, kABOtherLabel, kABPersonPhoneMobileLabel, kABPersonHomeFAXLabel || kABPersonHomeFAXLabel, kABPersonPhonePagerLabel
- * emails: work, home, other ---> kABWorkLabel, kABHomeLabel, kABOtherLabel
- * ims: aim, gtalk, icq, xmpp, msn, skype, qq, yahoo --> kABPersonInstantMessageService + (AIM, ICG, MSN, Yahoo). No support for gtalk, xmpp, skype, qq
- * addresses: work, home, other --> kABWorkLabel, kABHomeLabel, kABOtherLabel
- *
- *
- */
-+ (CFStringRef)convertContactTypeToPropertyLabel:(NSString*)label
-{
- CFStringRef type;
-
- if ([label isKindOfClass:[NSNull class]] || ![label isKindOfClass:[NSString class]]) {
- type = NULL; // no label
- } else if ([label caseInsensitiveCompare:kW3ContactWorkLabel] == NSOrderedSame) {
- type = kABWorkLabel;
- } else if ([label caseInsensitiveCompare:kW3ContactHomeLabel] == NSOrderedSame) {
- type = kABHomeLabel;
- } else if ([label caseInsensitiveCompare:kW3ContactOtherLabel] == NSOrderedSame) {
- type = kABOtherLabel;
- } else if ([label caseInsensitiveCompare:kW3ContactPhoneMobileLabel] == NSOrderedSame) {
- type = kABPersonPhoneMobileLabel;
- } else if ([label caseInsensitiveCompare:kW3ContactPhonePagerLabel] == NSOrderedSame) {
- type = kABPersonPhonePagerLabel;
- } else if ([label caseInsensitiveCompare:kW3ContactImAIMLabel] == NSOrderedSame) {
- type = kABPersonInstantMessageServiceAIM;
- } else if ([label caseInsensitiveCompare:kW3ContactImICQLabel] == NSOrderedSame) {
- type = kABPersonInstantMessageServiceICQ;
- } else if ([label caseInsensitiveCompare:kW3ContactImMSNLabel] == NSOrderedSame) {
- type = kABPersonInstantMessageServiceMSN;
- } else if ([label caseInsensitiveCompare:kW3ContactImYahooLabel] == NSOrderedSame) {
- type = kABPersonInstantMessageServiceYahoo;
- } else if ([label caseInsensitiveCompare:kW3ContactUrlProfile] == NSOrderedSame) {
- type = kABPersonHomePageLabel;
- } else {
- // CB-3950 If label is not one of kW3*Label constants, threat it as custom label,
- // otherwise fetching contact and then saving it will break this label in address book.
- type = (__bridge CFStringRef)(label);
- }
-
- return type;
-}
-
-+ (NSString*)convertPropertyLabelToContactType:(NSString*)label
-{
- NSString* type = nil;
-
- if (label != nil) { // improve efficiency......
- if ([label isEqualToString:(NSString*)kABPersonPhoneMobileLabel]) {
- type = kW3ContactPhoneMobileLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonPhoneHomeFAXLabel] ||
- [label isEqualToString:(NSString*)kABPersonPhoneWorkFAXLabel]) {
- type = kW3ContactPhoneFaxLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonPhonePagerLabel]) {
- type = kW3ContactPhonePagerLabel;
- } else if ([label isEqualToString:(NSString*)kABHomeLabel]) {
- type = kW3ContactHomeLabel;
- } else if ([label isEqualToString:(NSString*)kABWorkLabel]) {
- type = kW3ContactWorkLabel;
- } else if ([label isEqualToString:(NSString*)kABOtherLabel]) {
- type = kW3ContactOtherLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonInstantMessageServiceAIM]) {
- type = kW3ContactImAIMLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonInstantMessageServiceICQ]) {
- type = kW3ContactImICQLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonInstantMessageServiceJabber]) {
- type = kW3ContactOtherLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonInstantMessageServiceMSN]) {
- type = kW3ContactImMSNLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonInstantMessageServiceYahoo]) {
- type = kW3ContactImYahooLabel;
- } else if ([label isEqualToString:(NSString*)kABPersonHomePageLabel]) {
- type = kW3ContactUrlProfile;
- } else {
- // CB-3950 If label is not one of kW3*Label constants, threat it as custom label,
- // otherwise fetching contact and then saving it will break this label in address book.
- type = label;
- }
- }
- return type;
-}
-
-/* Check if the input label is a valid W3C ContactField.type. This is used when searching,
- * only search field types if the search string is a valid type. If we converted any search
- * string to a ABPropertyLabel it could convert to kABOtherLabel which is probably not want
- * the user wanted to search for and could skew the results.
- */
-+ (BOOL)isValidW3ContactType:(NSString*)label
-{
- BOOL isValid = NO;
-
- if ([label isKindOfClass:[NSNull class]] || ![label isKindOfClass:[NSString class]]) {
- isValid = NO; // no label
- } else if ([label caseInsensitiveCompare:kW3ContactWorkLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactHomeLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactOtherLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactPhoneMobileLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactPhonePagerLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactImAIMLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactImICQLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactImMSNLabel] == NSOrderedSame) {
- isValid = YES;
- } else if ([label caseInsensitiveCompare:kW3ContactImYahooLabel] == NSOrderedSame) {
- isValid = YES;
- } else {
- isValid = NO;
- }
-
- return isValid;
-}
-
-/* Create a new Contact Dictionary object from an ABRecordRef that contains information in a format such that
- * it can be returned to JavaScript callback as JSON object string.
- * Uses:
- * ABRecordRef set into Contact Object
- * NSDictionary withFields indicates which fields to return from the AddressBook Record
- *
- * JavaScript Contact:
- * @param {DOMString} id unique identifier
- * @param {DOMString} displayName
- * @param {ContactName} name
- * @param {DOMString} nickname
- * @param {ContactField[]} phoneNumbers array of phone numbers
- * @param {ContactField[]} emails array of email addresses
- * @param {ContactAddress[]} addresses array of addresses
- * @param {ContactField[]} ims instant messaging user ids
- * @param {ContactOrganization[]} organizations
- * @param {DOMString} published date contact was first created
- * @param {DOMString} updated date contact was last updated
- * @param {DOMString} birthday contact's birthday
- * @param (DOMString} anniversary contact's anniversary
- * @param {DOMString} gender contact's gender
- * @param {DOMString} note user notes about contact
- * @param {DOMString} preferredUsername
- * @param {ContactField[]} photos
- * @param {ContactField[]} tags
- * @param {ContactField[]} relationships
- * @param {ContactField[]} urls contact's web sites
- * @param {ContactAccounts[]} accounts contact's online accounts
- * @param {DOMString} timezone UTC time zone offset
- * @param {DOMString} connected
- */
-
-- (NSDictionary*)toDictionary:(NSDictionary*)withFields
-{
- // if not a person type record bail out for now
- if (ABRecordGetRecordType(self.record) != kABPersonType) {
- return NULL;
- }
- id value = nil;
- self.returnFields = withFields;
-
- NSMutableDictionary* nc = [NSMutableDictionary dictionaryWithCapacity:1]; // new contact dictionary to fill in from ABRecordRef
- // id
- [nc setObject:[NSNumber numberWithInt:ABRecordGetRecordID(self.record)] forKey:kW3ContactId];
- if (self.returnFields == nil) {
- // if no returnFields specified, W3C says to return empty contact (but Cordova will at least return id)
- return nc;
- }
- if ([self.returnFields objectForKey:kW3ContactDisplayName]) {
- // displayname requested - iOS doesn't have so return null
- [nc setObject:[NSNull null] forKey:kW3ContactDisplayName];
- // may overwrite below if requested ContactName and there are no values
- }
- // nickname
- if ([self.returnFields valueForKey:kW3ContactNickname]) {
- value = (__bridge_transfer NSString*)ABRecordCopyValue(self.record, kABPersonNicknameProperty);
- [nc setObject:(value != nil) ? value:[NSNull null] forKey:kW3ContactNickname];
- }
-
- // name dictionary
- // NSLog(@"getting name info");
- NSObject* data = [self extractName];
- if (data != nil) {
- [nc setObject:data forKey:kW3ContactName];
- }
- if ([self.returnFields objectForKey:kW3ContactDisplayName] && ((data == nil) || ([(NSDictionary*)data objectForKey : kW3ContactFormattedName] == [NSNull null]))) {
- // user asked for displayName which iOS doesn't support but there is no other name data being returned
- // try and use Composite Name so some name is returned
- id tryName = (__bridge_transfer NSString*)ABRecordCopyCompositeName(self.record);
- if (tryName != nil) {
- [nc setObject:tryName forKey:kW3ContactDisplayName];
- } else {
- // use nickname or empty string
- value = (__bridge_transfer NSString*)ABRecordCopyValue(self.record, kABPersonNicknameProperty);
- [nc setObject:(value != nil) ? value:@"" forKey:kW3ContactDisplayName];
- }
- }
- // phoneNumbers array
- // NSLog(@"getting phoneNumbers");
- value = [self extractMultiValue:kW3ContactPhoneNumbers];
- if (value != nil) {
- [nc setObject:value forKey:kW3ContactPhoneNumbers];
- }
- // emails array
- // NSLog(@"getting emails");
- value = [self extractMultiValue:kW3ContactEmails];
- if (value != nil) {
- [nc setObject:value forKey:kW3ContactEmails];
- }
- // urls array
- value = [self extractMultiValue:kW3ContactUrls];
- if (value != nil) {
- [nc setObject:value forKey:kW3ContactUrls];
- }
- // addresses array
- // NSLog(@"getting addresses");
- value = [self extractAddresses];
- if (value != nil) {
- [nc setObject:value forKey:kW3ContactAddresses];
- }
- // im array
- // NSLog(@"getting ims");
- value = [self extractIms];
- if (value != nil) {
- [nc setObject:value forKey:kW3ContactIms];
- }
- // organization array (only info for one organization in iOS)
- // NSLog(@"getting organizations");
- value = [self extractOrganizations];
- if (value != nil) {
- [nc setObject:value forKey:kW3ContactOrganizations];
- }
-
- // for simple properties, could make this a bit more efficient by storing all simple properties in a single
- // array in the returnFields dictionary and setting them via a for loop through the array
-
- // add dates
- // NSLog(@"getting dates");
- NSNumber* ms;
-
- /** Contact Revision field removed from June 16, 2011 version of specification
-
- if ([self.returnFields valueForKey:kW3ContactUpdated]){
- ms = [self getDateAsNumber: kABPersonModificationDateProperty];
- if (!ms){
- // try and get published date
- ms = [self getDateAsNumber: kABPersonCreationDateProperty];
- }
- if (ms){
- [nc setObject: ms forKey:kW3ContactUpdated];
- }
-
- }
- */
-
- if ([self.returnFields valueForKey:kW3ContactBirthday]) {
- ms = [self getDateAsNumber:kABPersonBirthdayProperty];
- if (ms) {
- [nc setObject:ms forKey:kW3ContactBirthday];
- }
- }
-
- /* Anniversary removed from 12-09-2010 W3C Contacts api spec
- if ([self.returnFields valueForKey:kW3ContactAnniversary]){
- // Anniversary date is stored in a multivalue property
- ABMultiValueRef multi = ABRecordCopyValue(self.record, kABPersonDateProperty);
- if (multi){
- CFStringRef label = nil;
- CFIndex count = ABMultiValueGetCount(multi);
- // see if contains an Anniversary date
- for(CFIndex i=0; i 0) { // ?? this will always be true since we set id,label,primary field??
- [(NSMutableArray*)addresses addObject : newAddress];
- }
- CFRelease(dict);
- } // end of loop through addresses
- } else {
- addresses = [NSNull null];
- }
- if (multi) {
- CFRelease(multi);
- }
-
- return addresses;
-}
-
-/* Create array of Dictionaries to match JavaScript ContactField object for ims
- * type one of [aim, gtalk, icq, xmpp, msn, skype, qq, yahoo] needs other as well
- * value
- * (bool) primary
- * id
- *
- * iOS IMs are a MultiValue Properties with label, value=dictionary of IM details (service, username), and id
- */
-- (NSObject*)extractIms
-{
- NSArray* fields = [self.returnFields objectForKey:kW3ContactIms];
-
- if (fields == nil) { // no name fields requested
- return nil;
- }
- NSObject* imArray;
- ABMultiValueRef multi = ABRecordCopyValue(self.record, kABPersonInstantMessageProperty);
- CFIndex count = multi ? ABMultiValueGetCount(multi) : 0;
- if (count) {
- imArray = [NSMutableArray arrayWithCapacity:count];
-
- for (CFIndex i = 0; i < ABMultiValueGetCount(multi); i++) {
- NSMutableDictionary* newDict = [NSMutableDictionary dictionaryWithCapacity:3];
- // iOS has label property (work, home, other) for each IM but W3C contact API doesn't use
- CFDictionaryRef dict = (CFDictionaryRef)ABMultiValueCopyValueAtIndex(multi, i);
- CFStringRef value; // all values should be CFStringRefs / NSString*
- bool bFound;
- if ([fields containsObject:kW3ContactFieldValue]) {
- // value = user name
- bFound = CFDictionaryGetValueIfPresent(dict, kABPersonInstantMessageUsernameKey, (void*)&value);
- if (bFound && (value != NULL)) {
- CFRetain(value);
- [newDict setObject:(__bridge id)value forKey:kW3ContactFieldValue];
- CFRelease(value);
- } else {
- [newDict setObject:[NSNull null] forKey:kW3ContactFieldValue];
- }
- }
- if ([fields containsObject:kW3ContactFieldType]) {
- bFound = CFDictionaryGetValueIfPresent(dict, kABPersonInstantMessageServiceKey, (void*)&value);
- if (bFound && (value != NULL)) {
- CFRetain(value);
- [newDict setObject:(id)[[CDVContact class] convertPropertyLabelToContactType : (__bridge NSString*)value] forKey:kW3ContactFieldType];
- CFRelease(value);
- } else {
- [newDict setObject:[NSNull null] forKey:kW3ContactFieldType];
- }
- }
- // always set ID
- id identifier = [NSNumber numberWithUnsignedInt:ABMultiValueGetIdentifierAtIndex(multi, i)];
- [newDict setObject:(identifier != nil) ? identifier:[NSNull null] forKey:kW3ContactFieldId];
-
- [(NSMutableArray*)imArray addObject : newDict];
- CFRelease(dict);
- }
- } else {
- imArray = [NSNull null];
- }
-
- if (multi) {
- CFRelease(multi);
- }
- return imArray;
-}
-
-/* Create array of Dictionaries to match JavaScript ContactOrganization object
- * pref - not supported in iOS
- * type - not supported in iOS
- * name
- * department
- * title
- */
-
-- (NSObject*)extractOrganizations
-{
- NSArray* fields = [self.returnFields objectForKey:kW3ContactOrganizations];
-
- if (fields == nil) { // no name fields requested
- return nil;
- }
- NSObject* array = nil;
- NSMutableDictionary* newDict = [NSMutableDictionary dictionaryWithCapacity:5];
- id value;
- int validValueCount = 0;
-
- for (id i in fields) {
- id key = [[CDVContact defaultW3CtoAB] valueForKey:i];
- if (key && [key isKindOfClass:[NSNumber class]]) {
- value = (__bridge_transfer NSString*)ABRecordCopyValue(self.record, (ABPropertyID)[[[CDVContact defaultW3CtoAB] valueForKey:i] intValue]);
- if (value != nil) {
- // if there are no organization values we should return null for organization
- // this counter keeps indicates if any organization values have been set
- validValueCount++;
- }
- [newDict setObject:(value != nil) ? value:[NSNull null] forKey:i];
- } else { // not a key iOS supports, set to null
- [newDict setObject:[NSNull null] forKey:i];
- }
- }
-
- if (([newDict count] > 0) && (validValueCount > 0)) {
- // add pref and type
- // they are not supported by iOS and thus these values never change
- [newDict setObject:@"false" forKey:kW3ContactFieldPrimary];
- [newDict setObject:[NSNull null] forKey:kW3ContactFieldType];
- array = [NSMutableArray arrayWithCapacity:1];
- [(NSMutableArray*)array addObject : newDict];
- } else {
- array = [NSNull null];
- }
- return array;
-}
-
-// W3C Contacts expects an array of photos. Can return photos in more than one format, currently
-// just returning the default format
-// Save the photo data into tmp directory and return FileURI - temp directory is deleted upon application exit
-- (NSObject*)extractPhotos
-{
- NSMutableArray* photos = nil;
-
- if (ABPersonHasImageData(self.record)) {
- CFIndex photoId = ABRecordGetRecordID(self.record);
- CFDataRef photoData = ABPersonCopyImageData(self.record);
- if (!photoData) {
- return nil;
- }
-
- NSData* data = (__bridge NSData*)photoData;
- // write to temp directory and store URI in photos array
- // get the temp directory path
- NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];
- NSString* filePath = [NSString stringWithFormat:@"%@/contact_photo_%ld", docsPath, photoId];
-
- // save file
- if ([data writeToFile:filePath atomically:YES]) {
- photos = [NSMutableArray arrayWithCapacity:1];
- NSMutableDictionary* newDict = [NSMutableDictionary dictionaryWithCapacity:2];
- [newDict setObject:filePath forKey:kW3ContactFieldValue];
- [newDict setObject:@"url" forKey:kW3ContactFieldType];
- [newDict setObject:@"false" forKey:kW3ContactFieldPrimary];
- [photos addObject:newDict];
- }
-
- CFRelease(photoData);
- }
- return photos;
-}
-
-/**
- * given an array of W3C Contact field names, create a dictionary of field names to extract
- * if field name represents an object, return all properties for that object: "name" - returns all properties in ContactName
- * if field name is an explicit property, return only those properties: "name.givenName - returns a ContactName with only ContactName.givenName
- * if field contains ONLY ["*"] return all fields
- * dictionary format:
- * key is W3Contact #define
- * value is NSMutableArray* for complex keys: name,addresses,organizations, phone, emails, ims
- * value is [NSNull null] for simple keys
-*/
-+ (NSDictionary*)calcReturnFields:(NSArray*)fieldsArray // NSLog(@"getting self.returnFields");
-{
- NSMutableDictionary* d = [NSMutableDictionary dictionaryWithCapacity:1];
-
- if ((fieldsArray != nil) && [fieldsArray isKindOfClass:[NSArray class]]) {
- if (([fieldsArray count] == 1) && [[fieldsArray objectAtIndex:0] isEqualToString:@"*"]) {
- return [CDVContact defaultFields]; // return all fields
- }
-
- for (id i in fieldsArray) {
-
- // CB-7906 ignore NULL desired fields to avoid fatal exception
- if ([i isKindOfClass:[NSNull class]]) continue;
-
- NSMutableArray* keys = nil;
- NSString* fieldStr = nil;
- if ([i isKindOfClass:[NSNumber class]]) {
- fieldStr = [i stringValue];
- } else {
- fieldStr = i;
- }
-
- // see if this is specific property request in object - object.property
- NSArray* parts = [fieldStr componentsSeparatedByString:@"."]; // returns original string if no separator found
- NSString* name = [parts objectAtIndex:0];
- NSString* property = nil;
- if ([parts count] > 1) {
- property = [parts objectAtIndex:1];
- }
- // see if this is a complex field by looking for its array of properties in objectAndProperties dictionary
- id fields = [[CDVContact defaultObjectAndProperties] objectForKey:name];
-
- // if find complex name (name,addresses,organizations, phone, emails, ims) in fields, add name as key
- // with array of associated properties as the value
- if ((fields != nil) && (property == nil)) { // request was for full object
- keys = [NSMutableArray arrayWithArray:fields];
- if (keys != nil) {
- [d setObject:keys forKey:name]; // will replace if prop array already exists
- }
- } else if ((fields != nil) && (property != nil)) {
- // found an individual property request in form of name.property
- // verify is real property name by using it as key in W3CtoAB
- id abEquiv = [[CDVContact defaultW3CtoAB] objectForKey:property];
- if (abEquiv || [[CDVContact defaultW3CtoNull] containsObject:property]) {
- // if existing array add to it
- if ((keys = [d objectForKey:name]) != nil) {
- [keys addObject:property];
- } else {
- keys = [NSMutableArray arrayWithObject:property];
- [d setObject:keys forKey:name];
- }
- } else {
- NSLog(@"Contacts.find -- request for invalid property ignored: %@.%@", name, property);
- }
- } else { // is an individual property, verify is real property name by using it as key in W3CtoAB
- id valid = [[CDVContact defaultW3CtoAB] objectForKey:name];
- if (valid || [[CDVContact defaultW3CtoNull] containsObject:name]) {
- [d setObject:[NSNull null] forKey:name];
- }
- }
- }
- }
- if ([d count] == 0) {
- // no array or nothing in the array. W3C spec says to return nothing
- return nil; // [Contact defaultFields];
- }
- return d;
-}
-
-
-- (BOOL)valueForKeyIsArray:(NSDictionary*)dict key:(NSString*)key
-{
- BOOL bArray = NO;
- NSObject* value = [dict objectForKey:key];
-
- if (value) {
- bArray = [value isKindOfClass:[NSArray class]];
- }
- return bArray;
-}
-
-
-/*
- * Search for the specified value in each of the fields specified in the searchFields dictionary.
- * NSString* value - the string value to search for (need clarification from W3C on how to search for dates)
- * NSDictionary* searchFields - a dictionary created via calcReturnFields where the key is the top level W3C
- * object and the object is the array of specific fields within that object or null if it is a single property
- * RETURNS
- * YES as soon as a match is found in any of the fields
- * NO - the specified value does not exist in any of the fields in this contact
- *
- * Note: I'm not a fan of returning in the middle of methods but have done it some in this method in order to
- * keep the code simpler. bgibson
- */
-- (BOOL)foundValue:(NSString*)testValue inFields:(NSDictionary*)searchFields
-{
- BOOL bFound = NO;
-
- if ((testValue == nil) || ![testValue isKindOfClass:[NSString class]] || ([testValue length] == 0)) {
- // nothing to find so return NO
- return NO;
- }
- NSInteger valueAsInt = [testValue integerValue];
-
- // per W3C spec, always include id in search
- int recordId = ABRecordGetRecordID(self.record);
- if (valueAsInt && (recordId == valueAsInt)) {
- return YES;
- }
-
- if (searchFields == nil) {
- // no fields to search
- return NO;
- }
-
- if ([searchFields valueForKey:kW3ContactNickname]) {
- bFound = [self testStringValue:testValue forW3CProperty:kW3ContactNickname];
- if (bFound == YES) {
- return bFound;
- }
- }
-
- if ([self valueForKeyIsArray:searchFields key:kW3ContactName]) {
- // test name fields. All are string properties obtained via ABRecordCopyValue except kW3ContactFormattedName
- NSArray* fields = [searchFields valueForKey:kW3ContactName];
-
- for (NSString* testItem in fields) {
- if ([testItem isEqualToString:kW3ContactFormattedName]) {
- NSString* propValue = (__bridge_transfer NSString*)ABRecordCopyCompositeName(self.record);
- if ((propValue != nil) && ([propValue length] > 0)) {
- NSRange range = [propValue rangeOfString:testValue options:NSCaseInsensitiveSearch];
- bFound = (range.location != NSNotFound);
- propValue = nil;
- }
- } else {
- bFound = [self testStringValue:testValue forW3CProperty:testItem];
- }
-
- if (bFound) {
- break;
- }
- }
- }
- if (!bFound && [self valueForKeyIsArray:searchFields key:kW3ContactPhoneNumbers]) {
- bFound = [self searchContactFields:(NSArray*)[searchFields valueForKey:kW3ContactPhoneNumbers]
- forMVStringProperty:kABPersonPhoneProperty withValue:testValue];
- }
- if (!bFound && [self valueForKeyIsArray:searchFields key:kW3ContactEmails]) {
- bFound = [self searchContactFields:(NSArray*)[searchFields valueForKey:kW3ContactEmails]
- forMVStringProperty:kABPersonEmailProperty withValue:testValue];
- }
-
- if (!bFound && [self valueForKeyIsArray:searchFields key:kW3ContactAddresses]) {
- bFound = [self searchContactFields:[searchFields valueForKey:kW3ContactAddresses]
- forMVDictionaryProperty:kABPersonAddressProperty withValue:testValue];
- }
-
- if (!bFound && [self valueForKeyIsArray:searchFields key:kW3ContactIms]) {
- bFound = [self searchContactFields:[searchFields valueForKey:kW3ContactIms]
- forMVDictionaryProperty:kABPersonInstantMessageProperty withValue:testValue];
- }
-
- if (!bFound && [self valueForKeyIsArray:searchFields key:kW3ContactOrganizations]) {
- NSArray* fields = [searchFields valueForKey:kW3ContactOrganizations];
-
- for (NSString* testItem in fields) {
- bFound = [self testStringValue:testValue forW3CProperty:testItem];
- if (bFound == YES) {
- break;
- }
- }
- }
- if (!bFound && [searchFields valueForKey:kW3ContactNote]) {
- bFound = [self testStringValue:testValue forW3CProperty:kW3ContactNote];
- }
-
- // if searching for a date field is requested, get the date field as a localized string then look for match against testValue in date string
- // searching for photos is not supported
- if (!bFound && [searchFields valueForKey:kW3ContactBirthday]) {
- bFound = [self testDateValue:testValue forW3CProperty:kW3ContactBirthday];
- }
- if (!bFound && [self valueForKeyIsArray:searchFields key:kW3ContactUrls]) {
- bFound = [self searchContactFields:(NSArray*)[searchFields valueForKey:kW3ContactUrls]
- forMVStringProperty:kABPersonURLProperty withValue:testValue];
- }
-
- return bFound;
-}
-
-- (BOOL)valueForKeyIsNumber:(NSDictionary*)dict key:(NSString*)key
-{
- BOOL bNumber = NO;
- NSObject* value = [dict objectForKey:key];
-
- if (value) {
- bNumber = [value isKindOfClass:[NSNumber class]];
- }
- return bNumber;
-}
-
-/*
- * Test for the existence of a given string within the value of a ABPersonRecord string property based on the W3c property name.
- *
- * IN:
- * NSString* testValue - the value to find - search is case insensitive
- * NSString* property - the W3c property string
- * OUT:
- * BOOL YES if the given string was found within the property value
- * NO if the testValue was not found, W3C property string was invalid or the AddressBook property was not a string
- */
-- (BOOL)testStringValue:(NSString*)testValue forW3CProperty:(NSString*)property
-{
- BOOL bFound = NO;
-
- if ([self valueForKeyIsNumber:[CDVContact defaultW3CtoAB] key:property]) {
- ABPropertyID propId = [[[CDVContact defaultW3CtoAB] objectForKey:property] intValue];
- if (ABPersonGetTypeOfProperty(propId) == kABStringPropertyType) {
- NSString* propValue = (__bridge_transfer NSString*)ABRecordCopyValue(self.record, propId);
- if ((propValue != nil) && ([propValue length] > 0)) {
- NSPredicate* containPred = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@", testValue];
- bFound = [containPred evaluateWithObject:propValue];
- // NSRange range = [propValue rangeOfString:testValue options: NSCaseInsensitiveSearch];
- // bFound = (range.location != NSNotFound);
- }
- }
- }
- return bFound;
-}
-
-/*
- * Test for the existence of a given Date string within the value of a ABPersonRecord datetime property based on the W3c property name.
- *
- * IN:
- * NSString* testValue - the value to find - search is case insensitive
- * NSString* property - the W3c property string
- * OUT:
- * BOOL YES if the given string was found within the localized date string value
- * NO if the testValue was not found, W3C property string was invalid or the AddressBook property was not a DateTime
- */
-- (BOOL)testDateValue:(NSString*)testValue forW3CProperty:(NSString*)property
-{
- BOOL bFound = NO;
-
- if ([self valueForKeyIsNumber:[CDVContact defaultW3CtoAB] key:property]) {
- ABPropertyID propId = [[[CDVContact defaultW3CtoAB] objectForKey:property] intValue];
- if (ABPersonGetTypeOfProperty(propId) == kABDateTimePropertyType) {
- NSDate* date = (__bridge_transfer NSDate*)ABRecordCopyValue(self.record, propId);
- if (date != nil) {
- NSString* dateString = [date descriptionWithLocale:[NSLocale currentLocale]];
- NSPredicate* containPred = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@", testValue];
- bFound = [containPred evaluateWithObject:dateString];
- }
- }
- }
- return bFound;
-}
-
-/*
- * Search the specified fields within an AddressBook multivalue string property for the specified test value.
- * Used for phoneNumbers, emails and urls.
- * IN:
- * NSArray* fields - the fields to search for within the multistring property (value and/or type)
- * ABPropertyID - the property to search
- * NSString* testValue - the value to search for. Will convert between W3C types and AB types. Will only
- * search for types if the testValue is a valid ContactField type.
- * OUT:
- * YES if the test value was found in one of the specified fields
- * NO if the test value was not found
- */
-- (BOOL)searchContactFields:(NSArray*)fields forMVStringProperty:(ABPropertyID)propId withValue:testValue
-{
- BOOL bFound = NO;
-
- for (NSString* type in fields) {
- NSString* testString = nil;
- if ([type isEqualToString:kW3ContactFieldType]) {
- if ([CDVContact isValidW3ContactType:testValue]) {
- // only search types if the filter string is a valid ContactField.type
- testString = (NSString*)[CDVContact convertContactTypeToPropertyLabel:testValue];
- }
- } else {
- testString = testValue;
- }
-
- if (testString != nil) {
- bFound = [self testMultiValueStrings:testString forProperty:propId ofType:type];
- }
- if (bFound == YES) {
- break;
- }
- }
-
- return bFound;
-}
-
-/*
- * Searches a multiString value of the specified type for the specified test value.
- *
- * IN:
- * NSString* testValue - the value to test for
- * ABPropertyID propId - the property id of the multivalue property to search
- * NSString* type - the W3C contact type to search for (value or type)
- * OUT:
- * YES is the test value was found
- * NO if the test value was not found
- */
-- (BOOL)testMultiValueStrings:(NSString*)testValue forProperty:(ABPropertyID)propId ofType:(NSString*)type
-{
- BOOL bFound = NO;
-
- if (ABPersonGetTypeOfProperty(propId) == kABMultiStringPropertyType) {
- NSArray* valueArray = nil;
- if ([type isEqualToString:kW3ContactFieldType]) {
- valueArray = [self labelsForProperty:propId inRecord:self.record];
- } else if ([type isEqualToString:kW3ContactFieldValue]) {
- valueArray = [self valuesForProperty:propId inRecord:self.record];
- }
- if (valueArray) {
- NSString* valuesAsString = [valueArray componentsJoinedByString:@" "];
- NSPredicate* containPred = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@", testValue];
- bFound = [containPred evaluateWithObject:valuesAsString];
- }
- }
- return bFound;
-}
-
-/*
- * Returns the array of values for a multivalue string property of the specified property id
- */
-- (__autoreleasing NSArray*)valuesForProperty:(ABPropertyID)propId inRecord:(ABRecordRef)aRecord
-{
- ABMultiValueRef multi = ABRecordCopyValue(aRecord, propId);
- NSArray* values = (__bridge_transfer NSArray*)ABMultiValueCopyArrayOfAllValues(multi);
-
- CFRelease(multi);
- return values;
-}
-
-/*
- * Returns the array of labels for a multivalue string property of the specified property id
- */
-- (NSArray*)labelsForProperty:(ABPropertyID)propId inRecord:(ABRecordRef)aRecord
-{
- ABMultiValueRef multi = ABRecordCopyValue(aRecord, propId);
- CFIndex count = ABMultiValueGetCount(multi);
- NSMutableArray* labels = [NSMutableArray arrayWithCapacity:count];
-
- for (int i = 0; i < count; i++) {
- NSString* label = (__bridge_transfer NSString*)ABMultiValueCopyLabelAtIndex(multi, i);
- if (label) {
- [labels addObject:label];
- }
- }
-
- CFRelease(multi);
- return labels;
-}
-
-/* search for values within MultiValue Dictionary properties Address or IM property
- * IN:
- * (NSArray*) fields - the array of W3C field names to search within
- * (ABPropertyID) propId - the AddressBook property that returns a multivalue dictionary
- * (NSString*) testValue - the string to search for within the specified fields
- *
- */
-- (BOOL)searchContactFields:(NSArray*)fields forMVDictionaryProperty:(ABPropertyID)propId withValue:(NSString*)testValue
-{
- BOOL bFound = NO;
-
- NSArray* values = [self valuesForProperty:propId inRecord:self.record]; // array of dictionaries (as CFDictionaryRef)
- NSUInteger dictCount = [values count];
-
- // for ims dictionary contains with service (w3C type) and username (W3c value)
- // for addresses dictionary contains street, city, state, zip, country
- for (int i = 0; i < dictCount; i++) {
- CFDictionaryRef dict = (__bridge CFDictionaryRef)[values objectAtIndex:i];
-
- for (NSString* member in fields) {
- NSString* abKey = [[CDVContact defaultW3CtoAB] valueForKey:member]; // im and address fields are all strings
- CFStringRef abValue = nil;
- if (abKey) {
- NSString* testString = nil;
- if ([member isEqualToString:kW3ContactImType]) {
- if ([CDVContact isValidW3ContactType:testValue]) {
- // only search service/types if the filter string is a valid ContactField.type
- testString = (NSString*)[CDVContact convertContactTypeToPropertyLabel:testValue];
- }
- } else {
- testString = testValue;
- }
- if (testString != nil) {
- BOOL bExists = CFDictionaryGetValueIfPresent(dict, (__bridge const void*)abKey, (void*)&abValue);
- if (bExists) {
- CFRetain(abValue);
- NSPredicate* containPred = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@", testString];
- bFound = [containPred evaluateWithObject:(__bridge id)abValue];
- CFRelease(abValue);
- }
- }
- }
- if (bFound == YES) {
- break;
- }
- } // end of for each member in fields
-
- if (bFound == YES) {
- break;
- }
- } // end of for each dictionary
-
- return bFound;
-}
-
-@end
diff --git a/plugins/cordova-plugin-contacts/src/ios/CDVContacts.h b/plugins/cordova-plugin-contacts/src/ios/CDVContacts.h
deleted file mode 100644
index 479d390..0000000
--- a/plugins/cordova-plugin-contacts/src/ios/CDVContacts.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import
-#import
-#import "CDVContact.h"
-
-@interface CDVContacts : CDVPlugin
-{
- ABAddressBookRef addressBook;
-}
-
-/*
- * newContact - create a new contact via the GUI
- *
- * arguments:
- * 1: successCallback: this is the javascript function that will be called with the newly created contactId
- */
-- (void)newContact:(CDVInvokedUrlCommand*)command;
-
-/*
- * displayContact - IN PROGRESS
- *
- * arguments:
- * 1: recordID of the contact to display in the iPhone contact display
- * 2: successCallback - currently not used
- * 3: error callback
- * options:
- * allowsEditing: set to true to allow the user to edit the contact - currently not supported
- */
-- (void)displayContact:(CDVInvokedUrlCommand*)command;
-
-/*
- * chooseContact
- *
- * arguments:
- * 1: this is the javascript function that will be called with the contact data as a JSON object (as the first param)
- * options:
- * allowsEditing: set to true to not choose the contact, but to edit it in the iPhone contact editor
- */
-- (void)chooseContact:(CDVInvokedUrlCommand*)command;
-
-- (void)newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person;
-- (BOOL)personViewController:(ABPersonViewController*)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
- property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue;
-/*
- * Launches the Contact Picker to select a single contact.
- *
- * arguments:
- * 1: this is the javascript function that will be called with the contact data as a JSON object (as the first param)
- * options:
- * desiredFields: ContactFields array to be returned back
- */
-- (void)pickContact:(CDVInvokedUrlCommand*)command;
-
-/*
- * search - searches for contacts. Only person records are currently supported.
- *
- * arguments:
- * 1: successcallback - this is the javascript function that will be called with the array of found contacts
- * 2: errorCallback - optional javascript function to be called in the event of an error with an error code.
- * options: dictionary containing ContactFields and ContactFindOptions
- * fields - ContactFields array
- * findOptions - ContactFindOptions object as dictionary
- *
- */
-- (void)search:(CDVInvokedUrlCommand*)command;
-
-/*
- * save - saves a new contact or updates and existing contact
- *
- * arguments:
- * 1: success callback - this is the javascript function that will be called with the JSON representation of the saved contact
- * search calls a fixed navigator.service.contacts._findCallback which then calls the success callback stored before making the call into obj-c
- */
-- (void)save:(CDVInvokedUrlCommand*)command;
-
-/*
- * remove - removes a contact from the address book
- *
- * arguments:
- * 1: 1: successcallback - this is the javascript function that will be called with a (now) empty contact object
- *
- * options: dictionary containing Contact object to remove
- * contact - Contact object as dictionary
- */
-- (void)remove:(CDVInvokedUrlCommand*)command;
-
-// - (void) dealloc;
-
-@end
-
-@interface CDVContactsPicker : ABPeoplePickerNavigationController
-{
- BOOL allowsEditing;
- NSString* callbackId;
- NSDictionary* options;
- NSDictionary* pickedContactDictionary;
-}
-
-@property BOOL allowsEditing;
-@property (copy) NSString* callbackId;
-@property (nonatomic, strong) NSDictionary* options;
-@property (nonatomic, strong) NSDictionary* pickedContactDictionary;
-
-@end
-
-@interface CDVNewContactsController : ABNewPersonViewController
-{
- NSString* callbackId;
-}
-@property (copy) NSString* callbackId;
-@end
-
-/* ABPersonViewController does not have any UI to dismiss. Adding navigationItems to it does not work properly, the navigationItems are lost when the app goes into the background.
- The solution was to create an empty NavController in front of the ABPersonViewController. This
- causes the ABPersonViewController to have a back button. By subclassing the ABPersonViewController,
- we can override viewWillDisappear and take down the entire NavigationController at that time.
- */
-@interface CDVDisplayContactViewController : ABPersonViewController
-{}
-@property (nonatomic, strong) CDVPlugin* contactsPlugin;
-
-@end
-@interface CDVAddressBookAccessError : NSObject
-{}
-@property (assign) CDVContactError errorCode;
-- (CDVAddressBookAccessError*)initWithCode:(CDVContactError)code;
-@end
-
-typedef void (^ CDVAddressBookWorkerBlock)(
- ABAddressBookRef addressBook,
- CDVAddressBookAccessError* error
- );
-@interface CDVAddressBookHelper : NSObject
-{}
-
-- (void)createAddressBook:(CDVAddressBookWorkerBlock)workerBlock;
-@end
diff --git a/plugins/cordova-plugin-contacts/src/ios/CDVContacts.m b/plugins/cordova-plugin-contacts/src/ios/CDVContacts.m
deleted file mode 100644
index d5dd958..0000000
--- a/plugins/cordova-plugin-contacts/src/ios/CDVContacts.m
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVContacts.h"
-#import
-
-@implementation CDVContactsPicker
-
-@synthesize allowsEditing;
-@synthesize callbackId;
-@synthesize options;
-@synthesize pickedContactDictionary;
-
-@end
-@implementation CDVNewContactsController
-
-@synthesize callbackId;
-
-@end
-
-@implementation CDVContacts
-
-// overridden to clean up Contact statics
-- (void)onAppTerminate
-{
- // NSLog(@"Contacts::onAppTerminate");
-}
-
-// iPhone only method to create a new contact through the GUI
-- (void)newContact:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
-
- CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
- CDVContacts* __weak weakSelf = self; // play it safe to avoid retain cycles
-
- [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errCode) {
- if (addrBook == NULL) {
- // permission was denied or other error just return (no error callback)
- return;
- }
- CDVNewContactsController* npController = [[CDVNewContactsController alloc] init];
- npController.addressBook = addrBook; // a CF retaining assign
- CFRelease(addrBook);
-
- npController.newPersonViewDelegate = self;
- npController.callbackId = callbackId;
-
- UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:npController];
-
- [weakSelf.viewController presentViewController:navController animated:YES completion:nil];
- }];
-}
-
-- (void)newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person
-{
- ABRecordID recordId = kABRecordInvalidID;
- CDVNewContactsController* newCP = (CDVNewContactsController*)newPersonViewController;
- NSString* callbackId = newCP.callbackId;
-
- if (person != NULL) {
- // return the contact id
- recordId = ABRecordGetRecordID(person);
- }
-
- [[newPersonViewController presentingViewController] dismissViewControllerAnimated:YES completion:nil];
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:recordId];
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
-}
-
-- (bool)existsValue:(NSDictionary*)dict val:(NSString*)expectedValue forKey:(NSString*)key
-{
- id val = [dict valueForKey:key];
- bool exists = false;
-
- if (val != nil) {
- exists = [(NSString*)val compare : expectedValue options : NSCaseInsensitiveSearch] == 0;
- }
-
- return exists;
-}
-
-- (void)displayContact:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- ABRecordID recordID = [[command argumentAtIndex:0] intValue];
- NSDictionary* options = [command argumentAtIndex:1 withDefault:[NSNull null]];
- bool bEdit = [options isKindOfClass:[NSNull class]] ? false : [self existsValue:options val:@"true" forKey:@"allowsEditing"];
-
- CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
- CDVContacts* __weak weakSelf = self; // play it safe to avoid retain cycles
-
- [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errCode) {
- if (addrBook == NULL) {
- // permission was denied or other error - return error
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:errCode ? (int)errCode.errorCode:UNKNOWN_ERROR];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- return;
- }
- ABRecordRef rec = ABAddressBookGetPersonWithRecordID(addrBook, recordID);
-
- if (rec) {
- CDVDisplayContactViewController* personController = [[CDVDisplayContactViewController alloc] init];
- personController.displayedPerson = rec;
- personController.personViewDelegate = self;
- personController.allowsEditing = NO;
-
- // create this so DisplayContactViewController will have a "back" button.
- UIViewController* parentController = [[UIViewController alloc] init];
- UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:parentController];
-
- [navController pushViewController:personController animated:YES];
-
- [self.viewController presentViewController:navController animated:YES completion:nil];
-
- if (bEdit) {
- // create the editing controller and push it onto the stack
- ABPersonViewController* editPersonController = [[ABPersonViewController alloc] init];
- editPersonController.displayedPerson = rec;
- editPersonController.personViewDelegate = self;
- editPersonController.allowsEditing = YES;
- [navController pushViewController:editPersonController animated:YES];
- }
- } else {
- // no record, return error
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:UNKNOWN_ERROR];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- CFRelease(addrBook);
- }];
-}
-
-- (BOOL)personViewController:(ABPersonViewController*)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
- property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue
-{
- return YES;
-}
-
-- (void)chooseContact:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSDictionary* options = [command argumentAtIndex:0 withDefault:[NSNull null]];
-
- CDVContactsPicker* pickerController = [[CDVContactsPicker alloc] init];
-
- pickerController.peoplePickerDelegate = self;
- pickerController.callbackId = callbackId;
- pickerController.options = options;
- pickerController.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kABRecordInvalidID], kW3ContactId, nil];
- id allowsEditingValue = [options valueForKey:@"allowsEditing"];
- BOOL allowsEditing = NO;
- if ([allowsEditingValue isKindOfClass:[NSNumber class]]) {
- allowsEditing = [(NSNumber*)allowsEditingValue boolValue];
- }
- pickerController.allowsEditing = allowsEditing;
-
- [self.viewController presentViewController:pickerController animated:YES completion:nil];
-}
-
-- (void)pickContact:(CDVInvokedUrlCommand *)command
-{
- // mimic chooseContact method call with required for us parameters
- NSArray* desiredFields = [command argumentAtIndex:0 withDefault:[NSArray array]];
- if (desiredFields == nil || desiredFields.count == 0) {
- desiredFields = [NSArray arrayWithObjects:@"*", nil];
- }
- NSMutableDictionary* options = [NSMutableDictionary dictionaryWithCapacity:2];
-
- [options setObject: desiredFields forKey:@"fields"];
- [options setObject: [NSNumber numberWithBool: FALSE] forKey:@"allowsEditing"];
-
- NSArray* args = [NSArray arrayWithObjects:options, nil];
-
- CDVInvokedUrlCommand* newCommand = [[CDVInvokedUrlCommand alloc] initWithArguments:args
- callbackId:command.callbackId
- className:command.className
- methodName:command.methodName];
-
- // First check for Address book permissions
- ABAuthorizationStatus status = ABAddressBookGetAuthorizationStatus();
- if (status == kABAuthorizationStatusAuthorized) {
- [self chooseContact:newCommand];
- return;
- }
-
- CDVPluginResult *errorResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsInt:PERMISSION_DENIED_ERROR];
-
- // if the access is already restricted/denied the only way is to fail
- if (status == kABAuthorizationStatusRestricted || status == kABAuthorizationStatusDenied) {
- [self.commandDelegate sendPluginResult: errorResult callbackId:command.callbackId];
- return;
- }
-
- // if no permissions granted try to request them first
- if (status == kABAuthorizationStatusNotDetermined) {
- ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
- if (granted) {
- [self chooseContact:newCommand];
- return;
- }
-
- [self.commandDelegate sendPluginResult: errorResult callbackId:command.callbackId];
- });
- }
-}
-
-- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker
- shouldContinueAfterSelectingPerson:(ABRecordRef)person
-{
- [self peoplePickerNavigationController:peoplePicker didSelectPerson:person];
- return NO;
-}
-
-- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker
- shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
-{
- return YES;
-}
-
-- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController*)peoplePicker
-{
- // return contactId or invalid if none picked
- CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
-
- if (picker.allowsEditing) {
- // get the info after possible edit
- // if we got this far, user has already approved/ disapproved addressBook access
- ABAddressBookRef addrBook = ABAddressBookCreateWithOptions(NULL, NULL);
- ABRecordRef person = ABAddressBookGetPersonWithRecordID(addrBook, (int)[[picker.pickedContactDictionary objectForKey:kW3ContactId] integerValue]);
- if (person) {
- CDVContact* pickedContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)person];
- NSArray* fields = [picker.options objectForKey:@"fields"];
- NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
- picker.pickedContactDictionary = [pickedContact toDictionary:returnFields];
- }
- CFRelease(addrBook);
- }
-
- CDVPluginResult* result = nil;
- NSNumber* recordId = picker.pickedContactDictionary[kW3ContactId];
-
- if ([recordId isEqualToNumber:[NSNumber numberWithInt:kABRecordInvalidID]]) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:OPERATION_CANCELLED_ERROR] ;
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
- }
-
- [self.commandDelegate sendPluginResult:result callbackId:picker.callbackId];
-
- [[peoplePicker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
-}
-
-// Called after a person has been selected by the user.
-- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker didSelectPerson:(ABRecordRef)person
-{
- CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
- NSNumber* pickedId = [NSNumber numberWithInt:ABRecordGetRecordID(person)];
-
- if (picker.allowsEditing) {
- ABPersonViewController* personController = [[ABPersonViewController alloc] init];
- personController.displayedPerson = person;
- personController.personViewDelegate = self;
- personController.allowsEditing = picker.allowsEditing;
- // store id so can get info in peoplePickerNavigationControllerDidCancel
- picker.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:pickedId, kW3ContactId, nil];
-
- [peoplePicker pushViewController:personController animated:YES];
- } else {
- // Retrieve and return pickedContact information
- CDVContact* pickedContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)person];
- NSArray* fields = [picker.options objectForKey:@"fields"];
- NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
- picker.pickedContactDictionary = [pickedContact toDictionary:returnFields];
-
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
- [self.commandDelegate sendPluginResult:result callbackId:picker.callbackId];
-
- [[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
- }
-}
-
-// Called after a property has been selected by the user.
-- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
-{
- // not implemented
-}
-
-- (void)search:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSArray* fields = [command argumentAtIndex:0];
- NSDictionary* findOptions = [command argumentAtIndex:1 withDefault:[NSNull null]];
-
- [self.commandDelegate runInBackground:^{
- // from Apple: Important You must ensure that an instance of ABAddressBookRef is used by only one thread.
- // which is why address book is created within the dispatch queue.
- // more details here: http: //blog.byadrian.net/2012/05/05/ios-addressbook-framework-and-gcd/
- CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
- CDVContacts* __weak weakSelf = self; // play it safe to avoid retain cycles
- // it gets uglier, block within block.....
- [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errCode) {
- if (addrBook == NULL) {
- // permission was denied or other error - return error
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:errCode ? (int)errCode.errorCode:UNKNOWN_ERROR];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- return;
- }
-
- NSArray* foundRecords = nil;
- // get the findOptions values
- BOOL multiple = NO; // default is false
- NSString* filter = nil;
- NSArray* desiredFields = nil;
- if (![findOptions isKindOfClass:[NSNull class]]) {
- id value = nil;
- filter = (NSString*)[findOptions objectForKey:@"filter"];
- value = [findOptions objectForKey:@"multiple"];
- if ([value isKindOfClass:[NSNumber class]]) {
- // multiple is a boolean that will come through as an NSNumber
- multiple = [(NSNumber*)value boolValue];
- // NSLog(@"multiple is: %d", multiple);
- }
- desiredFields = [findOptions objectForKey:@"desiredFields"];
- // return all fields if desired fields are not explicitly defined
- if (desiredFields == nil || desiredFields.count == 0) {
- desiredFields = [NSArray arrayWithObjects:@"*", nil];
- }
- }
-
- NSDictionary* searchFields = [[CDVContact class] calcReturnFields:fields];
- NSDictionary* returnFields = [[CDVContact class] calcReturnFields:desiredFields];
-
- NSMutableArray* matches = nil;
- if (!filter || [filter isEqualToString:@""]) {
- // get all records
- foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addrBook);
- if (foundRecords && ([foundRecords count] > 0)) {
- // create Contacts and put into matches array
- // doesn't make sense to ask for all records when multiple == NO but better check
- int xferCount = multiple == YES ? (int)[foundRecords count] : 1;
- matches = [NSMutableArray arrayWithCapacity:xferCount];
-
- for (int k = 0; k < xferCount; k++) {
- CDVContact* xferContact = [[CDVContact alloc] initFromABRecord:(__bridge ABRecordRef)[foundRecords objectAtIndex:k]];
- [matches addObject:xferContact];
- xferContact = nil;
- }
- }
- } else {
- foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addrBook);
- matches = [NSMutableArray arrayWithCapacity:1];
- BOOL bFound = NO;
- int testCount = (int)[foundRecords count];
-
- for (int j = 0; j < testCount; j++) {
- CDVContact* testContact = [[CDVContact alloc] initFromABRecord:(__bridge ABRecordRef)[foundRecords objectAtIndex:j]];
- if (testContact) {
- bFound = [testContact foundValue:filter inFields:searchFields];
- if (bFound) {
- [matches addObject:testContact];
- }
- testContact = nil;
- }
- }
- }
- NSMutableArray* returnContacts = [NSMutableArray arrayWithCapacity:1];
-
- if ((matches != nil) && ([matches count] > 0)) {
- // convert to JS Contacts format and return in callback
- // - returnFields determines what properties to return
- @autoreleasepool {
- int count = multiple == YES ? (int)[matches count] : 1;
-
- for (int i = 0; i < count; i++) {
- CDVContact* newContact = [matches objectAtIndex:i];
- NSDictionary* aContact = [newContact toDictionary:returnFields];
- [returnContacts addObject:aContact];
- }
- }
- }
- // return found contacts (array is empty if no contacts found)
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:returnContacts];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- // NSLog(@"findCallback string: %@", jsString);
-
- if (addrBook) {
- CFRelease(addrBook);
- }
- }];
- }]; // end of workQueue block
-
- return;
-}
-
-- (void)save:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSDictionary* contactDict = [command argumentAtIndex:0];
-
- [self.commandDelegate runInBackground:^{
- CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
- CDVContacts* __weak weakSelf = self; // play it safe to avoid retain cycles
-
- [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errorCode) {
- CDVPluginResult* result = nil;
- if (addrBook == NULL) {
- // permission was denied or other error - return error
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode ? (int)errorCode.errorCode:UNKNOWN_ERROR];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- return;
- }
-
- bool bIsError = FALSE, bSuccess = FALSE;
- BOOL bUpdate = NO;
- CDVContactError errCode = UNKNOWN_ERROR;
- CFErrorRef error;
- NSNumber* cId = [contactDict valueForKey:kW3ContactId];
- CDVContact* aContact = nil;
- ABRecordRef rec = nil;
- if (cId && ![cId isKindOfClass:[NSNull class]]) {
- rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
- if (rec) {
- aContact = [[CDVContact alloc] initFromABRecord:rec];
- bUpdate = YES;
- }
- }
- if (!aContact) {
- aContact = [[CDVContact alloc] init];
- }
-
- bSuccess = [aContact setFromContactDict:contactDict asUpdate:bUpdate];
- if (bSuccess) {
- if (!bUpdate) {
- bSuccess = ABAddressBookAddRecord(addrBook, [aContact record], &error);
- }
- if (bSuccess) {
- bSuccess = ABAddressBookSave(addrBook, &error);
- }
- if (!bSuccess) { // need to provide error codes
- bIsError = TRUE;
- errCode = IO_ERROR;
- } else {
- // give original dictionary back? If generate dictionary from saved contact, have no returnFields specified
- // so would give back all fields (which W3C spec. indicates is not desired)
- // for now (while testing) give back saved, full contact
- NSDictionary* newContact = [aContact toDictionary:[CDVContact defaultFields]];
- // NSString* contactStr = [newContact JSONRepresentation];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newContact];
- }
- } else {
- bIsError = TRUE;
- errCode = IO_ERROR;
- }
- CFRelease(addrBook);
-
- if (bIsError) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:(int)errCode];
- }
-
- if (result) {
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- }];
- }]; // end of queue
-}
-
-- (void)remove:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSNumber* cId = [command argumentAtIndex:0];
-
- CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
- CDVContacts* __weak weakSelf = self; // play it safe to avoid retain cycles
-
- [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errorCode) {
- CDVPluginResult* result = nil;
- if (addrBook == NULL) {
- // permission was denied or other error - return error
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode ? (int)errorCode.errorCode:UNKNOWN_ERROR];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- return;
- }
-
- bool bIsError = FALSE, bSuccess = FALSE;
- CDVContactError errCode = UNKNOWN_ERROR;
- CFErrorRef error;
- ABRecordRef rec = nil;
- if (cId && ![cId isKindOfClass:[NSNull class]] && ([cId intValue] != kABRecordInvalidID)) {
- rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
- if (rec) {
- bSuccess = ABAddressBookRemoveRecord(addrBook, rec, &error);
- if (!bSuccess) {
- bIsError = TRUE;
- errCode = IO_ERROR;
- } else {
- bSuccess = ABAddressBookSave(addrBook, &error);
- if (!bSuccess) {
- bIsError = TRUE;
- errCode = IO_ERROR;
- } else {
- // set id to null
- // [contactDict setObject:[NSNull null] forKey:kW3ContactId];
- // result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: contactDict];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
- // NSString* contactStr = [contactDict JSONRepresentation];
- }
- }
- } else {
- // no record found return error
- bIsError = TRUE;
- errCode = UNKNOWN_ERROR;
- }
- } else {
- // invalid contact id provided
- bIsError = TRUE;
- errCode = INVALID_ARGUMENT_ERROR;
- }
-
- if (addrBook) {
- CFRelease(addrBook);
- }
- if (bIsError) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:(int)errCode];
- }
- if (result) {
- [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- }];
- return;
-}
-
-@end
-
-/* ABPersonViewController does not have any UI to dismiss. Adding navigationItems to it does not work properly
- * The navigationItems are lost when the app goes into the background. The solution was to create an empty
- * NavController in front of the ABPersonViewController. This will cause the ABPersonViewController to have a back button. By subclassing the ABPersonViewController, we can override viewDidDisappear and take down the entire NavigationController.
- */
-@implementation CDVDisplayContactViewController
-@synthesize contactsPlugin;
-
-- (void)viewWillDisappear:(BOOL)animated
-{
- [super viewWillDisappear:animated];
-
- [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
-}
-
-@end
-@implementation CDVAddressBookAccessError
-
-@synthesize errorCode;
-
-- (CDVAddressBookAccessError*)initWithCode:(CDVContactError)code
-{
- self = [super init];
- if (self) {
- self.errorCode = code;
- }
- return self;
-}
-
-@end
-
-@implementation CDVAddressBookHelper
-
-/**
- * NOTE: workerBlock is responsible for releasing the addressBook that is passed to it
- */
-- (void)createAddressBook:(CDVAddressBookWorkerBlock)workerBlock
-{
- // TODO: this probably should be reworked - seems like the workerBlock can just create and release its own AddressBook,
- // and also this important warning from (http://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/BasicObjects.html):
- // "Important: Instances of ABAddressBookRef cannot be used by multiple threads. Each thread must make its own instance."
- ABAddressBookRef addressBook;
-
- CFErrorRef error = nil;
- // CFIndex status = ABAddressBookGetAuthorizationStatus();
- addressBook = ABAddressBookCreateWithOptions(NULL, &error);
- // NSLog(@"addressBook access: %lu", status);
- ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
- // callback can occur in background, address book must be accessed on thread it was created on
- dispatch_sync(dispatch_get_main_queue(), ^{
- if (error) {
- workerBlock(NULL, [[CDVAddressBookAccessError alloc] initWithCode:UNKNOWN_ERROR]);
- } else if (!granted) {
- workerBlock(NULL, [[CDVAddressBookAccessError alloc] initWithCode:PERMISSION_DENIED_ERROR]);
- } else {
- // access granted
- workerBlock(addressBook, [[CDVAddressBookAccessError alloc] initWithCode:UNKNOWN_ERROR]);
- }
- });
- });
-}
-
-@end
diff --git a/plugins/cordova-plugin-contacts/src/ubuntu/contacts.cpp b/plugins/cordova-plugin-contacts/src/ubuntu/contacts.cpp
deleted file mode 100644
index 373a276..0000000
--- a/plugins/cordova-plugin-contacts/src/ubuntu/contacts.cpp
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#include "contacts.h"
-
-#if defined QTCONTACTS_USE_NAMESPACE
-QTCONTACTS_USE_NAMESPACE
-#endif
-
-Contacts::Contacts(Cordova *cordova): CPlugin(cordova) {
- m_fieldNamePairs.clear();
-
- m_fieldNamePairs["displayName"] = QContactDetail::TypeDisplayLabel;
- m_fieldNamePairs["name"] = QContactDetail::TypeName;
- m_fieldNamePairs["nickname"] = QContactDetail::TypeNickname;
- m_fieldNamePairs["phoneNumbers"] = QContactDetail::TypePhoneNumber;
- m_fieldNamePairs["emails"] = QContactDetail::TypeEmailAddress;
- m_fieldNamePairs["addresses"] = QContactDetail::TypeAddress;
- m_fieldNamePairs["ims"] = QContactDetail::TypeOnlineAccount;
- m_fieldNamePairs["organizations"] = QContactDetail::TypeOrganization;
- m_fieldNamePairs["birthday"] = QContactDetail::TypeBirthday;
- m_fieldNamePairs["note"] = QContactDetail::TypeNote;
- m_fieldNamePairs["photos"] = QContactDetail::TypeAvatar;
- m_fieldNamePairs["urls"] = QContactDetail::TypeUrl;
-
- m_notSupportedFields.clear();
- m_notSupportedFields << "categories";
- m_manager.clear();
- m_manager = QSharedPointer(new QContactManager());
-}
-
-void Contacts::save(int scId, int ecId, const QVariantMap ¶ms) {
- QContact result;
- QList detailsToDelete;
-
- if (params.find("id") != params.end()) {
- QString id = params.find("id")->toString();
- if (!id.isEmpty()) {
- result = m_manager->contact(QContactId::fromString(id));
- result.clearDetails();
- }
- }
-
- foreach (QString field, params.keys()) {
- QContactDetail::DetailType qtDefinition = cordovaFieldNameToQtDefinition(field);
- if (qtDefinition == QContactDetail::TypeUndefined)
- continue;
-
- if (field == "nickname") {
- QContactNickname *detail = new QContactNickname;
- detail->setNickname(params[field].toString());
- detailsToDelete << detail;
- result.saveDetail(detail);
- } else if (field == "note") {
- QContactNote *detail = new QContactNote;
- detail->setNote(params[field].toString());
- detailsToDelete << detail;
- result.saveDetail(detail);
- } else if (field == "phoneNumbers") {
- if (params[field].type() != QVariant::List)
- continue;
- QVariantList phonesList = params[field].toList();
- foreach (const QVariant &phoneDesc, phonesList) {
- if (phoneDesc.type() != QVariant::Map)
- continue;
- QContactPhoneNumber *detail = new QContactPhoneNumber;
- detail->setNumber(phoneDesc.toMap()["value"].toString());
- if (!phoneDesc.toMap()["type"].toString().isEmpty() &&
- phoneDesc.toMap()["type"].toString() != "phone")
- detail->setSubTypes(QList() <<
- subTypePhoneFromString(phoneDesc.toMap()["type"].toString()));
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
- } else if (field == "emails") {
- if (params[field].type() != QVariant::List)
- continue;
- QVariantList emailsList = params[field].toList();
- foreach (const QVariant &emailDesc, emailsList) {
- if (emailDesc.type() != QVariant::Map)
- continue;
- if (emailDesc.toMap()["value"].toString().isEmpty())
- continue;
- QContactEmailAddress *detail = new QContactEmailAddress;
- detail->setEmailAddress(emailDesc.toMap()["value"].toString());
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
- } else if (field == "ims") {
- if (params[field].type() != QVariant::List)
- continue;
- QVariantList imsList = params[field].toList();
- foreach (const QVariant &imDesc, imsList) {
- if (imDesc.type() != QVariant::Map)
- continue;
- QContactOnlineAccount *detail = new QContactOnlineAccount;
- detail->setAccountUri(imDesc.toMap()["value"].toString());
- if (!imDesc.toMap()["type"].toString().isEmpty())
- detail->setSubTypes(QList() <<
- subTypeOnlineAccountFromString(imDesc.toMap()["type"].toString()));
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
- } else if (field == "photos") {
- if (params[field].type() != QVariant::List)
- continue;
- QVariantList photosList = params[field].toList();
- foreach (const QVariant &photoDesc, photosList) {
- if (photoDesc.type() != QVariant::Map)
- continue;
- //TODO: we need to decide should we support base64 images or not
- if (photoDesc.toMap()["type"].toString() != "url")
- continue;
- QContactAvatar *detail = new QContactAvatar;
- detail->setImageUrl(QUrl(photoDesc.toMap()["value"].toString()));
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
- } else if (field == "urls") {
- if (params[field].type() != QVariant::List)
- continue;
- QVariantList urlsList = params[field].toList();
- foreach (const QVariant &urlDesc, urlsList) {
- if (urlDesc.type() != QVariant::Map)
- continue;
- QContactUrl *detail = new QContactUrl;
- detail->setUrl(urlDesc.toMap()["value"].toString());
- if (!urlDesc.toMap()["type"].toString().isEmpty())
- detail->setSubType((QContactUrl::SubType) subTypeUrlFromString(urlDesc.toMap()["type"].toString()));
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
- } else if (field == "birthday") {
- QDateTime birthday;
- birthday.setTime_t(params[field].toLongLong() / 1000);
-
- QContactBirthday *detail = new QContactBirthday;
- detail->setDateTime(birthday);
- detailsToDelete << detail;
- result.saveDetail(detail);
- } else if (field == "organizations") {
-
- if (params[field].type() != QVariant::List)
- continue;
- QVariantList organizationsList = params[field].toList();
- foreach (const QVariant &organizationDesc, organizationsList) {
- if (organizationDesc.type() != QVariant::Map)
- continue;
- QContactOrganization *detail = new QContactOrganization;
- detail->setName(organizationDesc.toMap()["name"].toString());
- detail->setDepartment(QStringList() << organizationDesc.toMap()["department"].toString());
- detail->setRole(organizationDesc.toMap()["title"].toString());
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
-
- } else if (field == "name") {
- QContactName *detail = new QContactName;
- QVariantMap nameMap = params[field].toMap();
- detail->setLastName(nameMap["familyName"].toString());
- detail->setFirstName(nameMap["givenName"].toString());
- detail->setMiddleName(nameMap["middleName"].toString());
- detail->setPrefix(nameMap["honorificPrefix"].toString());
- detail->setSuffix(nameMap["honorificSuffix"].toString());
- detailsToDelete << detail;
- result.saveDetail(detail);
- }
-
- }
- if (!m_manager->saveContact(&result)) {
- switch (m_manager->error()) {
- case QContactManager::DoesNotExistError:
- case QContactManager::AlreadyExistsError:
- case QContactManager::InvalidDetailError:
- case QContactManager::InvalidRelationshipError:
- case QContactManager::BadArgumentError:
- case QContactManager::InvalidContactTypeError:
- callback(ecId, "ContactError.INVALID_ARGUMENT_ERROR");
- break;
- case QContactManager::DetailAccessError:
- case QContactManager::PermissionsError:
- callback(ecId, "ContactError.PERMISSION_DENIED_ERROR");
- break;
- case QContactManager::NotSupportedError:
- callback(ecId, "ContactError.NOT_SUPPORTED_ERROR");
- break;
- case QContactManager::TimeoutError:
- callback(ecId, "ContactError.TIMEOUT_ERROR");
- break;
- case QContactManager::UnspecifiedError:
- case QContactManager::LockedError:
- case QContactManager::OutOfMemoryError:
- case QContactManager::VersionMismatchError:
- case QContactManager::LimitReachedError:
- case QContactManager::NoError:
- default:
- callback(ecId, "ContactError.UNKNOWN_ERROR");
- break;
- }
- } else {
- callback(scId, jsonedContact(result));
- }
- qDeleteAll(detailsToDelete);
-}
-
-void Contacts::remove(int scId, int ecId, const QString &localId) {
- QContactId id = QContactId::fromString(localId);
-
- if (!m_manager->removeContact(id)) {
- switch (m_manager->error()) {
- case QContactManager::AlreadyExistsError:
- case QContactManager::InvalidDetailError:
- case QContactManager::InvalidRelationshipError:
- case QContactManager::BadArgumentError:
- case QContactManager::InvalidContactTypeError:
- callback(ecId, "ContactError.INVALID_ARGUMENT_ERROR");
- break;
- case QContactManager::DetailAccessError:
- case QContactManager::PermissionsError:
- callback(ecId, "ContactError.PERMISSION_DENIED_ERROR");
- break;
- case QContactManager::NotSupportedError:
- callback(ecId, "ContactError.NOT_SUPPORTED_ERROR");
- break;
- case QContactManager::TimeoutError:
- callback(ecId, "ContactError.TIMEOUT_ERROR");
- break;
- case QContactManager::UnspecifiedError:
- case QContactManager::LockedError:
- case QContactManager::OutOfMemoryError:
- case QContactManager::VersionMismatchError:
- case QContactManager::LimitReachedError:
- case QContactManager::NoError:
- case QContactManager::DoesNotExistError:
- default:
- callback(ecId, "ContactError.UNKNOWN_ERROR");
- break;
- }
-
- } else {
- cb(scId);
- }
-}
-
-void Contacts::search(int scId, int ecId, const QStringList &fields, const QVariantMap ¶ms) {
- QString filter;
- bool multiple = true;
-
- if (params.find("filter") != params.end()) {
- filter = params["filter"].toString();
- }
- if (params.find("multiple") != params.end()) {
- multiple = params["multiple"].toBool();
- }
-
- findContacts(scId, ecId, fields, filter, multiple);
-}
-
-void Contacts::findContacts(int scId, int ecId, const QStringList &fields, const QString &filter, bool multiple) {
- if (fields.length() <= 0){
- callback(ecId, "new ContactError(ContactError.INVALID_ARGUMENT_ERROR)");
- }
-
- QContactUnionFilter unionFilter;
-
- QMap > fieldNames;
- fieldNames[QContactDetail::TypeDisplayLabel] << QContactDisplayLabel::FieldLabel;
- fieldNames[QContactDetail::TypeName] << QContactName::FieldFirstName << QContactName::FieldLastName << QContactName::FieldMiddleName << QContactName::FieldPrefix << QContactName::FieldSuffix;
- fieldNames[QContactDetail::TypeNickname] << QContactNickname::FieldNickname;
- fieldNames[QContactDetail::TypePhoneNumber] << QContactPhoneNumber::FieldNumber;
- fieldNames[QContactDetail::TypeEmailAddress] << QContactEmailAddress::FieldEmailAddress;
- fieldNames[QContactDetail::TypeAddress] << QContactAddress::FieldCountry << QContactAddress::FieldLocality << QContactAddress::FieldPostcode << QContactAddress::FieldPostOfficeBox << QContactAddress::FieldRegion << QContactAddress::FieldStreet;
- fieldNames[QContactDetail::TypeOnlineAccount] << QContactOnlineAccount::FieldAccountUri;
- fieldNames[QContactDetail::TypeOrganization] << QContactOrganization::FieldAssistantName << QContactOrganization::FieldDepartment << QContactOrganization::FieldLocation << QContactOrganization::FieldName << QContactOrganization::FieldRole << QContactOrganization::FieldTitle;
- fieldNames[QContactDetail::TypeBirthday] << QContactBirthday::FieldBirthday;
- fieldNames[QContactDetail::TypeNote] << QContactNote::FieldNote;
- fieldNames[QContactDetail::TypeUrl] << QContactUrl::FieldUrl;
-
- foreach (const QContactDetail::DetailType &defName, fieldNames.keys()) {
- foreach(int fieldName, fieldNames[defName]) {
- QContactDetailFilter subFilter;
- subFilter.setDetailType(defName, fieldName);
- subFilter.setValue(filter);
- subFilter.setMatchFlags(QContactFilter::MatchContains);
- unionFilter.append(subFilter);
- }
- }
-
- QList contacts = m_manager->contacts(unionFilter);
- if (contacts.empty()) {
- callback(scId, "[]");
- } else {
- QStringList stringifiedContacts;
- foreach (const QContact &contact, contacts) {
- stringifiedContacts << jsonedContact(contact, fields);
-
- if (!multiple)
- break;
- }
- callback(scId, QString("[%1]").arg(stringifiedContacts.join(", ")));
- }
-}
-
-QContactDetail::DetailType Contacts::cordovaFieldNameToQtDefinition(const QString &cordovaFieldName) const {
- if (m_fieldNamePairs.contains(cordovaFieldName))
- return m_fieldNamePairs[cordovaFieldName];
-
- return QContactDetail::TypeUndefined;
-}
-
-int Contacts::subTypePhoneFromString(const QString &cordovaSubType) const
-{
- QString preparedSubType = cordovaSubType.toLower();
- if (preparedSubType == "mobile")
- return QContactPhoneNumber::SubTypeMobile;
- else if (preparedSubType == "fax")
- return QContactPhoneNumber::SubTypeFax;
- else if (preparedSubType == "pager")
- return QContactPhoneNumber::SubTypePager;
- else if (preparedSubType == "voice")
- return QContactPhoneNumber::SubTypeVoice;
- else if (preparedSubType == "modem")
- return QContactPhoneNumber::SubTypeModem;
- else if (preparedSubType == "video")
- return QContactPhoneNumber::SubTypeVideo;
- else if (preparedSubType == "car")
- return QContactPhoneNumber::SubTypeCar;
- else if (preparedSubType == "assistant")
- return QContactPhoneNumber::SubTypeAssistant;
- return QContactPhoneNumber::SubTypeLandline;
-}
-
-int Contacts::subTypeOnlineAccountFromString(const QString &cordovaSubType) const {
- QString preparedSubType = cordovaSubType.toLower();
- if (preparedSubType == "aim")
- return QContactOnlineAccount::ProtocolAim;
- else if (preparedSubType == "icq")
- return QContactOnlineAccount::ProtocolIcq;
- else if (preparedSubType == "irc")
- return QContactOnlineAccount::ProtocolIrc;
- else if (preparedSubType == "jabber")
- return QContactOnlineAccount::ProtocolJabber;
- else if (preparedSubType == "msn")
- return QContactOnlineAccount::ProtocolMsn;
- else if (preparedSubType == "qq")
- return QContactOnlineAccount::ProtocolQq;
- else if (preparedSubType == "skype")
- return QContactOnlineAccount::ProtocolSkype;
- else if (preparedSubType == "yahoo")
- return QContactOnlineAccount::ProtocolYahoo;
- return QContactOnlineAccount::ProtocolUnknown;
-}
-
-int Contacts::subTypeUrlFromString(const QString &cordovaSubType) const {
- QString preparedSubType = cordovaSubType.toLower();
- if (preparedSubType == "blog")
- return QContactUrl::SubTypeBlog;
- else if (preparedSubType == "favourite")
- return QContactUrl::SubTypeFavourite;
- return QContactUrl::SubTypeHomePage;
-}
-
-QString Contacts::subTypePhoneToString(int qtSubType) const {
- if (qtSubType == QContactPhoneNumber::SubTypeMobile)
- return "mobile";
- else if (qtSubType == QContactPhoneNumber::SubTypeFax)
- return "fax";
- else if (qtSubType == QContactPhoneNumber::SubTypePager)
- return "pager";
- else if (qtSubType == QContactPhoneNumber::SubTypeVoice)
- return "voice";
- else if (qtSubType == QContactPhoneNumber::SubTypeModem)
- return "modem";
- else if (qtSubType == QContactPhoneNumber::SubTypeVideo)
- return "video";
- else if (qtSubType == QContactPhoneNumber::SubTypeCar)
- return "car";
- else if (qtSubType == QContactPhoneNumber::SubTypeAssistant)
- return "assistant";
- return "home";
-}
-
-QString Contacts::subTypeOnlineAccountToString(int qtSubType) const {
- if (qtSubType == QContactOnlineAccount::ProtocolAim)
- return "aim";
- else if (qtSubType == QContactOnlineAccount::ProtocolIcq)
- return "icq";
- else if (qtSubType == QContactOnlineAccount::ProtocolIrc)
- return "irc";
- else if (qtSubType == QContactOnlineAccount::ProtocolJabber)
- return "jabber";
- else if (qtSubType == QContactOnlineAccount::ProtocolMsn)
- return "msn";
- else if (qtSubType == QContactOnlineAccount::ProtocolQq)
- return "qq";
- else if (qtSubType == QContactOnlineAccount::ProtocolSkype)
- return "skype";
- else if (qtSubType == QContactOnlineAccount::ProtocolYahoo)
- return "yahoo";
- return "unknown";
-}
-
-QString Contacts::subTypeUrlToString(int qtSubType) const {
- if (qtSubType == QContactUrl::SubTypeBlog)
- return "blog";
- else if (qtSubType == QContactUrl::SubTypeFavourite)
- return "favourite";
- return "homepage";
-}
-
-QString Contacts::jsonedContact(const QContact &contact, const QStringList &fields) const {
- QStringList resultingFields = fields;
- if (resultingFields.empty())
- resultingFields.append(m_fieldNamePairs.keys());
- if (!resultingFields.contains("id"))
- resultingFields << "id";
- QStringList fieldValuesList;
- foreach (const QString &field, resultingFields) {
- QContactDetail::DetailType qtDefinitionName = cordovaFieldNameToQtDefinition(field);
- if (field == "id") {
- fieldValuesList << QString("%1: \"%2\"")
- .arg(field)
- .arg(contact.id().toString());
- } else if (field == "displayName") {
- QContactDisplayLabel detail = contact.detail(qtDefinitionName);
- fieldValuesList << QString("%1: \"%2\"")
- .arg(field)
- .arg(detail.label());
- } else if (field == "nickname") {
- QContactNickname detail = contact.detail(qtDefinitionName);
- fieldValuesList << QString("%1: \"%2\"")
- .arg(field)
- .arg(detail.nickname());
- } else if (field == "note") {
- QContactNote detail = contact.detail(qtDefinitionName);
- fieldValuesList << QString("%1: \"%2\"")
- .arg(field)
- .arg(detail.note());
- } else if (field == "phoneNumbers") {
- QStringList fieldValues;
- QList details = contact.details(qtDefinitionName);
- foreach (const QContactDetail &detail, details) {
- QContactPhoneNumber castedDetail = detail;
- QStringList subTypes;
- foreach (int subType, castedDetail.subTypes())
- subTypes << subTypePhoneToString(subType);
-
- if (subTypes.isEmpty())
- subTypes << "phone";
- foreach(const QString &subType, subTypes) {
- fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
- .arg(subType)
- .arg(castedDetail.number())
- .arg("false");
- }
- }
- fieldValuesList << QString("%1: [%2]")
- .arg(field)
- .arg(fieldValues.join(", "));
- } else if (field == "emails") {
- QStringList fieldValues;
- QList details = contact.details(qtDefinitionName);
- foreach (const QContactDetail &detail, details) {
- QContactEmailAddress castedDetail = detail;
- fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
- .arg("email")
- .arg(castedDetail.emailAddress())
- .arg("false");
- }
- fieldValuesList << QString("%1: [%2]")
- .arg(field)
- .arg(fieldValues.join(", "));
- } else if (field == "ims") {
- QStringList fieldValues;
- QList details = contact.details(qtDefinitionName);
- foreach (const QContactDetail &detail, details) {
- QContactOnlineAccount castedDetail = detail;
- QStringList subTypes;
- foreach (int subType, castedDetail.subTypes())
- subTypes << subTypeOnlineAccountToString(subType);
-
- if (subTypes.isEmpty())
- subTypes << "IM";
- foreach(const QString &subType, subTypes) {
- fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
- .arg(subType)
- .arg(castedDetail.accountUri())
- .arg("false");
- }
- }
- fieldValuesList << QString("%1: [%2]")
- .arg(field)
- .arg(fieldValues.join(", "));
- } else if (field == "photos") {
- QStringList fieldValues;
- QList details = contact.details(qtDefinitionName);
- foreach (const QContactDetail &detail, details) {
- QContactAvatar castedDetail = detail;
- fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
- .arg("url")
- .arg(castedDetail.imageUrl().toString())
- .arg("false");
- }
- fieldValuesList << QString("%1: [%2]")
- .arg(field)
- .arg(fieldValues.join(", "));
- } else if (field == "urls") {
- QStringList fieldValues;
- QList details = contact.details(qtDefinitionName);
-
- foreach (const QContactDetail &detail, details) {
- QContactUrl castedDetail = detail;
- QString subType = subTypeUrlToString(castedDetail.subType());
-
- fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
- .arg(subType)
- .arg(castedDetail.url())
- .arg("false");
- }
- fieldValuesList << QString("%1: [%2]")
- .arg(field)
- .arg(fieldValues.join(", "));
- } else if (field == "birthday") {
- QContactBirthday detail = contact.detail(qtDefinitionName);
- fieldValuesList << QString("%1: %2")
- .arg(field)
- .arg(detail.dateTime().toMSecsSinceEpoch());
- } else if (field == "organizations") {
- QStringList fieldValues;
- QList details = contact.details(qtDefinitionName);
- foreach (const QContactDetail &detail, details) {
- QContactOrganization castedDetail = detail;
- fieldValues << QString("{type: \"%1\", name: \"%2\", department: \"%3\", title: \"%4\", pref: %5}")
- .arg("organization")
- .arg(castedDetail.name())
- .arg(castedDetail.department().join(" "))
- .arg(castedDetail.role())
- .arg("false");
- }
- fieldValuesList << QString("%1: [%2]")
- .arg(field)
- .arg(fieldValues.join(", "));
- } else if (field == "name") {
- QContactName detail = contact.detail(qtDefinitionName);
- fieldValuesList << QString("%1: {familyName: \"%2\", givenName: \"%3\", middleName: \"%4\", honorificPrefix: \"%5\", honorificSuffix: \"%6\"}")
- .arg(field)
- .arg(detail.lastName())
- .arg(detail.firstName())
- .arg(detail.middleName())
- .arg(detail.prefix())
- .arg(detail.suffix());
- }
-
-
- }
-
- return QString("{%1}").arg(fieldValuesList.join(", "));
-}
diff --git a/plugins/cordova-plugin-contacts/src/ubuntu/contacts.h b/plugins/cordova-plugin-contacts/src/ubuntu/contacts.h
deleted file mode 100644
index 4c1343b..0000000
--- a/plugins/cordova-plugin-contacts/src/ubuntu/contacts.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#ifndef CONTACTS_H_SSSSSSS
-#define CONTACTS_H_SSSSSSS
-
-#include
-
-#include
-#include
-
-QTCONTACTS_USE_NAMESPACE
-
-class Contacts : public CPlugin {
- Q_OBJECT
-public:
- explicit Contacts(Cordova *cordova);
-
- virtual const QString fullName() override {
- return Contacts::fullID();
- }
-
- virtual const QString shortName() override {
- return "Contacts";
- }
-
- static const QString fullID() {
- return "Contacts";
- }
-
-public slots:
- void save(int scId, int ecId, const QVariantMap ¶ms);
- void remove(int scId, int ecId, const QString &localId);
- void search(int scId, int ecId, const QStringList &fields, const QVariantMap ¶ms);
-
-private:
- void findContacts(int scId, int ecId, const QStringList &fields, const QString &filter, bool multiple);
- QContactDetail::DetailType cordovaFieldNameToQtDefinition(const QString &cordovaFieldName) const;
- int subTypePhoneFromString(const QString &cordovaSubType) const;
- int subTypeOnlineAccountFromString(const QString &cordovaSubType) const;
- int subTypeUrlFromString(const QString &cordovaSubType) const;
- QString subTypePhoneToString(int qtSubType) const;
- QString subTypeOnlineAccountToString(int qtSubType) const;
- QString subTypeUrlToString(int qtSubType) const;
- QString jsonedContact(const QContact &contact, const QStringList &fields = QStringList()) const;
-
- QHash m_fieldNamePairs;
- QSet m_notSupportedFields;
- QSharedPointer m_manager;
-};
-
-#endif
diff --git a/plugins/cordova-plugin-contacts/src/windows/ContactProxy.js b/plugins/cordova-plugin-contacts/src/windows/ContactProxy.js
deleted file mode 100644
index 61f1d7a..0000000
--- a/plugins/cordova-plugin-contacts/src/windows/ContactProxy.js
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-var ContactField = require('./ContactField'),
- ContactAddress = require('./ContactAddress'),
- ContactOrganization = require('./ContactOrganization'),
- ContactName = require('./ContactName'),
- ContactError = require('./ContactError'),
- Contact = require('./Contact');
-
-
-function convertToContact(windowsContact) {
- var contact = new Contact();
-
- // displayName & nickname
- contact.displayName = windowsContact.displayName || windowsContact.name;
- contact.nickname = windowsContact.name;
- contact.id = windowsContact.id;
-
- // name
- // Additional fields like lastName, middleName etc. available on windows8.1/wp8.1 only
- contact.name = new ContactName(
- windowsContact.displayName || windowsContact.name,
- windowsContact.lastName,
- windowsContact.firstName || windowsContact.name,
- windowsContact.middleName,
- windowsContact.honorificNamePrefix || windowsContact.honorificPrefix,
- windowsContact.honorificNameSuffix || windowsContact.honorificSuffix);
-
- // phoneNumbers
- contact.phoneNumbers = [];
- var phoneSource = windowsContact.phoneNumbers || windowsContact.phones;
- for (var i = 0; i < phoneSource.size; i++) {
- var rawPhone = phoneSource[i];
- var phone = new ContactField(rawPhone.category || rawPhone.kind, rawPhone.value || rawPhone.number);
- contact.phoneNumbers.push(phone);
- }
-
- // emails
- contact.emails = [];
- var emailSource = windowsContact.emails;
- for (var i = 0; i < emailSource.size; i++) {
- var rawEmail = emailSource[i];
- var email = new ContactField(rawEmail.category || rawEmail.kind, rawEmail.value || rawEmail.address);
- contact.emails.push(email);
- }
-
- // addressres
- contact.addresses = [];
- var addressSource = windowsContact.locations || windowsContact.addresses;
- for (var i = 0; i < addressSource.size; i++) {
- var rawAddress = addressSource[i];
- var address = new ContactAddress(
- null,
- rawAddress.category || rawAddress.kind,
- rawAddress.unstructuredAddress,
- rawAddress.street || rawAddress.streetAddress,
- rawAddress.city || rawAddress.locality,
- rawAddress.region,
- rawAddress.postalCode,
- rawAddress.country);
- contact.addresses.push(address);
- }
-
- // ims
- contact.ims = [];
- var imSource = windowsContact.instantMessages || windowsContact.connectedServiceAccounts;
- for (var i = 0; i < imSource.size; i++) {
- var rawIm = imSource[i];
- var im = new ContactField(rawIm.category || rawIm.serviceName, rawIm.userName || rawIm.id);
- contact.ims.push(im);
- }
-
- // jobInfo field available on Windows 8.1/WP8.1 only
- var jobInfo = windowsContact.jobInfo;
- if (jobInfo) {
- contact.organizations = [];
- for (var j = 0; j < jobInfo.size; j++) {
- var rawJob = jobInfo[i];
- contact.organizations.push(new ContactOrganization(false, null,
- rawJob.companyName, rawJob.department, rawJob.title));
- }
- }
-
- // note field available on Windows 8.1/WP8.1 only
- var contactNotes = windowsContact.notes;
- if (contactNotes) {
- contact.note = contactNotes;
- }
-
- // returned is a file, a blob url can be made
- var contactPhoto = windowsContact.thumbnail;
- if (contactPhoto && contactPhoto.path) {
- contact.photos = [new ContactField('url', URL.createObjectURL(contactPhoto) , false)];
- }
-
- return contact;
-}
-
-// Win API Contacts namespace
-var contactsNS = Windows.ApplicationModel.Contacts;
-
-function cdvContactToWindowsContact(contact) {
- var result = new contactsNS.Contact();
-
- // name first
- if (contact.name) {
- result.displayNameOverride = contact.name.formatted;
- result.firstName = contact.name.givenName;
- result.middleName = contact.name.middleName;
- result.lastName = contact.name.familyName;
- result.honorificNamePrefix = contact.name.honorificPrefix;
- result.honorificNameSuffix = contact.name.honorificSuffix;
- }
-
- result.nickname = contact.nickname;
-
- // phone numbers
- if (contact.phoneNumbers) {
- contact.phoneNumbers.forEach(function(contactPhone) {
- var resultPhone = new contactsNS.ContactPhone();
- resultPhone.description = contactPhone.type;
- resultPhone.number = contactPhone.value;
- result.phones.push(resultPhone);
- });
- }
-
- // emails
- if (contact.emails) {
- contact.emails.forEach(function(contactEmail) {
- var resultEmail = new contactsNS.ContactEmail();
- resultEmail.description = contactEmail.type;
- resultEmail.address = contactEmail.value;
- result.emails.push(resultEmail);
- });
- }
-
- // Addresses
- if (contact.addresses) {
- contact.addresses.forEach(function(contactAddress) {
- var address = new contactsNS.ContactAddress();
- address.description = contactAddress.type;
- address.streetAddress = contactAddress.streetAddress;
- address.locality = contactAddress.locality;
- address.region = contactAddress.region;
- address.postalCode = contactAddress.postalCode;
- address.country = contactAddress.country;
- result.addresses.push(address);
- });
- }
-
- // IMs
- if (contact.ims) {
- contact.ims.forEach(function(contactIM) {
- var acct = new contactsNS.ContactConnectedServiceAccount();
- acct.serviceName = contactIM.type;
- acct.id = contactIM.value;
- result.connectedServiceAccounts.push(acct);
- });
- }
-
- // JobInfo
- if (contact.organizations) {
- contact.organizations.forEach(function(contactOrg) {
- var job = new contactsNS.ContactJobInfo();
- job.companyName = contactOrg.name;
- job.department = contactOrg.department;
- job.description = contactOrg.type;
- job.title = contactOrg.title;
- result.jobInfo.push(job);
- });
- }
-
- result.notes = contact.note;
-
- if (contact.photos) {
- var eligiblePhotos = contact.photos.filter(function(photo) {
- return typeof photo.value !== 'undefined';
- });
- if (eligiblePhotos.length > 0) {
- var supportedPhoto = eligiblePhotos[0];
- var path = supportedPhoto.value;
-
- try {
- var streamRef;
- if (/^([a-z][a-z0-9+\-.]*):\/\//i.test(path)) {
- streamRef = Windows.Storage.Streams.RandomAccessStreamReference.createFromUri(new Windows.Foundation.Uri(path));
- } else {
- streamRef = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(path);
- }
- result.thumbnail = streamRef;
- }
- catch (e) {
- // incompatible reference to the photo
- }
- }
- }
-
- return result;
-}
-
-module.exports = {
-
- pickContact: function (win, fail, args) {
-
- // ContactPicker class works differently on Windows8/8.1 and Windows Phone 8.1
- // so we need to detect when we are running on phone
- var runningOnPhone = navigator.userAgent.indexOf('Windows Phone') !== -1;
-
- var picker = new contactsNS.ContactPicker();
- if (runningOnPhone) {
- // TODO: Windows Phone 8.1 requires this specification. This should be noted in quirks
- // See http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.contacts.contactpicker.desiredfieldswithcontactfieldtype.aspx for details
- // Multiple ContactFieldType items, appended to array causes `Request not suported` error.
- picker.desiredFieldsWithContactFieldType.append(Windows.ApplicationModel.Contacts.ContactFieldType.phoneNumber);
- }
-
- // pickContactAsync is available on Windows 8.1 or later, instead of
- // pickSingleContactAsync, which is deprecated in Windows 8.1,
- // so try to use newer method, if available.
- // see http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.contacts.contactpicker.picksinglecontactasync.aspx
-
- var pickRequest = picker.pickContactAsync ? picker.pickContactAsync() : picker.pickSingleContactAsync();
- pickRequest.done(function (contact) {
- // if contact was not picked
- if (!contact) {
- var cancelledError = new ContactError(ContactError.OPERATION_CANCELLED_ERROR);
- cancelledError.message = "User did not pick a contact.";
- fail(cancelledError);
- return;
- }
- // If we are on desktop, just send em back
- if (!runningOnPhone) {
- win(convertToContact(contact));
- return;
- }
- // On WP8.1 fields set in resulted Contact object depends on desiredFieldsWithContactFieldType property of contact picker
- // so we retrieve full contact by its' Id
- contactsNS.ContactManager.requestStoreAsync().done(function (contactStore) {
- contactStore.getContactAsync(contact.id).done(function(con) {
- win(convertToContact(con));
- }, function() {
- fail(new ContactError(ContactError.UNKNOWN_ERROR));
- });
- }, function () {
- fail(new ContactError(ContactError.UNKNOWN_ERROR));
- });
- });
- },
-
- save: function (win, fail, args) {
- if (typeof contactsNS.ContactList === 'undefined') {
- // Not supported yet since WinJS API do not provide methods to manage contactStore
- // On Windows Phone 8.1 this can be implemented using native class library
- // See Windows.Phone.PersonalInformation namespace
- // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.phone.personalinformation.aspx
-
- //We don't need to create Error object here since it will be created at navigator.contacts.find() method
- fail && fail(ContactError.NOT_SUPPORTED_ERROR);
- return;
- }
-
- var winContact = cdvContactToWindowsContact(args[0]);
-
- contactsNS.ContactManager.requestStoreAsync(contactsNS.ContactStoreAccessType.appContactsReadWrite).then(function(store) {
- return store.findContactListsAsync().then(function(lists) {
- if (lists.length > 0) {
- return lists[0];
- } else {
- return store.createContactListAsync('');
- }
- }, function(error) {
- return store.createContactListAsync('');
- });
- }).then(function(list) {
- return list.saveContactAsync(winContact);
- }).done(function(result) {
- win(convertToContact(winContact));
- }, function(error) {
- fail(error);
- });
- },
-
- remove: function(win, fail, args) {
- if (typeof contactsNS.ContactList === 'undefined') {
- // Not supported yet since WinJS API do not provide methods to manage contactStore
- // On Windows Phone 8.1 this can be implemented using native class library
- // See Windows.Phone.PersonalInformation namespace
- // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.phone.personalinformation.aspx
-
- //We don't need to create Error object here since it will be created at navigator.contacts.find() method
- fail && fail(ContactError.NOT_SUPPORTED_ERROR);
- return;
- }
-
- // This is a complicated scenario because in Win10, there is a notion of 'app contacts' vs 'global contacts'.
- // search() returns all global contacts, which are "aggregate contacts", so the IDs of contacts that Cordova
- // creates never match the IDs of the contacts returned from search().
- // In order to work around this, we need to:
- // - Get two Stores: one that is read-write to the app-contacts list, one which is read-only for global contacts
- // - Read the app-local store to see if a contact with the passed-in ID matches
- // - Grab the global aggregate contact manager, then ask it for raw contacts (app-local ACM returns access denied)
- // - Find my app-list of contacts
- // - Enumerate the raw contacts and see if there is a raw contact whose parent list matches the app-list
- // - If so, remove the raw contact from the app-list
- // - If any of this fails, the operation fails
- WinJS.Promise.join([contactsNS.ContactManager.requestStoreAsync(contactsNS.ContactStoreAccessType.appContactsReadWrite),
- contactsNS.ContactManager.requestStoreAsync(contactsNS.ContactStoreAccessType.allContactsReadOnly)]).then(function(stores) {
- var readOnlyStore = stores[1];
- var writableStore = stores[0];
-
- var storeReader = writableStore.getContactReader();
- return storeReader.readBatchAsync().then(function(batch) {
- if (batch.status !== contactsNS.ContactBatchStatus.success) {
- // Couldn't read contacts store
- throw new ContactError(ContactError.IO_ERROR);
- }
-
- var candidates = batch.contacts.filter(function(testContact) {
- return testContact.id === args[0];
- });
-
- if (candidates.length === 0) {
- // No matching contact from aggregate store
- throw new ContactError(ContactError.IO_ERROR);
- }
-
- return candidates[0];
- }).then(function(contactToDelete) {
- return readOnlyStore.aggregateContactManager.findRawContactsAsync(contactToDelete);
- }).then(function(rawContacts) {
- return writableStore.findContactListsAsync().then(function(lists) {
- var deleteList = null;
- var deleteContact = null;
- var matched = lists.some(function(list) {
- for (var i = 0; i < rawContacts.length; i++) {
- if (rawContacts[i].contactListId === list.id) {
- deleteList = list;
- deleteContact = rawContacts[i];
- return true;
- }
- }
- return false;
- });
-
- if (!matched) {
- throw new ContactError(ContactError.IO_ERROR);
- }
-
- return deleteList.deleteContactAsync(deleteContact);
- });
- });
- }).done(function() {
- win();
- }, function(error) {
- fail(error);
- });
- },
-
- search: function (win, fail, options) {
-
- // searchFields is not supported yet due to WP8.1 API limitations.
- // findContactsAsync(String) method will attempt to match the name, email address, or phone number of a contact.
- // see http://msdn.microsoft.com/en-us/library/windows/apps/dn624861.aspx for details
- var searchFields = options[0],
- searchOptions = options[1],
- searchFilter = searchOptions.filter,
- searchMultiple = searchOptions && searchOptions.multiple;
-
- // Check if necessary API is available.
- // If not available, we are running on desktop, which doesn't support searching for contacts
- if (!(contactsNS.ContactManager && contactsNS.ContactManager.requestStoreAsync)) {
- fail(new ContactError(ContactError.NOT_SUPPORTED_ERROR));
- return;
- }
-
- // Retrieve contact store instance
- var contactStoreRequest = contactsNS.ContactManager.requestStoreAsync();
-
- // When contact store retrieved
- contactStoreRequest.done(function (contactStore) {
- // determine, which function we use depending on whether searchOptions.filter specified or not
- var contactsRequest = searchFilter ? contactStore.findContactsAsync(searchFilter) : contactStore.findContactsAsync();
- // request contacts and resolve either with success or error callback
- contactsRequest.done(function (contacts) {
- var result = [];
- if (contacts.size !== 0) {
- // Depending on searchOptions we should return all contacts found or only first
- var outputContactsArray = searchMultiple ? contacts : [contacts[0]];
- outputContactsArray.forEach(function (contact) {
- // Convert windows contacts to plugin's contact objects
- result.push(convertToContact(contact));
- });
- }
- win(result);
- }, function() {
- fail(new ContactError(ContactError.UNKNOWN_ERROR));
- });
- }, function() {
- fail(new ContactError(ContactError.UNKNOWN_ERROR));
- });
- }
-};
-
-require("cordova/exec/proxy").add("Contacts", module.exports);
diff --git a/plugins/cordova-plugin-contacts/src/windows8/ContactProxy.js b/plugins/cordova-plugin-contacts/src/windows8/ContactProxy.js
deleted file mode 100644
index c67e771..0000000
--- a/plugins/cordova-plugin-contacts/src/windows8/ContactProxy.js
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-var ContactField = require('./ContactField'),
- ContactAddress = require('./ContactAddress'),
- ContactName = require('./ContactName'),
- Contact = require('./Contact');
-
-
-function convertToContact(windowsContact) {
- var contact = new Contact();
-
- // displayName & nickname
- contact.displayName = windowsContact.name;
- contact.nickname = windowsContact.name;
-
- // name
- contact.name = new ContactName(windowsContact.name);
-
- // phoneNumbers
- contact.phoneNumbers = [];
- for (var i = 0; i < windowsContact.phoneNumbers.size; i++) {
- var phone = new ContactField(windowsContact.phoneNumbers[i].category, windowsContact.phoneNumbers[i].value);
- contact.phoneNumbers.push(phone);
- }
-
- // emails
- contact.emails = [];
- for (var i = 0; i < windowsContact.emails.size; i++) {
- var email = new ContactField(windowsContact.emails[i].category, windowsContact.emails[i].value);
- contact.emails.push(email);
- }
-
- // addressres
- contact.addresses = [];
- for (var i = 0; i < windowsContact.locations.size; i++) {
- var address = new ContactAddress(null, windowsContact.locations[i].category,
- windowsContact.locations[i].unstructuredAddress, windowsContact.locations[i].street,
- null, windowsContact.locations[i].region, windowsContact.locations[i].postalCode,
- windowsContact.locations[i].country);
- contact.addresses.push(address);
- }
-
- // ims
- contact.ims = [];
- for (var i = 0; i < windowsContact.instantMessages.size; i++) {
- var im = new ContactField(windowsContact.instantMessages[i].category, windowsContact.instantMessages[i].userName);
- contact.ims.push(im);
- }
-
- return contact;
-};
-
-module.exports = {
- pickContact: function(win, fail, args) {
-
- var picker = new Windows.ApplicationModel.Contacts.ContactPicker();
- picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.contacts; // select entire contact
-
- // pickContactAsync is available on Windows 8.1 or later, instead of
- // pickSingleContactAsync, which is deprecated after Windows 8,
- // so try to use newer method, if available.
- // see http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.contacts.contactpicker.picksinglecontactasync.aspx
- if (picker.pickContactAsync) {
- // TODO: 8.1 has better contact support via the 'Contact' object
- } else {
-
- function success(con) {
- // if contact was not picked
- if (!con) {
- fail && setTimeout(function() {
- fail(new Error("User did not pick a contact."));
- }, 0);
- return;
- }
-
- // send em back
- win(convertToContact(con));
-
- }
-
- picker.pickSingleContactAsync().done(success, fail);
- }
- },
-
- save:function(win,fail,args){
- console && console.error && console.error("Error : Windows 8 does not support creating/saving contacts");
- fail && setTimeout(function () {
- fail(new Error("Contact create/save not supported on Windows 8"));
- }, 0);
- },
-
- search: function(win, fail, args) {
- console && console.error && console.error("Error : Windows 8 does not support searching contacts");
- fail && setTimeout(function() {
- fail(new Error("Contact search not supported on Windows 8"));
- }, 0);
- }
-
-
-}
-
-require("cordova/exec/proxy").add("Contacts", module.exports);
diff --git a/plugins/cordova-plugin-contacts/src/wp/ContactPicker.xaml b/plugins/cordova-plugin-contacts/src/wp/ContactPicker.xaml
deleted file mode 100644
index cef3681..0000000
--- a/plugins/cordova-plugin-contacts/src/wp/ContactPicker.xaml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/src/wp/ContactPicker.xaml.cs b/plugins/cordova-plugin-contacts/src/wp/ContactPicker.xaml.cs
deleted file mode 100644
index ea3916e..0000000
--- a/plugins/cordova-plugin-contacts/src/wp/ContactPicker.xaml.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- using System;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Navigation;
- using Microsoft.Phone.Tasks;
- using Microsoft.Phone.UserData;
- using DeviceContacts = Microsoft.Phone.UserData.Contacts;
-
- ///
- /// Custom implemented class for picking single contact
- ///
- public partial class ContactPicker
- {
- #region Fields
-
- ///
- /// Result of ContactPicker call, represent contact returned.
- ///
- private ContactPickerTask.PickResult result;
-
- #endregion
-
- #region Constructors
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ContactPicker()
- {
- InitializeComponent();
- var cons = new DeviceContacts();
- cons.SearchCompleted += this.OnSearchCompleted;
- cons.SearchAsync(string.Empty, FilterKind.None, string.Empty);
- }
-
- #endregion
-
- #region Callbacks
-
- ///
- /// Occurs when contact is selected or pick operation cancelled.
- ///
- public event EventHandler Completed;
-
- #endregion
-
- ///
- /// The on navigated from.
- ///
- ///
- /// The e.
- ///
- protected override void OnNavigatedFrom(NavigationEventArgs e)
- {
- if (this.result == null)
- {
- this.Completed(this, new ContactPickerTask.PickResult(TaskResult.Cancel));
- }
-
- base.OnNavigatedFrom(e);
- }
-
- ///
- /// Called when contacts retrieval completed.
- ///
- /// The sender.
- /// The instance containing the event data.
- private void OnSearchCompleted(object sender, ContactsSearchEventArgs e)
- {
- if (e.Results.Count() != 0)
- {
- lstContacts.ItemsSource = e.Results.ToList();
- lstContacts.Visibility = Visibility.Visible;
- NoContactsBlock.Visibility = Visibility.Collapsed;
- }
- else
- {
- lstContacts.Visibility = Visibility.Collapsed;
- NoContactsBlock.Visibility = Visibility.Visible;
- }
- }
-
- ///
- /// Called when any contact is selected.
- ///
- ///
- /// The sender.
- ///
- ///
- /// The e.
- ///
- private void ContactsListSelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- this.result = new ContactPickerTask.PickResult(TaskResult.OK) { Contact = e.AddedItems[0] as Contact };
- this.Completed(this, this.result);
-
- if (NavigationService.CanGoBack)
- {
- NavigationService.GoBack();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/src/wp/ContactPickerTask.cs b/plugins/cordova-plugin-contacts/src/wp/ContactPickerTask.cs
deleted file mode 100644
index b11170f..0000000
--- a/plugins/cordova-plugin-contacts/src/wp/ContactPickerTask.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- using System;
- using System.Windows;
- using Microsoft.Phone.Controls;
- using Microsoft.Phone.Tasks;
- using Microsoft.Phone.UserData;
-
- ///
- /// Allows an application to pick contact.
- /// Use this to allow users to pick contact from your application.
- ///
- public class ContactPickerTask
- {
- ///
- /// Occurs when a Pick task is completed.
- ///
- public event EventHandler Completed;
-
- ///
- /// Shows Contact pick application
- ///
- public void Show()
- {
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- var root = Application.Current.RootVisual as PhoneApplicationFrame;
-
- string baseUrl = "/";
-
- if (root != null)
- {
- root.Navigated += this.OnNavigate;
-
- // dummy parameter is used to always open a fresh version
- root.Navigate(
- new Uri(
- baseUrl + "Plugins/cordova-plugin-contacts/ContactPicker.xaml?dummy="
- + Guid.NewGuid(),
- UriKind.Relative));
- }
- });
- }
-
- ///
- /// Performs additional configuration of the picker application.
- ///
- /// The source of the event.
- /// The instance containing the event data.
- private void OnNavigate(object sender, System.Windows.Navigation.NavigationEventArgs e)
- {
- if (!(e.Content is ContactPicker))
- {
- return;
- }
-
- var phoneApplicationFrame = Application.Current.RootVisual as PhoneApplicationFrame;
- if (phoneApplicationFrame != null)
- {
- phoneApplicationFrame.Navigated -= this.OnNavigate;
- }
-
- ContactPicker contactPicker = (ContactPicker)e.Content;
-
- if (contactPicker != null)
- {
- contactPicker.Completed += this.Completed;
- }
- else if (this.Completed != null)
- {
- this.Completed(this, new PickResult(TaskResult.Cancel));
- }
- }
-
- ///
- /// Represents contact returned
- ///
- public class PickResult : TaskEventArgs
- {
- ///
- /// Initializes a new instance of the PickResult class.
- ///
- public PickResult()
- {
- }
-
- ///
- /// Initializes a new instance of the PickResult class
- /// with the specified Microsoft.Phone.Tasks.TaskResult.
- ///
- /// Associated Microsoft.Phone.Tasks.TaskResult
- public PickResult(TaskResult taskResult)
- : base(taskResult)
- {
- }
-
- ///
- /// Gets the contact.
- ///
- public Contact Contact { get; internal set; }
- }
- }
-}
diff --git a/plugins/cordova-plugin-contacts/src/wp/Contacts.cs b/plugins/cordova-plugin-contacts/src/wp/Contacts.cs
deleted file mode 100644
index 89af66c..0000000
--- a/plugins/cordova-plugin-contacts/src/wp/Contacts.cs
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-using Microsoft.Phone.Tasks;
-using Microsoft.Phone.UserData;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.Windows;
-using DeviceContacts = Microsoft.Phone.UserData.Contacts;
-
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- [DataContract]
- public class SearchOptions
- {
- [DataMember]
- public string filter { get; set; }
-
- [DataMember]
- public bool multiple { get; set; }
-
- [DataMember]
- public string[] desiredFields { get; set; }
- }
-
- [DataContract]
- public class ContactSearchParams
- {
- [DataMember]
- public string[] fields { get; set; }
-
- [DataMember]
- public SearchOptions options { get; set; }
- }
-
- [DataContract]
- public class JSONContactAddress
- {
- [DataMember]
- public string formatted { get; set; }
-
- [DataMember]
- public string type { get; set; }
-
- [DataMember]
- public string streetAddress { get; set; }
-
- [DataMember]
- public string locality { get; set; }
-
- [DataMember]
- public string region { get; set; }
-
- [DataMember]
- public string postalCode { get; set; }
-
- [DataMember]
- public string country { get; set; }
-
- [DataMember]
- public bool pref { get; set; }
- }
-
- [DataContract]
- public class JSONContactName
- {
- [DataMember]
- public string formatted { get; set; }
-
- [DataMember]
- public string familyName { get; set; }
-
- [DataMember]
- public string givenName { get; set; }
-
- [DataMember]
- public string middleName { get; set; }
-
- [DataMember]
- public string honorificPrefix { get; set; }
-
- [DataMember]
- public string honorificSuffix { get; set; }
- }
-
- [DataContract]
- public class JSONContactField
- {
- [DataMember]
- public string type { get; set; }
-
- [DataMember]
- public string value { get; set; }
-
- [DataMember]
- public bool pref { get; set; }
- }
-
- [DataContract]
- public class JSONContactOrganization
- {
- [DataMember]
- public string type { get; set; }
-
- [DataMember]
- public string name { get; set; }
-
- [DataMember]
- public bool pref { get; set; }
-
- [DataMember]
- public string department { get; set; }
-
- [DataMember]
- public string title { get; set; }
- }
-
- [DataContract]
- public class JSONContact
- {
- [DataMember]
- public string id { get; set; }
-
- [DataMember]
- public string rawId { get; set; }
-
- [DataMember]
- public string displayName { get; set; }
-
- [DataMember]
- public string nickname { get; set; }
-
- [DataMember]
- public string note { get; set; }
-
- [DataMember]
- public JSONContactName name { get; set; }
-
- [DataMember]
- public JSONContactField[] emails { get; set; }
-
- [DataMember]
- public JSONContactField[] phoneNumbers { get; set; }
-
- [DataMember]
- public JSONContactField[] ims { get; set; }
-
- [DataMember]
- public JSONContactField[] photos { get; set; }
-
- [DataMember]
- public JSONContactField[] categories { get; set; }
-
- [DataMember]
- public JSONContactField[] urls { get; set; }
-
- [DataMember]
- public JSONContactOrganization[] organizations { get; set; }
-
- [DataMember]
- public JSONContactAddress[] addresses { get; set; }
- }
-
-
- public class Contacts : BaseCommand
- {
- public const int UNKNOWN_ERROR = 0;
- public const int INVALID_ARGUMENT_ERROR = 1;
- public const int TIMEOUT_ERROR = 2;
- public const int PENDING_OPERATION_ERROR = 3;
- public const int IO_ERROR = 4;
- public const int NOT_SUPPORTED_ERROR = 5;
- public const int PERMISSION_DENIED_ERROR = 20;
- public const int SYNTAX_ERR = 8;
-
- // refer here for contact properties we can access: http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.savecontacttask_members%28v=VS.92%29.aspx
- public void save(string jsonContact)
- {
- // jsonContact is actually an array of 1 {contact}
- string[] args = JSON.JsonHelper.Deserialize(jsonContact);
-
-
- JSONContact contact = JSON.JsonHelper.Deserialize(args[0]);
-
- SaveContactTask contactTask = new SaveContactTask();
-
- if (contact.nickname != null)
- {
- contactTask.Nickname = contact.nickname;
- }
- if (contact.urls != null && contact.urls.Length > 0)
- {
- contactTask.Website = contact.urls[0].value;
- }
- if (contact.note != null)
- {
- contactTask.Notes = contact.note;
- }
-
- #region contact.name
-
- if (contact.name != null)
- {
- if (contact.name.givenName != null)
- contactTask.FirstName = contact.name.givenName;
- if (contact.name.familyName != null)
- contactTask.LastName = contact.name.familyName;
- if (contact.name.middleName != null)
- contactTask.MiddleName = contact.name.middleName;
- if (contact.name.honorificSuffix != null)
- contactTask.Suffix = contact.name.honorificSuffix;
- if (contact.name.honorificPrefix != null)
- contactTask.Title = contact.name.honorificPrefix;
- }
-
- #endregion
-
- #region contact.org
-
- if (contact.organizations != null && contact.organizations.Count() > 0)
- {
- contactTask.Company = contact.organizations[0].name;
- contactTask.JobTitle = contact.organizations[0].title;
- }
-
- #endregion
-
- #region contact.phoneNumbers
-
- if (contact.phoneNumbers != null && contact.phoneNumbers.Length > 0)
- {
- foreach (JSONContactField field in contact.phoneNumbers)
- {
- string fieldType = field.type.ToLower();
- if (fieldType == "work")
- {
- contactTask.WorkPhone = field.value;
- }
- else if (fieldType == "home")
- {
- contactTask.HomePhone = field.value;
- }
- else if (fieldType == "mobile")
- {
- contactTask.MobilePhone = field.value;
- }
- }
- }
-
- #endregion
-
- #region contact.emails
-
- if (contact.emails != null && contact.emails.Length > 0)
- {
- // set up different email types if they are not explicitly defined
- foreach (string type in new[] {"personal", "work", "other"})
- {
- foreach (JSONContactField field in contact.emails)
- {
- if (field != null && String.IsNullOrEmpty(field.type))
- {
- field.type = type;
- break;
- }
- }
- }
-
- foreach (JSONContactField field in contact.emails)
- {
- if (field != null)
- {
- if (field.type != null && field.type != "other")
- {
- string fieldType = field.type.ToLower();
- if (fieldType == "work")
- {
- contactTask.WorkEmail = field.value;
- }
- else if (fieldType == "home" || fieldType == "personal")
- {
- contactTask.PersonalEmail = field.value;
- }
- }
- else
- {
- contactTask.OtherEmail = field.value;
- }
- }
- }
- }
-
- #endregion
-
- if (contact.note != null && contact.note.Length > 0)
- {
- contactTask.Notes = contact.note;
- }
-
- #region contact.addresses
-
- if (contact.addresses != null && contact.addresses.Length > 0)
- {
- foreach (JSONContactAddress address in contact.addresses)
- {
- if (address.type == null)
- {
- address.type = "home"; // set a default
- }
- string fieldType = address.type.ToLower();
- if (fieldType == "work")
- {
- contactTask.WorkAddressCity = address.locality;
- contactTask.WorkAddressCountry = address.country;
- contactTask.WorkAddressState = address.region;
- contactTask.WorkAddressStreet = address.streetAddress;
- contactTask.WorkAddressZipCode = address.postalCode;
- }
- else if (fieldType == "home" || fieldType == "personal")
- {
- contactTask.HomeAddressCity = address.locality;
- contactTask.HomeAddressCountry = address.country;
- contactTask.HomeAddressState = address.region;
- contactTask.HomeAddressStreet = address.streetAddress;
- contactTask.HomeAddressZipCode = address.postalCode;
- }
- else
- {
- // no other address fields available ...
- Debug.WriteLine("Creating contact with unsupported address type :: " + address.type);
- }
- }
- }
-
- #endregion
-
- contactTask.Completed += ContactSaveTaskCompleted;
- contactTask.Show();
- }
-
- private void ContactSaveTaskCompleted(object sender, SaveContactResult e)
- {
- SaveContactTask task = sender as SaveContactTask;
-
- if (e.TaskResult == TaskResult.OK)
- {
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- var deviceContacts = new DeviceContacts();
- deviceContacts.SearchCompleted +=
- postAdd_SearchCompleted;
-
- if (task != null)
- {
- string displayName = String.Format("{0}{2}{1}", task.FirstName, task.LastName,
- String.IsNullOrEmpty(task.FirstName) ? "" : " ");
-
- deviceContacts.SearchAsync(displayName, FilterKind.DisplayName, task);
- }
- });
- }
- else if (e.TaskResult == TaskResult.Cancel)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Operation cancelled."));
- }
- }
-
- private void postAdd_SearchCompleted(object sender, ContactsSearchEventArgs e)
- {
- if (e.Results.Any())
- {
- new List();
-
- int n = (from Contact contact in e.Results select contact.GetHashCode()).Max();
- Contact newContact = (from Contact contact in e.Results
- where contact.GetHashCode() == n
- select contact).First();
-
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, newContact.ToJson(null)));
- }
- else
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.NO_RESULT));
- }
- }
-
-
- public void remove(string id)
- {
- // note id is wrapped in [] and always has exactly one string ...
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "{\"code\":" + NOT_SUPPORTED_ERROR + "}"));
- }
-
- public void pickContact(string arguments)
- {
- string[] args = JSON.JsonHelper.Deserialize(arguments);
-
- // Use custom contact picker because WP8 api doesn't provide its' own
- // contact picker, only PhoneNumberChooser or EmailAddressChooserTask
- var task = new ContactPickerTask();
- var desiredFields = JSON.JsonHelper.Deserialize(args[0]);
-
- task.Completed += delegate(Object sender, ContactPickerTask.PickResult e)
- {
- if (e.TaskResult == TaskResult.OK)
- {
- string strResult = e.Contact.ToJson(desiredFields);
- var result = new PluginResult(PluginResult.Status.OK)
- {
- Message = strResult
- };
- DispatchCommandResult(result);
- }
- if (e.TaskResult == TaskResult.Cancel)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Operation cancelled."));
- }
- };
-
- task.Show();
- }
-
- public void search(string searchCriteria)
- {
- string[] args = JSON.JsonHelper.Deserialize(searchCriteria);
-
- ContactSearchParams searchParams = new ContactSearchParams();
- try
- {
- searchParams.fields = JSON.JsonHelper.Deserialize(args[0]);
- searchParams.options = JSON.JsonHelper.Deserialize(args[1]);
- }
- catch (Exception)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, INVALID_ARGUMENT_ERROR));
- return;
- }
-
- if (searchParams.options == null)
- {
- searchParams.options = new SearchOptions();
- searchParams.options.filter = "";
- searchParams.options.multiple = true;
- }
- else if (searchParams.options.filter == null)
- {
- searchParams.options.filter = "";
- }
-
- DeviceContacts deviceContacts = new DeviceContacts();
- deviceContacts.SearchCompleted += contacts_SearchCompleted;
-
- // default is to search all fields
- FilterKind filterKind = FilterKind.None;
- // if only one field is specified, we will try the 3 available DeviceContact search filters
- if (searchParams.fields.Count() == 1)
- {
- if (searchParams.fields.Contains("name"))
- {
- filterKind = FilterKind.DisplayName;
- }
- else if (searchParams.fields.Contains("emails"))
- {
- filterKind = FilterKind.EmailAddress;
- }
- else if (searchParams.fields.Contains("phoneNumbers"))
- {
- filterKind = FilterKind.PhoneNumber;
- }
- }
-
- try
- {
- deviceContacts.SearchAsync(searchParams.options.filter, filterKind, searchParams);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("search contacts exception :: " + ex.Message);
- }
- }
-
- private void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
- {
- var searchParams = (ContactSearchParams) e.State;
-
- List foundContacts = null;
- // used for comparing strings, "" instantiates with InvariantCulture
- CultureInfo culture = new CultureInfo("");
- // make the search comparisons case insensitive.
- CompareOptions compare_option = CompareOptions.IgnoreCase;
-
- // if we have multiple search fields
-
- if (!String.IsNullOrEmpty(searchParams.options.filter) && searchParams.fields.Count() > 1)
- {
- foundContacts = new List();
- if (searchParams.fields.Contains("emails"))
- {
- foundContacts.AddRange(from Contact con in e.Results
- from ContactEmailAddress a in con.EmailAddresses
- where
- culture.CompareInfo.IndexOf(a.EmailAddress, searchParams.options.filter,
- compare_option) >= 0
- select con);
- }
- if (searchParams.fields.Contains("displayName"))
- {
- foundContacts.AddRange(from Contact con in e.Results
- where
- culture.CompareInfo.IndexOf(con.DisplayName, searchParams.options.filter,
- compare_option) >= 0
- select con);
- }
- if (searchParams.fields.Contains("name"))
- {
- foundContacts.AddRange(
- from Contact con in e.Results
- where con.CompleteName != null && (
- (con.CompleteName.FirstName != null && culture.CompareInfo.IndexOf(con.CompleteName.FirstName, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.LastName != null && culture.CompareInfo.IndexOf(con.CompleteName.LastName, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.MiddleName != null && culture.CompareInfo.IndexOf(con.CompleteName.MiddleName, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.Nickname != null && culture.CompareInfo.IndexOf(con.CompleteName.Nickname, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.Suffix != null && culture.CompareInfo.IndexOf(con.CompleteName.Suffix, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.Title != null && culture.CompareInfo.IndexOf(con.CompleteName.Title, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.YomiFirstName != null && culture.CompareInfo.IndexOf(con.CompleteName.YomiFirstName, searchParams.options.filter, compare_option) >= 0) ||
- (con.CompleteName.YomiLastName != null && culture.CompareInfo.IndexOf(con.CompleteName.YomiLastName, searchParams.options.filter, compare_option) >= 0))
- select con);
- }
- if (searchParams.fields.Contains("phoneNumbers"))
- {
- foundContacts.AddRange(from Contact con in e.Results
- from ContactPhoneNumber a in con.PhoneNumbers
- where
- culture.CompareInfo.IndexOf(a.PhoneNumber, searchParams.options.filter,
- compare_option) >= 0
- select con);
- }
- if (searchParams.fields.Contains("urls"))
- {
- foundContacts.AddRange(from Contact con in e.Results
- from string a in con.Websites
- where
- culture.CompareInfo.IndexOf(a, searchParams.options.filter,
- compare_option) >= 0
- select con);
- }
- }
- else
- {
- foundContacts = new List(e.Results);
- }
-
- string strResult = "";
-
- IEnumerable distinctContacts = foundContacts.Distinct();
-
- foreach (Contact contact in distinctContacts)
- {
- strResult += contact.ToJson(searchParams.options.desiredFields) + ",";
-
- if (!searchParams.options.multiple)
- {
- break; // just return the first item
- }
- }
- PluginResult result = new PluginResult(PluginResult.Status.OK);
- result.Message = "[" + strResult.TrimEnd(',') + "]";
- DispatchCommandResult(result);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/src/wp/ContactsHelper.cs b/plugins/cordova-plugin-contacts/src/wp/ContactsHelper.cs
deleted file mode 100644
index 80166fa..0000000
--- a/plugins/cordova-plugin-contacts/src/wp/ContactsHelper.cs
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Microsoft.Phone.UserData;
- using System.IO;
-
- ///
- /// Implements helper functionality to serialize contact to JSON string.
- ///
- internal static class ContactsHelper
- {
- ///
- /// Converts Contact object to string representation
- ///
- /// Contact object
- /// array of fields names
- /// JSON string
- public static string ToJson(this Contact contact, string[] desiredFields)
- {
- var contactFieldsWithJsonVals = contact.PopulateContactDictionary();
-
- // if desiredFields are not defined, use all avilable fields
- if (desiredFields == null || desiredFields.Length == 0)
- {
- desiredFields = contactFieldsWithJsonVals.Keys.ToArray();
- }
-
- return FillResultWithFields(desiredFields, contactFieldsWithJsonVals);
- }
-
- ///
- /// Returns JSON string with desired fields only.
- ///
- /// The desired fields.
- /// The contact fields with JSON values.
- /// JSON string
- private static string FillResultWithFields(string[] desiredFields, Dictionary> contactFieldsWithJsonVals)
- {
- var result = new StringBuilder();
- for (int i = 0; i < desiredFields.Count(); i++)
- {
- if (!contactFieldsWithJsonVals.ContainsKey(desiredFields[i]))
- {
- continue;
- }
-
- result.Append(contactFieldsWithJsonVals[desiredFields[i]]());
- if (i != desiredFields.Count() - 1)
- {
- result.Append(",");
- }
- }
-
- return "{" + result + "}";
- }
-
- ///
- /// Populates the contact dictionary.
- ///
- /// Contact, that converted to JSON
- /// JSON string with populated data
- private static Dictionary> PopulateContactDictionary(this Contact contact)
- {
- var contactFieldsJsonValsDictionary = new Dictionary>(StringComparer.InvariantCultureIgnoreCase)
- {
- { "id", () => string.Format("\"id\":\"{0}\"", contact.GetHashCode()) },
- { "displayName", () => string.Format("\"displayName\":\"{0}\"", EscapeJson(contact.DisplayName)) },
- {
- "nickname",
- () =>
- string.Format(
- "\"nickname\":\"{0}\"",
- EscapeJson(contact.CompleteName != null ? contact.CompleteName.Nickname : string.Empty))
- },
- { "phoneNumbers", () => string.Format("\"phoneNumbers\":[{0}]", FormatJsonPhoneNumbers(contact)) },
- { "emails", () => string.Format("\"emails\":[{0}]", FormatJsonEmails(contact)) },
- { "addresses", () => string.Format("\"addresses\":[{0}]", FormatJsonAddresses(contact)) },
- { "urls", () => string.Format("\"urls\":[{0}]", FormatJsonWebsites(contact)) },
- { "photos", () => string.Format("\"photos\":[{0}]", FormatJsonPhotos(contact)) },
- { "name", () => string.Format("\"name\":{0}", FormatJsonName(contact)) },
- { "note", () => string.Format("\"note\":\"{0}\"", EscapeJson(contact.Notes.FirstOrDefault())) },
- {
- "birthday",
- () =>
- string.Format(
- "\"birthday\":\"{0}\"",
- EscapeJson(Convert.ToString(contact.Birthdays.FirstOrDefault())))
- }
- };
- return contactFieldsJsonValsDictionary;
- }
-
- ///
- /// Add escape characters to the JSON string.
- ///
- /// Input JSON formatted string
- /// Escaped JSON string
- private static string EscapeJson(string str)
- {
- if (string.IsNullOrEmpty(str))
- {
- return str;
- }
-
- return str.Replace("\n", "\\n")
- .Replace("\r", "\\r")
- .Replace("\t", "\\t")
- .Replace("\"", "\\\"")
- .Replace("&", "\\&");
- }
-
- ///
- /// Formats phone numbers to JSON string.
- ///
- /// Contact object
- /// JSON string
- private static string FormatJsonPhoneNumbers(Contact con)
- {
- string retVal = string.Empty;
- const string ContactFieldFormat = "\"type\":\"{0}\",\"value\":\"{1}\",\"pref\":\"false\"";
- foreach (ContactPhoneNumber number in con.PhoneNumbers)
- {
- string contactField = string.Format(ContactFieldFormat, number.Kind.ToString(), number.PhoneNumber);
- retVal += "{" + contactField + "},";
- }
-
- return retVal.TrimEnd(',');
- }
-
- /*
- * formatted: The complete name of the contact. (DOMString)
- familyName: The contacts family name. (DOMString)
- givenName: The contacts given name. (DOMString)
- middleName: The contacts middle name. (DOMString)
- honorificPrefix: The contacts prefix (example Mr. or Dr.) (DOMString)
- honorificSuffix: The contacts suffix (example Esq.). (DOMString)
- */
-
- ///
- /// Formats the name to JSON string.
- ///
- /// Contact object
- /// JSON string
- private static string FormatJsonName(Contact con)
- {
- string retVal;
- const string FormatStr = "\"formatted\":\"{0}\"," +
- "\"familyName\":\"{1}\"," +
- "\"givenName\":\"{2}\"," +
- "\"middleName\":\"{3}\"," +
- "\"honorificPrefix\":\"{4}\"," +
- "\"honorificSuffix\":\"{5}\"";
-
- if (con.CompleteName != null)
- {
- retVal = string.Format(
- FormatStr,
- EscapeJson(con.CompleteName.FirstName + " " + con.CompleteName.LastName),
- //// TODO: does this need suffix? middlename?
- EscapeJson(con.CompleteName.LastName),
- EscapeJson(con.CompleteName.FirstName),
- EscapeJson(con.CompleteName.MiddleName),
- EscapeJson(con.CompleteName.Title),
- EscapeJson(con.CompleteName.Suffix));
- }
- else
- {
- retVal = string.Format(FormatStr, "", "", "", "", "", "");
- }
-
- return "{" + retVal + "}";
- }
-
- ///
- /// Format Emails to JSON string.
- ///
- /// Contact object
- /// JSON string
- private static string FormatJsonEmails(Contact con)
- {
- string retVal = string.Empty;
- const string ContactFieldFormat = "\"type\":\"{0}\",\"value\":\"{1}\",\"pref\":\"false\"";
- foreach (ContactEmailAddress address in con.EmailAddresses)
- {
- string contactField = string.Format(
- ContactFieldFormat,
- address.Kind.ToString(),
- EscapeJson(address.EmailAddress));
-
- retVal += "{" + contactField + "},";
- }
-
- return retVal.TrimEnd(',');
- }
-
- ///
- /// Format Addresses to JSON string.
- ///
- /// Contact object
- /// JSON string
- private static string FormatJsonAddresses(Contact con)
- {
- string retVal = string.Empty;
- foreach (ContactAddress address in con.Addresses)
- {
- retVal += GetFormattedJsonAddress(address, false) + ",";
- }
-
- return retVal.TrimEnd(',');
- }
-
- ///
- /// Format Websites to JSON string.
- ///
- /// Contact object
- /// JSON string
- private static string FormatJsonWebsites(Contact con)
- {
- string retVal = string.Empty;
- foreach (string website in con.Websites)
- {
- retVal += "\"" + EscapeJson(website) + "\",";
- }
-
- return retVal.TrimEnd(',');
- }
-
- ///
- /// Format single address to JSON string.
- ///
- ///
- /// Contact address.
- ///
- ///
- /// Contact is preferred?
- ///
- ///
- /// JSON string
- ///
- private static string GetFormattedJsonAddress(ContactAddress address, bool isPrefered)
- {
- const string AddressFormatString = "\"pref\":{0}," + // bool
- "\"type\":\"{1}\"," +
- "\"formatted\":\"{2}\"," +
- "\"streetAddress\":\"{3}\"," +
- "\"locality\":\"{4}\"," +
- "\"region\":\"{5}\"," +
- "\"postalCode\":\"{6}\"," +
- "\"country\":\"{7}\"";
-
- string formattedAddress = EscapeJson(address.PhysicalAddress.AddressLine1 + " "
- + address.PhysicalAddress.AddressLine2 + " "
- + address.PhysicalAddress.City + " "
- + address.PhysicalAddress.StateProvince + " "
- + address.PhysicalAddress.CountryRegion + " "
- + address.PhysicalAddress.PostalCode);
-
- string jsonAddress = string.Format(
- AddressFormatString,
- isPrefered ? "\"true\"" : "\"false\"",
- address.Kind.ToString(),
- formattedAddress,
- EscapeJson(address.PhysicalAddress.AddressLine1 + " " + address.PhysicalAddress.AddressLine2),
- address.PhysicalAddress.City,
- address.PhysicalAddress.StateProvince,
- address.PhysicalAddress.PostalCode,
- address.PhysicalAddress.CountryRegion);
-
- return "{" + jsonAddress + "}";
- }
-
- ///
- /// Formats contact photos to JSON string.
- ///
- /// Contact object
- /// JSON string
- private static string FormatJsonPhotos(Contact con) {
-
- // we return single photo since contact object instance contains single picture only
- var photoStream = con.GetPicture();
-
- if (photoStream == null) {
- return "";
- }
-
- return String.Format("{{value:\"{0}\", type: \"data\", pref: false}}", GetImageContent(photoStream));
- }
-
- ///
- /// Returns image content in a form of base64 string
- ///
- /// Image stream
- /// Base64 representation of the image
- private static string GetImageContent(Stream stream)
- {
- byte[] imageContent = null;
-
- try
- {
- int streamLength = (int)stream.Length;
- imageContent = new byte[streamLength + 1];
- stream.Read(imageContent, 0, streamLength);
-
- }
- finally
- {
- stream.Dispose();
- }
-
- return Convert.ToBase64String(imageContent);
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-contacts/tests/plugin.xml b/plugins/cordova-plugin-contacts/tests/plugin.xml
deleted file mode 100644
index a15e4b5..0000000
--- a/plugins/cordova-plugin-contacts/tests/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- Cordova Contacts Plugin Tests
- Apache 2.0
-
-
-
-
diff --git a/plugins/cordova-plugin-contacts/tests/tests.js b/plugins/cordova-plugin-contacts/tests/tests.js
deleted file mode 100644
index 376e5a9..0000000
--- a/plugins/cordova-plugin-contacts/tests/tests.js
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-exports.defineAutoTests = function() {
- // global to store a contact so it doesn't have to be created or retrieved multiple times
- // all of the setup/teardown test methods can reference the following variables to make sure to do the right cleanup
- var gContactObj = null,
- isWindowsPhone8 = cordova.platformId == 'windowsphone',
- isWindows = (cordova.platformId === "windows") || (cordova.platformId === "windows8"),
- isWindowsPhone81 = isWindows && WinJS.Utilities.isPhone;
-
- var isIOSPermissionBlocked = false;
-
- var fail = function(done) {
- expect(true).toBe(false);
- done();
- };
-
- var MEDIUM_TIMEOUT = 30000;
-
- var removeContact = function(done) {
- if (!gContactObj) {
- done();
- return;
- }
-
- gContactObj.remove(function() {
- gContactObj = null;
- done();
- }, function() {
- done();
- });
- };
-
- function removeContactsByFields(fields, filter, done) {
- var obj = new ContactFindOptions();
- obj.filter = filter;
- obj.multiple = true;
- navigator.contacts.find(fields, function(contacts) {
- var removes = [];
- contacts.forEach(function(contact) {
- removes.push(contact);
- });
- if (removes.length == 0) {
- done();
- return;
- }
-
- var nextToRemove = undefined;
- if (removes.length > 0) {
- nextToRemove = removes.shift();
- }
-
- function removeNext(item) {
- if (typeof item === 'undefined') {
- done();
- return;
- }
-
- if (removes.length > 0) {
- nextToRemove = removes.shift();
- } else {
- nextToRemove = undefined;
- }
-
- item.remove(function removeSucceeded() {
- removeNext(nextToRemove);
- }, function removeFailed() {
- removeNext(nextToRemove);
- });
- }
- removeNext(nextToRemove);
- }, done, obj);
- }
-
- describe("Contacts (navigator.contacts)", function() {
- it("contacts.spec.1 should exist", function() {
- expect(navigator.contacts).toBeDefined();
- });
-
- it("contacts.spec.2 should contain a find function", function() {
- expect(navigator.contacts.find).toBeDefined();
- expect(typeof navigator.contacts.find).toBe('function');
- });
-
- describe("find method", function() {
- it("contacts.spec.3 success callback should be called with an array", function(done) {
- // Find method is not supported on Windows platform
- if (isWindows && !isWindowsPhone81) {
- pending();
- return;
- }
- var win = function(result) {
- expect(result).toBeDefined();
- expect(result instanceof Array).toBe(true);
- done();
- },
- obj = new ContactFindOptions();
-
- obj.filter = "";
- obj.multiple = true;
-
- function failed(err) {
- if (err.code == ContactError.PERMISSION_DENIED_ERROR) {
- isIOSPermissionBlocked = true;
- done();
- }
- }
- navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails"], win, failed, obj);
- });
-
- it("contacts.spec.4 success callback should be called with an array, even if partial ContactFindOptions specified", function(done) {
- // Find method is not supported on Windows platform
- if ((isWindows && !isWindowsPhone81) || isIOSPermissionBlocked) {
- pending();
- return;
- }
- var win = function(result) {
- expect(result).toBeDefined();
- expect(result instanceof Array).toBe(true);
- done();
- };
-
- navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails"], win, fail.bind(null, done), {
- multiple: true
- });
- });
-
- it("contacts.spec.5 should throw an exception if success callback is empty", function() {
- var obj = new ContactFindOptions();
- obj.filter = "";
- obj.multiple = true;
-
- expect(function() {
- navigator.contacts.find(["displayName", "name", "emails", "phoneNumbers"], null, fail.bind(null, done), obj);
- }).toThrow();
- });
-
- it("contacts.spec.6 error callback should be called when no fields are specified", function(done) {
- var win = fail,
- // we don't want this to be called
- error = function(result) {
- expect(result).toBeDefined();
- expect(result.code).toBe(ContactError.INVALID_ARGUMENT_ERROR);
- done();
- },
- obj = new ContactFindOptions();
-
- obj.filter = "";
- obj.multiple = true;
- navigator.contacts.find([], win, error, obj);
- });
-
- describe("with newly-created contact", function() {
-
- afterEach(function (done) {
- removeContact(done);
- });
-
- it("contacts.spec.7 should be able to find a contact by name", function(done) {
- // Find method is not supported on Windows Store apps.
- // also this test will be skipped for Windows Phone 8.1 because function "save" not supported on WP8.1
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
-
- var foundName = function(result) {
- var bFound = false;
- try {
- for (var i = 0; i < result.length; i++) {
- if (result[i].name.familyName == "Delete") {
- bFound = true;
- break;
- }
- }
- } catch (e) {
- return false;
- }
- return bFound;
- },
- test = function(savedContact) {
- // update so contact will get removed
- gContactObj = savedContact;
- // ----
- // Find asserts
- // ---
- var findWin = function(object) {
- expect(object instanceof Array).toBe(true);
- expect(object.length >= 1).toBe(true);
- expect(foundName(object)).toBe(true);
- done();
- },
- findFail = fail,
- obj = new ContactFindOptions();
-
- obj.filter = "Delete";
- obj.multiple = true;
-
- navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails"], findWin, findFail.bind(null, done), obj);
- };
-
- gContactObj = new Contact();
- gContactObj.name = new ContactName();
- gContactObj.name.familyName = "Delete";
- gContactObj.save(test, fail.bind(null, done));
- });
- });
- });
-
- describe('create method', function() {
- it("contacts.spec.8 should exist", function() {
- expect(navigator.contacts.create).toBeDefined();
- expect(typeof navigator.contacts.create).toBe('function');
- });
-
- it("contacts.spec.9 should return a Contact object", function() {
- var bDay = new Date(1976, 7, 4);
- var obj = navigator.contacts.create({
- "displayName": "test name",
- "gender": "male",
- "note": "my note",
- "name": {
- "formatted": "Mr. Test Name"
- },
- "emails": [{
- "value": "here@there.com"
- }, {
- "value": "there@here.com"
- }],
- "birthday": bDay
- });
-
- expect(obj).toBeDefined();
- expect(obj.displayName).toBe('test name');
- expect(obj.note).toBe('my note');
- expect(obj.name.formatted).toBe('Mr. Test Name');
- expect(obj.emails.length).toBe(2);
- expect(obj.emails[0].value).toBe('here@there.com');
- expect(obj.emails[1].value).toBe('there@here.com');
- expect(obj.nickname).toBe(null);
- expect(obj.birthday).toBe(bDay);
- });
- });
-
- describe("Contact object", function() {
- it("contacts.spec.10 should be able to create instance", function() {
- var contact = new Contact("a", "b", new ContactName("a", "b", "c", "d", "e", "f"), "c", [], [], [], [], [], "f", "i", [], [], []);
- expect(contact).toBeDefined();
- expect(contact.id).toBe("a");
- expect(contact.displayName).toBe("b");
- expect(contact.name.formatted).toBe("a");
- expect(contact.nickname).toBe("c");
- expect(contact.phoneNumbers).toBeDefined();
- expect(contact.emails).toBeDefined();
- expect(contact.addresses).toBeDefined();
- expect(contact.ims).toBeDefined();
- expect(contact.organizations).toBeDefined();
- expect(contact.birthday).toBe("f");
- expect(contact.note).toBe("i");
- expect(contact.photos).toBeDefined();
- expect(contact.categories).toBeDefined();
- expect(contact.urls).toBeDefined();
- });
-
- it("contacts.spec.11 should be able to define a ContactName object", function() {
- var contactName = new ContactName("Dr. First Last Jr.", "Last", "First", "Middle", "Dr.", "Jr.");
- expect(contactName).toBeDefined();
- expect(contactName.formatted).toBe("Dr. First Last Jr.");
- expect(contactName.familyName).toBe("Last");
- expect(contactName.givenName).toBe("First");
- expect(contactName.middleName).toBe("Middle");
- expect(contactName.honorificPrefix).toBe("Dr.");
- expect(contactName.honorificSuffix).toBe("Jr.");
- });
-
- it("contacts.spec.12 should be able to define a ContactField object", function() {
- var contactField = new ContactField("home", "8005551212", true);
- expect(contactField).toBeDefined();
- expect(contactField.type).toBe("home");
- expect(contactField.value).toBe("8005551212");
- expect(contactField.pref).toBe(true);
- });
-
- it("contacts.spec.13 ContactField object should coerce type and value properties to strings", function() {
- var contactField = new ContactField(12345678, 12345678, true);
- expect(contactField.type).toBe("12345678");
- expect(contactField.value).toBe("12345678");
- });
-
- it("contacts.spec.14 should be able to define a ContactAddress object", function() {
- var contactAddress = new ContactAddress(true, "home", "a", "b", "c", "d", "e", "f");
- expect(contactAddress).toBeDefined();
- expect(contactAddress.pref).toBe(true);
- expect(contactAddress.type).toBe("home");
- expect(contactAddress.formatted).toBe("a");
- expect(contactAddress.streetAddress).toBe("b");
- expect(contactAddress.locality).toBe("c");
- expect(contactAddress.region).toBe("d");
- expect(contactAddress.postalCode).toBe("e");
- expect(contactAddress.country).toBe("f");
- });
-
- it("contacts.spec.15 should be able to define a ContactOrganization object", function() {
- var contactOrg = new ContactOrganization(true, "home", "a", "b", "c", "d", "e", "f", "g");
- expect(contactOrg).toBeDefined();
- expect(contactOrg.pref).toBe(true);
- expect(contactOrg.type).toBe("home");
- expect(contactOrg.name).toBe("a");
- expect(contactOrg.department).toBe("b");
- expect(contactOrg.title).toBe("c");
- });
-
- it("contacts.spec.16 should be able to define a ContactFindOptions object", function() {
- var contactFindOptions = new ContactFindOptions("a", true, "b");
- expect(contactFindOptions).toBeDefined();
- expect(contactFindOptions.filter).toBe("a");
- expect(contactFindOptions.multiple).toBe(true);
- });
-
- it("contacts.spec.17 should contain a clone function", function() {
- var contact = new Contact();
- expect(contact.clone).toBeDefined();
- expect(typeof contact.clone).toBe('function');
- });
-
- it("contacts.spec.18 clone function should make deep copy of Contact Object", function() {
- var contact = new Contact();
- contact.id = 1;
- contact.displayName = "Test Name";
- contact.nickname = "Testy";
- contact.gender = "male";
- contact.note = "note to be cloned";
- contact.name = new ContactName("Mr. Test Name");
-
- var clonedContact = contact.clone();
-
- expect(contact.id).toBe(1);
- expect(clonedContact.id).toBe(null);
- expect(clonedContact.displayName).toBe(contact.displayName);
- expect(clonedContact.nickname).toBe(contact.nickname);
- expect(clonedContact.gender).toBe(contact.gender);
- expect(clonedContact.note).toBe(contact.note);
- expect(clonedContact.name.formatted).toBe(contact.name.formatted);
- expect(clonedContact.connected).toBe(contact.connected);
- });
-
- it("contacts.spec.19 should contain a save function", function() {
- var contact = new Contact();
- expect(contact.save).toBeDefined();
- expect(typeof contact.save).toBe('function');
- });
-
- it("contacts.spec.20 should contain a remove function", function() {
- var contact = new Contact();
- expect(contact.remove).toBeDefined();
- expect(typeof contact.remove).toBe('function');
- });
- });
-
- describe('save method', function() {
-
- afterEach(function (done) {
- removeContact(done);
- });
-
- it("contacts.spec.21 should be able to save a contact", function(done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
-
- var bDay = new Date(1976, 6, 4);
- var obj = {
- "gender": "male",
- "note": "my note",
- "name": {
- "familyName": "Delete",
- "givenName": "Test"
- },
- "emails": [{
- "value": "here@there.com"
- }, {
- "value": "there@here.com"
- }],
- "birthday": bDay
- };
-
- var saveSuccess = function(obj) {
- expect(obj).toBeDefined();
- expect(obj.note).toBe('my note');
- expect(obj.name.familyName).toBe('Delete');
- expect(obj.name.givenName).toBe('Test');
- expect(obj.emails.length).toBe(2);
- expect(obj.emails[0].value).toBe('here@there.com');
- expect(obj.emails[1].value).toBe('there@here.com');
- expect(obj.birthday.toDateString()).toBe(bDay.toDateString());
- expect(obj.addresses).toBe(null);
- gContactObj = obj;
- done();
- },
- saveFail = fail.bind(null, done);
-
- navigator.contacts
- .create(obj)
- .save(saveSuccess, saveFail);
- });
-
- it("contacts.spec.22 update a contact", function(done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
-
- var aDay = new Date(1976, 6, 4);
- var bDay;
- var noteText = "an UPDATED note";
-
- var obj = {
- "gender": "male",
- "note": "my note",
- "name": {
- "familyName": "Delete",
- "givenName": "Test"
- },
- "emails": [{
- "value": "here@there.com"
- }, {
- "value": "there@here.com"
- }],
- "birthday": aDay
- };
-
- var saveFail = fail.bind(null, done);
-
- var saveSuccess = function(obj) {
- gContactObj = obj;
- gContactObj.emails[1].value = "";
- bDay = new Date(1975, 5, 4);
- gContactObj.birthday = bDay;
- gContactObj.note = noteText;
- gContactObj.save(updateSuccess, saveFail);
- };
-
- var updateSuccess = function(obj) {
- expect(obj).toBeDefined();
- expect(obj.id).toBe(gContactObj.id);
- expect(obj.note).toBe(noteText);
- expect(obj.birthday.toDateString()).toBe(bDay.toDateString());
- expect(obj.emails.length).toBe(1);
- expect(obj.emails[0].value).toBe('here@there.com');
- done();
- };
-
- navigator.contacts
- .create(obj)
- .save(saveSuccess, saveFail);
-
- }, MEDIUM_TIMEOUT);
- });
-
- describe('Contact.remove method', function(done) {
- afterEach(function (done) {
- removeContact(done);
- });
-
- it("contacts.spec.23 calling remove on a contact that has an id of null should return ContactError.UNKNOWN_ERROR", function(done) {
- var expectedFail = function(result) {
- expect(result.code).toBe(ContactError.UNKNOWN_ERROR);
- done();
- };
-
- var rmContact = new Contact();
- rmContact.remove(fail.bind(null, done), expectedFail);
- });
-
- it("contacts.spec.24 calling remove on a contact that does not exist should return ContactError.UNKNOWN_ERROR", function(done) {
- // remove method is not supported on Windows platform
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
- var rmWin = fail.bind(null, done);
- var rmFail = function(result) {
- expect(result.code).toBe(ContactError.UNKNOWN_ERROR);
- done();
- };
-
- // this is a bit risky as some devices may have contact ids that large
- var contact = new Contact("this string is supposed to be a unique identifier that will never show up on a device");
- contact.remove(rmWin, rmFail);
- }, MEDIUM_TIMEOUT);
- });
-
- describe("Round trip Contact tests (creating + save + delete + find)", function() {
- var saveAndFindBy = function (fields, filter, done) {
- removeContactsByFields(["note"], "DeleteMe", function() {
- gContactObj.save(function(c_obj) {
- var findWin = function(cs) {
- // update to have proper saved id
- gContactObj = cs[0];
- expect(cs.length).toBe(1);
- done();
- };
- var findFail = fail;
- var obj = new ContactFindOptions();
- obj.filter = filter;
- obj.multiple = true;
- navigator.contacts.find(fields, findWin, findFail, obj);
- }, fail);
- });
- };
-
- afterEach(function (done) {
- removeContact(done);
- });
-
- it("contacts.spec.25 Creating, saving, finding a contact should work", function(done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
- var contactName = "DeleteMe";
- gContactObj = new Contact();
- gContactObj.name = new ContactName();
- gContactObj.name.familyName = contactName;
- saveAndFindBy(["displayName", "name"], contactName, done);
- }, MEDIUM_TIMEOUT);
-
- it("contacts.spec.26 Creating, saving, finding a contact should work, removing it should work", function(done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
- var contactName = "DeleteMe";
- gContactObj = new Contact();
- gContactObj.name = new ContactName();
- gContactObj.name.familyName = contactName;
- saveAndFindBy(["displayName", "name"], contactName, function() {
- gContactObj.remove(function() {
- done();
- }, function(e) {
- throw ("Newly created contact's remove function invoked error callback. Test failed.");
- });
- });
- }, MEDIUM_TIMEOUT);
-
- it("contacts.spec.27 Should not be able to delete the same contact twice", function(done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8 || isIOSPermissionBlocked) {
- pending();
- }
- var contactName = "DeleteMe";
- gContactObj = new Contact();
- gContactObj.name = new ContactName();
- gContactObj.name.familyName = contactName;
- saveAndFindBy(["displayName", "name"], contactName, function() {
- gContactObj.remove(function() {
- var findWin = function(seas) {
- expect(seas.length).toBe(0);
- gContactObj.remove(function() {
- throw ("Success callback called after non-existent Contact object called remove(). Test failed.");
- }, function(e) {
- expect(e.code).toBe(ContactError.UNKNOWN_ERROR);
- done();
- });
- };
- var obj = new ContactFindOptions();
- obj.filter = contactName;
- obj.multiple = true;
- navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails"], findWin, fail, obj);
- }, fail);
- });
- }, MEDIUM_TIMEOUT);
-
- it("contacts.spec.28 should find a contact with unicode name", function (done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8) {
- pending();
- }
- var contactName = "\u2602";
- gContactObj = new Contact();
- gContactObj.note = "DeleteMe";
- gContactObj.name = new ContactName();
- gContactObj.name.familyName = contactName;
- saveAndFindBy(["displayName", "name"], contactName, done);
- }, MEDIUM_TIMEOUT);
-
- it("contacts.spec.29 should find a contact without a name", function (done) {
- // Save method is not supported on Windows platform
- if (isWindows || isWindowsPhone8) {
- pending();
- }
-
- gContactObj = new Contact();
- var phoneNumbers = [1];
- phoneNumbers[0] = new ContactField('work', '555-555-1234', true);
- gContactObj.phoneNumbers = phoneNumbers;
-
- saveAndFindBy(["phoneNumbers"], "555-555-1234", done);
-
- }, MEDIUM_TIMEOUT);
- });
-
- describe('ContactError interface', function() {
- it("contacts.spec.30 ContactError constants should be defined", function() {
- expect(ContactError.UNKNOWN_ERROR).toBe(0);
- expect(ContactError.INVALID_ARGUMENT_ERROR).toBe(1);
- expect(ContactError.TIMEOUT_ERROR).toBe(2);
- expect(ContactError.PENDING_OPERATION_ERROR).toBe(3);
- expect(ContactError.IO_ERROR).toBe(4);
- expect(ContactError.NOT_SUPPORTED_ERROR).toBe(5);
- expect(ContactError.OPERATION_CANCELLED_ERROR).toBe(6);
- expect(ContactError.PERMISSION_DENIED_ERROR).toBe(20);
- });
- });
- });
-};
-
-/******************************************************************************/
-/******************************************************************************/
-/******************************************************************************/
-
-exports.defineManualTests = function(contentEl, createActionButton) {
- function getContacts(filter) {
- var results = document.getElementById('contact_results');
- var obj = new ContactFindOptions();
- if (filter) {
- obj.filter = filter;
- }
- obj.multiple = true;
- navigator.contacts.find(["displayName", "name", "phoneNumbers", "emails", "urls", "note"], function(contacts) {
- var s = "";
- if (contacts.length == 0) {
- s = "No contacts found";
- } else {
- s = "Number of contacts: " + contacts.length + "
Name
Phone
Email
";
- for (var i = 0; i < contacts.length; i++) {
- var contact = contacts[i];
- var contactNameTag = contact.name ? "
" + contact.name.formatted + "
" : "
(No Name)
";
- s = s + contactNameTag;
- if (contact.phoneNumbers && contact.phoneNumbers.length > 0) {
- s = s + contact.phoneNumbers[0].value;
- }
- s = s + "
"
- if (contact.emails && contact.emails.length > 0) {
- s = s + contact.emails[0].value;
- }
- s = s + "
";
- }
- s = s + "
";
- }
-
- results.innerHTML = s;
- }, function(e) {
- if (e.code === ContactError.NOT_SUPPORTED_ERROR) {
- results.innerHTML = "Searching for contacts is not supported.";
- } else {
- results.innerHTML = "Search failed: error " + e.code;
- }
- }, obj);
- }
-
- function filterContacts() {
- var filter = document.getElementById('searchstring');
- getContacts(filter.value);
- }
-
- function pickContact() {
- var results = document.getElementById('contact_results');
- navigator.contacts.pickContact(
- function (contact) {
- results.innerHTML = contact ?
- "Picked contact:
" + JSON.stringify(contact, null, 4) + "
" :
- "No contacts found";
-
- },
- function (e) {
- results.innerHTML = (e && e.code === ContactError.NOT_SUPPORTED_ERROR) ?
- "Searching for contacts is not supported." :
- (e && e.code === ContactError.OPERATION_CANCELLED_ERROR) ?
- "Pick cancelled" :
- "Pick failed: error " + (e && e.code);
- }
- );
- }
-
- function addContact(displayName, name, phoneNumber, birthday) {
- try {
- var results = document.getElementById('contact_results');
- var contact = navigator.contacts.create({ "displayName": displayName, "name": name, "birthday": birthday, "note": "DeleteMe" });
-
- var phoneNumbers = [1];
- phoneNumbers[0] = new ContactField('work', phoneNumber, true);
- contact.phoneNumbers = phoneNumbers;
-
- contact.save(function() {
- results.innerHTML = (displayName || "Nameless contact") + " saved.";
- }, function(e) {
- if (e.code === ContactError.NOT_SUPPORTED_ERROR) {
- results.innerHTML = "Saving contacts not supported.";
- } else {
- results.innerHTML = "Contact save failed: error " + e.code;
- }
- });
- } catch (e) {
- console.error(e.message);
- }
- }
-
- function addDooneyEvans() {
- var displayName = "Dooney Evans";
- var contactName = {
- formatted: "Dooney Evans",
- familyName: "Evans",
- givenName: "Dooney",
- middleName: ""
- };
- var phoneNumber = '512-555-1234';
- var birthday = new Date(1985, 0, 23);
-
- addContact(displayName, contactName, phoneNumber, birthday);
- }
-
- function addNamelessContact() {
- addContact();
- }
-
- function addUnicodeContact() {
- var displayName = "Н€йромонах \nФеофаЊ";
- var contactName = {
- formatted: "Н€йромонах \nФеофаЊ",
- familyName: "\nФеофаЊ",
- givenName: "Н€йромонах",
- middleName: ""
- };
-
- addContact(displayName, contactName);
- }
-
- function renameDooneyEvans() {
- var results = document.getElementById('contact_results');
- var obj = new ContactFindOptions();
- obj.filter = 'Dooney Evans';
- obj.multiple = false;
-
- navigator.contacts.find(['displayName', 'name'], function(contacts) {
- if (contacts.length == 0) {
- results.innerHTML = 'No contacts to update.';
- return;
- }
- var contact = contacts[0];
- contact.displayName = "Urist McContact";
- var name = new ContactName();
- name.givenName = "Urist";
- name.familyName = "McContact";
- contact.name = name;
- contact.save(function(updated) {
- results.innerHTML = 'Contact updated.';
- },function(e) {
- results.innerHTML = 'Update failed: error ' + e.code;
- });
- }, function(e) {
- if (e.code === ContactError.NOT_SUPPORTED_ERROR) {
- results.innerHTML = 'Searching for contacts is not supported.';
- } else {
- results.innerHTML = 'Search failed: error ' + e.code;
- }
- }, obj)
- }
-
- function removeTestContacts() {
- var results = document.getElementById('contact_results');
- results.innerHTML = "";
- var obj = new ContactFindOptions();
- obj.filter = 'DeleteMe';
- obj.multiple = true;
- navigator.contacts.find(['note'], function(contacts) {
- var removes = [];
- contacts.forEach(function(contact) {
- removes.push(contact);
- });
- if (removes.length == 0) {
- results.innerHTML = "No contacts to remove";
- return;
- }
-
- var nextToRemove = undefined;
- if (removes.length > 0) {
- nextToRemove = removes.shift();
- }
-
- function removeNext(item) {
- if (typeof item === 'undefined') {
- return;
- }
-
- if (removes.length > 0) {
- nextToRemove = removes.shift();
- } else {
- nextToRemove = undefined;
- }
-
- item.remove(function removeSucceeded() {
- results.innerHTML += "Removed a contact with ID " + item.id + " ";
- removeNext(nextToRemove);
- }, function removeFailed() {
- results.innerHTML += "Failed to remove a contact with ID " + item.id + " ";
- removeNext(nextToRemove);
- });
- }
- removeNext(nextToRemove);
- }, function(e) {
- if (e.code === ContactError.NOT_SUPPORTED_ERROR) {
- results.innerHTML = 'Searching for contacts is not supported.';
- } else {
- results.innerHTML = 'Search failed: error ' + e.code;
- }
- }, obj);
- }
-
- function nameMatches(contact, contactName) {
- if (contactName === null && (contact.name === null || contact.name.formatted === null)) {
- return true;
- } else if (contact.name && contact.name.formatted && contact.name.formatted.indexOf(contactName) > -1) {
- return true;
- }
- return false;
- }
-
- /******************************************************************************/
-
- contentEl.innerHTML = '
' +
- 'Results: ' +
- '' +
- '
' +
- '' +
- '
Expected result: Status box will show number of contacts and list them. May be empty on a fresh device until you click Add.
' +
- '
Search:
' +
- '
Expected result: Will return only contacts which contain specified string
' +
- '' +
- '
Expected result: Device\'s address book will be shown. After picking a contact status box will show Contact object, passed to success callback
' +
- '' +
- '
Expected result: Will add a new contact. Log will say "Contact saved." or "Saving contacts not supported." if not supported on current platform. Verify by running Get phone contacts again
' +
- '' +
- '
Expected result: Will rename "Dooney Evans" to "Urist McContact".
' +
- '' +
- '
Expected result: Will remove all contacts created by these tests. Log will output success or failure and ID of the deleted contacts.
';
-
- createActionButton("Get phone's contacts", function() {
- getContacts();
- }, 'get_contacts');
-
- createActionButton("Filter contacts", function() {
- filterContacts();
- }, 'filter_contacts');
-
- createActionButton("Pick contact", function() {
- pickContact();
- }, 'pick_contact');
-
- createActionButton("Add a new contact 'Dooney Evans'", function() {
- addDooneyEvans();
- }, 'add_contact');
-
- createActionButton("Add new nameless contact", function() {
- addNamelessContact();
- }, 'add_contact');
-
- createActionButton("Add new unicode contact", function() {
- addUnicodeContact();
- }, 'add_contact');
-
- createActionButton("Rename 'Dooney Evans'", function() {
- renameDooneyEvans();
- }, 'update_contact');
-
- createActionButton("Delete all test contacts", function() {
- removeTestContacts();
- }, 'remove_contacts');
-};
diff --git a/plugins/cordova-plugin-contacts/www/Contact.js b/plugins/cordova-plugin-contacts/www/Contact.js
deleted file mode 100644
index 9c46a0c..0000000
--- a/plugins/cordova-plugin-contacts/www/Contact.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
- exec = require('cordova/exec'),
- ContactError = require('./ContactError'),
- utils = require('cordova/utils');
-
-/**
-* Converts primitives into Complex Object
-* Currently only used for Date fields
-*/
-function convertIn(contact) {
- var value = contact.birthday;
- try {
- contact.birthday = new Date(parseFloat(value));
- } catch (exception){
- console.log("Cordova Contact convertIn error: exception creating date.");
- }
- return contact;
-}
-
-/**
-* Converts Complex objects into primitives
-* Only conversion at present is for Dates.
-**/
-
-function convertOut(contact) {
- var value = contact.birthday;
- if (value !== null) {
- // try to make it a Date object if it is not already
- if (!utils.isDate(value)){
- try {
- value = new Date(value);
- } catch(exception){
- value = null;
- }
- }
- if (utils.isDate(value)){
- value = value.valueOf(); // convert to milliseconds
- }
- contact.birthday = value;
- }
- return contact;
-}
-
-/**
-* Contains information about a single contact.
-* @constructor
-* @param {DOMString} id unique identifier
-* @param {DOMString} displayName
-* @param {ContactName} name
-* @param {DOMString} nickname
-* @param {Array.} phoneNumbers array of phone numbers
-* @param {Array.} emails array of email addresses
-* @param {Array.} addresses array of addresses
-* @param {Array.} ims instant messaging user ids
-* @param {Array.} organizations
-* @param {DOMString} birthday contact's birthday
-* @param {DOMString} note user notes about contact
-* @param {Array.} photos
-* @param {Array.} categories
-* @param {Array.} urls contact's web sites
-*/
-var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses,
- ims, organizations, birthday, note, photos, categories, urls) {
- this.id = id || null;
- this.rawId = null;
- this.displayName = displayName || null;
- this.name = name || null; // ContactName
- this.nickname = nickname || null;
- this.phoneNumbers = phoneNumbers || null; // ContactField[]
- this.emails = emails || null; // ContactField[]
- this.addresses = addresses || null; // ContactAddress[]
- this.ims = ims || null; // ContactField[]
- this.organizations = organizations || null; // ContactOrganization[]
- this.birthday = birthday || null;
- this.note = note || null;
- this.photos = photos || null; // ContactField[]
- this.categories = categories || null; // ContactField[]
- this.urls = urls || null; // ContactField[]
-};
-
-/**
-* Removes contact from device storage.
-* @param successCB success callback
-* @param errorCB error callback
-*/
-Contact.prototype.remove = function(successCB, errorCB) {
- argscheck.checkArgs('FF', 'Contact.remove', arguments);
- var fail = errorCB && function(code) {
- errorCB(new ContactError(code));
- };
- if (this.id === null) {
- fail(ContactError.UNKNOWN_ERROR);
- }
- else {
- exec(successCB, fail, "Contacts", "remove", [this.id]);
- }
-};
-
-/**
-* Creates a deep copy of this Contact.
-* With the contact ID set to null.
-* @return copy of this Contact
-*/
-Contact.prototype.clone = function() {
- var clonedContact = utils.clone(this);
- clonedContact.id = null;
- clonedContact.rawId = null;
-
- function nullIds(arr) {
- if (arr) {
- for (var i = 0; i < arr.length; ++i) {
- arr[i].id = null;
- }
- }
- }
-
- // Loop through and clear out any id's in phones, emails, etc.
- nullIds(clonedContact.phoneNumbers);
- nullIds(clonedContact.emails);
- nullIds(clonedContact.addresses);
- nullIds(clonedContact.ims);
- nullIds(clonedContact.organizations);
- nullIds(clonedContact.categories);
- nullIds(clonedContact.photos);
- nullIds(clonedContact.urls);
- return clonedContact;
-};
-
-/**
-* Persists contact to device storage.
-* @param successCB success callback
-* @param errorCB error callback
-*/
-Contact.prototype.save = function(successCB, errorCB) {
- argscheck.checkArgs('FFO', 'Contact.save', arguments);
- var fail = errorCB && function(code) {
- errorCB(new ContactError(code));
- };
- var success = function(result) {
- if (result) {
- if (successCB) {
- var fullContact = require('./contacts').create(result);
- successCB(convertIn(fullContact));
- }
- }
- else {
- // no Entry object returned
- fail(ContactError.UNKNOWN_ERROR);
- }
- };
- var dupContact = convertOut(utils.clone(this));
- exec(success, fail, "Contacts", "save", [dupContact]);
-};
-
-
-module.exports = Contact;
diff --git a/plugins/cordova-plugin-contacts/www/ContactAddress.js b/plugins/cordova-plugin-contacts/www/ContactAddress.js
deleted file mode 100644
index 3d39086..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactAddress.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
-* Contact address.
-* @constructor
-* @param {DOMString} id unique identifier, should only be set by native code
-* @param formatted // NOTE: not a W3C standard
-* @param streetAddress
-* @param locality
-* @param region
-* @param postalCode
-* @param country
-*/
-
-var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) {
- this.id = null;
- this.pref = (typeof pref != 'undefined' ? pref : false);
- this.type = type || null;
- this.formatted = formatted || null;
- this.streetAddress = streetAddress || null;
- this.locality = locality || null;
- this.region = region || null;
- this.postalCode = postalCode || null;
- this.country = country || null;
-};
-
-module.exports = ContactAddress;
diff --git a/plugins/cordova-plugin-contacts/www/ContactError.js b/plugins/cordova-plugin-contacts/www/ContactError.js
deleted file mode 100644
index 6d4545d..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactError.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * ContactError.
- * An error code assigned by an implementation when an error has occurred
- * @constructor
- */
-var ContactError = function(err) {
- this.code = (typeof err != 'undefined' ? err : null);
-};
-
-/**
- * Error codes
- */
-ContactError.UNKNOWN_ERROR = 0;
-ContactError.INVALID_ARGUMENT_ERROR = 1;
-ContactError.TIMEOUT_ERROR = 2;
-ContactError.PENDING_OPERATION_ERROR = 3;
-ContactError.IO_ERROR = 4;
-ContactError.NOT_SUPPORTED_ERROR = 5;
-ContactError.OPERATION_CANCELLED_ERROR = 6;
-ContactError.PERMISSION_DENIED_ERROR = 20;
-
-module.exports = ContactError;
diff --git a/plugins/cordova-plugin-contacts/www/ContactField.js b/plugins/cordova-plugin-contacts/www/ContactField.js
deleted file mode 100644
index e84107a..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactField.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
-* Generic contact field.
-* @constructor
-* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard
-* @param type
-* @param value
-* @param pref
-*/
-var ContactField = function(type, value, pref) {
- this.id = null;
- this.type = (type && type.toString()) || null;
- this.value = (value && value.toString()) || null;
- this.pref = (typeof pref != 'undefined' ? pref : false);
-};
-
-module.exports = ContactField;
diff --git a/plugins/cordova-plugin-contacts/www/ContactFieldType.js b/plugins/cordova-plugin-contacts/www/ContactFieldType.js
deleted file mode 100644
index 8e012de..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactFieldType.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
- // Possible field names for various platforms.
- // Some field names are platform specific
-
- var fieldType = {
- addresses: "addresses",
- birthday: "birthday",
- categories: "categories",
- country: "country",
- department: "department",
- displayName: "displayName",
- emails: "emails",
- familyName: "familyName",
- formatted: "formatted",
- givenName: "givenName",
- honorificPrefix: "honorificPrefix",
- honorificSuffix: "honorificSuffix",
- id: "id",
- ims: "ims",
- locality: "locality",
- middleName: "middleName",
- name: "name",
- nickname: "nickname",
- note: "note",
- organizations: "organizations",
- phoneNumbers: "phoneNumbers",
- photos: "photos",
- postalCode: "postalCode",
- region: "region",
- streetAddress: "streetAddress",
- title: "title",
- urls: "urls"
- };
-
- module.exports = fieldType;
diff --git a/plugins/cordova-plugin-contacts/www/ContactFindOptions.js b/plugins/cordova-plugin-contacts/www/ContactFindOptions.js
deleted file mode 100644
index 73a497d..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactFindOptions.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * ContactFindOptions.
- * @constructor
- * @param filter used to match contacts against
- * @param multiple boolean used to determine if more than one contact should be returned
- * @param desiredFields
- * @param hasPhoneNumber boolean used to filter the search and only return contacts that have a phone number informed
- */
-
-var ContactFindOptions = function(filter, multiple, desiredFields, hasPhoneNumber) {
- this.filter = filter || '';
- this.multiple = (typeof multiple != 'undefined' ? multiple : false);
- this.desiredFields = typeof desiredFields != 'undefined' ? desiredFields : [];
- this.hasPhoneNumber = typeof hasPhoneNumber != 'undefined' ? hasPhoneNumber : false;
-};
-
-module.exports = ContactFindOptions;
diff --git a/plugins/cordova-plugin-contacts/www/ContactName.js b/plugins/cordova-plugin-contacts/www/ContactName.js
deleted file mode 100644
index 15cf60b..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactName.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
-* Contact name.
-* @constructor
-* @param formatted // NOTE: not part of W3C standard
-* @param familyName
-* @param givenName
-* @param middle
-* @param prefix
-* @param suffix
-*/
-var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) {
- this.formatted = formatted || null;
- this.familyName = familyName || null;
- this.givenName = givenName || null;
- this.middleName = middle || null;
- this.honorificPrefix = prefix || null;
- this.honorificSuffix = suffix || null;
-};
-
-module.exports = ContactName;
diff --git a/plugins/cordova-plugin-contacts/www/ContactOrganization.js b/plugins/cordova-plugin-contacts/www/ContactOrganization.js
deleted file mode 100644
index fdfefe2..0000000
--- a/plugins/cordova-plugin-contacts/www/ContactOrganization.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
-* Contact organization.
-* @constructor
-* @param pref
-* @param type
-* @param name
-* @param dept
-* @param title
-*/
-
-var ContactOrganization = function(pref, type, name, dept, title) {
- this.id = null;
- this.pref = (typeof pref != 'undefined' ? pref : false);
- this.type = type || null;
- this.name = name || null;
- this.department = dept || null;
- this.title = title || null;
-};
-
-module.exports = ContactOrganization;
diff --git a/plugins/cordova-plugin-contacts/www/contacts.js b/plugins/cordova-plugin-contacts/www/contacts.js
deleted file mode 100644
index 178a20a..0000000
--- a/plugins/cordova-plugin-contacts/www/contacts.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
- exec = require('cordova/exec'),
- ContactError = require('./ContactError'),
- utils = require('cordova/utils'),
- Contact = require('./Contact'),
- fieldType = require('./ContactFieldType');
-
-
-/**
-* Represents a group of Contacts.
-* @constructor
-*/
-var contacts = {
- fieldType: fieldType,
- /**
- * Returns an array of Contacts matching the search criteria.
- * @param fields that should be searched
- * @param successCB success callback
- * @param errorCB error callback
- * @param {ContactFindOptions} options that can be applied to contact searching
- * @return array of Contacts matching search criteria
- */
- find:function(fields, successCB, errorCB, options) {
- argscheck.checkArgs('afFO', 'contacts.find', arguments);
- if (!fields.length) {
- errorCB && errorCB(new ContactError(ContactError.INVALID_ARGUMENT_ERROR));
- } else {
- // missing 'options' param means return all contacts
- options = options || {filter: '', multiple: true}
- var win = function(result) {
- var cs = [];
- for (var i = 0, l = result.length; i < l; i++) {
- cs.push(contacts.create(result[i]));
- }
- successCB(cs);
- };
- exec(win, errorCB, "Contacts", "search", [fields, options]);
- }
- },
-
- /**
- * This function picks contact from phone using contact picker UI
- * @returns new Contact object
- */
- pickContact: function (successCB, errorCB) {
-
- argscheck.checkArgs('fF', 'contacts.pick', arguments);
-
- var win = function (result) {
- // if Contacts.pickContact return instance of Contact object
- // don't create new Contact object, use current
- var contact = result instanceof Contact ? result : contacts.create(result);
- successCB(contact);
- };
- exec(win, errorCB, "Contacts", "pickContact", []);
- },
-
- /**
- * This function creates a new contact, but it does not persist the contact
- * to device storage. To persist the contact to device storage, invoke
- * contact.save().
- * @param properties an object whose properties will be examined to create a new Contact
- * @returns new Contact object
- */
- create:function(properties) {
- argscheck.checkArgs('O', 'contacts.create', arguments);
- var contact = new Contact();
- for (var i in properties) {
- if (typeof contact[i] !== 'undefined' && properties.hasOwnProperty(i)) {
- contact[i] = properties[i];
- }
- }
- return contact;
- }
-};
-
-module.exports = contacts;
diff --git a/plugins/cordova-plugin-contacts/www/ios/Contact.js b/plugins/cordova-plugin-contacts/www/ios/Contact.js
deleted file mode 100644
index b40c41a..0000000
--- a/plugins/cordova-plugin-contacts/www/ios/Contact.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec'),
- ContactError = require('./ContactError');
-
-/**
- * Provides iOS Contact.display API.
- */
-module.exports = {
- display : function(errorCB, options) {
- /*
- * Display a contact using the iOS Contact Picker UI
- * NOT part of W3C spec so no official documentation
- *
- * @param errorCB error callback
- * @param options object
- * allowsEditing: boolean AS STRING
- * "true" to allow editing the contact
- * "false" (default) display contact
- */
-
- if (this.id === null) {
- if (typeof errorCB === "function") {
- var errorObj = new ContactError(ContactError.UNKNOWN_ERROR);
- errorCB(errorObj);
- }
- }
- else {
- exec(null, errorCB, "Contacts","displayContact", [this.id, options]);
- }
- }
-};
diff --git a/plugins/cordova-plugin-contacts/www/ios/contacts.js b/plugins/cordova-plugin-contacts/www/ios/contacts.js
deleted file mode 100644
index 67cf421..0000000
--- a/plugins/cordova-plugin-contacts/www/ios/contacts.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-/**
- * Provides iOS enhanced contacts API.
- */
-module.exports = {
- newContactUI : function(successCallback) {
- /*
- * Create a contact using the iOS Contact Picker UI
- * NOT part of W3C spec so no official documentation
- *
- * returns: the id of the created contact as param to successCallback
- */
- exec(successCallback, null, "Contacts","newContact", []);
- },
- chooseContact : function(successCallback, options) {
- /*
- * Select a contact using the iOS Contact Picker UI
- * NOT part of W3C spec so no official documentation
- *
- * @param errorCB error callback
- * @param options object
- * allowsEditing: boolean AS STRING
- * "true" to allow editing the contact
- * "false" (default) display contact
- * fields: array of fields to return in contact object (see ContactOptions.fields)
- *
- * @returns
- * id of contact selected
- * ContactObject
- * if no fields provided contact contains just id information
- * if fields provided contact object contains information for the specified fields
- *
- */
- var win = function(result) {
- var fullContact = require('./contacts').create(result);
- successCallback(fullContact.id, fullContact);
- };
- exec(win, null, "Contacts","chooseContact", [options]);
- }
-};
diff --git a/plugins/cordova-plugin-device-orientation/CONTRIBUTING.md b/plugins/cordova-plugin-device-orientation/CONTRIBUTING.md
deleted file mode 100644
index 4c8e6a5..0000000
--- a/plugins/cordova-plugin-device-orientation/CONTRIBUTING.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-# Contributing to Apache Cordova
-
-Anyone can contribute to Cordova. And we need your contributions.
-
-There are multiple ways to contribute: report bugs, improve the docs, and
-contribute code.
-
-For instructions on this, start with the
-[contribution overview](http://cordova.apache.org/contribute/).
-
-The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
- - Run the tests so your patch doesn't break existing functionality.
-
-We look forward to your contributions!
diff --git a/plugins/cordova-plugin-device-orientation/LICENSE b/plugins/cordova-plugin-device-orientation/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/plugins/cordova-plugin-device-orientation/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/NOTICE b/plugins/cordova-plugin-device-orientation/NOTICE
deleted file mode 100644
index 8ec56a5..0000000
--- a/plugins/cordova-plugin-device-orientation/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-device-orientation/README.md b/plugins/cordova-plugin-device-orientation/README.md
deleted file mode 100644
index 299c00e..0000000
--- a/plugins/cordova-plugin-device-orientation/README.md
+++ /dev/null
@@ -1,217 +0,0 @@
----
-title: Device Orientation
-description: Access compass data.
----
-
-
-|Android 4.4|Android 5.1|iOS 9.3|iOS 10.0|Windows 10 Store|Travis CI|
-|:-:|:-:|:-:|:-:|:-:|:-:|
-|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-device-orientation)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-device-orientation/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-device-orientation)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-device-orientation/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-device-orientation)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-device-orientation/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-device-orientation)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-device-orientation/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-device-orientation)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-device-orientation/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device-orientation)|
-
-# cordova-plugin-device-orientation
-
-
-This plugin provides access to the device's compass. The compass is a sensor
-that detects the direction or heading that the device is pointed, typically
-from the top of the device. It measures the heading in degrees from 0 to
-359.99, where 0 is north.
-
-Access is via a global `navigator.compass` object.
-
-Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Device%20Orientation%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
-
-## Installation
-
- cordova plugin add cordova-plugin-device-orientation
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Browser
-- Firefox OS
-- iOS
-- Tizen
-- Windows Phone 7 and 8 (if available in hardware)
-- Windows 8
-
-## Methods
-
-- navigator.compass.getCurrentHeading
-- navigator.compass.watchHeading
-- navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Get the current compass heading. The compass heading is returned via a `CompassHeading`
-object using the `compassSuccess` callback function.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-### Example
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-## navigator.compass.watchHeading
-
-Gets the device's current heading at a regular interval. Each time the heading
-is retrieved, the `headingSuccess` callback function is executed.
-
-The returned watch ID references the compass watch interval. The watch
-ID can be used with `navigator.compass.clearWatch` to stop watching the navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-`compassOptions` may contain the following keys:
-
-- __frequency__: How often to retrieve the compass heading in milliseconds. _(Number)_ (Default: 100)
-- __filter__: The change in degrees required to initiate a watchHeading success callback. When this value is set, __frequency__ is ignored. _(Number)_
-
-### Example
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Browser Quirks
-
-Values for current heading are randomly generated in order to simulate the compass.
-
-### iOS Quirks
-
-Only one `watchHeading` can be in effect at one time in iOS. If a
-`watchHeading` uses a filter, calling `getCurrentHeading` or
-`watchHeading` uses the existing filter value to specify heading
-changes. Watching heading changes with a filter is more efficient than
-with time intervals.
-
-### Amazon Fire OS Quirks
-
-- `filter` is not supported.
-
-### Android Quirks
-
-- No support for `filter`.
-
-### Firefox OS Quirks
-
-- No support for `filter`.
-
-### Tizen Quirks
-
-- No support for `filter`.
-
-### Windows Phone 7 and 8 Quirks
-
-- No support for `filter`.
-
-## navigator.compass.clearWatch
-
-Stop watching the compass referenced by the watch ID parameter.
-
- navigator.compass.clearWatch(watchID);
-
-- __watchID__: The ID returned by `navigator.compass.watchHeading`.
-
-### Example
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-## CompassHeading
-
-A `CompassHeading` object is returned to the `compassSuccess` callback function.
-
-### Properties
-
-- __magneticHeading__: The heading in degrees from 0-359.99 at a single moment in time. _(Number)_
-
-- __trueHeading__: The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading can't be determined. _(Number)_
-
-- __headingAccuracy__: The deviation in degrees between the reported heading and the true heading. _(Number)_
-
-- __timestamp__: The time at which this heading was determined. _(DOMTimeStamp)_
-
-
-### Amazon Fire OS Quirks
-
-- `trueHeading` is not supported, but reports the same value as `magneticHeading`
-
-- `headingAccuracy` is always 0 because there is no difference between the `magneticHeading` and `trueHeading`
-
-### Android Quirks
-
-- The `trueHeading` property is not supported, but reports the same value as `magneticHeading`.
-
-- The `headingAccuracy` property is always 0 because there is no difference between the `magneticHeading` and `trueHeading`.
-
-### Firefox OS Quirks
-
-- The `trueHeading` property is not supported, but reports the same value as `magneticHeading`.
-
-- The `headingAccuracy` property is always 0 because there is no difference between the `magneticHeading` and `trueHeading`.
-
-### iOS Quirks
-
-- The `trueHeading` property is only returned for location services enabled via `navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-A `CompassError` object is returned to the `compassError` callback function when an error occurs.
-
-### Properties
-
-- __code__: One of the predefined error codes listed below.
-
-### Constants
-
-- `CompassError.COMPASS_INTERNAL_ERR`
-- `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/RELEASENOTES.md b/plugins/cordova-plugin-device-orientation/RELEASENOTES.md
deleted file mode 100644
index 985644f..0000000
--- a/plugins/cordova-plugin-device-orientation/RELEASENOTES.md
+++ /dev/null
@@ -1,141 +0,0 @@
-
-# Release Notes
-
-### 1.0.6 (Feb 28, 2017)
-* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
-* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
-* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
-* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
-
-### 1.0.5 (Dec 07, 2016)
-* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 1.0.5
-* [CB-9179](https://issues.apache.org/jira/browse/CB-9179) (ios) Fixed trueHeading being always 0
-* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
-* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
-
-### 1.0.4 (Sep 08, 2016)
-* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
-* Add badges for paramedic builds on Jenkins
-* Add pull request template.
-* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
-* Removed ios quirk code + documentation
-
-### 1.0.3 (Apr 15, 2016)
-* Remove `warning` emoji, as it doesn't correctly display in the docs website: http://cordova.apache.org/docs/en/dev/cordova-plugin-device-orientation/index.html
-* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
-
-### 1.0.2 (Nov 18, 2015)
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
-* [CB-4596](https://issues.apache.org/jira/browse/CB-4596) Fix `timestamp` to be `DOMTimeStamp` across the board
-* Fixing contribute link.
-* [CB-9426](https://issues.apache.org/jira/browse/CB-9426) Fix exception when using device orientation plugin on **browser** platform.
-
-### 1.0.1 (Jun 17, 2015)
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-device-orientation documentation translation: cordova-plugin-device-orientation
-* fix npm md issue
-* Remove console log message from test
-
-### 1.0.0 (Apr 15, 2015)
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) updated windows and tizen specific references of old id to new id
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
-* Use TRAVIS_BUILD_DIR, install paramedic by npm
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of initWebView method
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of deprecated headers
-* force async callbacks
-* Updated plugin to be 'windows' instead of 'windows8'
-* [CB-8614](https://issues.apache.org/jira/browse/CB-8614) Fixed getCurrentHeading and watchHeading on windows platform
-* [CB-8563](https://issues.apache.org/jira/browse/CB-8563) Integrate TravisCI
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-device-orientation documentation translation: cordova-plugin-device-orientation
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
-* [CB-8458](https://issues.apache.org/jira/browse/CB-8458) Fixes false failure of test, when compass hardware is not available
-
-### 0.3.11 (Feb 04, 2015)
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
-
-### 0.3.10 (Dec 02, 2014)
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-device-orientation documentation translation: cordova-plugin-device-orientation
-* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
-
-### 0.3.9 (Sep 17, 2014)
-* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-device-orientation documentation translation: cordova-plugin-device-orientation
-* Fixed problem with watchCompass if pressed twice
-* [CB-7086](https://issues.apache.org/jira/browse/CB-7086) Renamed dir, added nested plugin.xml
-* added documentation for manual tests
-* Fixed problem with watchCompass if pressed twice
-* [CB-7086](https://issues.apache.org/jira/browse/CB-7086) Renamed dir, added nested plugin.xml
-* added documentation for manual tests
-* Updated docs for browser
-* Add support for the browser
-* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-device-orientation documentation translation
-* [CB-6960](https://issues.apache.org/jira/browse/CB-6960) Added manual tests
-* [CB-6960](https://issues.apache.org/jira/browse/CB-6960) Port compass tests to plugin-test-framework
-
-### 0.3.8 (Aug 06, 2014)
-* **FFOS** update compass.js
-* [CB-7187](https://issues.apache.org/jira/browse/CB-7187) ios: Add explicit dependency on CoreLocation.framework
-* [CB-7187](https://issues.apache.org/jira/browse/CB-7187) Delete unused #import of CDVShared.h
-
-### 0.3.7 (Jun 05, 2014)
-* [CB-6799](https://issues.apache.org/jira/browse/CB-6799) Add license
-* windows8. makes getHeading callback spec compliant
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
-
-### 0.3.6 (Apr 17, 2014)
-* [CB-6381](https://issues.apache.org/jira/browse/CB-6381): [WP8] unexpected error object
-* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
-* [CB-6465](https://issues.apache.org/jira/browse/CB-6465): Add license headers to Tizen code
-* Add NOTICE file
-
-### 0.3.5 (Feb 05, 2014)
-* [ubuntu] request sensors permission
-* [ubuntu] add missing files
-* Add support for Tizen.
-* FFOS info added
-
-### 0.3.4 (Jan 02, 2014)
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Compass plugin
-
-### 0.3.3 (Dec 4, 2013)
-* add ubuntu platform
-* 1. Added amazon-fireos platform. 2. Change to use amazon-fireos as a platform if user agent string contains 'cordova-amazon-fireos'.
-
-### 0.3.2 (Oct 28, 2013)
-* orientation plugin
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for device orientation plugin
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
-
-### 0.3.1 (Sept 25, 2013)
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming id
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming core in CompassProxy
-* [CB-4900](https://issues.apache.org/jira/browse/CB-4900) Windows 8 Compass plugin have extra define breaks plugin loading
-* [windows8] commandProxy was moved
-* Rename CHANGELOG.md -> RELEASENOTES.md
-* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
-
-### 0.3.0 (Sept 5, 2013)
-* [CB-3687](https://issues.apache.org/jira/browse/CB-3687) Added blackberry10 support
diff --git a/plugins/cordova-plugin-device-orientation/doc/de/README.md b/plugins/cordova-plugin-device-orientation/doc/de/README.md
deleted file mode 100644
index c5be422..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/de/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-Dieses Plugin ermöglicht den Zugriff auf das Gerät Kompass. Der Kompass ist ein Sensor, der erkennt die Richtung oder Position, dass das Gerät in der Regel von der Oberseite des Geräts gezeigt wird. Er misst die Überschrift im Grad von 0 bis 359.99, 0 wo Norden ist.
-
-Der Zugang ist über eine globale `navigator.compass`-Objekt.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Browser
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 und 8 (falls verfügbar in Hardware)
- * Windows 8
-
-## Methoden
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Erhalten Sie aktuelle Kompassrichtung. Die Kompassrichtung wird über ein `CompassHeading`-Objekt mithilfe der `compassSuccess`-Callback-Funktion zurückgegeben.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Beispiel
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Ruft das Gerät an den aktuellen Kurs in regelmäßigen Abständen. Jedes Mal, wenn die Überschrift abgerufen wird, wird die Callback-Funktion `headingSuccess` ausgeführt.
-
-Die zurückgegebenen Watch-ID verweist das Kompass-Uhr-Intervall. Die Uhr ID mit `navigator.compass.clearWatch` einsetzbar, um gerade die navigator.compass zu stoppen.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` enthalten die folgenden Schlüssel:
-
- * **Häufigkeit**: wie oft die Kompassrichtung in Millisekunden abrufen. *(Anzahl)* (Default: 100)
- * **Filter**: die Veränderung der Grad benötigt, um einen WatchHeading Erfolg Rückruf initiiert. Wenn dieser Wert festgelegt ist, wird die **Häufigkeit** ignoriert. *(Anzahl)*
-
-### Beispiel
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Browser-Eigenheiten
-
-Werte für aktuelle Überschrift werden nach dem Zufallsprinzip generiert, um den Kompass zu simulieren.
-
-### iOS Macken
-
-Nur ein `watchHeading` kann in der Tat auf einmal in iOS sein. Wenn ein `watchHeading` einen Filter verwendet, wird durch Aufrufen von `getCurrentHeading` oder `watchHeading` den vorhandenen Filterwert Überschrift Änderungen angegeben. Überschrift Veränderungen beobachten, mit einem Filter ist effizienter als mit Zeitintervallen.
-
-### Amazon Fire OS Macken
-
- * `filter`wird nicht unterstützt.
-
-### Android Eigenarten
-
- * Keine Unterstützung für`filter`.
-
-### Firefox OS Macken
-
- * Keine Unterstützung für`filter`.
-
-### Tizen Macken
-
- * Keine Unterstützung für`filter`.
-
-### Windows Phone 7 und 8 Eigenarten
-
- * Keine Unterstützung für`filter`.
-
-## navigator.compass.clearWatch
-
-Stoppen Sie, beobachten den Kompass auf der Watch-ID-Parameter verweist.
-
- navigator.compass.clearWatch(watchID);
-
-
- * **WatchID**: die ID von zurückgegeben`navigator.compass.watchHeading`.
-
-### Beispiel
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-Ein `CompassHeading`-Objekt wird an die `compassSuccess`-Callback-Funktion zurückgegeben.
-
-### Eigenschaften
-
- * **MagneticHeading**: die Überschrift in Grad von 0-359.99 zu einem einzigen Zeitpunkt. *(Anzahl)*
-
- * **TrueHeading**: die Überschrift im Verhältnis zu den geografischen Nordpol in Grad 0-359.99 zu einem einzigen Zeitpunkt. Ein negativer Wert bedeutet, dass die wahre Überschrift nicht bestimmt werden kann. *(Anzahl)*
-
- * **HeadingAccuracy**: die Abweichung in Grad zwischen der gemeldeten Überschrift und die wahre Richtung. *(Anzahl)*
-
- * **Timestamp**: die Zeit, an dem dieser Rubrik bestimmt war. *(Millisekunden)*
-
-### Amazon Fire OS Macken
-
- * `trueHeading`wird nicht unterstützt, aber meldet den gleichen Wert wie`magneticHeading`
-
- * `headingAccuracy`ist immer 0 da es keinen Unterschied zwischen gibt der `magneticHeading` und`trueHeading`
-
-### Android Eigenarten
-
- * Die `trueHeading` -Eigenschaft wird nicht unterstützt, jedoch meldet den gleichen Wert wie`magneticHeading`.
-
- * Die `headingAccuracy` -Eigenschaft ist immer 0 da es keinen Unterschied zwischen gibt der `magneticHeading` und`trueHeading`.
-
-### Firefox OS Macken
-
- * Die `trueHeading` -Eigenschaft wird nicht unterstützt, jedoch meldet den gleichen Wert wie`magneticHeading`.
-
- * Die `headingAccuracy` -Eigenschaft ist immer 0 da es keinen Unterschied zwischen gibt der `magneticHeading` und`trueHeading`.
-
-### iOS Macken
-
- * Die `trueHeading` -Eigenschaft nur für Ortungsdienste aktiviert über zurückgegeben`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-Ein `CompassError`-Objekt wird an die `compassError`-Callback-Funktion zurückgegeben, wenn ein Fehler auftritt.
-
-### Eigenschaften
-
- * **Code**: einer der vordefinierten Fehlercodes aufgeführt.
-
-### Konstanten
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/de/index.md b/plugins/cordova-plugin-device-orientation/doc/de/index.md
deleted file mode 100644
index c13308e..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/de/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-Dieses Plugin ermöglicht den Zugriff auf das Gerät Kompass. Der Kompass ist ein Sensor, der erkennt die Richtung oder Position, dass das Gerät in der Regel von der Oberseite des Geräts gezeigt wird. Er misst die Überschrift im Grad von 0 bis 359.99, 0 wo Norden ist.
-
-Der Zugang ist über eine globale `navigator.compass`-Objekt.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Browser
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 und 8 (falls verfügbar in Hardware)
-* Windows 8
-
-## Methoden
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Erhalten Sie aktuelle Kompassrichtung. Die Kompassrichtung wird über ein `CompassHeading`-Objekt mithilfe der `compassSuccess`-Callback-Funktion zurückgegeben.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Beispiel
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Ruft das Gerät an den aktuellen Kurs in regelmäßigen Abständen. Jedes Mal, wenn die Überschrift abgerufen wird, wird die Callback-Funktion `headingSuccess` ausgeführt.
-
-Die zurückgegebenen Watch-ID verweist das Kompass-Uhr-Intervall. Die Uhr ID mit `navigator.compass.clearWatch` einsetzbar, um gerade die navigator.compass zu stoppen.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` enthalten die folgenden Schlüssel:
-
-* **Häufigkeit**: wie oft die Kompassrichtung in Millisekunden abrufen. *(Anzahl)* (Default: 100)
-* **Filter**: die Veränderung der Grad benötigt, um einen WatchHeading Erfolg Rückruf initiiert. Wenn dieser Wert festgelegt ist, wird die **Häufigkeit** ignoriert. *(Anzahl)*
-
-### Beispiel
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Browser-Eigenheiten
-
-Werte für aktuelle Überschrift werden nach dem Zufallsprinzip generiert, um den Kompass zu simulieren.
-
-### iOS Macken
-
-Nur ein `watchHeading` kann in der Tat auf einmal in iOS sein. Wenn ein `watchHeading` einen Filter verwendet, wird durch Aufrufen von `getCurrentHeading` oder `watchHeading` den vorhandenen Filterwert Überschrift Änderungen angegeben. Überschrift Veränderungen beobachten, mit einem Filter ist effizienter als mit Zeitintervallen.
-
-### Amazon Fire OS Macken
-
-* `filter`wird nicht unterstützt.
-
-### Android Eigenarten
-
-* Keine Unterstützung für`filter`.
-
-### Firefox OS Macken
-
-* Keine Unterstützung für`filter`.
-
-### Tizen Macken
-
-* Keine Unterstützung für`filter`.
-
-### Windows Phone 7 und 8 Eigenarten
-
-* Keine Unterstützung für`filter`.
-
-## navigator.compass.clearWatch
-
-Stoppen Sie, beobachten den Kompass auf der Watch-ID-Parameter verweist.
-
- navigator.compass.clearWatch(watchID);
-
-
-* **WatchID**: die ID von zurückgegeben`navigator.compass.watchHeading`.
-
-### Beispiel
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-Ein `CompassHeading`-Objekt wird an die `compassSuccess`-Callback-Funktion zurückgegeben.
-
-### Eigenschaften
-
-* **MagneticHeading**: die Überschrift in Grad von 0-359.99 zu einem einzigen Zeitpunkt. *(Anzahl)*
-
-* **TrueHeading**: die Überschrift im Verhältnis zu den geografischen Nordpol in Grad 0-359.99 zu einem einzigen Zeitpunkt. Ein negativer Wert bedeutet, dass die wahre Überschrift nicht bestimmt werden kann. *(Anzahl)*
-
-* **HeadingAccuracy**: die Abweichung in Grad zwischen der gemeldeten Überschrift und die wahre Richtung. *(Anzahl)*
-
-* **Timestamp**: die Zeit, an dem dieser Rubrik bestimmt war. *(Millisekunden)*
-
-### Amazon Fire OS Macken
-
-* `trueHeading`wird nicht unterstützt, aber meldet den gleichen Wert wie`magneticHeading`
-
-* `headingAccuracy`ist immer 0 da es keinen Unterschied zwischen gibt der `magneticHeading` und`trueHeading`
-
-### Android Eigenarten
-
-* Die `trueHeading` -Eigenschaft wird nicht unterstützt, jedoch meldet den gleichen Wert wie`magneticHeading`.
-
-* Die `headingAccuracy` -Eigenschaft ist immer 0 da es keinen Unterschied zwischen gibt der `magneticHeading` und`trueHeading`.
-
-### Firefox OS Macken
-
-* Die `trueHeading` -Eigenschaft wird nicht unterstützt, jedoch meldet den gleichen Wert wie`magneticHeading`.
-
-* Die `headingAccuracy` -Eigenschaft ist immer 0 da es keinen Unterschied zwischen gibt der `magneticHeading` und`trueHeading`.
-
-### iOS Macken
-
-* Die `trueHeading` -Eigenschaft nur für Ortungsdienste aktiviert über zurückgegeben`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-Ein `CompassError`-Objekt wird an die `compassError`-Callback-Funktion zurückgegeben, wenn ein Fehler auftritt.
-
-### Eigenschaften
-
-* **Code**: einer der vordefinierten Fehlercodes aufgeführt.
-
-### Konstanten
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/es/README.md b/plugins/cordova-plugin-device-orientation/doc/es/README.md
deleted file mode 100644
index 9ef441c..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/es/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-Este plugin proporciona acceso al compás del dispositivo. La brújula es un sensor que detecta la dirección o rumbo que el dispositivo está apuntado, normalmente desde la parte superior del dispositivo. Mide el rumbo en grados de 0 a 359.99, donde 0 es el norte.
-
-El acceso es por un global `navigator.compass` objeto.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Instalación
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Explorador
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 y 8 (si está disponible en el hardware)
- * Windows 8
-
-## Métodos
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Conseguir el actual rumbo de la brújula. El rumbo de la brújula es devuelto vía un `CompassHeading` objeto usando la `compassSuccess` función de callback.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Ejemplo
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Obtiene el título actual del dispositivo a intervalos regulares. Cada vez que se recupera el título, el `headingSuccess` se ejecuta la función callback.
-
-El identificador devuelto reloj referencias el intervalo reloj brújula. El reloj ID puede utilizarse con `navigator.compass.clearWatch` para dejar de ver la navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions`puede contener las siguientes claves:
-
- * **frecuencia**: frecuencia con la que recuperar el rumbo de la brújula en milisegundos. *(Número)* (Por defecto: 100)
- * **filtro**: el cambio de grados necesarios para iniciar una devolución de llamada de éxito watchHeading. Cuando se establece este valor, **frecuencia** es ignorado. *(Número)*
-
-### Ejemplo
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Navegador rarezas
-
-Los valores de partida actual son generados al azar para simular la brújula.
-
-### iOS rarezas
-
-Solamente un `watchHeading` puede ser en efecto a la vez en iOS. Si un `watchHeading` utiliza un filtro, llamando a `getCurrentHeading` o `watchHeading` utiliza el valor existente del filtro para especificar los cambios de rumbo. Observando los cambios de rumbo con un filtro es más eficiente que con intervalos de tiempo.
-
-### Amazon fuego OS rarezas
-
- * `filter`No se admite.
-
-### Rarezas Android
-
- * No hay soporte para`filter`.
-
-### Firefox OS rarezas
-
- * No hay soporte para`filter`.
-
-### Rarezas Tizen
-
- * No hay soporte para`filter`.
-
-### Windows Phone 7 y 8 rarezas
-
- * No hay soporte para`filter`.
-
-## navigator.compass.clearWatch
-
-Deja de mirar la brújula al que hace referencia el parámetro ID de reloj.
-
- navigator.compass.clearWatch(watchID);
-
-
- * **watchID**: el identificador devuelto por`navigator.compass.watchHeading`.
-
-### Ejemplo
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-A `CompassHeading` objeto es devuelto a la `compassSuccess` función de callback.
-
-### Propiedades
-
- * **magneticHeading**: el rumbo en grados de 0-359.99 en un solo momento. *(Número)*
-
- * **trueHeading**: el título en relación con el polo norte geográfico en grados 0-359.99 en un solo momento. Un valor negativo indica que no se puede determinar el rumbo verdadero. *(Número)*
-
- * **headingAccuracy**: la desviación en grados entre el rumbo divulgado y el rumbo verdadero. *(Número)*
-
- * **timestamp**: el momento en el cual se determinó esta partida. *(milisegundos)*
-
-### Amazon fuego OS rarezas
-
- * `trueHeading`No es compatible, pero el mismo valor que los informes`magneticHeading`
-
- * `headingAccuracy`es siempre 0 porque no hay ninguna diferencia entre el `magneticHeading` y`trueHeading`
-
-### Rarezas Android
-
- * El `trueHeading` propiedad no es compatible, pero el mismo valor que los informes`magneticHeading`.
-
- * El `headingAccuracy` propiedad es siempre 0 porque no hay ninguna diferencia entre el `magneticHeading` y`trueHeading`.
-
-### Firefox OS rarezas
-
- * El `trueHeading` propiedad no es compatible, pero el mismo valor que los informes`magneticHeading`.
-
- * El `headingAccuracy` propiedad es siempre 0 porque no hay ninguna diferencia entre el `magneticHeading` y`trueHeading`.
-
-### iOS rarezas
-
- * El `trueHeading` propiedad es devuelto sólo para servicios de localización habilitados mediante`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-A `CompassError` objeto es devuelto a la `compassError` función de devolución de llamada cuando se produce un error.
-
-### Propiedades
-
- * **code**: uno de los códigos de error predefinido enumerados a continuación.
-
-### Constantes
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/es/index.md b/plugins/cordova-plugin-device-orientation/doc/es/index.md
deleted file mode 100644
index 5939d00..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/es/index.md
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-Este plugin proporciona acceso al compás del dispositivo. La brújula es un sensor que detecta la dirección o rumbo que el dispositivo está apuntado, normalmente desde la parte superior del dispositivo. Mide el rumbo en grados de 0 a 359.99, donde 0 es el norte.
-
-El acceso es por un global `navigator.compass` objeto.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log(navigator.compass)};
-
-
-## Instalación
-
- Cordova plugin añade cordova-plugin-device-orientación
-
-
-## Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Explorador
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 y 8 (si está disponible en el hardware)
-* Windows 8
-
-## Métodos
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Conseguir el actual rumbo de la brújula. El rumbo de la brújula es devuelto vía un `CompassHeading` objeto usando la `compassSuccess` función de callback.
-
- navigator.compass.getCurrentHeading (compassSuccess, compassError);
-
-
-### Ejemplo
-
- function onSuccess(heading) {alert (' dirige: ' + heading.magneticHeading);};
-
- function onError(error) {alert ('CompassError: "+ error.code);};
-
- navigator.compass.getCurrentHeading (onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Obtiene el título actual del dispositivo a intervalos regulares. Cada vez que se recupera el título, el `headingSuccess` se ejecuta la función callback.
-
-El identificador devuelto reloj referencias el intervalo reloj brújula. El reloj ID puede utilizarse con `navigator.compass.clearWatch` para dejar de ver la navigator.compass.
-
- var watchID = navigator.compass.watchHeading (compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions`puede contener las siguientes claves:
-
-* **frecuencia**: frecuencia con la que recuperar el rumbo de la brújula en milisegundos. *(Número)* (Por defecto: 100)
-* **filtro**: el cambio de grados necesarios para iniciar una devolución de llamada de éxito watchHeading. Cuando se establece este valor, **frecuencia** es ignorado. *(Número)*
-
-### Ejemplo
-
- function onSuccess(heading) {var elemento = document.getElementById('heading');
- element.innerHTML = ' Dirección: "+ heading.magneticHeading;
- };
-
- function onError(compassError) {alert (' error del compás: ' + compassError.code);};
-
- var opciones = {
- frequency: 3000
- }; Actualizar cada 3 segundos var watchID = navigator.compass.watchHeading (onSuccess, onError, opciones);
-
-
-### Navegador rarezas
-
-Los valores de partida actual son generados al azar para simular la brújula.
-
-### iOS rarezas
-
-Solamente un `watchHeading` puede ser en efecto a la vez en iOS. Si un `watchHeading` utiliza un filtro, llamando a `getCurrentHeading` o `watchHeading` utiliza el valor existente del filtro para especificar los cambios de rumbo. Observando los cambios de rumbo con un filtro es más eficiente que con intervalos de tiempo.
-
-### Amazon fuego OS rarezas
-
-* `filter`No se admite.
-
-### Rarezas Android
-
-* No hay soporte para`filter`.
-
-### Firefox OS rarezas
-
-* No hay soporte para`filter`.
-
-### Rarezas Tizen
-
-* No hay soporte para`filter`.
-
-### Windows Phone 7 y 8 rarezas
-
-* No hay soporte para`filter`.
-
-## navigator.compass.clearWatch
-
-Deja de mirar la brújula al que hace referencia el parámetro ID de reloj.
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: el identificador devuelto por`navigator.compass.watchHeading`.
-
-### Ejemplo
-
- var watchID = navigator.compass.watchHeading (onSuccess, onError, opciones);
-
- ... adelante... navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-A `CompassHeading` objeto es devuelto a la `compassSuccess` función de callback.
-
-### Propiedades
-
-* **magneticHeading**: el rumbo en grados de 0-359.99 en un solo momento. *(Número)*
-
-* **trueHeading**: el título en relación con el polo norte geográfico en grados 0-359.99 en un solo momento. Un valor negativo indica que no se puede determinar el rumbo verdadero. *(Número)*
-
-* **headingAccuracy**: la desviación en grados entre el rumbo divulgado y el rumbo verdadero. *(Número)*
-
-* **timestamp**: el momento en el cual se determinó esta partida. *(milisegundos)*
-
-### Amazon fuego OS rarezas
-
-* `trueHeading`No es compatible, pero el mismo valor que los informes`magneticHeading`
-
-* `headingAccuracy`es siempre 0 porque no hay ninguna diferencia entre el `magneticHeading` y`trueHeading`
-
-### Rarezas Android
-
-* El `trueHeading` propiedad no es compatible, pero el mismo valor que los informes`magneticHeading`.
-
-* El `headingAccuracy` propiedad es siempre 0 porque no hay ninguna diferencia entre el `magneticHeading` y`trueHeading`.
-
-### Firefox OS rarezas
-
-* El `trueHeading` propiedad no es compatible, pero el mismo valor que los informes`magneticHeading`.
-
-* El `headingAccuracy` propiedad es siempre 0 porque no hay ninguna diferencia entre el `magneticHeading` y`trueHeading`.
-
-### iOS rarezas
-
-* El `trueHeading` propiedad es devuelto sólo para servicios de localización habilitados mediante`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-A `CompassError` objeto es devuelto a la `compassError` función de devolución de llamada cuando se produce un error.
-
-### Propiedades
-
-* **code**: uno de los códigos de error predefinido enumerados a continuación.
-
-### Constantes
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/fr/README.md b/plugins/cordova-plugin-device-orientation/doc/fr/README.md
deleted file mode 100644
index da61200..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/fr/README.md
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-Ce plugin permet d'accéder à la boussole de l'appareil. La boussole est un capteur qui détecte la direction ou la position que l'appareil est pointé, généralement par le haut de l'appareil. Il mesure la position en degrés de 0 à 359.99, où 0 est vers le Nord.
-
-Accès se fait par un global `navigator.compass` objet.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.compass);}
-
-
-## Installation
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Navigateur
- * Firefox OS
- * iOS
- * Paciarelli
- * Windows Phone 7 et 8 (s'il est disponible dans le matériel)
- * Windows 8
-
-## Méthodes
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Téléchargez la cours de la boussole. La boussole est renvoyé via un `CompassHeading` s'opposer à l'aide de la `compassSuccess` fonction de rappel.
-
- navigator.compass.getCurrentHeading (compassSuccess, compassError) ;
-
-
-### Exemple
-
- function onSuccess(heading) {alert (' intitulé: "+ heading.magneticHeading);} ;
-
- function onError(error) {alert ('CompassError: ' + error.code);} ;
-
- navigator.compass.getCurrentHeading (onSuccess, onError) ;
-
-
-## navigator.compass.watchHeading
-
-Obtient la position actuelle de l'appareil à intervalle régulier. Chaque fois que le titre est récupéré, la `headingSuccess` fonction de rappel est exécutée.
-
-Le code retourné montre fait référence à l'intervalle montre boussole. La montre ID peut être utilisé avec `navigator.compass.clearWatch` d'arrêter de regarder le navigator.compass.
-
- var watchID = navigator.compass.watchHeading (compassSuccess, compassError, [compassOptions]) ;
-
-
-`compassOptions`peut contenir les clés suivantes :
-
- * **fréquence** : la fréquence de récupération de la boussole en millisecondes. *(Nombre)* (Par défaut : 100)
- * **filtre**: le changement en degrés nécessaires pour lancer un rappel de succès watchHeading. Lorsque cette valeur est définie, la **fréquence** est ignoré. *(Nombre)*
-
-### Exemple
-
- function onSuccess(heading) {var element = document.getElementById('heading') ;
- element.innerHTML = "intitulé:" + heading.magneticHeading ;
- };
-
- function onError(compassError) {alert (' erreur de boussole: "+ compassError.code);} ;
-
- options de var = {
- frequency: 3000
- } ; Mise à jour chaque 3 secondes var watchID = navigator.compass.watchHeading (onSuccess, onError, options) ;
-
-
-### Bizarreries navigateur
-
-Valeurs pour la rubrique actuelle sont générés au hasard afin de simuler la boussole.
-
-### Notes au sujet d'iOS
-
-Seul `watchHeading` peut être en effet à un moment donné dans l'iOS. Si un `watchHeading` utilise un filtre, appeler `getCurrentHeading` ou `watchHeading` utilise la valeur existante de filtre pour spécifier des changements de position. En regardant les changements de position avec un filtre est plus efficace qu'avec des intervalles de temps.
-
-### Amazon Fire OS Quirks
-
- * `filter`n'est pas pris en charge.
-
-### Quirks Android
-
- * Pas de support pour`filter`.
-
-### Firefox OS Quirks
-
- * Pas de support pour`filter`.
-
-### Bizarreries de paciarelli
-
- * Pas de support pour`filter`.
-
-### Notes au sujet de Windows Phone 7 et 8
-
- * Pas de support pour`filter`.
-
-## navigator.compass.clearWatch
-
-Arrêter de regarder la boussole référencée par le paramètre ID de montre.
-
- navigator.compass.clearWatch(watchID) ;
-
-
- * **watchID**: l'ID retourné par`navigator.compass.watchHeading`.
-
-### Exemple
-
- var watchID = navigator.compass.watchHeading (onSuccess, onError, options) ;
-
- ... plus tard... navigator.compass.clearWatch(watchID) ;
-
-
-## CompassHeading
-
-A `CompassHeading` objet est retourné à la `compassSuccess` fonction de rappel.
-
-### Propriétés
-
- * **magneticHeading**: la position en degrés de 0-359,99 à un instant donné. *(Nombre)*
-
- * **trueHeading**: la position par rapport au pôle Nord géographique en degrés 0-359,99 à un instant donné. Une valeur négative indique que le cap vrai ne peut être déterminée. *(Nombre)*
-
- * **headingAccuracy**: la déviation en degrés entre la direction signalée et la véritable direction. *(Nombre)*
-
- * **horodatage**: l'heure à laquelle cette direction a été déterminée. *(millisecondes)*
-
-### Amazon Fire OS Quirks
-
- * `trueHeading`n'est pas pris en charge, mais la même valeur que les rapports`magneticHeading`
-
- * `headingAccuracy`est toujours 0 car il n'y a pas de différence entre la `magneticHeading` et`trueHeading`
-
-### Quirks Android
-
- * La `trueHeading` propriété n'est pas pris en charge, mais la même valeur que des rapports`magneticHeading`.
-
- * La `headingAccuracy` propriété est toujours 0 car il n'y a pas de différence entre la `magneticHeading` et`trueHeading`.
-
-### Firefox OS Quirks
-
- * La `trueHeading` propriété n'est pas pris en charge, mais la même valeur que des rapports`magneticHeading`.
-
- * La `headingAccuracy` propriété est toujours 0 car il n'y a pas de différence entre la `magneticHeading` et`trueHeading`.
-
-### Notes au sujet d'iOS
-
- * La `trueHeading` propriété est retournée uniquement pour les services de localisation activées via`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-A `CompassError` objet est retourné à la `compassError` fonction de rappel lorsqu'une erreur survient.
-
-### Propriétés
-
- * **code**: l'un des codes d'erreur prédéfinis énumérés ci-dessous.
-
-### Constantes
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/fr/index.md b/plugins/cordova-plugin-device-orientation/doc/fr/index.md
deleted file mode 100644
index f04a6a9..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/fr/index.md
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-Ce plugin permet d'accéder à la boussole de l'appareil. La boussole est un capteur qui détecte la direction ou la position que l'appareil est pointé, généralement par le haut de l'appareil. Il mesure la position en degrés de 0 à 359.99, où 0 est vers le Nord.
-
-Accès se fait par un global `navigator.compass` objet.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.compass);}
-
-
-## Installation
-
- Cordova plugin ajouter cordova-plugin-device-orientation
-
-
-## Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Navigateur
-* Firefox OS
-* iOS
-* Paciarelli
-* Windows Phone 7 et 8 (s'il est disponible dans le matériel)
-* Windows 8
-
-## Méthodes
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Téléchargez la cours de la boussole. La boussole est renvoyé via un `CompassHeading` s'opposer à l'aide de la `compassSuccess` fonction de rappel.
-
- navigator.compass.getCurrentHeading (compassSuccess, compassError) ;
-
-
-### Exemple
-
- function onSuccess(heading) {alert (' intitulé: "+ heading.magneticHeading);} ;
-
- function onError(error) {alert ('CompassError: ' + error.code);} ;
-
- navigator.compass.getCurrentHeading (onSuccess, onError) ;
-
-
-## navigator.compass.watchHeading
-
-Obtient la position actuelle de l'appareil à intervalle régulier. Chaque fois que le titre est récupéré, la `headingSuccess` fonction de rappel est exécutée.
-
-Le code retourné montre fait référence à l'intervalle montre boussole. La montre ID peut être utilisé avec `navigator.compass.clearWatch` d'arrêter de regarder le navigator.compass.
-
- var watchID = navigator.compass.watchHeading (compassSuccess, compassError, [compassOptions]) ;
-
-
-`compassOptions`peut contenir les clés suivantes :
-
-* **fréquence** : la fréquence de récupération de la boussole en millisecondes. *(Nombre)* (Par défaut : 100)
-* **filtre**: le changement en degrés nécessaires pour lancer un rappel de succès watchHeading. Lorsque cette valeur est définie, la **fréquence** est ignoré. *(Nombre)*
-
-### Exemple
-
- function onSuccess(heading) {var element = document.getElementById('heading') ;
- element.innerHTML = "intitulé:" + heading.magneticHeading ;
- };
-
- function onError(compassError) {alert (' erreur de boussole: "+ compassError.code);} ;
-
- options de var = {
- frequency: 3000
- } ; Mise à jour chaque 3 secondes var watchID = navigator.compass.watchHeading (onSuccess, onError, options) ;
-
-
-### Bizarreries navigateur
-
-Valeurs pour la rubrique actuelle sont générés au hasard afin de simuler la boussole.
-
-### iOS Quirks
-
-Seul `watchHeading` peut être en effet à un moment donné dans l'iOS. Si un `watchHeading` utilise un filtre, appeler `getCurrentHeading` ou `watchHeading` utilise la valeur existante de filtre pour spécifier des changements de position. En regardant les changements de position avec un filtre est plus efficace qu'avec des intervalles de temps.
-
-### Amazon Fire OS Quirks
-
-* `filter`n'est pas pris en charge.
-
-### Quirks Android
-
-* Pas de support pour`filter`.
-
-### Firefox OS Quirks
-
-* Pas de support pour`filter`.
-
-### Bizarreries de paciarelli
-
-* Pas de support pour`filter`.
-
-### Windows Phone 7 et 8 Quirks
-
-* Pas de support pour`filter`.
-
-## navigator.compass.clearWatch
-
-Arrêter de regarder la boussole référencée par le paramètre ID de montre.
-
- navigator.compass.clearWatch(watchID) ;
-
-
-* **watchID**: l'ID retourné par`navigator.compass.watchHeading`.
-
-### Exemple
-
- var watchID = navigator.compass.watchHeading (onSuccess, onError, options) ;
-
- ... plus tard... navigator.compass.clearWatch(watchID) ;
-
-
-## CompassHeading
-
-A `CompassHeading` objet est retourné à la `compassSuccess` fonction de rappel.
-
-### Propriétés
-
-* **magneticHeading**: la position en degrés de 0-359,99 à un instant donné. *(Nombre)*
-
-* **trueHeading**: la position par rapport au pôle Nord géographique en degrés 0-359,99 à un instant donné. Une valeur négative indique que le cap vrai ne peut être déterminée. *(Nombre)*
-
-* **headingAccuracy**: la déviation en degrés entre la direction signalée et la véritable direction. *(Nombre)*
-
-* **horodatage**: l'heure à laquelle cette direction a été déterminée. *(millisecondes)*
-
-### Amazon Fire OS Quirks
-
-* `trueHeading`n'est pas pris en charge, mais la même valeur que les rapports`magneticHeading`
-
-* `headingAccuracy`est toujours 0 car il n'y a pas de différence entre la `magneticHeading` et`trueHeading`
-
-### Quirks Android
-
-* La `trueHeading` propriété n'est pas pris en charge, mais la même valeur que des rapports`magneticHeading`.
-
-* La `headingAccuracy` propriété est toujours 0 car il n'y a pas de différence entre la `magneticHeading` et`trueHeading`.
-
-### Firefox OS Quirks
-
-* La `trueHeading` propriété n'est pas pris en charge, mais la même valeur que des rapports`magneticHeading`.
-
-* La `headingAccuracy` propriété est toujours 0 car il n'y a pas de différence entre la `magneticHeading` et`trueHeading`.
-
-### iOS Quirks
-
-* La `trueHeading` propriété est retournée uniquement pour les services de localisation activées via`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-A `CompassError` objet est retourné à la `compassError` fonction de rappel lorsqu'une erreur survient.
-
-### Propriétés
-
-* **code**: l'un des codes d'erreur prédéfinis énumérés ci-dessous.
-
-### Constantes
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/it/README.md b/plugins/cordova-plugin-device-orientation/doc/it/README.md
deleted file mode 100644
index 76133c1..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/it/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-Questo plugin consente di accedere alla bussola del dispositivo. La bussola è un sensore che rileva la direzione o la voce che il dispositivo è puntato, in genere dalla parte superiore del dispositivo. Esso misura la rotta in gradi da 0 a 359.99, dove 0 è a nord.
-
-L'accesso avviene tramite un oggetto globale `navigator.compass`.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Browser
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 e 8 (se disponibili nell'hardware)
- * Windows 8
-
-## Metodi
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Ottenere la corrente della bussola. La bussola viene restituita tramite un oggetto `CompassHeading` utilizzando la funzione di callback `compassSuccess`.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Esempio
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Ottiene il titolo attuale del dispositivo a intervalli regolari. Ogni volta che viene recuperato il titolo, viene eseguita la funzione di callback `headingSuccess`.
-
-L'orologio restituito ID fa riferimento l'intervallo orologio bussola. L'ID di orologio utilizzabile con `navigator.compass.clearWatch` a smettere di guardare la navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` può contenere i seguenti tasti:
-
- * **frequency**: la frequenza di recuperare la bussola in millisecondi. *(Numero)* (Default: 100)
- * **filter**: il cambiamento in gradi necessari per avviare un callback di successo watchHeading. Quando questo valore è impostato, la **frequency** viene ignorata. *(Numero)*
-
-### Esempio
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Stranezze browser
-
-I valori per la rubrica attuale sono generati casualmente al fine di simulare la bussola.
-
-### iOS stranezze
-
-Solo un `watchHeading` può essere in effetti una volta in iOS. Se un `watchHeading` utilizza un filtro, chiamata `getCurrentHeading` o `watchHeading` utilizza il valore di filtro esistenti per specificare le modifiche intestazione. Guardando i cambiamenti di direzione con un filtro è più efficiente con intervalli di tempo.
-
-### Amazon fuoco OS stranezze
-
- * `filter`non è supportato.
-
-### Stranezze Android
-
- * Nessun supporto per`filter`.
-
-### Firefox OS stranezze
-
- * Nessun supporto per`filter`.
-
-### Tizen stranezze
-
- * Nessun supporto per`filter`.
-
-### Windows Phone 7 e 8 stranezze
-
- * Nessun supporto per`filter`.
-
-## navigator.compass.clearWatch
-
-Smettere di guardare la bussola a cui fa riferimento il parametro ID orologio.
-
- navigator.compass.clearWatch(watchID);
-
-
- * **watchID**: l'ID restituito da`navigator.compass.watchHeading`.
-
-### Esempio
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-Alla funzione di callback `compassSuccess` viene restituito un oggetto `CompassHeading`.
-
-### Proprietà
-
- * **magneticHeading**: la rotta in gradi da 0-359.99 in un unico momento. *(Numero)*
-
- * **trueHeading**: la voce rispetto al Polo Nord geografico in gradi 0-359.99 in un unico momento. Un valore negativo indica che non è possibile determinare la vera voce. *(Numero)*
-
- * **headingAccuracy**: lo scostamento in gradi tra il titolo segnalato e la vera voce. *(Numero)*
-
- * **timestamp**: il tempo in cui questa voce è stata determinata. *(millisecondi)*
-
-### Amazon fuoco OS stranezze
-
- * `trueHeading`non è supportato, ma riporta lo stesso valore`magneticHeading`
-
- * `headingAccuracy`è sempre 0 perché non non c'è alcuna differenza tra la `magneticHeading` e`trueHeading`
-
-### Stranezze Android
-
- * La `trueHeading` proprietà non è supportata, ma riporta lo stesso valore`magneticHeading`.
-
- * La `headingAccuracy` proprietà è sempre 0 perché non non c'è alcuna differenza tra la `magneticHeading` e`trueHeading`.
-
-### Firefox OS stranezze
-
- * La `trueHeading` proprietà non è supportata, ma riporta lo stesso valore`magneticHeading`.
-
- * La `headingAccuracy` proprietà è sempre 0 perché non non c'è alcuna differenza tra la `magneticHeading` e`trueHeading`.
-
-### iOS stranezze
-
- * La `trueHeading` proprietà viene restituito solo per servizi di localizzazione attivate tramite`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-Un oggetto `CompassError` viene restituito alla funzione di callback `compassError` quando si verifica un errore.
-
-### Proprietà
-
- * **codice**: uno dei codici di errore predefiniti elencati di seguito.
-
-### Costanti
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/it/index.md b/plugins/cordova-plugin-device-orientation/doc/it/index.md
deleted file mode 100644
index 975b5e0..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/it/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-Questo plugin consente di accedere alla bussola del dispositivo. La bussola è un sensore che rileva la direzione o la voce che il dispositivo è puntato, in genere dalla parte superiore del dispositivo. Esso misura la rotta in gradi da 0 a 359.99, dove 0 è a nord.
-
-L'accesso avviene tramite un oggetto globale `navigator.compass`.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Browser
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 e 8 (se disponibili nell'hardware)
-* Windows 8
-
-## Metodi
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Ottenere la corrente della bussola. La bussola viene restituita tramite un oggetto `CompassHeading` utilizzando la funzione di callback `compassSuccess`.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Esempio
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Ottiene il titolo attuale del dispositivo a intervalli regolari. Ogni volta che viene recuperato il titolo, viene eseguita la funzione di callback `headingSuccess`.
-
-L'orologio restituito ID fa riferimento l'intervallo orologio bussola. L'ID di orologio utilizzabile con `navigator.compass.clearWatch` a smettere di guardare la navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` può contenere i seguenti tasti:
-
-* **frequency**: la frequenza di recuperare la bussola in millisecondi. *(Numero)* (Default: 100)
-* **filter**: il cambiamento in gradi necessari per avviare un callback di successo watchHeading. Quando questo valore è impostato, la **frequency** viene ignorata. *(Numero)*
-
-### Esempio
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Stranezze browser
-
-I valori per la rubrica attuale sono generati casualmente al fine di simulare la bussola.
-
-### iOS stranezze
-
-Solo un `watchHeading` può essere in effetti una volta in iOS. Se un `watchHeading` utilizza un filtro, chiamata `getCurrentHeading` o `watchHeading` utilizza il valore di filtro esistenti per specificare le modifiche intestazione. Guardando i cambiamenti di direzione con un filtro è più efficiente con intervalli di tempo.
-
-### Amazon fuoco OS stranezze
-
-* `filter`non è supportato.
-
-### Stranezze Android
-
-* Nessun supporto per`filter`.
-
-### Firefox OS stranezze
-
-* Nessun supporto per`filter`.
-
-### Tizen stranezze
-
-* Nessun supporto per`filter`.
-
-### Windows Phone 7 e 8 stranezze
-
-* Nessun supporto per`filter`.
-
-## navigator.compass.clearWatch
-
-Smettere di guardare la bussola a cui fa riferimento il parametro ID orologio.
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: l'ID restituito da`navigator.compass.watchHeading`.
-
-### Esempio
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-Alla funzione di callback `compassSuccess` viene restituito un oggetto `CompassHeading`.
-
-### Proprietà
-
-* **magneticHeading**: la rotta in gradi da 0-359.99 in un unico momento. *(Numero)*
-
-* **trueHeading**: la voce rispetto al Polo Nord geografico in gradi 0-359.99 in un unico momento. Un valore negativo indica che non è possibile determinare la vera voce. *(Numero)*
-
-* **headingAccuracy**: lo scostamento in gradi tra il titolo segnalato e la vera voce. *(Numero)*
-
-* **timestamp**: il tempo in cui questa voce è stata determinata. *(millisecondi)*
-
-### Amazon fuoco OS stranezze
-
-* `trueHeading`non è supportato, ma riporta lo stesso valore`magneticHeading`
-
-* `headingAccuracy`è sempre 0 perché non non c'è alcuna differenza tra la `magneticHeading` e`trueHeading`
-
-### Stranezze Android
-
-* La `trueHeading` proprietà non è supportata, ma riporta lo stesso valore`magneticHeading`.
-
-* La `headingAccuracy` proprietà è sempre 0 perché non non c'è alcuna differenza tra la `magneticHeading` e`trueHeading`.
-
-### Firefox OS stranezze
-
-* La `trueHeading` proprietà non è supportata, ma riporta lo stesso valore`magneticHeading`.
-
-* La `headingAccuracy` proprietà è sempre 0 perché non non c'è alcuna differenza tra la `magneticHeading` e`trueHeading`.
-
-### iOS stranezze
-
-* La `trueHeading` proprietà viene restituito solo per servizi di localizzazione attivate tramite`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-Un oggetto `CompassError` viene restituito alla funzione di callback `compassError` quando si verifica un errore.
-
-### Proprietà
-
-* **codice**: uno dei codici di errore predefiniti elencati di seguito.
-
-### Costanti
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/ja/README.md b/plugins/cordova-plugin-device-orientation/doc/ja/README.md
deleted file mode 100644
index f129ddc..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/ja/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-このプラグインは、デバイスのコンパスへのアクセスを提供します。 コンパスは方向またはというデバイスは、通常から指摘装置の上部の見出しを検出するセンサーです。 359.99、0 は北に 0 からの角度で見出しを測定します。
-
-アクセスは、グローバル `navigator.compass` オブジェクトを介して。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * ブラウザー
- * Firefox の OS
- * iOS
- * Tizen
- * Windows Phone 7 および 8 (可能な場合ハードウェアで)
- * Windows 8
-
-## メソッド
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-現在のコンパス方位を取得します。コンパス針路が `compassSuccess` コールバック関数を使用して `CompassHeading` オブジェクトを介して返されます。
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### 例
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-デバイスの定期的な間隔で現在の方位を取得します。見出しを取り出すたびに `headingSuccess` コールバック関数が実行されます。
-
-返される時計 ID コンパス時計腕時計間隔を参照します。時計 ID は、navigator.compass を見て停止する `navigator.compass.clearWatch` を使用できます。
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` は、次のキーを含めることができます。
-
- * **周波数**: 多くの場合、コンパス針路 (ミリ秒単位) を取得する方法。*(数)*(デフォルト: 100)
- * **フィルター**: watchHeading 成功時のコールバックを開始する必要度の変化。この値を設定すると、**頻度**は無視されます。*(数)*
-
-### 例
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### ブラウザーの癖
-
-現在の見出しの値は、コンパスをシミュレートするためにランダムに生成されます。
-
-### iOS の癖
-
-1 つだけ `watchHeading` は iOS の効果を同時にすることができます。 `watchHeading` はフィルターを使用して、`getCurrentHeading` または `watchHeading` を呼び出す見出しの変更を指定する既存のフィルター値を使用します。 フィルターを使用して見出しの変更を見て時間間隔よりも効率的にファイルです。
-
-### アマゾン火 OS 癖
-
- * `filter`サポートされていません。
-
-### Android の癖
-
- * サポートされていません`filter`.
-
-### Firefox OS 癖
-
- * サポートされていません`filter`.
-
-### Tizen の癖
-
- * サポートされていません`filter`.
-
-### Windows Phone 7 と 8 癖
-
- * サポートされていません`filter`.
-
-## navigator.compass.clearWatch
-
-時計 ID パラメーターによって参照されるコンパスを見て停止します。
-
- navigator.compass.clearWatch(watchID);
-
-
- * **watchID**: によって返される ID`navigator.compass.watchHeading`.
-
-### 例
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-`CompassHeading` オブジェクトは、`compassSuccess` コールバック関数に返されます。
-
-### プロパティ
-
- * **magneticHeading**: 1 つの時点で 0 359.99 から角度での見出し。*(数)*
-
- * **trueHeading**: 度 0 359.99 で地理的な北極を基準にして、1 つの時点での見出し。 負の値は真針路を特定できないことを示します。 *(数)*
-
- * **headingAccuracy**: 報告された見出しと真方位角度偏差。*(数)*
-
- * **タイムスタンプ**: この見出しを決定した時。*(ミリ秒)*
-
-### アマゾン火 OS 癖
-
- * `trueHeading`レポートと同じ値はサポートされていません`magneticHeading`
-
- * `headingAccuracy`常に 0 の間の違いはありませんので、 `magneticHeading` と`trueHeading`
-
-### Android の癖
-
- * `trueHeading`プロパティはサポートされていませんと同じ値を報告`magneticHeading`.
-
- * `headingAccuracy`プロパティは常に 0 の間の違いはありませんので、 `magneticHeading` と`trueHeading`.
-
-### Firefox OS 癖
-
- * `trueHeading`プロパティはサポートされていませんと同じ値を報告`magneticHeading`.
-
- * `headingAccuracy`プロパティは常に 0 の間の違いはありませんので、 `magneticHeading` と`trueHeading`.
-
-### iOS の癖
-
- * `trueHeading`経由で有効になっている位置情報サービスのプロパティが返されますのみ`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-`CompassError` オブジェクトにエラーが発生したときに `compassError` コールバック関数に返されます。
-
-### プロパティ
-
- * **コード**: 次のいずれかの定義済みのエラー コード。
-
-### 定数
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/ja/index.md b/plugins/cordova-plugin-device-orientation/doc/ja/index.md
deleted file mode 100644
index 82774cc..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/ja/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-このプラグインは、デバイスのコンパスへのアクセスを提供します。 コンパスは方向またはというデバイスは、通常から指摘装置の上部の見出しを検出するセンサーです。 359.99、0 は北に 0 からの角度で見出しを測定します。
-
-アクセスは、グローバル `navigator.compass` オブジェクトを介して。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* ブラウザー
-* Firefox の OS
-* iOS
-* Tizen
-* Windows Phone 7 および 8 (可能な場合ハードウェアで)
-* Windows 8
-
-## メソッド
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-現在のコンパス方位を取得します。コンパス針路が `compassSuccess` コールバック関数を使用して `CompassHeading` オブジェクトを介して返されます。
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### 例
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-デバイスの定期的な間隔で現在の方位を取得します。見出しを取り出すたびに `headingSuccess` コールバック関数が実行されます。
-
-返される時計 ID コンパス時計腕時計間隔を参照します。時計 ID は、navigator.compass を見て停止する `navigator.compass.clearWatch` を使用できます。
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` は、次のキーを含めることができます。
-
-* **周波数**: 多くの場合、コンパス針路 (ミリ秒単位) を取得する方法。*(数)*(デフォルト: 100)
-* **フィルター**: watchHeading 成功時のコールバックを開始する必要度の変化。この値を設定すると、**頻度**は無視されます。*(数)*
-
-### 例
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### ブラウザーの癖
-
-現在の見出しの値は、コンパスをシミュレートするためにランダムに生成されます。
-
-### iOS の癖
-
-1 つだけ `watchHeading` は iOS の効果を同時にすることができます。 `watchHeading` はフィルターを使用して、`getCurrentHeading` または `watchHeading` を呼び出す見出しの変更を指定する既存のフィルター値を使用します。 フィルターを使用して見出しの変更を見て時間間隔よりも効率的にファイルです。
-
-### アマゾン火 OS 癖
-
-* `filter`サポートされていません。
-
-### Android の癖
-
-* サポートされていません`filter`.
-
-### Firefox OS 癖
-
-* サポートされていません`filter`.
-
-### Tizen の癖
-
-* サポートされていません`filter`.
-
-### Windows Phone 7 と 8 癖
-
-* サポートされていません`filter`.
-
-## navigator.compass.clearWatch
-
-時計 ID パラメーターによって参照されるコンパスを見て停止します。
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: によって返される ID`navigator.compass.watchHeading`.
-
-### 例
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-`CompassHeading` オブジェクトは、`compassSuccess` コールバック関数に返されます。
-
-### プロパティ
-
-* **magneticHeading**: 1 つの時点で 0 359.99 から角度での見出し。*(数)*
-
-* **trueHeading**: 度 0 359.99 で地理的な北極を基準にして、1 つの時点での見出し。 負の値は真針路を特定できないことを示します。 *(数)*
-
-* **headingAccuracy**: 報告された見出しと真方位角度偏差。*(数)*
-
-* **タイムスタンプ**: この見出しを決定した時。*(ミリ秒)*
-
-### アマゾン火 OS 癖
-
-* `trueHeading`レポートと同じ値はサポートされていません`magneticHeading`
-
-* `headingAccuracy`常に 0 の間の違いはありませんので、 `magneticHeading` と`trueHeading`
-
-### Android の癖
-
-* `trueHeading`プロパティはサポートされていませんと同じ値を報告`magneticHeading`.
-
-* `headingAccuracy`プロパティは常に 0 の間の違いはありませんので、 `magneticHeading` と`trueHeading`.
-
-### Firefox OS 癖
-
-* `trueHeading`プロパティはサポートされていませんと同じ値を報告`magneticHeading`.
-
-* `headingAccuracy`プロパティは常に 0 の間の違いはありませんので、 `magneticHeading` と`trueHeading`.
-
-### iOS の癖
-
-* `trueHeading`経由で有効になっている位置情報サービスのプロパティが返されますのみ`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-`CompassError` オブジェクトにエラーが発生したときに `compassError` コールバック関数に返されます。
-
-### プロパティ
-
-* **コード**: 次のいずれかの定義済みのエラー コード。
-
-### 定数
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/ko/README.md b/plugins/cordova-plugin-device-orientation/doc/ko/README.md
deleted file mode 100644
index 26388cb..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/ko/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-이 플러그인 디바이스의 나침반에 대 한 액세스를 제공합니다. 나침반 방향 또는 표제는 장치 지적 이다, 일반적으로 장치 위에서 감지 하는 센서입니다. 359.99, 0가 북쪽을 0에서도에서 머리글을 측정 합니다.
-
-글로벌 `navigator.compass` 개체를 통해 액세스가입니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * 브라우저
- * Firefox 운영 체제
- * iOS
- * Tizen
- * Windows Phone 7, 8 (사용 가능한 경우 하드웨어)
- * 윈도우 8
-
-## 메서드
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-현재 나침반 제목 좀. 나침반 제목 `compassSuccess` 콜백 함수를 사용 하 여 `CompassHeading` 개체를 통해 반환 됩니다.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### 예를 들어
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-정기적 장치의 현재 머리글을 가져옵니다. 제목 검색 때마다 `headingSuccess` 콜백 함수가 실행 됩니다.
-
-반환 된 시계 ID 나침반 시계 간격을 참조합니다. 시계 ID는 navigator.compass를 보는 중지 하 `navigator.compass.clearWatch`와 함께 사용할 수 있습니다.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions`는 다음 키를 포함할 수 있습니다.
-
- * **frequency**: 자주 밀리초에서 나침반 머리글을 검색 하는 방법. *(수)* (기본값: 100)
- * **filter**:도 watchHeading 성공 콜백을 시작 하는 데 필요한 변경. 이 값을 설정 하는 경우 **주파수** 는 무시 됩니다. *(수)*
-
-### 예를 들어
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### 브라우저 만지면
-
-현재 제목에 대 한 값은 나침반을 시뮬레이션 하기 위해 임의로 생성 됩니다.
-
-### iOS 단점
-
-하나의 `watchHeading` iOS에서 한 번에 적용에서 될 수 있습니다. `watchHeading` 필터를 사용 하는 경우 `getCurrentHeading` 또는 `watchHeading` 호출 사용 하 여 기존 필터 값 지정 제목 변경. 필터와 제목 변화를 보고 시간을 간격으로 보다 더 효율적입니다.
-
-### 아마존 화재 OS 단점
-
- * `filter`지원 되지 않습니다.
-
-### 안 드 로이드 단점
-
- * 대 한 지원`filter`.
-
-### 파이어 폭스 OS 단점
-
- * 대 한 지원`filter`.
-
-### Tizen 특수
-
- * 대 한 지원`filter`.
-
-### Windows Phone 7, 8 특수
-
- * 대 한 지원`filter`.
-
-## navigator.compass.clearWatch
-
-시계 ID 매개 변수에서 참조 하는 나침반을 보고 중지 합니다.
-
- navigator.compass.clearWatch(watchID);
-
-
- * **watchID**: ID 반환`navigator.compass.watchHeading`.
-
-### 예를 들어
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-`CompassHeading` 개체는 `compassSuccess` 콜백 함수에 반환 됩니다.
-
-### 속성
-
- * **magneticHeading**: 단일 시점에서 0-359.99에서도 제목. *(수)*
-
- * **trueHeading**: 단일 시점에서 0-359.99에서에서 지리적 북극을 기준으로 향하고. 음수 값을 나타냅니다 진정한 표제를 확인할 수 없습니다. *(수)*
-
- * **headingAccuracy**: 보고 된 머리글 사이의 진정한 제목도 편차. *(수)*
-
- * **타임 스탬프**:이 제목 결정 하는 시간. *(밀리초)*
-
-### 아마존 화재 OS 단점
-
- * `trueHeading`지원 되지 않습니다 하지만 같은 값으로 보고`magneticHeading`
-
- * `headingAccuracy`항상 0 사이 차이가 있기 때문에 `magneticHeading` 와`trueHeading`
-
-### 안 드 로이드 단점
-
- * `trueHeading`속성은 지원 되지 않습니다 하지만 같은 값으로 보고`magneticHeading`.
-
- * `headingAccuracy`속성은 항상 0 사이 차이가 있기 때문에 `magneticHeading` 와`trueHeading`.
-
-### 파이어 폭스 OS 단점
-
- * `trueHeading`속성은 지원 되지 않습니다 하지만 같은 값으로 보고`magneticHeading`.
-
- * `headingAccuracy`속성은 항상 0 사이 차이가 있기 때문에 `magneticHeading` 와`trueHeading`.
-
-### iOS 단점
-
- * `trueHeading`속성을 통해 위치 서비스에 대 한 반환만`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-`CompassError` 개체는 오류가 발생 하면 `compassError` 콜백 함수에 반환 됩니다.
-
-### 속성
-
- * **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
-
-### 상수
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/ko/index.md b/plugins/cordova-plugin-device-orientation/doc/ko/index.md
deleted file mode 100644
index 38c9980..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/ko/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-이 플러그인 디바이스의 나침반에 대 한 액세스를 제공합니다. 나침반 방향 또는 표제는 장치 지적 이다, 일반적으로 장치 위에서 감지 하는 센서입니다. 359.99, 0가 북쪽을 0에서도에서 머리글을 측정 합니다.
-
-글로벌 `navigator.compass` 개체를 통해 액세스가입니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* 브라우저
-* Firefox 운영 체제
-* iOS
-* Tizen
-* Windows Phone 7, 8 (사용 가능한 경우 하드웨어)
-* 윈도우 8
-
-## 메서드
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-현재 나침반 제목 좀. 나침반 제목 `compassSuccess` 콜백 함수를 사용 하 여 `CompassHeading` 개체를 통해 반환 됩니다.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### 예를 들어
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-정기적 장치의 현재 머리글을 가져옵니다. 제목 검색 때마다 `headingSuccess` 콜백 함수가 실행 됩니다.
-
-반환 된 시계 ID 나침반 시계 간격을 참조합니다. 시계 ID는 navigator.compass를 보는 중지 하 `navigator.compass.clearWatch`와 함께 사용할 수 있습니다.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions`는 다음 키를 포함할 수 있습니다.
-
-* **frequency**: 자주 밀리초에서 나침반 머리글을 검색 하는 방법. *(수)* (기본값: 100)
-* **filter**:도 watchHeading 성공 콜백을 시작 하는 데 필요한 변경. 이 값을 설정 하는 경우 **주파수** 는 무시 됩니다. *(수)*
-
-### 예를 들어
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### 브라우저 만지면
-
-현재 제목에 대 한 값은 나침반을 시뮬레이션 하기 위해 임의로 생성 됩니다.
-
-### iOS 단점
-
-하나의 `watchHeading` iOS에서 한 번에 적용에서 될 수 있습니다. `watchHeading` 필터를 사용 하는 경우 `getCurrentHeading` 또는 `watchHeading` 호출 사용 하 여 기존 필터 값 지정 제목 변경. 필터와 제목 변화를 보고 시간을 간격으로 보다 더 효율적입니다.
-
-### 아마존 화재 OS 단점
-
-* `filter`지원 되지 않습니다.
-
-### 안 드 로이드 단점
-
-* 대 한 지원`filter`.
-
-### 파이어 폭스 OS 단점
-
-* 대 한 지원`filter`.
-
-### Tizen 특수
-
-* 대 한 지원`filter`.
-
-### Windows Phone 7, 8 특수
-
-* 대 한 지원`filter`.
-
-## navigator.compass.clearWatch
-
-시계 ID 매개 변수에서 참조 하는 나침반을 보고 중지 합니다.
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: ID 반환`navigator.compass.watchHeading`.
-
-### 예를 들어
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-`CompassHeading` 개체는 `compassSuccess` 콜백 함수에 반환 됩니다.
-
-### 속성
-
-* **magneticHeading**: 단일 시점에서 0-359.99에서도 제목. *(수)*
-
-* **trueHeading**: 단일 시점에서 0-359.99에서에서 지리적 북극을 기준으로 향하고. 음수 값을 나타냅니다 진정한 표제를 확인할 수 없습니다. *(수)*
-
-* **headingAccuracy**: 보고 된 머리글 사이의 진정한 제목도 편차. *(수)*
-
-* **타임 스탬프**:이 제목 결정 하는 시간. *(밀리초)*
-
-### 아마존 화재 OS 단점
-
-* `trueHeading`지원 되지 않습니다 하지만 같은 값으로 보고`magneticHeading`
-
-* `headingAccuracy`항상 0 사이 차이가 있기 때문에 `magneticHeading` 와`trueHeading`
-
-### 안 드 로이드 단점
-
-* `trueHeading`속성은 지원 되지 않습니다 하지만 같은 값으로 보고`magneticHeading`.
-
-* `headingAccuracy`속성은 항상 0 사이 차이가 있기 때문에 `magneticHeading` 와`trueHeading`.
-
-### 파이어 폭스 OS 단점
-
-* `trueHeading`속성은 지원 되지 않습니다 하지만 같은 값으로 보고`magneticHeading`.
-
-* `headingAccuracy`속성은 항상 0 사이 차이가 있기 때문에 `magneticHeading` 와`trueHeading`.
-
-### iOS 단점
-
-* `trueHeading`속성을 통해 위치 서비스에 대 한 반환만`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-`CompassError` 개체는 오류가 발생 하면 `compassError` 콜백 함수에 반환 됩니다.
-
-### 속성
-
-* **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
-
-### 상수
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/pl/README.md b/plugins/cordova-plugin-device-orientation/doc/pl/README.md
deleted file mode 100644
index 875fae7..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/pl/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-Ten plugin umożliwia dostęp do urządzenia kompas. Kompas jest czujnik, który wykrywa kierunek lub pozycji, że urządzenie jest wskazywany, zazwyczaj z górnej części urządzenia. Mierzy on nagłówek w stopniach od 0 do 359.99, gdzie 0 jest północ.
-
-Dostęp odbywa się za pomocą obiektu globalnego `navigator.compass`.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Przeglądarka
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 i 8 (jeśli jest dostępny w sprzęcie)
- * Windows 8
-
-## Metody
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Uzyskać bieżącej pozycji kompas. Kompas pozycji jest zwracana za pośrednictwem obiektu `CompassHeading` za pomocą funkcji wywołania zwrotnego `compassSuccess`.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Przykład
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Pobiera bieżący nagłówek urządzenia w regularnych odstępach czasu. Każdym razem, gdy nagłówek jest źródło, funkcja wywołania zwrotnego `headingSuccess` jest wykonywany.
-
-Identyfikator zwrócony zegarek odwołuje interwał kompas zegarek. Oglądaj identyfikator może być używany z `navigator.compass.clearWatch`, aby przestać oglądać navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` może zawierać następujące klucze:
-
- * **częstotliwość**: jak często pobrać kompas pozycji w milisekundach. *(Liczba)* (Domyślnie: 100)
- * **Filtr**: zmiana stopni wymagane zainicjować wywołania zwrotnego watchHeading sukces. Gdy ta wartość jest ustawiona, **częstotliwość** jest ignorowana. *(Liczba)*
-
-### Przykład
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Quirks przeglądarki
-
-Wartości dla bieżącej pozycji są losowo generowane w celu symulacji kompas.
-
-### Dziwactwa iOS
-
-Tylko jeden `watchHeading` może być efekt w tym samym czasie w iOS. Jeśli `watchHeading` używa filtru, `getCurrentHeading` lub `watchHeading` używa istniejących wartości filtru określić zmiany pozycji. Obserwując zmiany pozycji z filtrem jest bardziej efektywne niż z odstępach czasu.
-
-### Amazon ogień OS dziwactwa
-
- * `filter`nie jest obsługiwane.
-
-### Dziwactwa Androida
-
- * Brak wsparcia dla`filter`.
-
-### Firefox OS dziwactwa
-
- * Brak wsparcia dla`filter`.
-
-### Dziwactwa Tizen
-
- * Brak wsparcia dla`filter`.
-
-### Windows Phone 7 i 8 dziwactwa
-
- * Brak wsparcia dla`filter`.
-
-## navigator.compass.clearWatch
-
-Przestać oglądać określany przez parametr ID Zegarek kompas.
-
- navigator.compass.clearWatch(watchID);
-
-
- * **watchID**: Identyfikator zwrócony przez`navigator.compass.watchHeading`.
-
-### Przykład
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-Obiekt `CompassHeading` jest zwracany do funkcji wywołania zwrotnego `compassSuccess`.
-
-### Właściwości
-
- * **magneticHeading**: pozycja w stopniach od 0-359.99 w jednym momencie. *(Liczba)*
-
- * **trueHeading**: nagłówek do geograficznego Bieguna Północnego w stopniu 0-359.99 w jednym momencie. Wartość ujemna wskazuje, że prawda pozycji nie może być ustalona. *(Liczba)*
-
- * **headingAccuracy**: odchylenie w stopniach między zgłoszonych pozycji i pozycji prawda. *(Liczba)*
-
- * **sygnatura czasowa**: czas, w którym pozycja ta została ustalona. *(w milisekundach)*
-
-### Amazon ogień OS dziwactwa
-
- * `trueHeading`nie jest obsługiwane, ale raporty taką samą wartość jak`magneticHeading`
-
- * `headingAccuracy`jest zawsze 0, ponieważ nie ma żadnej różnicy między `magneticHeading` i`trueHeading`
-
-### Dziwactwa Androida
-
- * `trueHeading`Właściwość nie jest obsługiwany, ale raporty taką samą wartość jak`magneticHeading`.
-
- * `headingAccuracy`Właściwość jest zawsze 0, ponieważ nie ma żadnej różnicy między `magneticHeading` i`trueHeading`.
-
-### Firefox OS dziwactwa
-
- * `trueHeading`Właściwość nie jest obsługiwany, ale raporty taką samą wartość jak`magneticHeading`.
-
- * `headingAccuracy`Właściwość jest zawsze 0, ponieważ nie ma żadnej różnicy między `magneticHeading` i`trueHeading`.
-
-### Dziwactwa iOS
-
- * `trueHeading`Właściwość jest zwracana tylko dla lokalizacji usług włączone za pomocą`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-Gdy wystąpi błąd, funkcja wywołania zwrotnego `compassError` zwracany jest obiekt `CompassError`.
-
-### Właściwości
-
- * **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
-
-### Stałe
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/pl/index.md b/plugins/cordova-plugin-device-orientation/doc/pl/index.md
deleted file mode 100644
index ae37966..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/pl/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-Ten plugin umożliwia dostęp do urządzenia kompas. Kompas jest czujnik, który wykrywa kierunek lub pozycji, że urządzenie jest wskazywany, zazwyczaj z górnej części urządzenia. Mierzy on nagłówek w stopniach od 0 do 359.99, gdzie 0 jest północ.
-
-Dostęp odbywa się za pomocą obiektu globalnego `navigator.compass`.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Przeglądarka
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 i 8 (jeśli jest dostępny w sprzęcie)
-* Windows 8
-
-## Metody
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Uzyskać bieżącej pozycji kompas. Kompas pozycji jest zwracana za pośrednictwem obiektu `CompassHeading` za pomocą funkcji wywołania zwrotnego `compassSuccess`.
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### Przykład
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Pobiera bieżący nagłówek urządzenia w regularnych odstępach czasu. Każdym razem, gdy nagłówek jest źródło, funkcja wywołania zwrotnego `headingSuccess` jest wykonywany.
-
-Identyfikator zwrócony zegarek odwołuje interwał kompas zegarek. Oglądaj identyfikator może być używany z `navigator.compass.clearWatch`, aby przestać oglądać navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` może zawierać następujące klucze:
-
-* **częstotliwość**: jak często pobrać kompas pozycji w milisekundach. *(Liczba)* (Domyślnie: 100)
-* **Filtr**: zmiana stopni wymagane zainicjować wywołania zwrotnego watchHeading sukces. Gdy ta wartość jest ustawiona, **częstotliwość** jest ignorowana. *(Liczba)*
-
-### Przykład
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Quirks przeglądarki
-
-Wartości dla bieżącej pozycji są losowo generowane w celu symulacji kompas.
-
-### Dziwactwa iOS
-
-Tylko jeden `watchHeading` może być efekt w tym samym czasie w iOS. Jeśli `watchHeading` używa filtru, `getCurrentHeading` lub `watchHeading` używa istniejących wartości filtru określić zmiany pozycji. Obserwując zmiany pozycji z filtrem jest bardziej efektywne niż z odstępach czasu.
-
-### Amazon ogień OS dziwactwa
-
-* `filter`nie jest obsługiwane.
-
-### Dziwactwa Androida
-
-* Brak wsparcia dla`filter`.
-
-### Firefox OS dziwactwa
-
-* Brak wsparcia dla`filter`.
-
-### Dziwactwa Tizen
-
-* Brak wsparcia dla`filter`.
-
-### Windows Phone 7 i 8 dziwactwa
-
-* Brak wsparcia dla`filter`.
-
-## navigator.compass.clearWatch
-
-Przestać oglądać określany przez parametr ID Zegarek kompas.
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: Identyfikator zwrócony przez`navigator.compass.watchHeading`.
-
-### Przykład
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-Obiekt `CompassHeading` jest zwracany do funkcji wywołania zwrotnego `compassSuccess`.
-
-### Właściwości
-
-* **magneticHeading**: pozycja w stopniach od 0-359.99 w jednym momencie. *(Liczba)*
-
-* **trueHeading**: nagłówek do geograficznego Bieguna Północnego w stopniu 0-359.99 w jednym momencie. Wartość ujemna wskazuje, że prawda pozycji nie może być ustalona. *(Liczba)*
-
-* **headingAccuracy**: odchylenie w stopniach między zgłoszonych pozycji i pozycji prawda. *(Liczba)*
-
-* **sygnatura czasowa**: czas, w którym pozycja ta została ustalona. *(w milisekundach)*
-
-### Amazon ogień OS dziwactwa
-
-* `trueHeading`nie jest obsługiwane, ale raporty taką samą wartość jak`magneticHeading`
-
-* `headingAccuracy`jest zawsze 0, ponieważ nie ma żadnej różnicy między `magneticHeading` i`trueHeading`
-
-### Dziwactwa Androida
-
-* `trueHeading`Właściwość nie jest obsługiwany, ale raporty taką samą wartość jak`magneticHeading`.
-
-* `headingAccuracy`Właściwość jest zawsze 0, ponieważ nie ma żadnej różnicy między `magneticHeading` i`trueHeading`.
-
-### Firefox OS dziwactwa
-
-* `trueHeading`Właściwość nie jest obsługiwany, ale raporty taką samą wartość jak`magneticHeading`.
-
-* `headingAccuracy`Właściwość jest zawsze 0, ponieważ nie ma żadnej różnicy między `magneticHeading` i`trueHeading`.
-
-### Dziwactwa iOS
-
-* `trueHeading`Właściwość jest zwracana tylko dla lokalizacji usług włączone za pomocą`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-Gdy wystąpi błąd, funkcja wywołania zwrotnego `compassError` zwracany jest obiekt `CompassError`.
-
-### Właściwości
-
-* **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
-
-### Stałe
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/ru/index.md b/plugins/cordova-plugin-device-orientation/doc/ru/index.md
deleted file mode 100644
index e66f94c..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/ru/index.md
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-Этот плагин обеспечивает доступ к устройства компас. Компас-это датчик, который определяет направление или заголовок, что устройство указывает, как правило в верхней части устройства. Он измеряет направление в градусах от 0 до 359,99 градусов, где 0 — север.
-
-## Установка
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Обозреватель
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 и 8 (при наличии оборудования)
-* Windows 8
-
-## Методы
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-Получите текущий курс. Курс возвращается через `CompassHeading` объекта с помощью `compassSuccess` функции обратного вызова.
-
- navigator.compass.getCurrentHeading (compassSuccess, compassError);
-
-
-### Пример
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-Получает текущий заголовок устройства в регулярном интервале. Каждый раз, когда извлекаются заголовок, `headingSuccess` выполняется функция обратного вызова.
-
-Идентификатор возвращаемой смотреть ссылки компас часы интервал. Часы, ID может быть использован с `navigator.compass.clearWatch` чтобы остановить просмотр navigator.compass.
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions`может содержать следующие разделы:
-
-* **Частота**: как часто получить курс в миллисекундах. *(Число)* (По умолчанию: 100)
-* **Фильтр**: изменения в градусах, требуемых для инициирования обратного вызова watchHeading успех. Если это значение задано, **Частота** учитывается. *(Число)*
-
-### Пример
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### Браузер причуды
-
-Для того, чтобы имитировать компас генерируются случайным образом значения для текущего заголовка.
-
-### Особенности iOS
-
-Только один `watchHeading` может быть в одно время эффекта в iOS. Если `watchHeading` использует фильтр, вызов `getCurrentHeading` или `watchHeading` для указания изменения заголовка используется существующее значение фильтра. Наблюдая изменения заголовка с помощью фильтра является более эффективным, чем с интервалов времени.
-
-### Особенности Amazon Fire OS
-
-* `filter`не поддерживается.
-
-### Особенности Android
-
-* Поддержка отсутствует`filter`.
-
-### Особенности Firefox OS
-
-* Поддержка отсутствует`filter`.
-
-### Особенности Tizen
-
-* Поддержка отсутствует`filter`.
-
-### Особенности Windows Phone 7 и 8
-
-* Поддержка отсутствует`filter`.
-
-## navigator.compass.clearWatch
-
-Перестать смотреть компас, на который ссылается параметр ID смотреть.
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: идентификатор, возвращенный`navigator.compass.watchHeading`.
-
-### Пример
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-A `CompassHeading` объект возвращается к `compassSuccess` функции обратного вызова.
-
-### Параметры
-
-* **magneticHeading**: направление в градусах от 0-359,99 в один момент времени. *(Число)*
-
-* **trueHeading**: заголовок относительно географического Северного полюса в градусах 0-359,99 в один момент времени. Отрицательное значение указывает, что заголовок правда не может быть определено. *(Число)*
-
-* **headingAccuracy**: отклонение в градусах между сообщил заголовок и заголовок верно. *(Число)*
-
-* **отметка времени**: время, на котором был определен этот заголовок. *(в миллисекундах)*
-
-### Особенности Amazon Fire OS
-
-* `trueHeading`не поддерживается, но сообщает то же значение`magneticHeading`
-
-* `headingAccuracy`Это всегда 0 потому, что нет никакой разницы между `magneticHeading` и`trueHeading`
-
-### Особенности Android
-
-* `trueHeading`Свойство не поддерживается, но сообщает то же значение`magneticHeading`.
-
-* `headingAccuracy`Свойство всегда имеет 0 потому, что нет никакой разницы между `magneticHeading` и`trueHeading`.
-
-### Особенности Firefox OS
-
-* `trueHeading`Свойство не поддерживается, но сообщает то же значение`magneticHeading`.
-
-* `headingAccuracy`Свойство всегда имеет 0 потому, что нет никакой разницы между `magneticHeading` и`trueHeading`.
-
-### Особенности iOS
-
-* `trueHeading`Свойства возвращается только для служб определения местоположения включена через`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-A `CompassError` объект возвращается к `compassError` функцию обратного вызова при возникновении ошибки.
-
-### Параметры
-
-* **code**: один из стандартных кодов ошибок, перечисленных ниже.
-
-### Константы
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/doc/zh/README.md b/plugins/cordova-plugin-device-orientation/doc/zh/README.md
deleted file mode 100644
index fd7a020..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/zh/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-device-orientation.svg)](https://travis-ci.org/apache/cordova-plugin-device-orientation)
-
-這個外掛程式提供了對設備的指南針的訪問。 羅盤是感應器,可檢測的方向或設備通常指從設備的頂部的標題。 它的措施中從 0 度到 359.99,其中 0 是北部的標題。
-
-訪問是通過一個全球 `navigator.compass` 物件。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 瀏覽器
- * 火狐瀏覽器作業系統
- * iOS
- * Tizen
- * Windows Phone 7 和第 8 (如果在硬體中可用)
- * Windows 8
-
-## 方法
-
- * navigator.compass.getCurrentHeading
- * navigator.compass.watchHeading
- * navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-獲取當前的羅經航向。羅經航向被經由一個 `CompassHeading` 物件,使用 `compassSuccess` 回呼函數。
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### 示例
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-獲取設備的當前標題的間隔時間定期。檢索到的標題,每次執行 `headingSuccess` 回呼函數。
-
-返回的表 ID 引用的指南針手錶的時間間隔。表 ID 可用於與 `navigator.compass.clearWatch` 停止看 navigator.compass。
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` 可能包含以下項:
-
- * **frequency**: 經常如何檢索以毫秒為單位的羅經航向。*(Number)*(預設值: 100)
- * **filter**: 啟動 watchHeading 成功回檔所需的度的變化。當設置此值時,**frequency**將被忽略。*(Number)*
-
-### 示例
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### 瀏覽器的怪癖
-
-隨機生成當前標題的值,以便類比羅盤。
-
-### iOS 的怪癖
-
-只有一個 `watchHeading` 可以在 iOS 中一次的效果。 如果 `watchHeading` 使用一個篩選器,致電 `getCurrentHeading` 或 `watchHeading` 使用現有的篩選器值來指定標題的變化。 帶有篩選器看標題的變化是與時間間隔比效率更高。
-
-### 亞馬遜火 OS 怪癖
-
- * `filter`不受支援。
-
-### Android 的怪癖
-
- * 不支援`filter`.
-
-### 火狐瀏覽器作業系統的怪癖
-
- * 不支援`filter`.
-
-### Tizen 怪癖
-
- * 不支援`filter`.
-
-### Windows Phone 7 和 8 怪癖
-
- * 不支援`filter`.
-
-## navigator.compass.clearWatch
-
-別看手錶 ID 參數所引用的指南針。
-
- navigator.compass.clearWatch(watchID);
-
-
- * **watchID**: 由返回的 ID`navigator.compass.watchHeading`.
-
-### 示例
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-`CompassSuccess` 回呼函數返回一個 `CompassHeading` 物件。
-
-### 屬性
-
- * **magneticHeading**: 在某一時刻在時間中從 0-359.99 度的標題。*(人數)*
-
- * **trueHeading**: 在某一時刻的時間與地理北極在 0-359.99 度標題。 負值表示不能確定真正的標題。 *(人數)*
-
- * **headingAccuracy**: 中度報告的標題和真正標題之間的偏差。*(人數)*
-
- * **timestamp**: 本項決定在其中的時間。*(毫秒)*
-
-### 亞馬遜火 OS 怪癖
-
- * `trueHeading`不受支援,但報告相同的值`magneticHeading`
-
- * `headingAccuracy`是始終為 0 因為有沒有區別 `magneticHeading` 和`trueHeading`
-
-### Android 的怪癖
-
- * `trueHeading`屬性不受支援,但報告相同的值`magneticHeading`.
-
- * `headingAccuracy`屬性始終是 0 因為有沒有區別 `magneticHeading` 和`trueHeading`.
-
-### 火狐瀏覽器作業系統的怪癖
-
- * `trueHeading`屬性不受支援,但報告相同的值`magneticHeading`.
-
- * `headingAccuracy`屬性始終是 0 因為有沒有區別 `magneticHeading` 和`trueHeading`.
-
-### iOS 的怪癖
-
- * `trueHeading`屬性只返回位置服務通過以下方式啟用`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-當發生錯誤時,`compassError` 回呼函數情況下會返回一個 `CompassError` 物件。
-
-### 屬性
-
- * **code**: 下面列出的預定義的錯誤代碼之一。
-
-### 常量
-
- * `CompassError.COMPASS_INTERNAL_ERR`
- * `CompassError.COMPASS_NOT_SUPPORTED`
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/doc/zh/index.md b/plugins/cordova-plugin-device-orientation/doc/zh/index.md
deleted file mode 100644
index 4ca2a59..0000000
--- a/plugins/cordova-plugin-device-orientation/doc/zh/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-# cordova-plugin-device-orientation
-
-這個外掛程式提供了對設備的指南針的訪問。 羅盤是感應器,可檢測的方向或設備通常指從設備的頂部的標題。 它的措施中從 0 度到 359.99,其中 0 是北部的標題。
-
-訪問是通過一個全球 `navigator.compass` 物件。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.compass);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-device-orientation
-
-
-## 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* 瀏覽器
-* 火狐瀏覽器的作業系統
-* iOS
-* 泰
-* Windows Phone 7 和第 8 (如果在硬體中可用)
-* Windows 8
-
-## 方法
-
-* navigator.compass.getCurrentHeading
-* navigator.compass.watchHeading
-* navigator.compass.clearWatch
-
-## navigator.compass.getCurrentHeading
-
-獲取當前的羅經航向。羅經航向被經由一個 `CompassHeading` 物件,使用 `compassSuccess` 回呼函數。
-
- navigator.compass.getCurrentHeading(compassSuccess, compassError);
-
-
-### 示例
-
- function onSuccess(heading) {
- alert('Heading: ' + heading.magneticHeading);
- };
-
- function onError(error) {
- alert('CompassError: ' + error.code);
- };
-
- navigator.compass.getCurrentHeading(onSuccess, onError);
-
-
-## navigator.compass.watchHeading
-
-獲取設備的當前標題的間隔時間定期。檢索到的標題,每次執行 `headingSuccess` 回呼函數。
-
-返回的表 ID 引用的指南針手錶的時間間隔。表 ID 可用於與 `navigator.compass.clearWatch` 停止看 navigator.compass。
-
- var watchID = navigator.compass.watchHeading(compassSuccess, compassError, [compassOptions]);
-
-
-`compassOptions` 可能包含以下項:
-
-* **frequency**: 經常如何檢索以毫秒為單位的羅經航向。*(Number)*(預設值: 100)
-* **filter**: 啟動 watchHeading 成功回檔所需的度的變化。當設置此值時,**frequency**將被忽略。*(Number)*
-
-### 示例
-
- function onSuccess(heading) {
- var element = document.getElementById('heading');
- element.innerHTML = 'Heading: ' + heading.magneticHeading;
- };
-
- function onError(compassError) {
- alert('Compass error: ' + compassError.code);
- };
-
- var options = {
- frequency: 3000
- }; // Update every 3 seconds
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
-
-### 瀏覽器的怪癖
-
-隨機生成當前標題的值,以便類比羅盤。
-
-### iOS 的怪癖
-
-只有一個 `watchHeading` 可以在 iOS 中一次的效果。 如果 `watchHeading` 使用一個篩選器,致電 `getCurrentHeading` 或 `watchHeading` 使用現有的篩選器值來指定標題的變化。 帶有篩選器看標題的變化是與時間間隔比效率更高。
-
-### 亞馬遜火 OS 怪癖
-
-* `filter`不受支援。
-
-### Android 的怪癖
-
-* 不支援`filter`.
-
-### 火狐瀏覽器作業系統的怪癖
-
-* 不支援`filter`.
-
-### 泰怪癖
-
-* 不支援`filter`.
-
-### Windows Phone 7 和 8 的怪癖
-
-* 不支援`filter`.
-
-## navigator.compass.clearWatch
-
-別看手錶 ID 參數所引用的指南針。
-
- navigator.compass.clearWatch(watchID);
-
-
-* **watchID**: 由返回的 ID`navigator.compass.watchHeading`.
-
-### 示例
-
- var watchID = navigator.compass.watchHeading(onSuccess, onError, options);
-
- // ... later on ...
-
- navigator.compass.clearWatch(watchID);
-
-
-## CompassHeading
-
-`CompassSuccess` 回呼函數返回一個 `CompassHeading` 物件。
-
-### 屬性
-
-* **magneticHeading**: 在某一時刻在時間中從 0-359.99 度的標題。*(人數)*
-
-* **trueHeading**: 在某一時刻的時間與地理北極在 0-359.99 度標題。 負值表示不能確定真正的標題。 *(人數)*
-
-* **headingAccuracy**: 中度報告的標題和真正標題之間的偏差。*(人數)*
-
-* **timestamp**: 本項決定在其中的時間。*(毫秒)*
-
-### 亞馬遜火 OS 怪癖
-
-* `trueHeading`不受支援,但報告相同的值`magneticHeading`
-
-* `headingAccuracy`是始終為 0 因為有沒有區別 `magneticHeading` 和`trueHeading`
-
-### Android 的怪癖
-
-* `trueHeading`屬性不受支援,但報告相同的值`magneticHeading`.
-
-* `headingAccuracy`屬性始終是 0 因為有沒有區別 `magneticHeading` 和`trueHeading`.
-
-### 火狐瀏覽器作業系統的怪癖
-
-* `trueHeading`屬性不受支援,但報告相同的值`magneticHeading`.
-
-* `headingAccuracy`屬性始終是 0 因為有沒有區別 `magneticHeading` 和`trueHeading`.
-
-### iOS 的怪癖
-
-* `trueHeading`屬性只返回位置服務通過以下方式啟用`navigator.geolocation.watchLocation()`.
-
-## CompassError
-
-當發生錯誤時,`compassError` 回呼函數情況下會返回一個 `CompassError` 物件。
-
-### 屬性
-
-* **code**: 下面列出的預定義的錯誤代碼之一。
-
-### 常量
-
-* `CompassError.COMPASS_INTERNAL_ERR`
-* `CompassError.COMPASS_NOT_SUPPORTED`
diff --git a/plugins/cordova-plugin-device-orientation/package.json b/plugins/cordova-plugin-device-orientation/package.json
deleted file mode 100644
index 1c72346..0000000
--- a/plugins/cordova-plugin-device-orientation/package.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "name": "cordova-plugin-device-orientation",
- "version": "1.0.6",
- "description": "Cordova Device Orientation Plugin",
- "types": "./types/index.d.ts",
- "cordova": {
- "id": "cordova-plugin-device-orientation",
- "platforms": [
- "firefoxos",
- "android",
- "amazon-fireos",
- "ubuntu",
- "blackberry10",
- "ios",
- "wp7",
- "wp8",
- "windows8",
- "tizen",
- "browser"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-plugin-device-orientation"
- },
- "keywords": [
- "cordova",
- "device",
- "orientation",
- "ecosystem:cordova",
- "cordova-firefoxos",
- "cordova-android",
- "cordova-amazon-fireos",
- "cordova-ubuntu",
- "cordova-blackberry10",
- "cordova-ios",
- "cordova-wp7",
- "cordova-wp8",
- "cordova-windows8",
- "cordova-tizen",
- "cordova-browser"
- ],
- "scripts": {
- "test": "npm run jshint",
- "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
- },
- "author": "Apache Software Foundation",
- "license": "Apache-2.0",
- "engines": {
- "cordovaDependencies": {
- "2.0.0": {
- "cordova": ">100"
- }
- }
- },
- "devDependencies": {
- "jshint": "^2.6.0"
- }
-}
diff --git a/plugins/cordova-plugin-device-orientation/plugin.xml b/plugins/cordova-plugin-device-orientation/plugin.xml
deleted file mode 100644
index 0dd9006..0000000
--- a/plugins/cordova-plugin-device-orientation/plugin.xml
+++ /dev/null
@@ -1,173 +0,0 @@
-
-
-
-
-
- Device Orientation
- Cordova Device Orientation Plugin
- Apache 2.0
- cordova,device,orientation
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation.git
- https://issues.apache.org/jira/browse/CB/component/12320637
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-device-orientation/src/android/CompassListener.java b/plugins/cordova-plugin-device-orientation/src/android/CompassListener.java
deleted file mode 100644
index 194db0d..0000000
--- a/plugins/cordova-plugin-device-orientation/src/android/CompassListener.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.deviceorientation;
-
-import java.util.List;
-
-import org.apache.cordova.CordovaWebView;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.content.Context;
-
-import android.os.Handler;
-import android.os.Looper;
-
-/**
- * This class listens to the compass sensor and stores the latest heading value.
- */
-public class CompassListener extends CordovaPlugin implements SensorEventListener {
-
- public static int STOPPED = 0;
- public static int STARTING = 1;
- public static int RUNNING = 2;
- public static int ERROR_FAILED_TO_START = 3;
-
- public long TIMEOUT = 30000; // Timeout in msec to shut off listener
-
- int status; // status of listener
- float heading; // most recent heading value
- long timeStamp; // time of most recent value
- long lastAccessTime; // time the value was last retrieved
- int accuracy; // accuracy of the sensor
-
- private SensorManager sensorManager;// Sensor manager
- Sensor mSensor; // Compass sensor returned by sensor manager
-
- private CallbackContext callbackContext;
-
- /**
- * Constructor.
- */
- public CompassListener() {
- this.heading = 0;
- this.timeStamp = 0;
- this.setStatus(CompassListener.STOPPED);
- }
-
- /**
- * Sets the context of the Command. This can then be used to do things like
- * get file paths associated with the Activity.
- *
- * @param cordova The context of the main Activity.
- * @param webView The CordovaWebView Cordova is running in.
- */
- public void initialize(CordovaInterface cordova, CordovaWebView webView) {
- super.initialize(cordova, webView);
- this.sensorManager = (SensorManager) cordova.getActivity().getSystemService(Context.SENSOR_SERVICE);
- }
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArry of arguments for the plugin.
- * @param callbackS=Context The callback id used when calling back into JavaScript.
- * @return True if the action was valid.
- * @throws JSONException
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- if (action.equals("start")) {
- this.start();
- }
- else if (action.equals("stop")) {
- this.stop();
- }
- else if (action.equals("getStatus")) {
- int i = this.getStatus();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, i));
- }
- else if (action.equals("getHeading")) {
- // If not running, then this is an async call, so don't worry about waiting
- if (this.status != CompassListener.RUNNING) {
- int r = this.start();
- if (r == CompassListener.ERROR_FAILED_TO_START) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, CompassListener.ERROR_FAILED_TO_START));
- return true;
- }
- // Set a timeout callback on the main thread.
- Handler handler = new Handler(Looper.getMainLooper());
- handler.postDelayed(new Runnable() {
- public void run() {
- CompassListener.this.timeout();
- }
- }, 2000);
- }
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, getCompassHeading()));
- }
- else if (action.equals("setTimeout")) {
- this.setTimeout(args.getLong(0));
- }
- else if (action.equals("getTimeout")) {
- long l = this.getTimeout();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, l));
- } else {
- // Unsupported action
- return false;
- }
- return true;
- }
-
- /**
- * Called when listener is to be shut down and object is being destroyed.
- */
- public void onDestroy() {
- this.stop();
- }
-
- /**
- * Called when app has navigated and JS listeners have been destroyed.
- */
- public void onReset() {
- this.stop();
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- /**
- * Start listening for compass sensor.
- *
- * @return status of listener
- */
- public int start() {
-
- // If already starting or running, then just return
- if ((this.status == CompassListener.RUNNING) || (this.status == CompassListener.STARTING)) {
- return this.status;
- }
-
- // Get compass sensor from sensor manager
- @SuppressWarnings("deprecation")
- List list = this.sensorManager.getSensorList(Sensor.TYPE_ORIENTATION);
-
- // If found, then register as listener
- if (list != null && list.size() > 0) {
- this.mSensor = list.get(0);
- this.sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_NORMAL);
- this.lastAccessTime = System.currentTimeMillis();
- this.setStatus(CompassListener.STARTING);
- }
-
- // If error, then set status to error
- else {
- this.setStatus(CompassListener.ERROR_FAILED_TO_START);
- }
-
- return this.status;
- }
-
- /**
- * Stop listening to compass sensor.
- */
- public void stop() {
- if (this.status != CompassListener.STOPPED) {
- this.sensorManager.unregisterListener(this);
- }
- this.setStatus(CompassListener.STOPPED);
- }
-
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- // TODO Auto-generated method stub
- }
-
- /**
- * Called after a delay to time out if the listener has not attached fast enough.
- */
- private void timeout() {
- if (this.status == CompassListener.STARTING) {
- this.setStatus(CompassListener.ERROR_FAILED_TO_START);
- if (this.callbackContext != null) {
- this.callbackContext.error("Compass listener failed to start.");
- }
- }
- }
-
- /**
- * Sensor listener event.
- *
- * @param SensorEvent event
- */
- public void onSensorChanged(SensorEvent event) {
-
- // We only care about the orientation as far as it refers to Magnetic North
- float heading = event.values[0];
-
- // Save heading
- this.timeStamp = System.currentTimeMillis();
- this.heading = heading;
- this.setStatus(CompassListener.RUNNING);
-
- // If heading hasn't been read for TIMEOUT time, then turn off compass sensor to save power
- if ((this.timeStamp - this.lastAccessTime) > this.TIMEOUT) {
- this.stop();
- }
- }
-
- /**
- * Get status of compass sensor.
- *
- * @return status
- */
- public int getStatus() {
- return this.status;
- }
-
- /**
- * Get the most recent compass heading.
- *
- * @return heading
- */
- public float getHeading() {
- this.lastAccessTime = System.currentTimeMillis();
- return this.heading;
- }
-
- /**
- * Set the timeout to turn off compass sensor if getHeading() hasn't been called.
- *
- * @param timeout Timeout in msec.
- */
- public void setTimeout(long timeout) {
- this.TIMEOUT = timeout;
- }
-
- /**
- * Get the timeout to turn off compass sensor if getHeading() hasn't been called.
- *
- * @return timeout in msec
- */
- public long getTimeout() {
- return this.TIMEOUT;
- }
-
- /**
- * Set the status and send it to JavaScript.
- * @param status
- */
- private void setStatus(int status) {
- this.status = status;
- }
-
- /**
- * Create the CompassHeading JSON object to be returned to JavaScript
- *
- * @return a compass heading
- */
- private JSONObject getCompassHeading() throws JSONException {
- JSONObject obj = new JSONObject();
-
- obj.put("magneticHeading", this.getHeading());
- obj.put("trueHeading", this.getHeading());
- // Since the magnetic and true heading are always the same our and accuracy
- // is defined as the difference between true and magnetic always return zero
- obj.put("headingAccuracy", 0);
- obj.put("timestamp", this.timeStamp);
-
- return obj;
- }
-
-}
diff --git a/plugins/cordova-plugin-device-orientation/src/blackberry10/index.js b/plugins/cordova-plugin-device-orientation/src/blackberry10/index.js
deleted file mode 100644
index cd1bdf5..0000000
--- a/plugins/cordova-plugin-device-orientation/src/blackberry10/index.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2013 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* global PluginResult */
-
-module.exports = {
- getHeading: function (success, fail, args, env) {
- var result = new PluginResult(args, env),
- callback = function (orientation) {
- var info = {
- magneticHeading: orientation.alpha,
- trueHeading: 360-orientation.alpha,
- headingAccuracy: 360-(2*orientation.alpha),
- timestamp: new Date().getTime()
- };
- window.removeEventListener("deviceorientation", callback);
- result.callbackOk(info, false);
- };
- window.addEventListener("deviceorientation", callback);
- result.noResult(true);
- }
-};
diff --git a/plugins/cordova-plugin-device-orientation/src/browser/CompassProxy.js b/plugins/cordova-plugin-device-orientation/src/browser/CompassProxy.js
deleted file mode 100644
index 24e571a..0000000
--- a/plugins/cordova-plugin-device-orientation/src/browser/CompassProxy.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Compass = {
- getHeading: function(success, error) {
- var listener = function() {
- var orient = {};
- var heading = (Math.round((Math.random() * 360) * 100) / 100);
-
- orient.trueHeading = heading;
- orient.magneticHeading = heading;
- orient.headingAccuracy = 0;
- orient.timestamp = new Date().getTime();
-
- success(orient);
-
- window.removeEventListener('deviceorientation', listener, false);
- };
-
- return window.addEventListener('deviceorientation', listener, false);
- }
-};
-
-module.exports = Compass;
-require('cordova/exec/proxy').add('Compass', Compass);
diff --git a/plugins/cordova-plugin-device-orientation/src/firefoxos/compass.js b/plugins/cordova-plugin-device-orientation/src/firefoxos/compass.js
deleted file mode 100644
index 95ac02c..0000000
--- a/plugins/cordova-plugin-device-orientation/src/firefoxos/compass.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Compass = {
- getHeading: function(success, error) {
- var listener = function(ev) {
- var orient = {
- trueHeading: ev.alpha,
- magneticHeading: ev.alpha,
- headingAccuracy: 0,
- timestamp: new Date().getTime()
- };
- success(orient);
- // remove listener after first response
- window.removeEventListener('deviceorientation', listener, false);
- };
- return window.addEventListener('deviceorientation', listener, false);
- }
-};
-
-module.exports = Compass;
-require('cordova/exec/proxy').add('Compass', Compass);
-
diff --git a/plugins/cordova-plugin-device-orientation/src/ios/CDVCompass.h b/plugins/cordova-plugin-device-orientation/src/ios/CDVCompass.h
deleted file mode 100644
index 529e11b..0000000
--- a/plugins/cordova-plugin-device-orientation/src/ios/CDVCompass.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import
-
-enum CDVHeadingStatus {
- HEADINGSTOPPED = 0,
- HEADINGSTARTING,
- HEADINGRUNNING,
- HEADINGERROR
-};
-typedef NSUInteger CDVHeadingStatus;
-
-// simple object to keep track of heading information
-@interface CDVHeadingData : NSObject {}
-
-@property (nonatomic, assign) CDVHeadingStatus headingStatus;
-@property (nonatomic, strong) CLHeading* headingInfo;
-@property (nonatomic, strong) NSMutableArray* headingCallbacks;
-@property (nonatomic, copy) NSString* headingFilter;
-@property (nonatomic, strong) NSDate* headingTimestamp;
-@property (assign) NSInteger timeout;
-
-@end
-
-@interface CDVCompass : CDVPlugin {
- @private BOOL __locationStarted;
- @private BOOL __highAccuracyEnabled;
- CDVHeadingData* headingData;
-}
-
-@property (nonatomic, strong) CLLocationManager* locationManager;
-@property (strong) CDVHeadingData* headingData;
-
-- (BOOL)hasHeadingSupport;
-
-- (void)locationManager:(CLLocationManager*)manager
- didFailWithError:(NSError*)error;
-
-- (void)getHeading:(CDVInvokedUrlCommand*)command;
-- (void)returnHeadingInfo:(NSString*)callbackId keepCallback:(BOOL)bRetain;
-- (void)watchHeadingFilter:(CDVInvokedUrlCommand*)command;
-- (void)stopHeading:(CDVInvokedUrlCommand*)command;
-- (void)startHeadingWithFilter:(CLLocationDegrees)filter;
-- (void)locationManager:(CLLocationManager*)manager
- didUpdateHeading:(CLHeading*)heading;
-
-- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager*)manager;
-
-@end
diff --git a/plugins/cordova-plugin-device-orientation/src/ios/CDVCompass.m b/plugins/cordova-plugin-device-orientation/src/ios/CDVCompass.m
deleted file mode 100644
index 192264b..0000000
--- a/plugins/cordova-plugin-device-orientation/src/ios/CDVCompass.m
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVCompass.h"
-
-#pragma mark Constants
-
-#define kPGLocationErrorDomain @"kPGLocationErrorDomain"
-#define kPGLocationDesiredAccuracyKey @"desiredAccuracy"
-#define kPGLocationForcePromptKey @"forcePrompt"
-#define kPGLocationDistanceFilterKey @"distanceFilter"
-#define kPGLocationFrequencyKey @"frequency"
-
-#pragma mark -
-#pragma mark CDVHeadingData
-
-@implementation CDVHeadingData
-
-@synthesize headingStatus, headingInfo, headingCallbacks, headingFilter, headingTimestamp, timeout;
-- (CDVHeadingData*)init
-{
- self = (CDVHeadingData*)[super init];
- if (self) {
- self.headingStatus = HEADINGSTOPPED;
- self.headingInfo = nil;
- self.headingCallbacks = nil;
- self.headingFilter = nil;
- self.headingTimestamp = nil;
- self.timeout = 10;
- }
- return self;
-}
-
-@end
-
-#pragma mark -
-#pragma mark CDVLocation
-
-@implementation CDVCompass
-
-@synthesize locationManager, headingData;
-
-- (void)pluginInitialize
-{
- self.locationManager = [[CLLocationManager alloc] init];
- self.locationManager.delegate = self; // Tells the location manager to send updates to this object
- __locationStarted = NO;
- __highAccuracyEnabled = NO;
- self.headingData = nil;
-}
-
-- (BOOL)hasHeadingSupport
-{
- BOOL headingInstancePropertyAvailable = [self.locationManager respondsToSelector:@selector(headingAvailable)]; // iOS 3.x
- BOOL headingClassPropertyAvailable = [CLLocationManager respondsToSelector:@selector(headingAvailable)]; // iOS 4.x
-
- if (headingInstancePropertyAvailable) { // iOS 3.x
- return [(id)self.locationManager headingAvailable];
- } else if (headingClassPropertyAvailable) { // iOS 4.x
- return [CLLocationManager headingAvailable];
- } else { // iOS 2.x
- return NO;
- }
-}
-
-// called to get the current heading
-// Will call location manager to startUpdatingHeading if necessary
-
-- (void)getHeading:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSDictionary* options = [command argumentAtIndex:0 withDefault:nil];
- NSNumber* filter = [options valueForKey:@"filter"];
-
- if (filter) {
- [self watchHeadingFilter:command];
- return;
- }
- if ([self hasHeadingSupport] == NO) {
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:20];
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- } else {
- // heading retrieval does is not affected by disabling locationServices and authorization of app for location services
- if (!self.headingData) {
- self.headingData = [[CDVHeadingData alloc] init];
- }
- CDVHeadingData* hData = self.headingData;
-
- if (!hData.headingCallbacks) {
- hData.headingCallbacks = [NSMutableArray arrayWithCapacity:1];
- }
- // add the callbackId into the array so we can call back when get data
- [hData.headingCallbacks addObject:callbackId];
-
- if ((hData.headingStatus != HEADINGRUNNING) && (hData.headingStatus != HEADINGERROR)) {
- // Tell the location manager to start notifying us of heading updates
- [self startHeadingWithFilter:0.2];
- } else {
- [self returnHeadingInfo:callbackId keepCallback:NO];
- }
- }
-}
-
-// called to request heading updates when heading changes by a certain amount (filter)
-- (void)watchHeadingFilter:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSDictionary* options = [command argumentAtIndex:0 withDefault:nil];
- NSNumber* filter = [options valueForKey:@"filter"];
- CDVHeadingData* hData = self.headingData;
-
- if ([self hasHeadingSupport] == NO) {
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:20];
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- } else {
- if (!hData) {
- self.headingData = [[CDVHeadingData alloc] init];
- hData = self.headingData;
- }
- if (hData.headingStatus != HEADINGRUNNING) {
- // Tell the location manager to start notifying us of heading updates
- [self startHeadingWithFilter:[filter doubleValue]];
- } else {
- // if already running check to see if due to existing watch filter
- if (hData.headingFilter && ![hData.headingFilter isEqualToString:callbackId]) {
- // new watch filter being specified
- // send heading data one last time to clear old successCallback
- [self returnHeadingInfo:hData.headingFilter keepCallback:NO];
- }
- }
- // save the new filter callback and update the headingFilter setting
- hData.headingFilter = callbackId;
- // check if need to stop and restart in order to change value???
- self.locationManager.headingFilter = [filter doubleValue];
- }
-}
-
-- (void)returnHeadingInfo:(NSString*)callbackId keepCallback:(BOOL)bRetain
-{
- CDVPluginResult* result = nil;
- CDVHeadingData* hData = self.headingData;
-
- self.headingData.headingTimestamp = [NSDate date];
-
- if (hData && (hData.headingStatus == HEADINGERROR)) {
- // return error
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:0];
- } else if (hData && (hData.headingStatus == HEADINGRUNNING) && hData.headingInfo) {
- // if there is heading info, return it
- CLHeading* hInfo = hData.headingInfo;
- NSMutableDictionary* returnInfo = [NSMutableDictionary dictionaryWithCapacity:4];
- NSNumber* timestamp = [NSNumber numberWithDouble:([hInfo.timestamp timeIntervalSince1970] * 1000)];
- [returnInfo setObject:timestamp forKey:@"timestamp"];
- [returnInfo setObject:[NSNumber numberWithDouble:hInfo.magneticHeading] forKey:@"magneticHeading"];
- id trueHeading = __locationStarted ? (id)[NSNumber numberWithDouble : hInfo.trueHeading] : (id)[NSNull null];
- [returnInfo setObject:trueHeading forKey:@"trueHeading"];
- [returnInfo setObject:[NSNumber numberWithDouble:hInfo.headingAccuracy] forKey:@"headingAccuracy"];
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:returnInfo];
- [result setKeepCallbackAsBool:bRetain];
- }
- if (result) {
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
-}
-
-- (void)stopHeading:(CDVInvokedUrlCommand*)command
-{
- // CDVHeadingData* hData = self.headingData;
- if (self.headingData && (self.headingData.headingStatus != HEADINGSTOPPED)) {
- if (self.headingData.headingFilter) {
- // callback one last time to clear callback
- [self returnHeadingInfo:self.headingData.headingFilter keepCallback:NO];
- self.headingData.headingFilter = nil;
- }
- [self.locationManager stopUpdatingHeading];
- NSLog(@"heading STOPPED");
- self.headingData = nil;
- }
-}
-
-// helper method to check the orientation and start updating headings
-- (void)startHeadingWithFilter:(CLLocationDegrees)filter
-{
- self.locationManager.headingFilter = filter;
- [self.locationManager startUpdatingHeading];
- self.headingData.headingStatus = HEADINGSTARTING;
-}
-
-- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager*)manager
-{
- return YES;
-}
-
-- (void)locationManager:(CLLocationManager*)manager
- didUpdateHeading:(CLHeading*)heading
-{
- CDVHeadingData* hData = self.headingData;
-
- // normally we would clear the delegate to stop getting these notifications, but
- // we are sharing a CLLocationManager to get location data as well, so we do a nil check here
- // ideally heading and location should use their own CLLocationManager instances
- if (hData == nil) {
- return;
- }
-
- // save the data for next call into getHeadingData
- hData.headingInfo = heading;
- BOOL bTimeout = NO;
- if (!hData.headingFilter && hData.headingTimestamp) {
- bTimeout = fabs([hData.headingTimestamp timeIntervalSinceNow]) > hData.timeout;
- }
-
- if (hData.headingStatus == HEADINGSTARTING) {
- hData.headingStatus = HEADINGRUNNING; // so returnHeading info will work
-
- // this is the first update
- for (NSString* callbackId in hData.headingCallbacks) {
- [self returnHeadingInfo:callbackId keepCallback:NO];
- }
-
- [hData.headingCallbacks removeAllObjects];
- }
- if (hData.headingFilter) {
- [self returnHeadingInfo:hData.headingFilter keepCallback:YES];
- } else if (bTimeout) {
- [self stopHeading:nil];
- }
- hData.headingStatus = HEADINGRUNNING; // to clear any error
- __locationStarted = YES;
-}
-
-- (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error
-{
- NSLog(@"locationManager::didFailWithError %@", [error localizedFailureReason]);
-
- // Compass Error
- if ([error code] == kCLErrorHeadingFailure) {
- CDVHeadingData* hData = self.headingData;
- if (hData) {
- if (hData.headingStatus == HEADINGSTARTING) {
- // heading error during startup - report error
- for (NSString* callbackId in hData.headingCallbacks) {
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:0];
- [self.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
-
- [hData.headingCallbacks removeAllObjects];
- } // else for frequency watches next call to getCurrentHeading will report error
- if (hData.headingFilter) {
- CDVPluginResult* resultFilter = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:0];
- [self.commandDelegate sendPluginResult:resultFilter callbackId:hData.headingFilter];
- }
- hData.headingStatus = HEADINGERROR;
- }
- }
-
- [self.locationManager stopUpdatingLocation];
- __locationStarted = NO;
-}
-
-- (void)dealloc
-{
- self.locationManager.delegate = nil;
-}
-
-- (void)onReset
-{
- [self.locationManager stopUpdatingHeading];
- self.headingData = nil;
-}
-
-@end
diff --git a/plugins/cordova-plugin-device-orientation/src/tizen/CompassProxy.js b/plugins/cordova-plugin-device-orientation/src/tizen/CompassProxy.js
deleted file mode 100644
index 0e03af9..0000000
--- a/plugins/cordova-plugin-device-orientation/src/tizen/CompassProxy.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var CompassHeading = require('cordova-plugin-device-orientation.CompassHeading'),
- CompassError = require('cordova-plugin-device-orientation.CompassError');
-
-var compassCallback = null,
- compassReady = false;
-
-
-module.exports = {
- getHeading: function (successCallback, errorCallback) {
- if (window.DeviceOrientationEvent !== undefined) {
- compassCallback = function (orientation) {
- var heading = 360 - orientation.alpha;
-
- if (compassReady) {
- if (successCallback)
- successCallback( new CompassHeading (heading, heading, 0, 0));
- window.removeEventListener("deviceorientation", compassCallback, true);
- }
- compassReady = true;
- };
- compassReady = false; // workaround invalid first event value returned by WRT
- window.addEventListener("deviceorientation", compassCallback, true);
- }
- else {
- if (errorCallback)
- errorCallback(CompassError.COMPASS_NOT_SUPPORTED);
- }
- },
-
- stopHeading: function (successCallback, errorCallback) {
- console.log("Compass stopHeading: not implemented yet.");
- }
-};
-
-require("cordova/tizen/commandProxy").add("Compass", module.exports);
diff --git a/plugins/cordova-plugin-device-orientation/src/ubuntu/compass.cpp b/plugins/cordova-plugin-device-orientation/src/ubuntu/compass.cpp
deleted file mode 100644
index a2c3bee..0000000
--- a/plugins/cordova-plugin-device-orientation/src/ubuntu/compass.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "compass.h"
-
-DeviceOrientation::DeviceOrientation(Cordova *cordova): CPlugin(cordova), _validData(false) {
- _compass.connectToBackend();
- connect(&_compass, SIGNAL(readingChanged()), SLOT(updateSensor()));
- connect(&_compass, SIGNAL(sensorError(int)), SLOT(sensorError(int)));
-}
-
-void DeviceOrientation::getHeading(int scId, int ecId, QVariantMap options) {
- Q_UNUSED(options);
- if (_compass.isConnectedToBackend() || !_compass.start()) {
- this->callback(ecId, "CompassError.COMPASS_NOT_SUPPORTED");
- return;
- }
-
- _successCallbacks << scId;
- _errorCallbacks << ecId;
-
- if (_validData) {
- reportResult();
- return;
- }
-}
-
-void DeviceOrientation::sensorError(int error) {
- Q_UNUSED(error);
-
- for (int ecId: _errorCallbacks) {
- this->callback(ecId, "CompassError.COMPASS_INTERNAL_ERR");
- }
-
- _errorCallbacks.clear();
- _successCallbacks.clear();
- _validData = false;
-}
-
-void DeviceOrientation::reportResult() {
- QVariantMap obj;
-
- obj.insert("magneticHeading", _azymuth);
- obj.insert("trueHeading", _azymuth);
- obj.insert("headingAccuracy", _accuracy);
- obj.insert("timestamp", _timestamp);
-
- for (int scId: _successCallbacks) {
- this->cb(scId, obj);
- }
-
- _errorCallbacks.clear();
- _successCallbacks.clear();
-}
-
-void DeviceOrientation::updateSensor(){
- QCompassReading *heading = _compass.reading();
- _azymuth = heading->azimuth();
- _accuracy = heading->calibrationLevel();
- _timestamp = QDateTime::currentDateTime().toMSecsSinceEpoch();
-
- _validData = true;
- reportResult();
-}
diff --git a/plugins/cordova-plugin-device-orientation/src/ubuntu/compass.h b/plugins/cordova-plugin-device-orientation/src/ubuntu/compass.h
deleted file mode 100644
index a1f421e..0000000
--- a/plugins/cordova-plugin-device-orientation/src/ubuntu/compass.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef COMPASS_H_HKFSAHKDFAS
-#define COMPASS_H_HKFSAHKDFAS
-
-#include
-#include
-#include
-
-class DeviceOrientation: public CPlugin {
- Q_OBJECT
-public:
- explicit DeviceOrientation(Cordova *cordova);
-
- virtual const QString fullName() override {
- return DeviceOrientation::fullID();
- }
-
- virtual const QString shortName() override {
- return "Compass";
- }
-
- static const QString fullID() {
- return "Compass";
- }
-
-public slots:
- void getHeading(int scId, int ecId, QVariantMap options);
-
-protected slots:
- void updateSensor();
- void sensorError(int error);
-
-private:
- void reportResult();
- QCompass _compass;
- QList _successCallbacks;
- QList _errorCallbacks;
-
- double _azymuth;
- double _accuracy;
- qtimestamp _timestamp;
- bool _validData;
-};
-
-#endif
diff --git a/plugins/cordova-plugin-device-orientation/src/windows/CompassProxy.js b/plugins/cordova-plugin-device-orientation/src/windows/CompassProxy.js
deleted file mode 100644
index 4302636..0000000
--- a/plugins/cordova-plugin-device-orientation/src/windows/CompassProxy.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*jslint sloppy:true */
-/*global Windows:true, require, module, setTimeout */
-
-var CompassHeading = require('cordova-plugin-device-orientation.CompassHeading'),
- CompassError = require('cordova-plugin-device-orientation.CompassError');
-
-
-module.exports = {
-
- onReadingChanged: null,
- getHeading: function (win, lose) {
- var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
- if (!deviceCompass) {
- setTimeout(function () {
- lose(CompassError.COMPASS_NOT_SUPPORTED);
- }, 0);
- } else {
- var reading = deviceCompass.getCurrentReading(),
- heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth, null, reading.timestamp.getTime());
- setTimeout(function () {
- win(heading);
- }, 0);
- }
- },
- stopHeading: function (win, lose) {
- setTimeout(function () {
- win();
- }, 0);
- }
-};
-
-require("cordova/exec/proxy").add("Compass", module.exports);
diff --git a/plugins/cordova-plugin-device-orientation/src/wp/Compass.cs b/plugins/cordova-plugin-device-orientation/src/wp/Compass.cs
deleted file mode 100644
index d1ce894..0000000
--- a/plugins/cordova-plugin-device-orientation/src/wp/Compass.cs
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-using System;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-using DeviceCompass = Microsoft.Devices.Sensors.Compass;
-using System.Windows.Threading;
-using System.Runtime.Serialization;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.Threading;
-using Microsoft.Devices.Sensors;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-
- public class Compass : BaseCommand
- {
- #region Static members
-
- ///
- /// Status of listener
- ///
- private static int currentStatus;
-
- ///
- /// Id for get getCompass method
- ///
- private static string getCompassId = "getCompassId";
-
- ///
- /// Compass
- ///
- private static DeviceCompass compass = new DeviceCompass();
-
- ///
- /// Listeners for callbacks
- ///
- private static Dictionary watchers = new Dictionary();
-
- #endregion
-
- #region Status codes
-
- public const int Stopped = 0;
- public const int Starting = 1;
- public const int Running = 2;
- public const int ErrorFailedToStart = 4;
- public const int Not_Supported = 20;
-
- /*
- * // Capture error codes
- CompassError.COMPASS_INTERNAL_ERR = 0;
- CompassError.COMPASS_NOT_SUPPORTED = 20;
- * */
-
- #endregion
-
- #region CompassOptions class
- ///
- /// Represents Accelerometer options.
- ///
- [DataContract]
- public class CompassOptions
- {
- ///
- /// How often to retrieve the Acceleration in milliseconds
- ///
- [DataMember(IsRequired = false, Name = "frequency")]
- public int Frequency { get; set; }
-
- ///
- /// The change in degrees required to initiate a watchHeadingFilter success callback.
- ///
- [DataMember(IsRequired = false, Name = "filter")]
- public int Filter { get; set; }
-
- ///
- /// Watcher id
- ///
- [DataMember(IsRequired = false, Name = "id")]
- public string Id { get; set; }
-
- }
- #endregion
-
-
- ///
- /// Time the value was last changed
- ///
- //private DateTime lastValueChangedTime;
-
- ///
- /// Accelerometer options
- ///
- private CompassOptions compassOptions;
-
- //bool isDataValid;
-
- //bool calibrating = false;
-
- public Compass()
- {
-
- }
-
- ///
- /// Formats current coordinates into JSON format
- ///
- /// Coordinates in JSON format
- private string GetHeadingFormatted(CompassReading reading)
- {
- // NOTE: timestamp is generated on the JS side, to avoid issues with format conversions
- string result = String.Format("\"magneticHeading\":{0},\"headingAccuracy\":{1},\"trueHeading\":{2}",
- reading.MagneticHeading.ToString("0.0", CultureInfo.InvariantCulture),
- reading.HeadingAccuracy.ToString("0.0", CultureInfo.InvariantCulture),
- reading.TrueHeading.ToString("0.0", CultureInfo.InvariantCulture));
- return "{" + result + "}";
- }
-
- public void getHeading(string options)
- {
- if (!DeviceCompass.IsSupported)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, Not_Supported));
- }
- else
- {
- //if (compass == null)
- //{
- // // Instantiate the compass.
- // compass = new DeviceCompass();
- // compass.TimeBetweenUpdates = TimeSpan.FromMilliseconds(40);
- // compass.CurrentValueChanged += new EventHandler>(compass_CurrentValueChanged);
- // compass.Calibrate += new EventHandler(compass_Calibrate);
- //}
-
-
- //compass.Start();
-
- }
-
- try
- {
- if (currentStatus != Running)
- {
- lock (compass)
- {
- compass.CurrentValueChanged += compass_SingleHeadingValueChanged;
- compass.Start();
- this.SetStatus(Starting);
- }
-
- long timeout = 2000;
- while ((currentStatus == Starting) && (timeout > 0))
- {
- timeout = timeout - 100;
- Thread.Sleep(100);
- }
-
- if (currentStatus != Running)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, ErrorFailedToStart));
- return;
- }
- }
- lock (compass)
- {
- compass.CurrentValueChanged -= compass_SingleHeadingValueChanged;
- if (watchers.Count < 1)
- {
- compass.Stop();
- this.SetStatus(Stopped);
- }
- }
- }
- catch (UnauthorizedAccessException)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ILLEGAL_ACCESS_EXCEPTION, ErrorFailedToStart));
- }
- catch (Exception)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ErrorFailedToStart));
- }
- }
-
- void compass_SingleHeadingValueChanged(object sender, Microsoft.Devices.Sensors.SensorReadingEventArgs e)
- {
- this.SetStatus(Running);
- if (compass.IsDataValid)
- {
- // trueHeading :: The heading in degrees from 0 - 359.99 at a single moment in time.
- // magneticHeading:: The heading relative to the geographic North Pole in degrees 0 - 359.99 at a single moment in time.
- // A negative value indicates that the true heading could not be determined.
- // headingAccuracy :: The deviation in degrees between the reported heading and the true heading.
- //rawMagnetometerReading = e.SensorReading.MagnetometerReading;
-
- //Debug.WriteLine("Compass Result :: " + GetHeadingFormatted(e.SensorReading));
-
- PluginResult result = new PluginResult(PluginResult.Status.OK, GetHeadingFormatted(e.SensorReading));
-
- DispatchCommandResult(result);
- }
- }
-
- ///
- /// Starts listening for compass sensor
- ///
- /// status of listener
- private int start()
- {
- if ((currentStatus == Running) || (currentStatus == Starting))
- {
- return currentStatus;
- }
- try
- {
- lock (compass)
- {
- watchers.Add(getCompassId, this);
- compass.CurrentValueChanged += watchers[getCompassId].compass_CurrentValueChanged;
- compass.Start();
- this.SetStatus(Starting);
- }
- }
- catch (Exception)
- {
- this.SetStatus(ErrorFailedToStart);
- }
- return currentStatus;
- }
-
- public void startWatch(string options)
- {
- if (!DeviceCompass.IsSupported)
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, Not_Supported));
- }
-
- try
- {
- compassOptions = JSON.JsonHelper.Deserialize(options);
- }
- catch (Exception ex)
- {
- this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
- return;
- }
-
- if (string.IsNullOrEmpty(compassOptions.Id))
- {
- this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- return;
- }
-
- try
- {
- lock (compass)
- {
- watchers.Add(compassOptions.Id, this);
- compass.CurrentValueChanged += watchers[compassOptions.Id].compass_CurrentValueChanged;
- compass.Start();
- this.SetStatus(Starting);
- }
- }
- catch (Exception)
- {
- this.DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ErrorFailedToStart));
- return;
- }
- }
-
- public void stopWatch(string options)
- {
- try
- {
- compassOptions = JSON.JsonHelper.Deserialize(options);
- }
- catch (Exception ex)
- {
- this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
- return;
- }
-
- if (string.IsNullOrEmpty(compassOptions.Id))
- {
- this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- return;
- }
-
- if (currentStatus != Stopped)
- {
- lock (compass)
- {
- Compass watcher = watchers[compassOptions.Id];
- compass.CurrentValueChanged -= watcher.compass_CurrentValueChanged;
- watchers.Remove(compassOptions.Id);
- watcher.Dispose();
- }
- }
- this.SetStatus(Stopped);
-
- this.DispatchCommandResult();
- }
-
- void compass_Calibrate(object sender, Microsoft.Devices.Sensors.CalibrationEventArgs e)
- {
- //throw new NotImplementedException();
- // TODO: pass calibration error to JS
- }
-
- void compass_CurrentValueChanged(object sender, Microsoft.Devices.Sensors.SensorReadingEventArgs e)
- {
- this.SetStatus(Running);
- if (compass.IsDataValid)
- {
- // trueHeading :: The heading in degrees from 0 - 359.99 at a single moment in time.
- // magneticHeading:: The heading relative to the geographic North Pole in degrees 0 - 359.99 at a single moment in time.
- // A negative value indicates that the true heading could not be determined.
- // headingAccuracy :: The deviation in degrees between the reported heading and the true heading.
- //rawMagnetometerReading = e.SensorReading.MagnetometerReading;
-
- //Debug.WriteLine("Compass Result :: " + GetHeadingFormatted(e.SensorReading));
-
- PluginResult result = new PluginResult(PluginResult.Status.OK, GetHeadingFormatted(e.SensorReading));
- result.KeepCallback = true;
-
- DispatchCommandResult(result);
- }
- }
-
- ///
- /// Sets current status
- ///
- /// current status
- private void SetStatus(int status)
- {
- currentStatus = status;
- }
-
- }
-}
diff --git a/plugins/cordova-plugin-device-orientation/tests/plugin.xml b/plugins/cordova-plugin-device-orientation/tests/plugin.xml
deleted file mode 100644
index c1e7f4b..0000000
--- a/plugins/cordova-plugin-device-orientation/tests/plugin.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- Cordova Device Orientation Plugin Tests
- Apache 2.0
-
-
-
-
diff --git a/plugins/cordova-plugin-device-orientation/tests/tests.js b/plugins/cordova-plugin-device-orientation/tests/tests.js
deleted file mode 100644
index 7d56214..0000000
--- a/plugins/cordova-plugin-device-orientation/tests/tests.js
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-
-/* jshint jasmine: true */
-
-exports.defineAutoTests = function () {
- var fail = function (done, message) {
- message = (typeof message !== 'string') ? "Forced failure: wrong callback called" : message;
- expect(true).toFailWithMessage(message);
- done();
- },
- unexpectedFailure = "Forced failure: error callback should not have been called";
-
- describe('Compass (navigator.compass)', function () {
- beforeEach(function () {
- jasmine.Expectation.addMatchers({
- toFailWithMessage: function () {
- return {
- compare: function (actual, customMessage) {
- var pass = false;
- if (customMessage === undefined) {
- customMessage = "Forced failure: wrong callback called";
- }
- return {
- pass: pass,
- message: customMessage
- };
- }
- };
- }
- });
- });
-
- var isCompassAvailable = true;
-
- beforeEach(function (done) {
- if (!isCompassAvailable) {
- // if we're already ensured that compass is not available, no need to check it again
- done();
- return;
- }
- // Try to access compass device, and if it is not available
- // set hardwarefailure flag to mark some tests pending
- navigator.compass.getCurrentHeading(done, function (error) {
- if (error.code == CompassError.COMPASS_NOT_SUPPORTED) {
- isCompassAvailable = false;
- }
- done();
- });
- });
-
- it("compass.spec.1 should exist", function () {
- expect(navigator.compass).toBeDefined();
- });
-
- it("compass.spec.2 should contain a getCurrentHeading function", function () {
- expect(navigator.compass.getCurrentHeading).toBeDefined();
- expect(typeof navigator.compass.getCurrentHeading == 'function').toBe(true);
- });
-
- it("compass.spec.3 getCurrentHeading success callback should be called with a Heading object", function (done) {
- if (!isCompassAvailable) {
- pending();
- }
- navigator.compass.getCurrentHeading(function (a) {
- expect(a instanceof CompassHeading).toBe(true);
- expect(a.magneticHeading).toBeDefined();
- expect(typeof a.magneticHeading == 'number').toBe(true);
- expect(a.trueHeading).not.toBe(undefined);
- expect(typeof a.trueHeading == 'number' || a.trueHeading === null).toBe(true);
- expect(a.headingAccuracy).not.toBe(undefined);
- expect(typeof a.headingAccuracy == 'number' || a.headingAccuracy === null).toBe(true);
- expect(typeof a.timestamp == 'number').toBe(true);
- done();
- }, fail.bind(null, done, unexpectedFailure));
- });
-
- it("compass.spec.4 should contain a watchHeading function", function () {
- expect(navigator.compass.watchHeading).toBeDefined();
- expect(typeof navigator.compass.watchHeading == 'function').toBe(true);
- });
-
- it("compass.spec.5 should contain a clearWatch function", function () {
- expect(navigator.compass.clearWatch).toBeDefined();
- expect(typeof navigator.compass.clearWatch == 'function').toBe(true);
- });
-
- describe('Compass Constants (window.CompassError)', function () {
- it("compass.spec.1 should exist", function () {
- expect(window.CompassError).toBeDefined();
- expect(window.CompassError.COMPASS_INTERNAL_ERR).toBe(0);
- expect(window.CompassError.COMPASS_NOT_SUPPORTED).toBe(20);
- });
- });
-
- describe('Compass Heading model (CompassHeading)', function () {
- it("compass.spec.1 should exist", function () {
- expect(CompassHeading).toBeDefined();
- });
-
- it("compass.spec.8 should be able to create a new CompassHeading instance with no parameters", function () {
- var h = new CompassHeading();
- expect(h).toBeDefined();
- expect(h.magneticHeading).toBeUndefined();
- expect(h.trueHeading).toBeUndefined();
- expect(h.headingAccuracy).toBeUndefined();
- expect(typeof h.timestamp == 'number').toBe(true);
- });
-
- it("compass.spec.9 should be able to create a new CompassHeading instance with parameters", function () {
- var h = new CompassHeading(1, 2, 3, 4);
- expect(h.magneticHeading).toBe(1);
- expect(h.trueHeading).toBe(2);
- expect(h.headingAccuracy).toBe(3);
- expect(h.timestamp.valueOf()).toBe(4);
- expect(typeof h.timestamp == 'number').toBe(true);
- });
- });
-
- describe("Compass watch heading", function() {
- it("compass.spec.10 watchCurrentHeading called with a Heading object", function (done) {
- if (!isCompassAvailable) {
- pending();
- }
-
- var calledOnce = false;
-
- var watchId = navigator.compass.watchHeading(
- function (a){
- expect(a instanceof CompassHeading).toBe(true);
- expect(a.magneticHeading).toBeDefined();
- expect(typeof a.magneticHeading == 'number').toBe(true);
- expect(a.trueHeading).not.toBe(undefined);
- expect(typeof a.trueHeading == 'number' || a.trueHeading === null).toBe(true);
- expect(a.headingAccuracy).not.toBe(undefined);
- expect(typeof a.headingAccuracy == 'number' || a.headingAccuracy === null).toBe(true);
- expect(typeof a.timestamp == 'number').toBe(true);
-
- if (calledOnce) {
- navigator.compass.clearWatch(watchId);
- done();
- }
-
- calledOnce = true;
- },
- function (compassError){},
- { frequency: 50 }
- );
- });
-
- it("compass.spec.11 the watch success callback should not be called once the watch is cleared", function (done) {
- if (!isCompassAvailable) {
- pending();
- }
-
- var calledOnce = false;
- var watchCleared = false;
-
- var watchId = navigator.compass.watchHeading(
- function (a){
- // Don't invoke this function if we have cleared the watch
- expect(watchCleared).toBe(false);
-
- if (calledOnce) {
- navigator.compass.clearWatch(watchId);
- watchCleared = true;
- setInterval(function(){
- done();
- }, 100);
- }
-
- calledOnce = true;
- },
- function (compassError){},
- { frequency: 50 }
- );
- });
- });
- });
-};
-
-/******************************************************************************/
-/******************************************************************************/
-/******************************************************************************/
-
-exports.defineManualTests = function (contentEl, createActionButton) {
- function roundNumber(num) {
- var dec = 3;
- var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
- return result;
- }
-
- var watchCompassId = null;
-
- /**
- * Set compass status
- */
- function setCompassStatus(status) {
- document.getElementById('compass_status').innerHTML = status;
- }
-
- // Success callback for both watchHeading and getCurrentHeading
- function success(a) {
- var magneticHeading = document.getElementById('magneticHeading');
- var trueHeading = document.getElementById("trueHeading");
- var headingAccuracy = document.getElementById("headingAccuracy");
- var timestamp = document.getElementById("timestamp");
-
- magneticHeading.innerHTML = roundNumber(a.magneticHeading);
- trueHeading.innerHTML = roundNumber(a.trueHeading);
- headingAccuracy.innerHTML = a.headingAccuracy;
- timestamp.innerHTML = a.timestamp;
- }
-
- /**
- * Stop watching the acceleration
- */
- function stopCompass() {
- setCompassStatus("Stopped");
- if (watchCompassId) {
- navigator.compass.clearWatch(watchCompassId);
- watchCompassId = null;
- }
- }
-
- /**
- * Start watching compass
- */
- var watchCompass = function () {
- console.log("watchCompass()");
-
- // Fail callback
- var fail = function (e) {
- console.log("watchCompass fail callback with error: " + JSON.stringify(e));
- stopCompass();
- setCompassStatus(e);
- };
-
- // Stop compass if running
- stopCompass();
-
- // Update heading every 1 sec
- var opt = {};
- opt.frequency = 1000;
- watchCompassId = navigator.compass.watchHeading(success, fail, opt);
-
- setCompassStatus("Running");
- };
-
- /**
- * Get current compass
- */
- var getCompass = function () {
- console.log("getCompass()");
-
- // Stop compass if running
- stopCompass();
-
- // Fail callback
- var fail = function (e) {
- console.log("getCompass fail callback with error: " + JSON.stringify(e));
- setCompassStatus(e);
- };
-
- // Make call
- var opt = {};
- navigator.compass.getCurrentHeading(success, fail, opt);
- };
-
- /******************************************************************************/
-
- var orientation_tests = '
iOS devices may bring up a calibration screen when initiating these tests
' +
- '' +
- 'Expected result: Will update the status box with current heading. Status will read "Stopped"' +
- ' ' +
- 'Expected result: When pressed, will start a watch on the compass and update the heading value when heading changes. Status will read "Running"' +
- ' ' +
- 'Expected result: Will clear the compass watch, so heading value will no longer be updated. Status will read "Stopped"';
-
- contentEl.innerHTML = '
Status: ' +
- 'Stopped' +
- '
' +
- '
Magnetic heading:
' +
- '
True heading:
' +
- '
Heading accuracy:
' +
- '
Timestamp:
' +
- '
' +
- orientation_tests;
-
- createActionButton('Get Compass', function () {
- getCompass();
- }, 'getCompass');
-
- createActionButton('Start Watching Compass', function () {
- watchCompass();
- }, 'watchCompass');
-
- createActionButton('Stop Watching Compass', function () {
- stopCompass();
- }, 'stopCompass');
-};
diff --git a/plugins/cordova-plugin-device-orientation/types/index.d.ts b/plugins/cordova-plugin-device-orientation/types/index.d.ts
deleted file mode 100644
index dcd9654..0000000
--- a/plugins/cordova-plugin-device-orientation/types/index.d.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-// Type definitions for Apache Cordova Device Orientation plugin
-// Project: https://github.com/apache/cordova-plugin-device-orientation
-// Definitions by: Microsoft Open Technologies Inc
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-//
-// Copyright (c) Microsoft Open Technologies Inc
-// Licensed under the MIT license.
-
-interface Navigator {
- /**
- * This plugin provides access to the device's compass. The compass is a sensor that detects
- * the direction or heading that the device is pointed, typically from the top of the device.
- * It measures the heading in degrees from 0 to 359.99, where 0 is north.
- */
- compass: Compass;
-}
-
-/**
- * This plugin provides access to the device's compass. The compass is a sensor that detects
- * the direction or heading that the device is pointed, typically from the top of the device.
- * It measures the heading in degrees from 0 to 359.99, where 0 is north.
- */
-interface Compass {
- /**
- * Get the current compass heading. The compass heading is returned via a CompassHeading
- * object using the onSuccess callback function.
- * @param onSuccess Success callback that passes CompassHeading object.
- * @param onError Error callback that passes CompassError object.
- */
- getCurrentHeading(
- onSuccess: (heading: CompassHeading) => void,
- onError: (error: CompassError) => void,
- options?: CompassOptions): void;
- /**
- * Gets the device's current heading at a regular interval. Each time the heading is retrieved,
- * the headingSuccess callback function is executed. The returned watch ID references the compass
- * watch interval. The watch ID can be used with navigator.compass.clearWatch to stop watching
- * the navigator.compass.
- * @param onSuccess Success callback that passes CompassHeading object.
- * @param onError Error callback that passes CompassError object.
- * @param options CompassOptions object
- */
- watchHeading(
- onSuccess: (heading: CompassHeading) => void,
- onError: (error: CompassError) => void,
- options?: CompassOptions): number;
- /**
- * Stop watching the compass referenced by the watch ID parameter.
- * @param id The ID returned by navigator.compass.watchHeading.
- */
- clearWatch(id: number): void;
-}
-
-/** A CompassHeading object is returned to the compassSuccess callback function. */
-interface CompassHeading {
- /** The heading in degrees from 0-359.99 at a single moment in time. */
- magneticHeading: number;
- /** The heading relative to the geographic North Pole in degrees 0-359.99 at a single moment in time. A negative value indicates that the true heading can't be determined. */
- trueHeading: number;
- /** The deviation in degrees between the reported heading and the true heading. */
- headingAccuracy: number;
- /** The time at which this heading was determined. */
- timestamp: number;
-}
-
-interface CompassOptions {
- filter?: number;
- frequency?: number;
-}
-
-/** A CompassError object is returned to the onError callback function when an error occurs. */
-interface CompassError {
- /**
- * One of the predefined error codes
- * CompassError.COMPASS_INTERNAL_ERR
- * CompassError.COMPASS_NOT_SUPPORTED
- */
- code: number;
-}
-
-declare var CompassError: {
- /** Constructor for CompassError object */
- new(code: number): CompassError;
- COMPASS_INTERNAL_ERR: number;
- COMPASS_NOT_SUPPORTED: number
-}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device-orientation/www/CompassError.js b/plugins/cordova-plugin-device-orientation/www/CompassError.js
deleted file mode 100644
index 7b5b485..0000000
--- a/plugins/cordova-plugin-device-orientation/www/CompassError.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * CompassError.
- * An error code assigned by an implementation when an error has occurred
- * @constructor
- */
-var CompassError = function(err) {
- this.code = (err !== undefined ? err : null);
-};
-
-CompassError.COMPASS_INTERNAL_ERR = 0;
-CompassError.COMPASS_NOT_SUPPORTED = 20;
-
-module.exports = CompassError;
diff --git a/plugins/cordova-plugin-device-orientation/www/CompassHeading.js b/plugins/cordova-plugin-device-orientation/www/CompassHeading.js
deleted file mode 100644
index 70343ee..0000000
--- a/plugins/cordova-plugin-device-orientation/www/CompassHeading.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) {
- this.magneticHeading = magneticHeading;
- this.trueHeading = trueHeading;
- this.headingAccuracy = headingAccuracy;
- this.timestamp = timestamp || new Date().getTime();
-};
-
-module.exports = CompassHeading;
diff --git a/plugins/cordova-plugin-device-orientation/www/compass.js b/plugins/cordova-plugin-device-orientation/www/compass.js
deleted file mode 100644
index 603e727..0000000
--- a/plugins/cordova-plugin-device-orientation/www/compass.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
- exec = require('cordova/exec'),
- utils = require('cordova/utils'),
- CompassHeading = require('./CompassHeading'),
- CompassError = require('./CompassError'),
-
- timers = {},
- eventTimerId = null,
- compass = {
- /**
- * Asynchronously acquires the current heading.
- * @param {Function} successCallback The function to call when the heading
- * data is available
- * @param {Function} errorCallback The function to call when there is an error
- * getting the heading data.
- * @param {CompassOptions} options The options for getting the heading data (not used).
- */
- getCurrentHeading:function(successCallback, errorCallback, options) {
- argscheck.checkArgs('fFO', 'compass.getCurrentHeading', arguments);
-
- var win = function(result) {
- var ch = new CompassHeading(result.magneticHeading, result.trueHeading, result.headingAccuracy, result.timestamp);
- successCallback(ch);
- };
- var fail = errorCallback && function(code) {
- var ce = new CompassError(code);
- errorCallback(ce);
- };
-
- // Get heading
- exec(win, fail, "Compass", "getHeading", [options]);
- },
-
- /**
- * Asynchronously acquires the heading repeatedly at a given interval.
- * @param {Function} successCallback The function to call each time the heading
- * data is available
- * @param {Function} errorCallback The function to call when there is an error
- * getting the heading data.
- * @param {HeadingOptions} options The options for getting the heading data
- * such as timeout and the frequency of the watch. For iOS, filter parameter
- * specifies to watch via a distance filter rather than time.
- */
- watchHeading:function(successCallback, errorCallback, options) {
- argscheck.checkArgs('fFO', 'compass.watchHeading', arguments);
- // Default interval (100 msec)
- var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100;
- var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0;
-
- var id = utils.createUUID();
- if (filter > 0) {
- // is an iOS request for watch by filter, no timer needed
- timers[id] = "iOS";
- compass.getCurrentHeading(successCallback, errorCallback, options);
- } else {
- // Start watch timer to get headings
- timers[id] = window.setInterval(function() {
- compass.getCurrentHeading(successCallback, errorCallback);
- }, frequency);
- }
-
- if (cordova.platformId === 'browser' && !eventTimerId) {
- // Start firing deviceorientation events if haven't already
- var deviceorientationEvent = new Event('deviceorientation');
- eventTimerId = window.setInterval(function() {
- window.dispatchEvent(deviceorientationEvent);
- }, 200);
- }
-
- return id;
- },
-
- /**
- * Clears the specified heading watch.
- * @param {String} id The ID of the watch returned from #watchHeading.
- */
- clearWatch:function(id) {
- // Stop javascript timer & remove from timer list
- if (id && timers[id]) {
- if (timers[id] != "iOS") {
- clearInterval(timers[id]);
- } else {
- // is iOS watch by filter so call into device to stop
- exec(null, null, "Compass", "stopHeading", []);
- }
- delete timers[id];
-
- if (eventTimerId && Object.keys(timers).length === 0) {
- // No more watchers, so stop firing 'deviceorientation' events
- window.clearInterval(eventTimerId);
- eventTimerId = null;
- }
- }
- }
- };
-
-module.exports = compass;
diff --git a/plugins/cordova-plugin-dialogs/CONTRIBUTING.md b/plugins/cordova-plugin-dialogs/CONTRIBUTING.md
deleted file mode 100644
index 4c8e6a5..0000000
--- a/plugins/cordova-plugin-dialogs/CONTRIBUTING.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-# Contributing to Apache Cordova
-
-Anyone can contribute to Cordova. And we need your contributions.
-
-There are multiple ways to contribute: report bugs, improve the docs, and
-contribute code.
-
-For instructions on this, start with the
-[contribution overview](http://cordova.apache.org/contribute/).
-
-The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
- - Run the tests so your patch doesn't break existing functionality.
-
-We look forward to your contributions!
diff --git a/plugins/cordova-plugin-dialogs/LICENSE b/plugins/cordova-plugin-dialogs/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/plugins/cordova-plugin-dialogs/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/NOTICE b/plugins/cordova-plugin-dialogs/NOTICE
deleted file mode 100644
index 8ec56a5..0000000
--- a/plugins/cordova-plugin-dialogs/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-dialogs/README.md b/plugins/cordova-plugin-dialogs/README.md
deleted file mode 100644
index 5598ab3..0000000
--- a/plugins/cordova-plugin-dialogs/README.md
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-# cordova-plugin-dialogs
-
-This plugin provides access to some native dialog UI elements
-via a global `navigator.notification` object.
-
-Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Dialogs%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
-
-## Installation
-
- cordova plugin add cordova-plugin-dialogs
-
-## Methods
-
-- `navigator.notification.alert`
-- `navigator.notification.confirm`
-- `navigator.notification.prompt`
-- `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Shows a custom alert or dialog box. Most Cordova implementations use a native
-dialog box for this feature, but some platforms use the browser's `alert`
-function, which is typically less customizable.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-- __message__: Dialog message. _(String)_
-
-- __alertCallback__: Callback to invoke when alert dialog is dismissed. _(Function)_
-
-- __title__: Dialog title. _(String)_ (Optional, defaults to `Alert`)
-
-- __buttonName__: Button name. _(String)_ (Optional, defaults to `OK`)
-
-
-### Example
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Tizen
-- Windows Phone 7 and 8
-- Windows 8
-- Windows
-
-### Windows Phone 7 and 8 Quirks
-
-- There is no built-in browser alert, but you can bind one as follows to call `alert()` in the global scope:
-
- window.alert = navigator.notification.alert;
-
-- Both `alert` and `confirm` are non-blocking calls, results of which are only available asynchronously.
-
-### Firefox OS Quirks:
-
-Both native-blocking `window.alert()` and non-blocking `navigator.notification.alert()` are available.
-
-### BlackBerry 10 Quirks
-`navigator.notification.alert('text', callback, 'title', 'text')` callback parameter is passed the number 1.
-
-## navigator.notification.confirm
-
-Displays a customizable confirmation dialog box.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-- __message__: Dialog message. _(String)_
-
-- __confirmCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_
-
-- __title__: Dialog title. _(String)_ (Optional, defaults to `Confirm`)
-
-- __buttonLabels__: Array of strings specifying button labels. _(Array)_ (Optional, defaults to [`OK,Cancel`])
-
-
-### confirmCallback
-
-The `confirmCallback` executes when the user presses one of the
-buttons in the confirmation dialog box.
-
-The callback takes the argument `buttonIndex` _(Number)_, which is the
-index of the pressed button. Note that the index uses one-based
-indexing, so the value is `1`, `2`, `3`, etc.
-
-### Example
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Firefox OS
-- iOS
-- Tizen
-- Windows Phone 7 and 8
-- Windows 8
-- Windows
-
-### Windows Phone 7 and 8 Quirks
-
-- There is no built-in browser function for `window.confirm`, but you can bind it by assigning:
-
- window.confirm = navigator.notification.confirm;
-
-- Calls to `alert` and `confirm` are non-blocking, so the result is only available asynchronously.
-
-### Windows Quirks
-
-- On Windows8/8.1 it is not possible to add more than three buttons to MessageDialog instance.
-
-- On Windows Phone 8.1 it's not possible to show dialog with more than two buttons.
-
-### Firefox OS Quirks:
-
-Both native-blocking `window.confirm()` and non-blocking `navigator.notification.confirm()` are available.
-
-## navigator.notification.prompt
-
-Displays a native dialog box that is more customizable than the browser's `prompt` function.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-- __message__: Dialog message. _(String)_
-
-- __promptCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_
-
-- __title__: Dialog title _(String)_ (Optional, defaults to `Prompt`)
-
-- __buttonLabels__: Array of strings specifying button labels _(Array)_ (Optional, defaults to `["OK","Cancel"]`)
-
-- __defaultText__: Default textbox input value (`String`) (Optional, Default: empty string)
-
-### promptCallback
-
-The `promptCallback` executes when the user presses one of the buttons
-in the prompt dialog box. The `results` object passed to the callback
-contains the following properties:
-
-- __buttonIndex__: The index of the pressed button. _(Number)_ Note that the index uses one-based indexing, so the value is `1`, `2`, `3`, etc.
-
-
-
-- __input1__: The text entered in the prompt dialog box. _(String)_
-
-### Example
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- Firefox OS
-- iOS
-- Windows Phone 7 and 8
-- Windows 8
-- Windows
-
-### Android Quirks
-
-- Android supports a maximum of three buttons, and ignores any more than that.
-
-- On Android 3.0 and later, buttons are displayed in reverse order for devices that use the Holo theme.
-
-### Windows Quirks
-
-- On Windows prompt dialog is html-based due to lack of such native api.
-
-### Firefox OS Quirks:
-
-Both native-blocking `window.prompt()` and non-blocking `navigator.notification.prompt()` are available.
-
-## navigator.notification.beep
-
-The device plays a beep sound.
-
- navigator.notification.beep(times);
-
-- __times__: The number of times to repeat the beep. _(Number)_
-
-### Example
-
- // Beep twice!
- navigator.notification.beep(2);
-
-### Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- iOS
-- Tizen
-- Windows Phone 7 and 8
-- Windows 8
-
-### Amazon Fire OS Quirks
-
-- Amazon Fire OS plays the default __Notification Sound__ specified under the __Settings/Display & Sound__ panel.
-
-### Android Quirks
-
-- Android plays the default __Notification ringtone__ specified under the __Settings/Sound & Display__ panel.
-
-### Windows Phone 7 and 8 Quirks
-
-- Relies on a generic beep file from the Cordova distribution.
-
-### Tizen Quirks
-
-- Tizen implements beeps by playing an audio file via the media API.
-
-- The beep file must be short, must be located in a `sounds` subdirectory of the application's root directory, and must be named `beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/RELEASENOTES.md b/plugins/cordova-plugin-dialogs/RELEASENOTES.md
deleted file mode 100644
index 20e114f..0000000
--- a/plugins/cordova-plugin-dialogs/RELEASENOTES.md
+++ /dev/null
@@ -1,151 +0,0 @@
-
-# Release Notes
-
-### 1.2.1 (Apr 15, 2016)
-* CB-10097 dialog doesn't show on **iOS** when called from a select list `onChange` event
-* Remove `warning` emoji, as it doesn't correctly display in the docs website: http://cordova.apache.org/docs/en/dev/cordova-plugin-dialogs/index.html
-* CB-10727 Dialogs plugin has warnings on **iOS**
-* CB-10636 Add `JSHint` for plugins
-
-### 1.2.0 (Nov 18, 2015)
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
-* [CB-8549](https://issues.apache.org/jira/browse/CB-8549) Updated source to pass `Fortify` scan.
-* Fixing contribute link.
-* add `CSS class` to prompt `div` for **Windows** platform
-* [CB-9347](https://issues.apache.org/jira/browse/CB-9347) - fix to allow to stack multiple `UIAlertControllers`
-
-### 1.1.1 (Jun 17, 2015)
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-dialogs documentation translation: cordova-plugin-dialogs
-* fix npm md
-
-### 1.1.0 (May 06, 2015)
-* [CB-8928](https://issues.apache.org/jira/browse/CB-8928): Removed direct call to `toStaticHTML`, only call it if we are sure it's present. This closes #52
-* [CB-7734](https://issues.apache.org/jira/browse/CB-7734) - `navigator.notification.alert` or `navigator.notification.confirm` seem have a "many words" issue. (closes #39)
-
-### 1.0.0 (Apr 15, 2015)
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) updated wp and bb specific references of old id to new id
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
-* Use TRAVIS_BUILD_DIR, install paramedic by npm
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of deprecated headers
-* [CB-8565](https://issues.apache.org/jira/browse/CB-8565) Integrate TravisCI
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-dialogs documentation translation: cordova-plugin-dialogs
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
-* [CB-8367](https://issues.apache.org/jira/browse/CB-8367) [org.apache.cordova.dialogs] Add Prompt support on Windows
-
-### 0.3.0 (Feb 04, 2015)
-* Correct way to specify Windows platform in config.xml
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
-* [CB-7955](https://issues.apache.org/jira/browse/CB-7955) Add support "browser" platform
-
-### 0.2.11 (Dec 02, 2014)
-* [CB-7737](https://issues.apache.org/jira/browse/CB-7737) lower min height for alert
-* [CB-8038](https://issues.apache.org/jira/browse/CB-8038) backslash getting escaped twice in **BB10**
-* [CB-8029](https://issues.apache.org/jira/browse/CB-8029) test 1-based indexing for confirm
-* [CB-7639](https://issues.apache.org/jira/browse/CB-7639) Update docs + manual tests
-* [CB-7639](https://issues.apache.org/jira/browse/CB-7639) Revert back `isAlertShowing` flag in case of exception to prevent queuing of future dialogs.
-* [CB-7639](https://issues.apache.org/jira/browse/CB-7639) Handle button labels as array on windows
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
-* Check for `setTextDirection` API level
-* **Android** Make spinner dialog to use `THEME_DEVICE_DEFAULT_LIGHT` (same as the other dialogs)
-* **Android** Unbreak `API` level < `14`
-* [CB-7414](https://issues.apache.org/jira/browse/CB-7414) **BB10** Document callback parameter for `navigator.notification.alert`
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-dialogs documentation translation: cordova-plugin-dialogs
-* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
-
-### 0.2.10 (Sep 17, 2014)
-* [CB-7538](https://issues.apache.org/jira/browse/CB-7538) Android beep thread fix Beep now executes in it's own thread. It was previously executing in the main UI thread which was causing the application to lock up will the beep was occurring. Closing pull request
-* Set dialog text dir to locale
-* Renamed test dir, added nested plugin.xml
-* added documentation for manual tests
-* [CB-6965](https://issues.apache.org/jira/browse/CB-6965) Added manual tests
-* [CB-6965](https://issues.apache.org/jira/browse/CB-6965) Port notification tests to test-framework
-
-### 0.2.9 (Aug 06, 2014)
-* ubuntu: pass proper arguments to prompt callback
-* ubuntu: use TextField instead of TextInput
-* ubuntu: proper message escaping before passing to qml
-* **FFOS** update notification.js
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
-* android: Explicitly apply default theme to dialogs
-* Fix Beep exception on Android when no argument passed
-
-### 0.2.8 (Jun 05, 2014)
-* [CB-6801](https://issues.apache.org/jira/browse/CB-6801) Add license
-* running original windows.open, inAppBrowser is overriding it no need to place CSS in every page anymore
-* [CB-5945](https://issues.apache.org/jira/browse/CB-5945) [Windows8] do not call success callbacks until dialog is dismissed
-* [CB-4616](https://issues.apache.org/jira/browse/CB-4616) Returned index 0 was not documented for notification.prompt
-* update docs to state that prompt is supported on windowsphone
-* [CB-6528](https://issues.apache.org/jira/browse/CB-6528) allow scroll on alert message content
-* [CB-6628][amazon-fireos]dialogs plugin's confirm and prompt methods dont work confirm() method was missing amazon-fireos platform check. added that. prompt() method had bug. It is executed in a worker thread that does not have a message queue(or Looper object) associated with it and hence "can't create a handler" exception is thrown. To fix this issue, we need to create the EditText widget from within the UI thread. This was fixed sometime ago when we added fireos platform but commit got lost somewhere. So fixing it again now.
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
-* Added check for isFinishing() on the parent activity to prevent crashes when trying to display dialogs when activity is in this phase of it's lifecycle
-* [CB-4966](https://issues.apache.org/jira/browse/CB-4966) Dialogs are in window now No need to add anything to manifest or index.html
-* Removing FirefoxOS Quirks * no need to add special permission (it's different API with the same name) * notification.css is added automatically
-
-### 0.2.7 (Apr 17, 2014)
-* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
-* [CB-6411](https://issues.apache.org/jira/browse/CB-6411): [BlackBerry10] Work around Audio playback issue
-* [CB-6411](https://issues.apache.org/jira/browse/CB-6411): [BlackBerry10] Updates to beep
-* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
-* Add NOTICE file
-
-### 0.2.6 (Feb 05, 2014)
-* no need to recreate the manifest.webapp file after each `cordova prepare` for FFOS
-* FFOS description added
-
-### 0.2.5 (Jan 02, 2014)
-* [CB-4696](https://issues.apache.org/jira/browse/CB-4696) Fix compile error for Xcode 4.5.
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Dialogs plugin
-* [CB-3762](https://issues.apache.org/jira/browse/CB-3762) Change prompt default to empty string
-* Move images from css to img
-
-### 0.2.4 (Dec 4, 2013)
-* add ubuntu platform
-* 1. Added amazon-fireos platform. 2. Change to use amazon-fireos as a platform if user agent string contains 'cordova-amazon-fireos'.
-* added beep funtionality using ms-winsoundevent:Notfication.Default
-
-### 0.2.3 (Oct 28, 2013)
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for dialogs plugin
-* new plugin execute arguments supported
-* new plugin style
-* smaller fonts styling input
-* img files copied inside plugin
-* style added
-* prompt added
-* styling from James
-* fixed "exec" calls addedd css, but not working yet
-* first (blind) try
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
-
-### 0.2.2 (Sept 25, 2013)
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
-* [windows8] commandProxy was moved
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming reference in Notification.cs
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.dialogs to org.apache.cordova.dialogs
-* Rename CHANGELOG.md -> RELEASENOTES.md
-* [CB-4592](https://issues.apache.org/jira/browse/CB-4592) [Blackberry10] Added beep support
-* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
diff --git a/plugins/cordova-plugin-dialogs/doc/de/README.md b/plugins/cordova-plugin-dialogs/doc/de/README.md
deleted file mode 100644
index 355cd4d..0000000
--- a/plugins/cordova-plugin-dialogs/doc/de/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-Dieses Plugin ermöglicht den Zugriff auf einige native Dialog-UI-Elemente über eine globale `navigator.notification`-Objekt.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Methoden
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Zeigt eine benutzerdefinierte Warnung oder Dialogfeld Feld. Die meisten Implementierungen von Cordova ein native Dialogfeld für dieses Feature verwenden, jedoch einige Plattformen des Browsers-`alert`-Funktion, die in der Regel weniger anpassbar ist.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **Nachricht**: Dialogfeld Nachricht. *(String)*
-
- * **AlertCallback**: Callback aufgerufen wird, wenn Warnungs-Dialogfeld geschlossen wird. *(Funktion)*
-
- * **Titel**: Dialog "Titel". *(String)* (Optional, Standard ist`Alert`)
-
- * **ButtonName**: Name der Schaltfläche. *(String)* (Optional, Standard ist`OK`)
-
-### Beispiel
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 und 8 Eigenarten
-
- * Es gibt keine eingebaute Datenbanksuchroutine-Warnung, aber Sie können binden, wie folgt zu nennen `alert()` im globalen Gültigkeitsbereich:
-
- window.alert = navigator.notification.alert;
-
-
- * Beide `alert` und `confirm` sind nicht blockierende Aufrufe, die Ergebnisse davon nur asynchron sind.
-
-### Firefox OS Macken:
-
-Native blockierenden `window.alert()` und nicht-blockierende `navigator.notification.alert()` zur Verfügung.
-
-### BlackBerry 10 Macken
-
-`navigator.notification.alert ('Text', Rückruf, 'Titel', 'Text')` Callback-Parameter wird die Zahl 1 übergeben.
-
-## navigator.notification.confirm
-
-Zeigt das Dialogfeld anpassbare Bestätigung.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **Nachricht**: Dialogfeld Nachricht. *(String)*
-
- * **ConfirmCallback**: Callback aufgerufen wird, mit Index gedrückt (1, 2 oder 3) oder wenn das Dialogfeld geschlossen wird, ohne einen Tastendruck (0). *(Funktion)*
-
- * **Titel**: Dialog "Titel". *(String)* (Optional, Standard ist`Confirm`)
-
- * **ButtonLabels**: Array von Zeichenfolgen, die Schaltflächenbezeichnungen angeben. *(Array)* (Optional, Standard ist [ `OK,Cancel` ])
-
-### confirmCallback
-
-Die `confirmCallback` wird ausgeführt, wenn der Benutzer eine der Schaltflächen im Dialogfeld zur Bestätigung drückt.
-
-Der Rückruf dauert das Argument `buttonIndex` *(Anzahl)*, die der Index der Schaltfläche gedrückt ist. Beachten Sie, dass der Index 1-basierte Indizierung, sodass der Wert `1`, `2`, `3` usw. ist.
-
-### Beispiel
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 und 8 Eigenarten
-
- * Es gibt keine integrierte Browser-Funktion für `window.confirm` , aber Sie können es binden, indem Sie zuweisen:
-
- window.confirm = navigator.notification.confirm;
-
-
- * Aufrufe von `alert` und `confirm` sind nicht blockierend, so dass das Ergebnis nur asynchron zur Verfügung steht.
-
-### Windows-Eigenheiten
-
- * Auf Windows8/8.1 kann nicht mehr als drei Schaltflächen MessageDialog-Instanz hinzu.
-
- * Auf Windows Phone 8.1 ist es nicht möglich, Dialog mit mehr als zwei Knöpfen zeigen.
-
-### Firefox OS Macken:
-
-Native blockierenden `window.confirm()` und nicht-blockierende `navigator.notification.confirm()` zur Verfügung.
-
-## navigator.notification.prompt
-
-Zeigt eine native Dialogfeld, das mehr als `Prompt`-Funktion des Browsers anpassbar ist.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **Nachricht**: Dialogfeld Nachricht. *(String)*
-
- * **promptCallback**: Callback aufgerufen wird, mit Index gedrückt (1, 2 oder 3) oder wenn das Dialogfeld geschlossen wird, ohne einen Tastendruck (0). *(Funktion)*
-
- * **title**: Dialog Title *(String)* (Optional, Standard ist `Prompt`)
-
- * **buttonLabels**: Array von Zeichenfolgen angeben Schaltfläche Etiketten *(Array)* (Optional, Standard ist `["OK", "Abbrechen"]`)
-
- * **defaultText**: Standard-Textbox Eingabewert (`String`) (Optional, Standard: leere Zeichenfolge)
-
-### promptCallback
-
-Die `promptCallback` wird ausgeführt, wenn der Benutzer eine der Schaltflächen im Eingabedialogfeld drückt. `Des Objekts an den Rückruf übergeben` enthält die folgenden Eigenschaften:
-
- * **buttonIndex**: der Index der Schaltfläche gedrückt. *(Anzahl)* Beachten Sie, dass der Index 1-basierte Indizierung, sodass der Wert `1`, `2`, `3` usw. ist.
-
- * **input1**: in Eingabedialogfeld eingegebenen Text. *(String)*
-
-### Beispiel
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * Firefox OS
- * iOS
- * Windows Phone 7 und 8
- * Windows 8
- * Windows
-
-### Android Eigenarten
-
- * Android unterstützt maximal drei Schaltflächen und mehr als das ignoriert.
-
- * Auf Android 3.0 und höher, werden die Schaltflächen in umgekehrter Reihenfolge für Geräte angezeigt, die das Holo-Design verwenden.
-
-### Windows-Eigenheiten
-
- * Unter Windows ist Prompt Dialogfeld html-basierten mangels solcher native api.
-
-### Firefox OS Macken:
-
-Native blockierenden `window.prompt()` und nicht-blockierende `navigator.notification.prompt()` zur Verfügung.
-
-## navigator.notification.beep
-
-Das Gerät spielt einen Signalton sound.
-
- navigator.notification.beep(times);
-
-
- * **times**: die Anzahl der Wiederholungen des Signaltons. *(Anzahl)*
-
-### Beispiel
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * iOS
- * Tizen
- * Windows Phone 7 und 8
- * Windows 8
-
-### Amazon Fire OS Macken
-
- * Amazon Fire OS spielt die Standardeinstellung **Akustische Benachrichtigung** unter **Einstellungen/Display & Sound** Bereich angegeben.
-
-### Android Eigenarten
-
- * Android spielt die Standardeinstellung **Benachrichtigung Klingelton** unter **Einstellungen/Sound & Display**-Panel angegeben.
-
-### Windows Phone 7 und 8 Eigenarten
-
- * Stützt sich auf eine generische Piepton-Datei aus der Cordova-Distribution.
-
-### Tizen Macken
-
- * Tizen implementiert Signaltöne durch Abspielen einer Audiodatei über die Medien API.
-
- * Die Beep-Datei muss kurz sein, in einem `sounds`-Unterverzeichnis des Stammverzeichnisses der Anwendung befinden muss und muss den Namen `beep.wav`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/de/index.md b/plugins/cordova-plugin-dialogs/doc/de/index.md
deleted file mode 100644
index c003d40..0000000
--- a/plugins/cordova-plugin-dialogs/doc/de/index.md
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-Dieses Plugin ermöglicht den Zugriff auf einige native Dialog-UI-Elemente über eine globale `navigator.notification`-Objekt.
-
-Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Methoden
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Zeigt eine benutzerdefinierte Warnung oder Dialogfeld Feld. Die meisten Implementierungen von Cordova ein native Dialogfeld für dieses Feature verwenden, jedoch einige Plattformen des Browsers-`alert`-Funktion, die in der Regel weniger anpassbar ist.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
-* **Nachricht**: Dialogfeld Nachricht. *(String)*
-
-* **AlertCallback**: Callback aufgerufen wird, wenn Warnungs-Dialogfeld geschlossen wird. *(Funktion)*
-
-* **Titel**: Dialog "Titel". *(String)* (Optional, Standard ist`Alert`)
-
-* **ButtonName**: Name der Schaltfläche. *(String)* (Optional, Standard ist`OK`)
-
-### Beispiel
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 und 8 Eigenarten
-
-* Es gibt keine eingebaute Datenbanksuchroutine-Warnung, aber Sie können binden, wie folgt zu nennen `alert()` im globalen Gültigkeitsbereich:
-
- window.alert = navigator.notification.alert;
-
-
-* Beide `alert` und `confirm` sind nicht blockierende Aufrufe, die Ergebnisse davon nur asynchron sind.
-
-### Firefox OS Macken:
-
-Native blockierenden `window.alert()` und nicht-blockierende `navigator.notification.alert()` zur Verfügung.
-
-### BlackBerry 10 Macken
-
-`navigator.notification.alert ('Text', Rückruf, 'Titel', 'Text')` Callback-Parameter wird die Zahl 1 übergeben.
-
-## navigator.notification.confirm
-
-Zeigt das Dialogfeld anpassbare Bestätigung.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **Nachricht**: Dialogfeld Nachricht. *(String)*
-
-* **ConfirmCallback**: Callback aufgerufen wird, mit Index gedrückt (1, 2 oder 3) oder wenn das Dialogfeld geschlossen wird, ohne einen Tastendruck (0). *(Funktion)*
-
-* **Titel**: Dialog "Titel". *(String)* (Optional, Standard ist`Confirm`)
-
-* **ButtonLabels**: Array von Zeichenfolgen, die Schaltflächenbezeichnungen angeben. *(Array)* (Optional, Standard ist [ `OK,Cancel` ])
-
-### confirmCallback
-
-Die `confirmCallback` wird ausgeführt, wenn der Benutzer eine der Schaltflächen im Dialogfeld zur Bestätigung drückt.
-
-Der Rückruf dauert das Argument `buttonIndex` *(Anzahl)*, die der Index der Schaltfläche gedrückt ist. Beachten Sie, dass der Index 1-basierte Indizierung, sodass der Wert `1`, `2`, `3` usw. ist.
-
-### Beispiel
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 und 8 Eigenarten
-
-* Es gibt keine integrierte Browser-Funktion für `window.confirm` , aber Sie können es binden, indem Sie zuweisen:
-
- window.confirm = navigator.notification.confirm;
-
-
-* Aufrufe von `alert` und `confirm` sind nicht blockierend, so dass das Ergebnis nur asynchron zur Verfügung steht.
-
-### Windows-Eigenheiten
-
-* Auf Windows8/8.1 kann nicht mehr als drei Schaltflächen MessageDialog-Instanz hinzu.
-
-* Auf Windows Phone 8.1 ist es nicht möglich, Dialog mit mehr als zwei Knöpfen zeigen.
-
-### Firefox OS Macken:
-
-Native blockierenden `window.confirm()` und nicht-blockierende `navigator.notification.confirm()` zur Verfügung.
-
-## navigator.notification.prompt
-
-Zeigt eine native Dialogfeld, das mehr als `Prompt`-Funktion des Browsers anpassbar ist.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **Nachricht**: Dialogfeld Nachricht. *(String)*
-
-* **promptCallback**: Callback aufgerufen wird, mit Index gedrückt (1, 2 oder 3) oder wenn das Dialogfeld geschlossen wird, ohne einen Tastendruck (0). *(Funktion)*
-
-* **title**: Dialog Title *(String)* (Optional, Standard ist `Prompt`)
-
-* **buttonLabels**: Array von Zeichenfolgen angeben Schaltfläche Etiketten *(Array)* (Optional, Standard ist `["OK", "Abbrechen"]`)
-
-* **defaultText**: Standard-Textbox Eingabewert (`String`) (Optional, Standard: leere Zeichenfolge)
-
-### promptCallback
-
-Die `promptCallback` wird ausgeführt, wenn der Benutzer eine der Schaltflächen im Eingabedialogfeld drückt. `Des Objekts an den Rückruf übergeben` enthält die folgenden Eigenschaften:
-
-* **buttonIndex**: der Index der Schaltfläche gedrückt. *(Anzahl)* Beachten Sie, dass der Index 1-basierte Indizierung, sodass der Wert `1`, `2`, `3` usw. ist.
-
-* **input1**: in Eingabedialogfeld eingegebenen Text. *(String)*
-
-### Beispiel
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* Firefox OS
-* iOS
-* Windows Phone 7 und 8
-* Windows 8
-* Windows
-
-### Android Eigenarten
-
-* Android unterstützt maximal drei Schaltflächen und mehr als das ignoriert.
-
-* Auf Android 3.0 und höher, werden die Schaltflächen in umgekehrter Reihenfolge für Geräte angezeigt, die das Holo-Design verwenden.
-
-### Windows-Eigenheiten
-
-* Unter Windows ist Prompt Dialogfeld html-basierten mangels solcher native api.
-
-### Firefox OS Macken:
-
-Native blockierenden `window.prompt()` und nicht-blockierende `navigator.notification.prompt()` zur Verfügung.
-
-## navigator.notification.beep
-
-Das Gerät spielt einen Signalton sound.
-
- navigator.notification.beep(times);
-
-
-* **times**: die Anzahl der Wiederholungen des Signaltons. *(Anzahl)*
-
-### Beispiel
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* iOS
-* Tizen
-* Windows Phone 7 und 8
-* Windows 8
-
-### Amazon Fire OS Macken
-
-* Amazon Fire OS spielt die Standardeinstellung **Akustische Benachrichtigung** unter **Einstellungen/Display & Sound** Bereich angegeben.
-
-### Android Eigenarten
-
-* Android spielt die Standardeinstellung **Benachrichtigung Klingelton** unter **Einstellungen/Sound & Display**-Panel angegeben.
-
-### Windows Phone 7 und 8 Eigenarten
-
-* Stützt sich auf eine generische Piepton-Datei aus der Cordova-Distribution.
-
-### Tizen Macken
-
-* Tizen implementiert Signaltöne durch Abspielen einer Audiodatei über die Medien API.
-
-* Die Beep-Datei muss kurz sein, in einem `sounds`-Unterverzeichnis des Stammverzeichnisses der Anwendung befinden muss und muss den Namen `beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/doc/es/README.md b/plugins/cordova-plugin-dialogs/doc/es/README.md
deleted file mode 100644
index e7df5fe..0000000
--- a/plugins/cordova-plugin-dialogs/doc/es/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-Este plugin permite acceder a algunos elementos de interfaz de usuario nativa diálogo vía global `navigator.notification` objeto.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Instalación
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Métodos
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Muestra un cuadro de alerta o cuadro de diálogo personalizado. La mayoría de las implementaciones de Cordova utilizan un cuadro de diálogo nativa para esta característica, pero algunas plataformas utilizan el navegador `alert` la función, que es típicamente menos personalizable.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **message**: mensaje de diálogo. *(String)*
-
- * **alertCallback**: Callback para invocar al diálogo de alerta es desestimada. *(Función)*
-
- * **title**: título de diálogo. *(String)* (Opcional, el valor predeterminado de `Alert`)
-
- * **buttonName**: nombre del botón. *(String)* (Opcional, por defecto `Aceptar`)
-
-### Ejemplo
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 y 8 rarezas
-
- * No hay ninguna alerta del navegador integrado, pero puede enlazar uno proceda a llamar `alert()` en el ámbito global:
-
- window.alert = navigator.notification.alert;
-
-
- * `alert` y `confirm` son non-blocking llamadas, cuyos resultados sólo están disponibles de forma asincrónica.
-
-### Firefox OS rarezas:
-
-Dos nativos de bloqueo `window.alert()` y no-bloqueo `navigator.notification.alert()` están disponibles.
-
-### BlackBerry 10 rarezas
-
-`navigator.notification.alert('text', callback, 'title', 'text')`parámetro de devolución de llamada se pasa el número 1.
-
-## navigator.notification.confirm
-
-Muestra un cuadro de diálogo de confirmación personalizables.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **message**: mensaje de diálogo. *(String)*
-
- * **confirmCallback**: Callback para invocar con índice de botón pulsado (1, 2 o 3) o cuando el diálogo es despedido sin la presión del botón (0). *(Función)*
-
- * **title**: título de diálogo. *(String)* (Opcional, por defecto a `confirmar`)
-
- * **buttonLabels**: matriz de cadenas especificando las etiquetas de botón. *(Matriz)* (Opcional, por defecto [`OK, cancelar`])
-
-### confirmCallback
-
-El `confirmCallback` se ejecuta cuando el usuario presiona uno de los botones en el cuadro de diálogo de confirmación.
-
-La devolución de llamada toma el argumento `buttonIndex` *(número)*, que es el índice del botón presionado. Observe que el índice utiliza indexación basada en uno, entonces el valor es `1` , `2` , `3` , etc..
-
-### Ejemplo
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 y 8 rarezas
-
- * No hay ninguna función de navegador incorporado para `window.confirm`, pero lo puede enlazar mediante la asignación:
-
- window.confirm = navigator.notification.confirm;
-
-
- * Llamadas de `alert` y `confirm` son non-blocking, así que el resultado sólo está disponible de forma asincrónica.
-
-### Windows rarezas
-
- * Sobre Windows8/8.1 no es posible agregar más de tres botones a instancia de MessageDialog.
-
- * En Windows Phone 8.1 no es posible Mostrar cuadro de diálogo con más de dos botones.
-
-### Firefox OS rarezas:
-
-Dos nativos de bloqueo `window.confirm()` y no-bloqueo `navigator.notification.confirm()` están disponibles.
-
-## navigator.notification.prompt
-
-Muestra un cuadro de diálogo nativa que es más personalizable que del navegador `prompt` función.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **message**: mensaje de diálogo. *(String)*
-
- * **promptCallback**: Callback para invocar con índice del botón pulsado (1, 2 ó 3) o cuando el cuadro de diálogo es despedido sin la presión del botón (0). *(Función)*
-
- * **título**: título *(String)* (opcional, por defecto de diálogo`Prompt`)
-
- * **buttonLabels**: matriz de cadenas especificando botón etiquetas *(Array)* (opcional, por defecto`["OK","Cancel"]`)
-
- * **defaultText**: valor de la entrada predeterminada textbox ( `String` ) (opcional, por defecto: cadena vacía)
-
-### promptCallback
-
-El `promptCallback` se ejecuta cuando el usuario presiona uno de los botones del cuadro de diálogo pronto. El `results` objeto que se pasa a la devolución de llamada contiene las siguientes propiedades:
-
- * **buttonIndex**: el índice del botón presionado. *(Número)* Observe que el índice utiliza indexación basada en uno, entonces el valor es `1` , `2` , `3` , etc..
-
- * **INPUT1**: el texto introducido en el cuadro de diálogo pronto. *(String)*
-
-### Ejemplo
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * Firefox OS
- * iOS
- * Windows Phone 7 y 8
- * Windows 8
- * Windows
-
-### Rarezas Android
-
- * Android soporta un máximo de tres botones e ignora nada más.
-
- * En Android 3.0 y posteriores, los botones aparecen en orden inverso para dispositivos que utilizan el tema Holo.
-
-### Windows rarezas
-
- * En Windows pronto diálogo está basado en html debido a falta de tal api nativa.
-
-### Firefox OS rarezas:
-
-Dos nativos de bloqueo `window.prompt()` y no-bloqueo `navigator.notification.prompt()` están disponibles.
-
-## navigator.notification.beep
-
-El aparato reproduce un sonido sonido.
-
- navigator.notification.beep(times);
-
-
- * **tiempos**: el número de veces a repetir la señal. *(Número)*
-
-### Ejemplo
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * iOS
- * Tizen
- * Windows Phone 7 y 8
- * Windows 8
-
-### Amazon fuego OS rarezas
-
- * Amazon fuego OS reproduce el **Sonido de notificación** especificados en el panel de **configuración/pantalla y sonido** por defecto.
-
-### Rarezas Android
-
- * Androide reproduce el **tono de notificación** especificados en el panel **ajustes de sonido y visualización** por defecto.
-
-### Windows Phone 7 y 8 rarezas
-
- * Se basa en un archivo de sonido genérico de la distribución de Córdoba.
-
-### Rarezas Tizen
-
- * Tizen implementa pitidos por reproducir un archivo de audio a través de los medios de comunicación API.
-
- * El archivo de sonido debe ser corto, debe estar ubicado en un `sounds` subdirectorio del directorio raíz de la aplicación y deben ser nombrados`beep.wav`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/es/index.md b/plugins/cordova-plugin-dialogs/doc/es/index.md
deleted file mode 100644
index 9ff4251..0000000
--- a/plugins/cordova-plugin-dialogs/doc/es/index.md
+++ /dev/null
@@ -1,247 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-Este plugin permite acceder a algunos elementos de interfaz de usuario nativa diálogo vía global `navigator.notification` objeto.
-
-Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log(navigator.notification)};
-
-
-## Instalación
-
- Cordova plugin agregar cordova-plugin-dialogs
-
-
-## Métodos
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Muestra un cuadro de alerta o cuadro de diálogo personalizado. La mayoría de las implementaciones de Cordova utilizan un cuadro de diálogo nativa para esta característica, pero algunas plataformas utilizan el navegador `alert` la función, que es típicamente menos personalizable.
-
- Navigator.Notification.alert (mensaje, alertCallback, [title], [buttonName])
-
-
-* **message**: mensaje de diálogo. *(String)*
-
-* **alertCallback**: Callback para invocar al diálogo de alerta es desestimada. *(Función)*
-
-* **title**: título de diálogo. *(String)* (Opcional, el valor predeterminado de `Alert`)
-
-* **buttonName**: nombre del botón. *(String)* (Opcional, por defecto `Aceptar`)
-
-### Ejemplo
-
- function alertDismissed() {/ / hacer algo} navigator.notification.alert ('Tú eres el ganador!', / / mensaje alertDismissed, / / callback 'Game Over', / / título 'hecho' / / buttonName);
-
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 y 8 rarezas
-
-* No hay ninguna alerta del navegador integrado, pero puede enlazar uno proceda a llamar `alert()` en el ámbito global:
-
- window.alert = navigator.notification.alert;
-
-
-* `alert` y `confirm` son non-blocking llamadas, cuyos resultados sólo están disponibles de forma asincrónica.
-
-### Firefox OS rarezas:
-
-Dos nativos de bloqueo `window.alert()` y no-bloqueo `navigator.notification.alert()` están disponibles.
-
-### BlackBerry 10 rarezas
-
-`navigator.notification.alert('text', callback, 'title', 'text')`parámetro de devolución de llamada se pasa el número 1.
-
-## navigator.notification.confirm
-
-Muestra un cuadro de diálogo de confirmación personalizables.
-
- Navigator.Notification.CONFIRM (mensaje, confirmCallback, [title], [buttonLabels])
-
-
-* **message**: mensaje de diálogo. *(String)*
-
-* **confirmCallback**: Callback para invocar con índice de botón pulsado (1, 2 o 3) o cuando el diálogo es despedido sin la presión del botón (0). *(Función)*
-
-* **title**: título de diálogo. *(String)* (Opcional, por defecto a `confirmar`)
-
-* **buttonLabels**: matriz de cadenas especificando las etiquetas de botón. *(Matriz)* (Opcional, por defecto [`OK, cancelar`])
-
-### confirmCallback
-
-El `confirmCallback` se ejecuta cuando el usuario presiona uno de los botones en el cuadro de diálogo de confirmación.
-
-La devolución de llamada toma el argumento `buttonIndex` *(número)*, que es el índice del botón presionado. Observe que el índice utiliza indexación basada en uno, entonces el valor es `1` , `2` , `3` , etc..
-
-### Ejemplo
-
- function onConfirm(buttonIndex) {alert ('Tu botón seleccionado' + buttonIndex);}
-
- Navigator.Notification.CONFIRM ('Tú eres el ganador!', / / mensaje onConfirm, / callback para invocar con índice del botón pulsado 'Game Over', / / / título ['reiniciar', 'Exit'] / / buttonLabels);
-
-
-### Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 y 8 rarezas
-
-* No hay ninguna función de navegador incorporado para `window.confirm`, pero lo puede enlazar mediante la asignación:
-
- window.confirm = navigator.notification.confirm;
-
-
-* Llamadas de `alert` y `confirm` son non-blocking, así que el resultado sólo está disponible de forma asincrónica.
-
-### Windows rarezas
-
-* Sobre Windows8/8.1 no es posible agregar más de tres botones a instancia de MessageDialog.
-
-* En Windows Phone 8.1 no es posible Mostrar cuadro de diálogo con más de dos botones.
-
-### Firefox OS rarezas:
-
-Dos nativos de bloqueo `window.confirm()` y no-bloqueo `navigator.notification.confirm()` están disponibles.
-
-## navigator.notification.prompt
-
-Muestra un cuadro de diálogo nativa que es más personalizable que del navegador `prompt` función.
-
- Navigator.Notification.prompt (mensaje, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **mensaje**: mensaje de diálogo. *(String)*
-
-* **promptCallback**: Callback para invocar con índice del botón pulsado (1, 2 ó 3) o cuando el cuadro de diálogo es despedido sin la presión del botón (0). *(Función)*
-
-* **título**: título *(String)* (opcional, por defecto de diálogo`Prompt`)
-
-* **buttonLabels**: matriz de cadenas especificando botón etiquetas *(Array)* (opcional, por defecto`["OK","Cancel"]`)
-
-* **defaultText**: valor de la entrada predeterminada textbox ( `String` ) (opcional, por defecto: cadena vacía)
-
-### promptCallback
-
-El `promptCallback` se ejecuta cuando el usuario presiona uno de los botones del cuadro de diálogo pronto. El `results` objeto que se pasa a la devolución de llamada contiene las siguientes propiedades:
-
-* **buttonIndex**: el índice del botón presionado. *(Número)* Observe que el índice utiliza indexación basada en uno, entonces el valor es `1` , `2` , `3` , etc..
-
-* **INPUT1**: el texto introducido en el cuadro de diálogo pronto. *(String)*
-
-### Ejemplo
-
- function onPrompt(results) {alert ("seleccionaron botón número" + results.buttonIndex + "y entró en" + results.input1);}
-
- Navigator.Notification.prompt ('Por favor introduce tu nombre', / / mensaje onPrompt, / / callback para invocar 'Registro', / / título ['Ok', 'Exit'], / / buttonLabels 'Jane Doe' / / defaultText);
-
-
-### Plataformas soportadas
-
-* Amazon fuego OS
-* Android
-* Firefox OS
-* iOS
-* Windows Phone 7 y 8
-* Windows 8
-* Windows
-
-### Rarezas Android
-
-* Android soporta un máximo de tres botones e ignora nada más.
-
-* En Android 3.0 y posteriores, los botones aparecen en orden inverso para dispositivos que utilizan el tema Holo.
-
-### Windows rarezas
-
-* En Windows pronto diálogo está basado en html debido a falta de tal api nativa.
-
-### Firefox OS rarezas:
-
-Dos nativos de bloqueo `window.prompt()` y no-bloqueo `navigator.notification.prompt()` están disponibles.
-
-## navigator.notification.beep
-
-El aparato reproduce un sonido sonido.
-
- Navigator.Notification.Beep(Times);
-
-
-* **tiempos**: el número de veces a repetir la señal. *(Número)*
-
-### Ejemplo
-
- Dos pitidos.
- Navigator.Notification.Beep(2);
-
-
-### Plataformas soportadas
-
-* Amazon fuego OS
-* Android
-* BlackBerry 10
-* iOS
-* Tizen
-* Windows Phone 7 y 8
-* Windows 8
-
-### Amazon fuego OS rarezas
-
-* Amazon fuego OS reproduce el **Sonido de notificación** especificados en el panel de **configuración/pantalla y sonido** por defecto.
-
-### Rarezas Android
-
-* Androide reproduce el **tono de notificación** especificados en el panel **ajustes de sonido y visualización** por defecto.
-
-### Windows Phone 7 y 8 rarezas
-
-* Se basa en un archivo de sonido genérico de la distribución de Córdoba.
-
-### Rarezas Tizen
-
-* Tizen implementa pitidos por reproducir un archivo de audio a través de los medios de comunicación API.
-
-* El archivo de sonido debe ser corto, debe estar ubicado en un `sounds` subdirectorio del directorio raíz de la aplicación y deben ser nombrados`beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/doc/fr/README.md b/plugins/cordova-plugin-dialogs/doc/fr/README.md
deleted file mode 100644
index 994c826..0000000
--- a/plugins/cordova-plugin-dialogs/doc/fr/README.md
+++ /dev/null
@@ -1,249 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-Ce plugin permet d'accéder à certains éléments d'interface utilisateur native de dialogue via un global `navigator.notification` objet.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.notification);}
-
-
-## Installation
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Méthodes
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Affiche une boîte de dialogue ou d'alerte personnalisé. La plupart des implémentations de Cordova utilisent une boîte de dialogue natives pour cette fonctionnalité, mais certaines plates-formes du navigateur `alert` fonction, qui est généralement moins personnalisable.
-
- Navigator.notification.Alert (message, alertCallback, [title], [buttonName])
-
-
- * **message**: message de la boîte de dialogue. *(String)*
-
- * **alertCallback**: callback à appeler lorsque la boîte de dialogue d'alerte est rejetée. *(Fonction)*
-
- * **titre**: titre de la boîte de dialogue. *(String)* (Facultatif, par défaut`Alert`)
-
- * **buttonName**: nom du bouton. *(String)* (Facultatif, par défaut`OK`)
-
-### Exemple
-
- function alertDismissed() {/ / faire quelque chose} navigator.notification.alert ('Vous êtes le gagnant!', / / message alertDismissed, / / rappel « Game Over », / / titre « Done » / / buttonName) ;
-
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Paciarelli
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Notes au sujet de Windows Phone 7 et 8
-
- * Il n'y a aucune boîte de dialogue d'alerte intégrée au navigateur, mais vous pouvez en lier une pour appeler `alert()` dans le scope global:
-
- window.alert = navigator.notification.alert;
-
-
- * Les deux appels `alert` et `confirm` sont non-blocants, leurs résultats ne sont disponibles que de façon asynchrone.
-
-### Firefox OS Quirks :
-
-Les deux indigènes bloquant `window.alert()` et non-bloquante `navigator.notification.alert()` sont disponibles.
-
-### BlackBerry 10 Quirks
-
-`navigator.notification.alert('text', callback, 'title', 'text')`paramètre callback est passé numéro 1.
-
-## navigator.notification.confirm
-
-Affiche une boîte de dialogue de confirmation personnalisable.
-
- Navigator.notification.Confirm (message, confirmCallback, [title], [buttonLabels])
-
-
- * **message**: message de la boîte de dialogue. *(String)*
-
- * **confirmCallback**: callback à appeler avec l'index du bouton pressé (1, 2 ou 3) ou lorsque la boîte de dialogue est fermée sans qu'un bouton ne soit pressé (0). *(Fonction)*
-
- * **titre**: titre de dialogue. *(String)* (Facultatif, par défaut`Confirm`)
-
- * **buttonLabels**: tableau de chaînes spécifiant les étiquettes des boutons. *(Array)* (Optionnel, par défaut, [ `OK,Cancel` ])
-
-### confirmCallback
-
-Le `confirmCallback` s'exécute lorsque l'utilisateur appuie sur un bouton dans la boîte de dialogue de confirmation.
-
-Le rappel prend l'argument `buttonIndex` *(nombre)*, qui est l'index du bouton activé. Notez que l'index utilise base d'indexation, la valeur est `1` , `2` , `3` , etc..
-
-### Exemple
-
- function onConfirm(buttonIndex) {alert (« Vous bouton sélectionné » + buttonIndex);}
-
- Navigator.notification.Confirm ('Vous êtes le gagnant!', / / message onConfirm, / / rappel d'invoquer avec l'index du bouton enfoncé « Game Over », / / title ['redémarrer', « Exit »] / / buttonLabels) ;
-
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Paciarelli
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Notes au sujet de Windows Phone 7 et 8
-
- * Il n'y a aucune fonction intégrée au navigateur pour `window.confirm`, mais vous pouvez en lier une en affectant:
-
- window.confirm = navigator.notification.confirm ;
-
-
- * Les appels à `alert` et `confirm` sont non-bloquants, donc le résultat est seulement disponible de façon asynchrone.
-
-### Bizarreries de Windows
-
- * Sur Windows8/8.1, il n'est pas possible d'ajouter plus de trois boutons à MessageDialog instance.
-
- * Sur Windows Phone 8.1, il n'est pas possible d'établir le dialogue avec plus de deux boutons.
-
-### Firefox OS Quirks :
-
-Les deux indigènes bloquant `window.confirm()` et non-bloquante `navigator.notification.confirm()` sont disponibles.
-
-## navigator.notification.prompt
-
-Affiche une boîte de dialogue natif qui est plus personnalisable que le navigateur `prompt` fonction.
-
- Navigator.notification.prompt (message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **message**: message de la boîte de dialogue. *(String)*
-
- * **promptCallback**: rappel d'invoquer avec l'index du bouton pressé (1, 2 ou 3) ou lorsque la boîte de dialogue est fermée sans une presse de bouton (0). *(Fonction)*
-
- * **titre**: titre *(String)* (facultatif, la valeur par défaut de dialogue`Prompt`)
-
- * **buttonLabels**: tableau de chaînes spécifiant les bouton *(Array)* (facultatif, par défaut, les étiquettes`["OK","Cancel"]`)
-
- * **defaultText**: zone de texte par défaut entrée valeur ( `String` ) (en option, par défaut : chaîne vide)
-
-### promptCallback
-
-Le `promptCallback` s'exécute lorsque l'utilisateur appuie sur un bouton dans la boîte de dialogue d'invite. Le `results` objet passé au rappel contient les propriétés suivantes :
-
- * **buttonIndex**: l'index du bouton activé. *(Nombre)* Notez que l'index utilise base d'indexation, la valeur est `1` , `2` , `3` , etc..
-
- * **entrée 1**: le texte entré dans la boîte de dialogue d'invite. *(String)*
-
-### Exemple
-
- function onPrompt(results) {alert (« Vous avez sélectionné le numéro du bouton » + results.buttonIndex + « et saisi » + results.input1);}
-
- Navigator.notification.prompt ('Veuillez saisir votre nom', / / message onPrompt, / / rappel à appeler « Registration », / / title ['Ok', 'Exit'], / / buttonLabels « Jane Doe » / / defaultText) ;
-
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * Firefox OS
- * iOS
- * Windows Phone 7 et 8
- * Windows 8
- * Windows
-
-### Quirks Android
-
- * Android prend en charge un maximum de trois boutons et ignore plus que cela.
-
- * Sur Android 3.0 et versions ultérieures, les boutons sont affichés dans l'ordre inverse pour les appareils qui utilisent le thème Holo.
-
-### Bizarreries de Windows
-
- * Sous Windows, dialogue d'invite est basé sur html en raison de l'absence de ces api native.
-
-### Firefox OS Quirks :
-
-Les deux indigènes bloquant `window.prompt()` et non-bloquante `navigator.notification.prompt()` sont disponibles.
-
-## navigator.notification.beep
-
-Le dispositif joue un bip sonore.
-
- Navigator.notification.Beep(Times) ;
-
-
- * **temps**: le nombre de fois répéter le bip. *(Nombre)*
-
-### Exemple
-
- Deux bips !
- Navigator.notification.Beep(2) ;
-
-
-### Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * iOS
- * Paciarelli
- * Windows Phone 7 et 8
- * Windows 8
-
-### Amazon Fire OS Quirks
-
- * Amazon Fire OS joue la valeur par défaut le **Son de Notification** spécifié sous le panneau **d'affichage des réglages/& Sound** .
-
-### Quirks Android
-
- * Android joue la **sonnerie de Notification** spécifié sous le panneau des **réglages/son et affichage** de valeur par défaut.
-
-### Notes au sujet de Windows Phone 7 et 8
-
- * S'appuie sur un fichier générique bip de la distribution de Cordova.
-
-### Bizarreries de paciarelli
-
- * Paciarelli implémente les bips en lisant un fichier audio via les médias API.
-
- * Le fichier sonore doit être court, doit se trouver dans un `sounds` sous-répertoire du répertoire racine de l'application et doit être nommé`beep.wav`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/fr/index.md b/plugins/cordova-plugin-dialogs/doc/fr/index.md
deleted file mode 100644
index fec0939..0000000
--- a/plugins/cordova-plugin-dialogs/doc/fr/index.md
+++ /dev/null
@@ -1,247 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-Ce plugin permet d'accéder à certains éléments d'interface utilisateur native de dialogue via un global `navigator.notification` objet.
-
-Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(navigator.notification);}
-
-
-## Installation
-
- Cordova plugin ajouter cordova-plugin-dialogs
-
-
-## Méthodes
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Affiche une boîte de dialogue ou d'alerte personnalisé. La plupart des implémentations de Cordova utilisent une boîte de dialogue natives pour cette fonctionnalité, mais certaines plates-formes du navigateur `alert` fonction, qui est généralement moins personnalisable.
-
- Navigator.notification.Alert (message, alertCallback, [title], [buttonName])
-
-
-* **message**: message de la boîte de dialogue. *(String)*
-
-* **alertCallback**: callback à appeler lorsque la boîte de dialogue d'alerte est rejetée. *(Fonction)*
-
-* **titre**: titre de la boîte de dialogue. *(String)* (Facultatif, par défaut`Alert`)
-
-* **buttonName**: nom du bouton. *(String)* (Facultatif, par défaut`OK`)
-
-### Exemple
-
- function alertDismissed() {/ / faire quelque chose} navigator.notification.alert ('Vous êtes le gagnant!', / / message alertDismissed, / / rappel « Game Over », / / titre « Done » / / buttonName) ;
-
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 et 8 Quirks
-
-* Il n'y a aucune boîte de dialogue d'alerte intégrée au navigateur, mais vous pouvez en lier une pour appeler `alert()` dans le scope global:
-
- window.alert = navigator.notification.alert;
-
-
-* Les deux appels `alert` et `confirm` sont non-blocants, leurs résultats ne sont disponibles que de façon asynchrone.
-
-### Firefox OS Quirks :
-
-Les deux indigènes bloquant `window.alert()` et non-bloquante `navigator.notification.alert()` sont disponibles.
-
-### BlackBerry 10 Quirks
-
-`navigator.notification.alert('text', callback, 'title', 'text')`paramètre callback est passé numéro 1.
-
-## navigator.notification.confirm
-
-Affiche une boîte de dialogue de confirmation personnalisable.
-
- Navigator.notification.Confirm (message, confirmCallback, [title], [buttonLabels])
-
-
-* **message**: message de la boîte de dialogue. *(String)*
-
-* **confirmCallback**: callback à appeler avec l'index du bouton pressé (1, 2 ou 3) ou lorsque la boîte de dialogue est fermée sans qu'un bouton ne soit pressé (0). *(Fonction)*
-
-* **titre**: titre de dialogue. *(String)* (Facultatif, par défaut`Confirm`)
-
-* **buttonLabels**: tableau de chaînes spécifiant les étiquettes des boutons. *(Array)* (Optionnel, par défaut, [ `OK,Cancel` ])
-
-### confirmCallback
-
-Le `confirmCallback` s'exécute lorsque l'utilisateur appuie sur un bouton dans la boîte de dialogue de confirmation.
-
-Le rappel prend l'argument `buttonIndex` *(nombre)*, qui est l'index du bouton activé. Notez que l'index utilise base d'indexation, la valeur est `1` , `2` , `3` , etc..
-
-### Exemple
-
- function onConfirm(buttonIndex) {alert (« Vous bouton sélectionné » + buttonIndex);}
-
- Navigator.notification.Confirm ('Vous êtes le gagnant!', / / message onConfirm, / / rappel d'invoquer avec l'index du bouton enfoncé « Game Over », / / title ['redémarrer', « Exit »] / / buttonLabels) ;
-
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Paciarelli
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 et 8 Quirks
-
-* Il n'y a aucune fonction intégrée au navigateur pour `window.confirm`, mais vous pouvez en lier une en affectant:
-
- window.confirm = navigator.notification.confirm ;
-
-
-* Les appels à `alert` et `confirm` sont non-bloquants, donc le résultat est seulement disponible de façon asynchrone.
-
-### Bizarreries de Windows
-
-* Sur Windows8/8.1, il n'est pas possible d'ajouter plus de trois boutons à MessageDialog instance.
-
-* Sur Windows Phone 8.1, il n'est pas possible d'établir le dialogue avec plus de deux boutons.
-
-### Firefox OS Quirks :
-
-Les deux indigènes bloquant `window.confirm()` et non-bloquante `navigator.notification.confirm()` sont disponibles.
-
-## navigator.notification.prompt
-
-Affiche une boîte de dialogue natif qui est plus personnalisable que le navigateur `prompt` fonction.
-
- Navigator.notification.prompt (message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **message**: message de la boîte de dialogue. *(String)*
-
-* **promptCallback**: rappel d'invoquer avec l'index du bouton pressé (1, 2 ou 3) ou lorsque la boîte de dialogue est fermée sans une presse de bouton (0). *(Fonction)*
-
-* **titre**: titre *(String)* (facultatif, la valeur par défaut de dialogue`Prompt`)
-
-* **buttonLabels**: tableau de chaînes spécifiant les bouton *(Array)* (facultatif, par défaut, les étiquettes`["OK","Cancel"]`)
-
-* **defaultText**: zone de texte par défaut entrée valeur ( `String` ) (en option, par défaut : chaîne vide)
-
-### promptCallback
-
-Le `promptCallback` s'exécute lorsque l'utilisateur appuie sur un bouton dans la boîte de dialogue d'invite. Le `results` objet passé au rappel contient les propriétés suivantes :
-
-* **buttonIndex**: l'index du bouton activé. *(Nombre)* Notez que l'index utilise base d'indexation, la valeur est `1` , `2` , `3` , etc..
-
-* **entrée 1**: le texte entré dans la boîte de dialogue d'invite. *(String)*
-
-### Exemple
-
- function onPrompt(results) {alert (« Vous avez sélectionné le numéro du bouton » + results.buttonIndex + « et saisi » + results.input1);}
-
- Navigator.notification.prompt ('Veuillez saisir votre nom', / / message onPrompt, / / rappel à appeler « Registration », / / title ['Ok', 'Exit'], / / buttonLabels « Jane Doe » / / defaultText) ;
-
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* Firefox OS
-* iOS
-* Windows Phone 7 et 8
-* Windows 8
-* Windows
-
-### Quirks Android
-
-* Android prend en charge un maximum de trois boutons et ignore plus que cela.
-
-* Sur Android 3.0 et versions ultérieures, les boutons sont affichés dans l'ordre inverse pour les appareils qui utilisent le thème Holo.
-
-### Bizarreries de Windows
-
-* Sous Windows, dialogue d'invite est basé sur html en raison de l'absence de ces api native.
-
-### Firefox OS Quirks :
-
-Les deux indigènes bloquant `window.prompt()` et non-bloquante `navigator.notification.prompt()` sont disponibles.
-
-## navigator.notification.beep
-
-Le dispositif joue un bip sonore.
-
- Navigator.notification.Beep(Times) ;
-
-
-* **temps**: le nombre de fois répéter le bip. *(Nombre)*
-
-### Exemple
-
- Deux bips !
- Navigator.notification.Beep(2) ;
-
-
-### Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* iOS
-* Paciarelli
-* Windows Phone 7 et 8
-* Windows 8
-
-### Amazon Fire OS Quirks
-
-* Amazon Fire OS joue la valeur par défaut le **Son de Notification** spécifié sous le panneau **d'affichage des réglages/& Sound** .
-
-### Quirks Android
-
-* Android joue la **sonnerie de Notification** spécifié sous le panneau des **réglages/son et affichage** de valeur par défaut.
-
-### Windows Phone 7 et 8 Quirks
-
-* S'appuie sur un fichier générique bip de la distribution de Cordova.
-
-### Bizarreries de paciarelli
-
-* Paciarelli implémente les bips en lisant un fichier audio via les médias API.
-
-* Le fichier sonore doit être court, doit se trouver dans un `sounds` sous-répertoire du répertoire racine de l'application et doit être nommé`beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/doc/it/README.md b/plugins/cordova-plugin-dialogs/doc/it/README.md
deleted file mode 100644
index 8a72905..0000000
--- a/plugins/cordova-plugin-dialogs/doc/it/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-Questo plugin consente di accedere ad alcuni elementi di interfaccia utente nativa dialogo tramite un oggetto globale `navigator.notification`.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Metodi
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Mostra una finestra di avviso o la finestra di dialogo personalizzata. La maggior parte delle implementazioni di Cordova utilizzano una finestra di dialogo nativa per questa caratteristica, ma alcune piattaforme utilizzano la funzione di `alert` del browser, che è in genere meno personalizzabile.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **message**: messaggio finestra di dialogo. *(String)*
-
- * **alertCallback**: Callback da richiamare quando viene chiusa la finestra di avviso. *(Funzione)*
-
- * **title**: titolo di dialogo. *(String)* (Opzionale, default è `Alert`)
-
- * **buttonName**: nome del pulsante. *(String)* (Opzionale, default è `OK`)
-
-### Esempio
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 e 8 stranezze
-
- * Non non c'è nessun avviso del browser integrato, ma è possibile associare uno come segue per chiamare `alert()` in ambito globale:
-
- window.alert = navigator.notification.alert;
-
-
- * Entrambi `alert` e `confirm` sono non di blocco chiamate, risultati di cui sono disponibili solo in modo asincrono.
-
-### Firefox OS Stranezze:
-
-Nativo di blocco `window.alert()` blocco `navigator.notification.alert()` sono disponibili sia.
-
-### BlackBerry 10 capricci
-
-parametro di callback `navigator.notification.alert ('text' callback, 'title' 'text')` viene passato il numero 1.
-
-## navigator.notification.confirm
-
-Visualizza una finestra di dialogo conferma personalizzabile.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **message**: messaggio finestra di dialogo. *(String)*
-
- * **confirmCallback**: Callback da richiamare con l'indice del pulsante premuto (1, 2 o 3) o quando la finestra di dialogo viene chiusa senza una pressione del pulsante (0). *(Funzione)*
-
- * **titolo**: titolo di dialogo. *(String)* (Opzionale, default è`Confirm`)
-
- * **buttonLabels**: matrice di stringhe che specificano le etichette dei pulsanti. *(Matrice)* (Opzionale, default è [ `OK,Cancel` ])
-
-### confirmCallback
-
-Il `confirmCallback` viene eseguito quando l'utente preme uno dei pulsanti nella finestra di dialogo conferma.
-
-Il callback accetta l'argomento `buttonIndex` *(numero)*, che è l'indice del pulsante premuto. Si noti che l'indice utilizza l'indicizzazione base uno, quindi il valore è `1`, `2`, `3`, ecc.
-
-### Esempio
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 e 8 stranezze
-
- * Non non c'è nessuna funzione browser incorporato per `window.confirm` , ma è possibile associare assegnando:
-
- window.confirm = navigator.notification.confirm;
-
-
- * Chiama al `alert` e `confirm` sono non bloccante, quindi il risultato è disponibile solo in modo asincrono.
-
-### Stranezze di Windows
-
- * Su Windows8/8.1 non è possibile aggiungere più di tre pulsanti a MessageDialog istanza.
-
- * Su Windows Phone 8.1 non è possibile mostrare la finestra di dialogo con più di due pulsanti.
-
-### Firefox OS Stranezze:
-
-Nativo di blocco `window.confirm()` blocco `navigator.notification.confirm()` sono disponibili sia.
-
-## navigator.notification.prompt
-
-Visualizza una finestra di dialogo nativa che è più personalizzabile di funzione `prompt` del browser.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **message**: messaggio finestra di dialogo. *(String)*
-
- * **promptCallback**: Callback da richiamare con l'indice del pulsante premuto (1, 2 o 3) o quando la finestra di dialogo viene chiusa senza una pressione del pulsante (0). *(Funzione)*
-
- * **title**: dialogo titolo *(String)* (opzionale, default è `Prompt`)
-
- * **buttonLabels**: matrice di stringhe specificando il pulsante etichette *(Array)* (opzionale, default è `["OK", "Cancel"]`)
-
- * **defaultText**: valore (`String`) di input predefinito textbox (opzionale, Default: empty string)
-
-### promptCallback
-
-Il `promptCallback` viene eseguito quando l'utente preme uno dei pulsanti nella finestra di dialogo richiesta. `results` oggetto passato al metodo di callback contiene le seguenti proprietà:
-
- * **buttonIndex**: l'indice del pulsante premuto. *(Numero)* Si noti che l'indice utilizza l'indicizzazione base uno, quindi il valore è `1`, `2`, `3`, ecc.
-
- * **input1**: il testo immesso nella finestra di dialogo richiesta. *(String)*
-
-### Esempio
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * Firefox OS
- * iOS
- * Windows Phone 7 e 8
- * Windows 8
- * Windows
-
-### Stranezze Android
-
- * Android supporta un massimo di tre pulsanti e ignora di più di quello.
-
- * Su Android 3.0 e versioni successive, i pulsanti vengono visualizzati in ordine inverso per dispositivi che utilizzano il tema Holo.
-
-### Stranezze di Windows
-
- * Su Windows finestra di dialogo richiesta è a causa di mancanza di tali api nativa basata su html.
-
-### Firefox OS Stranezze:
-
-Nativo di blocco `window.prompt()` blocco `navigator.notification.prompt()` sono disponibili sia.
-
-## navigator.notification.beep
-
-Il dispositivo riproduce un bip sonoro.
-
- navigator.notification.beep(times);
-
-
- * **times**: il numero di volte per ripetere il segnale acustico. *(Numero)*
-
-### Esempio
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * iOS
- * Tizen
- * Windows Phone 7 e 8
- * Windows 8
-
-### Amazon fuoco OS stranezze
-
- * Amazon fuoco OS riproduce il **Suono di notifica** specificato sotto il pannello **Impostazioni/Display e il suono** predefinito.
-
-### Stranezze Android
-
- * Android giochi default **Notification ringtone** specificato sotto il pannello **impostazioni/audio e Display**.
-
-### Windows Phone 7 e 8 stranezze
-
- * Si basa su un file generico bip dalla distribuzione di Cordova.
-
-### Tizen stranezze
-
- * Tizen implementa bip di riproduzione di un file audio tramite i media API.
-
- * Il file beep deve essere breve, deve trovarsi in una sottodirectory di `sounds` della directory principale dell'applicazione e deve essere denominato `beep.wav`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/it/index.md b/plugins/cordova-plugin-dialogs/doc/it/index.md
deleted file mode 100644
index e8e02c7..0000000
--- a/plugins/cordova-plugin-dialogs/doc/it/index.md
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-Questo plugin consente di accedere ad alcuni elementi di interfaccia utente nativa dialogo tramite un oggetto globale `navigator.notification`.
-
-Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Metodi
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Mostra una finestra di avviso o la finestra di dialogo personalizzata. La maggior parte delle implementazioni di Cordova utilizzano una finestra di dialogo nativa per questa caratteristica, ma alcune piattaforme utilizzano la funzione di `alert` del browser, che è in genere meno personalizzabile.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
-* **message**: messaggio finestra di dialogo. *(String)*
-
-* **alertCallback**: Callback da richiamare quando viene chiusa la finestra di avviso. *(Funzione)*
-
-* **title**: titolo di dialogo. *(String)* (Opzionale, default è `Alert`)
-
-* **buttonName**: nome del pulsante. *(String)* (Opzionale, default è `OK`)
-
-### Esempio
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 e 8 stranezze
-
-* Non non c'è nessun avviso del browser integrato, ma è possibile associare uno come segue per chiamare `alert()` in ambito globale:
-
- window.alert = navigator.notification.alert;
-
-
-* Entrambi `alert` e `confirm` sono non di blocco chiamate, risultati di cui sono disponibili solo in modo asincrono.
-
-### Firefox OS Stranezze:
-
-Nativo di blocco `window.alert()` blocco `navigator.notification.alert()` sono disponibili sia.
-
-### BlackBerry 10 capricci
-
-parametro di callback `navigator.notification.alert ('text' callback, 'title' 'text')` viene passato il numero 1.
-
-## navigator.notification.confirm
-
-Visualizza una finestra di dialogo conferma personalizzabile.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **messaggio**: messaggio finestra di dialogo. *(String)*
-
-* **confirmCallback**: Callback da richiamare con l'indice del pulsante premuto (1, 2 o 3) o quando la finestra di dialogo viene chiusa senza una pressione del pulsante (0). *(Funzione)*
-
-* **titolo**: titolo di dialogo. *(String)* (Opzionale, default è`Confirm`)
-
-* **buttonLabels**: matrice di stringhe che specificano le etichette dei pulsanti. *(Matrice)* (Opzionale, default è [ `OK,Cancel` ])
-
-### confirmCallback
-
-Il `confirmCallback` viene eseguito quando l'utente preme uno dei pulsanti nella finestra di dialogo conferma.
-
-Il callback accetta l'argomento `buttonIndex` *(numero)*, che è l'indice del pulsante premuto. Si noti che l'indice utilizza l'indicizzazione base uno, quindi il valore è `1`, `2`, `3`, ecc.
-
-### Esempio
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 e 8 stranezze
-
-* Non non c'è nessuna funzione browser incorporato per `window.confirm` , ma è possibile associare assegnando:
-
- window.confirm = navigator.notification.confirm;
-
-
-* Chiama al `alert` e `confirm` sono non bloccante, quindi il risultato è disponibile solo in modo asincrono.
-
-### Stranezze di Windows
-
-* Su Windows8/8.1 non è possibile aggiungere più di tre pulsanti a MessageDialog istanza.
-
-* Su Windows Phone 8.1 non è possibile mostrare la finestra di dialogo con più di due pulsanti.
-
-### Firefox OS Stranezze:
-
-Nativo di blocco `window.confirm()` blocco `navigator.notification.confirm()` sono disponibili sia.
-
-## navigator.notification.prompt
-
-Visualizza una finestra di dialogo nativa che è più personalizzabile di funzione `prompt` del browser.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **message**: messaggio finestra di dialogo. *(String)*
-
-* **promptCallback**: Callback da richiamare con l'indice del pulsante premuto (1, 2 o 3) o quando la finestra di dialogo viene chiusa senza una pressione del pulsante (0). *(Funzione)*
-
-* **title**: dialogo titolo *(String)* (opzionale, default è `Prompt`)
-
-* **buttonLabels**: matrice di stringhe specificando il pulsante etichette *(Array)* (opzionale, default è `["OK", "Cancel"]`)
-
-* **defaultText**: valore (`String`) di input predefinito textbox (opzionale, Default: empty string)
-
-### promptCallback
-
-Il `promptCallback` viene eseguito quando l'utente preme uno dei pulsanti nella finestra di dialogo richiesta. `results` oggetto passato al metodo di callback contiene le seguenti proprietà:
-
-* **buttonIndex**: l'indice del pulsante premuto. *(Numero)* Si noti che l'indice utilizza l'indicizzazione base uno, quindi il valore è `1`, `2`, `3`, ecc.
-
-* **input1**: il testo immesso nella finestra di dialogo richiesta. *(String)*
-
-### Esempio
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* Firefox OS
-* iOS
-* Windows Phone 7 e 8
-* Windows 8
-* Windows
-
-### Stranezze Android
-
-* Android supporta un massimo di tre pulsanti e ignora di più di quello.
-
-* Su Android 3.0 e versioni successive, i pulsanti vengono visualizzati in ordine inverso per dispositivi che utilizzano il tema Holo.
-
-### Stranezze di Windows
-
-* Su Windows finestra di dialogo richiesta è a causa di mancanza di tali api nativa basata su html.
-
-### Firefox OS Stranezze:
-
-Nativo di blocco `window.prompt()` blocco `navigator.notification.prompt()` sono disponibili sia.
-
-## navigator.notification.beep
-
-Il dispositivo riproduce un bip sonoro.
-
- navigator.notification.beep(times);
-
-
-* **times**: il numero di volte per ripetere il segnale acustico. *(Numero)*
-
-### Esempio
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* iOS
-* Tizen
-* Windows Phone 7 e 8
-* Windows 8
-
-### Amazon fuoco OS stranezze
-
-* Amazon fuoco OS riproduce il **Suono di notifica** specificato sotto il pannello **Impostazioni/Display e il suono** predefinito.
-
-### Stranezze Android
-
-* Android giochi default **Notification ringtone** specificato sotto il pannello **impostazioni/audio e Display**.
-
-### Windows Phone 7 e 8 stranezze
-
-* Si basa su un file generico bip dalla distribuzione di Cordova.
-
-### Tizen stranezze
-
-* Tizen implementa bip di riproduzione di un file audio tramite i media API.
-
-* Il file beep deve essere breve, deve trovarsi in una sottodirectory di `sounds` della directory principale dell'applicazione e deve essere denominato `beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/doc/ja/README.md b/plugins/cordova-plugin-dialogs/doc/ja/README.md
deleted file mode 100644
index 0722658..0000000
--- a/plugins/cordova-plugin-dialogs/doc/ja/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-このプラグインは、グローバル `navigator.notification` オブジェクトを介していくつかネイティブ ダイアログの UI 要素へのアクセスを提供します。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## メソッド
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-カスタムの警告またはダイアログ ボックスが表示されます。 ほとんどコルドバ ネイティブ] ダイアログ ボックスの使用この機能がいくつかのプラットフォームは通常小さいカスタマイズ可能なブラウザーの `警告` 機能を使用します。
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **メッセージ**: ダイアログ メッセージ。*(文字列)*
-
- * **alertCallback**: 警告ダイアログが閉じられたときに呼び出すコールバック。*(機能)*
-
- * **タイトル**: ダイアログのタイトル。*(文字列)*(省略可能、既定値は`Alert`)
-
- * **buttonName**: ボタンの名前。*(文字列)*(省略可能、既定値は`OK`)
-
-### 例
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Tizen
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 と 8 癖
-
- * 組み込みのブラウザー警告がない呼び出しを次のように 1 つをバインドすることができます `alert()` 、グローバル スコープで。
-
- window.alert = navigator.notification.alert;
-
-
- * 両方の `alert` と `confirm` は非ブロッキング呼び出し、結果は非同期的にのみ利用できます。
-
-### Firefox OS 互換:
-
-ネイティブ ブロック `window.alert()` と非ブロッキング `navigator.notification.alert()` があります。
-
-### ブラックベリー 10 癖
-
-`navigator.notification.alert ('text' コールバック 'title'、'text')` コールバック パラメーターは数 1 に渡されます。
-
-## navigator.notification.confirm
-
-カスタマイズ可能な確認のダイアログ ボックスが表示されます。
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **メッセージ**: ダイアログ メッセージ。*(文字列)*
-
- * **confirmCallback**: インデックス (1、2、または 3) を押されたボタンまたはダイアログ ボックスは、ボタンを押す (0) なしに解雇されたときに呼び出すコールバック。*(機能)*
-
- * **タイトル**: ダイアログのタイトル。*(文字列)*(省略可能、既定値は`Confirm`)
-
- * **buttonLabels**: ボタンのラベルを指定する文字列の配列。*(配列)*(省略可能、既定値は [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback` は、いずれかの確認ダイアログ ボックスでボタンを押したときに実行します。
-
-コールバックは、引数 `buttonIndex` *(番号)* は、押されたボタンのインデックス。 インデックスがインデックス 1 ベースので、値は `1`、`2`、`3` などに注意してください。
-
-### 例
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * Firefox の OS
- * iOS
- * Tizen
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 と 8 癖
-
- * 組み込みブラウザーの機能はありません `window.confirm` が割り当てることによってバインドすることができます。
-
- window.confirm = navigator.notification.confirm;
-
-
- * 呼び出しを `alert` と `confirm` では非ブロッキング、結果は非同期的にのみ使用できます。
-
-### Windows の癖
-
- * Windows8/8.1 の MessageDialog インスタンスを 3 つ以上のボタンを追加することはできません。
-
- * Windows Phone 8.1 に 2 つ以上のボタンを持つダイアログを表示することはできません。
-
-### Firefox OS 互換:
-
-ネイティブ ブロック `window.confirm()` と非ブロッキング `navigator.notification.confirm()` があります。
-
-## navigator.notification.prompt
-
-ブラウザーの `プロンプト` 機能より詳細にカスタマイズはネイティブのダイアログ ボックスが表示されます。
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **メッセージ**: ダイアログ メッセージ。*(文字列)*
-
- * **promptCallback**: インデックス (1、2、または 3) を押されたボタンまたはダイアログ ボックスは、ボタンを押す (0) なしに解雇されたときに呼び出すコールバック。*(機能)*
-
- * **title**: タイトル *(String)* (省略可能、既定 `プロンプト` ダイアログ)
-
- * **buttonLabels**: ボタンのラベル *(配列)* (省略可能、既定値 `["OK"、「キャンセル」]` を指定する文字列の配列)
-
- * **defaultText**: 既定テキスト ボックスの入力値 (`文字列`) (省略可能、既定: 空の文字列)
-
-### promptCallback
-
-`promptCallback` は、プロンプト ダイアログ ボックス内のボタンのいずれかを押したときに実行します。コールバックに渡される `results` オブジェクトには、次のプロパティが含まれています。
-
- * **buttonIndex**: 押されたボタンのインデックス。*(数)*インデックスがインデックス 1 ベースので、値は `1`、`2`、`3` などに注意してください。
-
- * **input1**: プロンプト ダイアログ ボックスに入力したテキスト。*(文字列)*
-
-### 例
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * Firefox の OS
- * iOS
- * Windows Phone 7 と 8
- * Windows 8
- * Windows
-
-### Android の癖
-
- * Android は最大 3 つのボタンをサポートしているし、それ以上無視します。
-
- * アンドロイド 3.0 と後、ホロのテーマを使用するデバイスを逆の順序でボタンが表示されます。
-
-### Windows の癖
-
- * Windows プロンプト ダイアログは html ベースのようなネイティブ api の不足のためです。
-
-### Firefox OS 互換:
-
-ネイティブ ブロック `window.prompt()` と非ブロッキング `navigator.notification.prompt()` があります。
-
-## navigator.notification.beep
-
-デバイス サウンドをビープ音を再生します。
-
- navigator.notification.beep(times);
-
-
- * **times**: ビープ音を繰り返す回数。*(数)*
-
-### 例
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * iOS
- * Tizen
- * Windows Phone 7 と 8
- * Windows 8
-
-### アマゾン火 OS 癖
-
- * アマゾン火 OS デフォルト **設定/表示 & サウンド** パネルの下に指定した **通知音** を果たしています。
-
-### Android の癖
-
- * アンドロイド デフォルト **通知着信音** **設定/サウンド & ディスプレイ** パネルの下に指定を果たしています。
-
-### Windows Phone 7 と 8 癖
-
- * コルドバ分布からジェネリック ビープ音ファイルに依存します。
-
-### Tizen の癖
-
- * Tizen は、メディア API 経由でオーディオ ファイルを再生してビープ音を実装します。
-
- * ビープ音ファイル短い、`sounds` アプリケーションのルート ディレクトリのサブディレクトリである必要があり。、`beep.wav` という名前である必要があります。.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/ja/index.md b/plugins/cordova-plugin-dialogs/doc/ja/index.md
deleted file mode 100644
index b530860..0000000
--- a/plugins/cordova-plugin-dialogs/doc/ja/index.md
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-このプラグインは、グローバル `navigator.notification` オブジェクトを介していくつかネイティブ ダイアログの UI 要素へのアクセスを提供します。
-
-オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## メソッド
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-カスタムの警告またはダイアログ ボックスが表示されます。 ほとんどコルドバ ネイティブ] ダイアログ ボックスの使用この機能がいくつかのプラットフォームは通常小さいカスタマイズ可能なブラウザーの `警告` 機能を使用します。
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
-* **メッセージ**: ダイアログ メッセージ。*(文字列)*
-
-* **alertCallback**: 警告ダイアログが閉じられたときに呼び出すコールバック。*(機能)*
-
-* **タイトル**: ダイアログのタイトル。*(文字列)*(省略可能、既定値は`Alert`)
-
-* **buttonName**: ボタンの名前。*(文字列)*(省略可能、既定値は`OK`)
-
-### 例
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Tizen
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 と 8 癖
-
-* 組み込みのブラウザー警告がない呼び出しを次のように 1 つをバインドすることができます `alert()` 、グローバル スコープで。
-
- window.alert = navigator.notification.alert;
-
-
-* 両方の `alert` と `confirm` は非ブロッキング呼び出し、結果は非同期的にのみ利用できます。
-
-### Firefox OS 互換:
-
-ネイティブ ブロック `window.alert()` と非ブロッキング `navigator.notification.alert()` があります。
-
-### ブラックベリー 10 癖
-
-`navigator.notification.alert ('text' コールバック 'title'、'text')` コールバック パラメーターは数 1 に渡されます。
-
-## navigator.notification.confirm
-
-カスタマイズ可能な確認のダイアログ ボックスが表示されます。
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **メッセージ**: ダイアログ メッセージ。*(文字列)*
-
-* **confirmCallback**: インデックス (1、2、または 3) を押されたボタンまたはダイアログ ボックスは、ボタンを押す (0) なしに解雇されたときに呼び出すコールバック。*(機能)*
-
-* **タイトル**: ダイアログのタイトル。*(文字列)*(省略可能、既定値は`Confirm`)
-
-* **buttonLabels**: ボタンのラベルを指定する文字列の配列。*(配列)*(省略可能、既定値は [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback` は、いずれかの確認ダイアログ ボックスでボタンを押したときに実行します。
-
-コールバックは、引数 `buttonIndex` *(番号)* は、押されたボタンのインデックス。 インデックスがインデックス 1 ベースので、値は `1`、`2`、`3` などに注意してください。
-
-### 例
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* Firefox の OS
-* iOS
-* Tizen
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 と 8 癖
-
-* 組み込みブラウザーの機能はありません `window.confirm` が割り当てることによってバインドすることができます。
-
- window.confirm = navigator.notification.confirm;
-
-
-* 呼び出しを `alert` と `confirm` では非ブロッキング、結果は非同期的にのみ使用できます。
-
-### Windows の癖
-
-* Windows8/8.1 の MessageDialog インスタンスを 3 つ以上のボタンを追加することはできません。
-
-* Windows Phone 8.1 に 2 つ以上のボタンを持つダイアログを表示することはできません。
-
-### Firefox OS 互換:
-
-ネイティブ ブロック `window.confirm()` と非ブロッキング `navigator.notification.confirm()` があります。
-
-## navigator.notification.prompt
-
-ブラウザーの `プロンプト` 機能より詳細にカスタマイズはネイティブのダイアログ ボックスが表示されます。
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **message**: ダイアログ メッセージ。*(文字列)*
-
-* **promptCallback**: インデックス (1、2、または 3) を押されたボタンまたはダイアログ ボックスは、ボタンを押す (0) なしに解雇されたときに呼び出すコールバック。*(機能)*
-
-* **title**: タイトル *(String)* (省略可能、既定 `プロンプト` ダイアログ)
-
-* **buttonLabels**: ボタンのラベル *(配列)* (省略可能、既定値 `["OK"、「キャンセル」]` を指定する文字列の配列)
-
-* **defaultText**: 既定テキスト ボックスの入力値 (`文字列`) (省略可能、既定: 空の文字列)
-
-### promptCallback
-
-`promptCallback` は、プロンプト ダイアログ ボックス内のボタンのいずれかを押したときに実行します。コールバックに渡される `results` オブジェクトには、次のプロパティが含まれています。
-
-* **buttonIndex**: 押されたボタンのインデックス。*(数)*インデックスがインデックス 1 ベースので、値は `1`、`2`、`3` などに注意してください。
-
-* **input1**: プロンプト ダイアログ ボックスに入力したテキスト。*(文字列)*
-
-### 例
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* Firefox の OS
-* iOS
-* Windows Phone 7 と 8
-* Windows 8
-* Windows
-
-### Android の癖
-
-* Android は最大 3 つのボタンをサポートしているし、それ以上無視します。
-
-* アンドロイド 3.0 と後、ホロのテーマを使用するデバイスを逆の順序でボタンが表示されます。
-
-### Windows の癖
-
-* Windows プロンプト ダイアログは html ベースのようなネイティブ api の不足のためです。
-
-### Firefox OS 互換:
-
-ネイティブ ブロック `window.prompt()` と非ブロッキング `navigator.notification.prompt()` があります。
-
-## navigator.notification.beep
-
-デバイス サウンドをビープ音を再生します。
-
- navigator.notification.beep(times);
-
-
-* **times**: ビープ音を繰り返す回数。*(数)*
-
-### 例
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* iOS
-* Tizen
-* Windows Phone 7 と 8
-* Windows 8
-
-### アマゾン火 OS 癖
-
-* アマゾン火 OS デフォルト **設定/表示 & サウンド** パネルの下に指定した **通知音** を果たしています。
-
-### Android の癖
-
-* アンドロイド デフォルト **通知着信音** **設定/サウンド & ディスプレイ** パネルの下に指定を果たしています。
-
-### Windows Phone 7 と 8 癖
-
-* コルドバ分布からジェネリック ビープ音ファイルに依存します。
-
-### Tizen の癖
-
-* Tizen は、メディア API 経由でオーディオ ファイルを再生してビープ音を実装します。
-
-* ビープ音ファイル短い、`sounds` アプリケーションのルート ディレクトリのサブディレクトリである必要があり。、`beep.wav` という名前である必要があります。.
diff --git a/plugins/cordova-plugin-dialogs/doc/ko/README.md b/plugins/cordova-plugin-dialogs/doc/ko/README.md
deleted file mode 100644
index 04532da..0000000
--- a/plugins/cordova-plugin-dialogs/doc/ko/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-이 플러그인 글로벌 `navigator.notification` 개체를 통해 몇 가지 기본 대화 상자 UI 요소에 액세스할 수 있습니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## 메서드
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-사용자 지정 경고 또는 대화 상자를 보여 줍니다. 이 기능에 대 한 기본 대화 상자를 사용 하는 대부분의 코르도바 구현 하지만 일부 플랫폼은 일반적으로 덜 사용자 정의할 수 있는 브라우저의 `alert` 기능을 사용 합니다.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **message**: 대화 메시지. *(문자열)*
-
- * **alertCallback**: 콜백을 호출할 때 경고 대화 기 각. *(기능)*
-
- * **title**: 제목 대화 상자. *(문자열)* (옵션, 기본값:`Alert`)
-
- * **buttonName**: 단추 이름. *(문자열)* (옵션, 기본값:`OK`)
-
-### 예를 들어
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Tizen
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### Windows Phone 7, 8 특수
-
- * 아니 내장 브라우저 경고 하지만 다음과 같이 전화를 바인딩할 수 있습니다 `alert()` 전역 범위에서:
-
- window.alert = navigator.notification.alert;
-
-
- * 둘 다 `alert` 와 `confirm` 는 비차단 호출, 결과 비동기적으로 사용할 수 있습니다.
-
-### 파이어 폭스 OS 단점:
-
-기본 차단 `window.alert()` 및 차단 되지 않은 `navigator.notification.alert()` 사용할 수 있습니다.
-
-### 블랙베리 10 단점
-
-`navigator.notification.alert ('텍스트', 콜백, '제목', '텍스트')` 콜백 매개 변수 1 번을 전달 됩니다.
-
-## navigator.notification.confirm
-
-사용자 정의 확인 대화 상자가 표시 됩니다.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **message**: 대화 메시지. *(문자열)*
-
- * **confirmCallback**: 인덱스 버튼 (1, 2 또는 3) 또는 대화 상자 버튼을 누르면 (0) 없이 기 각 될 때 호출할 콜백 합니다. *(기능)*
-
- * **title**: 제목 대화 상자. *(문자열)* (옵션, 기본값:`Confirm`)
-
- * **buttonLabels**: 단추 레이블을 지정 하는 문자열 배열입니다. *(배열)* (옵션, 기본값은 [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback`는 사용자가 확인 대화 상자에서 단추 중 하나를 누를 때 실행 합니다.
-
-콜백이 걸립니다 인수 `buttonIndex` *(번호)를* 누르면된 버튼의 인덱스입니다. Note 인덱스에서는 인덱싱 1 시작 값은 `1`, `2`, `3`, 등등.
-
-### 예를 들어
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * Firefox 운영 체제
- * iOS
- * Tizen
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### Windows Phone 7, 8 특수
-
- * 에 대 한 기본 제공 브라우저 함수가 `window.confirm` , 그러나 할당 하 여 바인딩할 수 있습니다:
-
- window.confirm = navigator.notification.confirm;
-
-
- * 호출 `alert` 및 `confirm` 되므로 차단 되지 않은 결과만 비동기적으로 사용할 수 있습니다.
-
-### 윈도우 특수
-
- * Windows8/8.1에 3 개 이상 단추 MessageDialog 인스턴스를 추가할 수는 없습니다.
-
- * Windows Phone 8.1에 두 개 이상의 단추와 대화 상자 표시 수는 없습니다.
-
-### 파이어 폭스 OS 단점:
-
-기본 차단 `window.confirm()` 및 차단 되지 않은 `navigator.notification.confirm()` 사용할 수 있습니다.
-
-## navigator.notification.prompt
-
-브라우저의 `프롬프트` 함수 보다 더 많은 사용자 정의 기본 대화 상자가 표시 됩니다.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **message**: 대화 메시지. *(문자열)*
-
- * **promptCallback**: 인덱스 버튼 (1, 2 또는 3) 또는 대화 상자 버튼을 누르면 (0) 없이 기 각 될 때 호출할 콜백 합니다. *(기능)*
-
- * **title**: 제목 대화 상자. *(문자열)* (옵션, 기본값:`Prompt`)
-
- * **buttonLabels**: 버튼 레이블 *(배열)* (옵션, 기본값 `["확인", "취소"]을` 지정 하는 문자열의 배열)
-
- * **defaultText**: 기본 텍스트 상자에 값 (`문자열`) 입력 (옵션, 기본값: 빈 문자열)
-
-### promptCallback
-
-`promptCallback`는 사용자가 프롬프트 대화 상자에서 단추 중 하나를 누를 때 실행 합니다. 콜백에 전달 된 `results` 개체에는 다음 속성이 포함 되어 있습니다.
-
- * **buttonIndex**: 눌려진된 버튼의 인덱스. *(수)* Note 인덱스에서는 인덱싱 1 시작 값은 `1`, `2`, `3`, 등등.
-
- * **input1**: 프롬프트 대화 상자에 입력 한 텍스트. *(문자열)*
-
-### 예를 들어
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * Firefox 운영 체제
- * iOS
- * Windows Phone 7과 8
- * 윈도우 8
- * 윈도우
-
-### 안 드 로이드 단점
-
- * 안 드 로이드 최대 3 개의 단추를 지원 하 고 그것 보다는 더 이상 무시 합니다.
-
- * 안 드 로이드 3.0 및 나중에, 단추는 홀로 테마를 사용 하는 장치에 대 한 반대 순서로 표시 됩니다.
-
-### 윈도우 특수
-
- * 윈도우에서 프롬프트 대화 같은 네이티브 api의 부족으로 인해 html 기반 이다.
-
-### 파이어 폭스 OS 단점:
-
-기본 차단 `window.prompt()` 및 차단 되지 않은 `navigator.notification.prompt()` 사용할 수 있습니다.
-
-## navigator.notification.beep
-
-장치는 경고음 소리를 재생 합니다.
-
- navigator.notification.beep(times);
-
-
- * **times**: 경고음을 반복 하는 횟수. *(수)*
-
-### 예를 들어
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * iOS
- * Tizen
- * Windows Phone 7과 8
- * 윈도우 8
-
-### 아마존 화재 OS 단점
-
- * 아마존 화재 운영 체제 기본 **설정/디스플레이 및 사운드** 패널에 지정 된 **알림 소리** 재생 됩니다.
-
-### 안 드 로이드 단점
-
- * 안 드 로이드 기본 **알림 벨소리** **설정/사운드 및 디스플레이** 패널에서 지정 합니다.
-
-### Windows Phone 7, 8 특수
-
- * 코르 도우 바 분포에서 일반 경고음 파일에 의존합니다.
-
-### Tizen 특수
-
- * Tizen은 미디어 API 통해 오디오 파일을 재생 하 여 경고음을 구현 합니다.
-
- * 경고음 파일 짧은 되어야 합니다, 응용 프로그램의 루트 디렉터리의 `소리` 하위 디렉터리에 위치 해야 합니다 및 `beep.wav`는 명명 된.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/ko/index.md b/plugins/cordova-plugin-dialogs/doc/ko/index.md
deleted file mode 100644
index 8216d8c..0000000
--- a/plugins/cordova-plugin-dialogs/doc/ko/index.md
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-이 플러그인 글로벌 `navigator.notification` 개체를 통해 몇 가지 기본 대화 상자 UI 요소에 액세스할 수 있습니다.
-
-개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## 메서드
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-사용자 지정 경고 또는 대화 상자를 보여 줍니다. 이 기능에 대 한 기본 대화 상자를 사용 하는 대부분의 코르도바 구현 하지만 일부 플랫폼은 일반적으로 덜 사용자 정의할 수 있는 브라우저의 `alert` 기능을 사용 합니다.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
-* **message**: 대화 메시지. *(문자열)*
-
-* **alertCallback**: 콜백을 호출할 때 경고 대화 기 각. *(기능)*
-
-* **title**: 제목 대화 상자. *(문자열)* (옵션, 기본값:`Alert`)
-
-* **buttonName**: 단추 이름. *(문자열)* (옵션, 기본값:`OK`)
-
-### 예를 들어
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Tizen
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### Windows Phone 7, 8 특수
-
-* 아니 내장 브라우저 경고 하지만 다음과 같이 전화를 바인딩할 수 있습니다 `alert()` 전역 범위에서:
-
- window.alert = navigator.notification.alert;
-
-
-* 둘 다 `alert` 와 `confirm` 는 비차단 호출, 결과 비동기적으로 사용할 수 있습니다.
-
-### 파이어 폭스 OS 단점:
-
-기본 차단 `window.alert()` 및 차단 되지 않은 `navigator.notification.alert()` 사용할 수 있습니다.
-
-### 블랙베리 10 단점
-
-`navigator.notification.alert ('텍스트', 콜백, '제목', '텍스트')` 콜백 매개 변수 1 번을 전달 됩니다.
-
-## navigator.notification.confirm
-
-사용자 정의 확인 대화 상자가 표시 됩니다.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **message**: 대화 메시지. *(문자열)*
-
-* **confirmCallback**: 인덱스 버튼 (1, 2 또는 3) 또는 대화 상자 버튼을 누르면 (0) 없이 기 각 될 때 호출할 콜백 합니다. *(기능)*
-
-* **title**: 제목 대화 상자. *(문자열)* (옵션, 기본값:`Confirm`)
-
-* **buttonLabels**: 단추 레이블을 지정 하는 문자열 배열입니다. *(배열)* (옵션, 기본값은 [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback`는 사용자가 확인 대화 상자에서 단추 중 하나를 누를 때 실행 합니다.
-
-콜백이 걸립니다 인수 `buttonIndex` *(번호)를* 누르면된 버튼의 인덱스입니다. Note 인덱스에서는 인덱싱 1 시작 값은 `1`, `2`, `3`, 등등.
-
-### 예를 들어
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* Firefox 운영 체제
-* iOS
-* Tizen
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### Windows Phone 7, 8 특수
-
-* 에 대 한 기본 제공 브라우저 함수가 `window.confirm` , 그러나 할당 하 여 바인딩할 수 있습니다:
-
- window.confirm = navigator.notification.confirm;
-
-
-* 호출 `alert` 및 `confirm` 되므로 차단 되지 않은 결과만 비동기적으로 사용할 수 있습니다.
-
-### 윈도우 특수
-
-* Windows8/8.1에 3 개 이상 단추 MessageDialog 인스턴스를 추가할 수는 없습니다.
-
-* Windows Phone 8.1에 두 개 이상의 단추와 대화 상자 표시 수는 없습니다.
-
-### 파이어 폭스 OS 단점:
-
-기본 차단 `window.confirm()` 및 차단 되지 않은 `navigator.notification.confirm()` 사용할 수 있습니다.
-
-## navigator.notification.prompt
-
-브라우저의 `프롬프트` 함수 보다 더 많은 사용자 정의 기본 대화 상자가 표시 됩니다.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **message**: 대화 메시지. *(문자열)*
-
-* **promptCallback**: 인덱스 버튼 (1, 2 또는 3) 또는 대화 상자 버튼을 누르면 (0) 없이 기 각 될 때 호출할 콜백 합니다. *(기능)*
-
-* **title**: 제목 대화 상자. *(문자열)* (옵션, 기본값:`Prompt`)
-
-* **buttonLabels**: 버튼 레이블 *(배열)* (옵션, 기본값 `["확인", "취소"]을` 지정 하는 문자열의 배열)
-
-* **defaultText**: 기본 텍스트 상자에 값 (`문자열`) 입력 (옵션, 기본값: 빈 문자열)
-
-### promptCallback
-
-`promptCallback`는 사용자가 프롬프트 대화 상자에서 단추 중 하나를 누를 때 실행 합니다. 콜백에 전달 된 `results` 개체에는 다음 속성이 포함 되어 있습니다.
-
-* **buttonIndex**: 눌려진된 버튼의 인덱스. *(수)* Note 인덱스에서는 인덱싱 1 시작 값은 `1`, `2`, `3`, 등등.
-
-* **input1**: 프롬프트 대화 상자에 입력 한 텍스트. *(문자열)*
-
-### 예를 들어
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* Firefox 운영 체제
-* iOS
-* Windows Phone 7과 8
-* 윈도우 8
-* 윈도우
-
-### 안 드 로이드 단점
-
-* 안 드 로이드 최대 3 개의 단추를 지원 하 고 그것 보다는 더 이상 무시 합니다.
-
-* 안 드 로이드 3.0 및 나중에, 단추는 홀로 테마를 사용 하는 장치에 대 한 반대 순서로 표시 됩니다.
-
-### 윈도우 특수
-
-* 윈도우에서 프롬프트 대화 같은 네이티브 api의 부족으로 인해 html 기반 이다.
-
-### 파이어 폭스 OS 단점:
-
-기본 차단 `window.prompt()` 및 차단 되지 않은 `navigator.notification.prompt()` 사용할 수 있습니다.
-
-## navigator.notification.beep
-
-장치는 경고음 소리를 재생 합니다.
-
- navigator.notification.beep(times);
-
-
-* **times**: 경고음을 반복 하는 횟수. *(수)*
-
-### 예를 들어
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* iOS
-* Tizen
-* Windows Phone 7과 8
-* 윈도우 8
-
-### 아마존 화재 OS 단점
-
-* 아마존 화재 운영 체제 기본 **설정/디스플레이 및 사운드** 패널에 지정 된 **알림 소리** 재생 됩니다.
-
-### 안 드 로이드 단점
-
-* 안 드 로이드 기본 **알림 벨소리** **설정/사운드 및 디스플레이** 패널에서 지정 합니다.
-
-### Windows Phone 7, 8 특수
-
-* 코르 도우 바 분포에서 일반 경고음 파일에 의존합니다.
-
-### Tizen 특수
-
-* Tizen은 미디어 API 통해 오디오 파일을 재생 하 여 경고음을 구현 합니다.
-
-* 경고음 파일 짧은 되어야 합니다, 응용 프로그램의 루트 디렉터리의 `소리` 하위 디렉터리에 위치 해야 합니다 및 `beep.wav`는 명명 된.
diff --git a/plugins/cordova-plugin-dialogs/doc/pl/README.md b/plugins/cordova-plugin-dialogs/doc/pl/README.md
deleted file mode 100644
index 45fa937..0000000
--- a/plugins/cordova-plugin-dialogs/doc/pl/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-Ten plugin umożliwia dostęp do niektórych rodzimych okna dialogowego elementy interfejsu użytkownika za pośrednictwem obiektu globalnego `navigator.notification`.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Metody
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Pokazuje niestandardowe wpisu lub okno dialogowe. Większość implementacji Cordova używać rodzimych okno dialogowe dla tej funkcji, ale niektóre platformy używać przeglądarki `alert` funkcji, która jest zazwyczaj mniej konfigurowalny.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **wiadomość**: komunikat okna dialogowego. *(String)*
-
- * **alertCallback**: wywołanie zwrotne do wywołania, gdy okno dialogowe alert jest oddalona. *(Funkcja)*
-
- * **tytuł**: okno tytuł. *(String)* (Opcjonalna, domyślnie`Alert`)
-
- * **buttonName**: Nazwa przycisku. *(String)* (Opcjonalna, domyślnie`OK`)
-
-### Przykład
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 i 8 dziwactwa
-
- * Istnieje wpis nie wbudowana przeglądarka, ale można powiązać w następujący sposób na wywołanie `alert()` w globalnym zasięgu:
-
- window.alert = navigator.notification.alert;
-
-
- * Zarówno `alert` i `confirm` są bez blokowania połączeń, których wyniki są tylko dostępne asynchronicznie.
-
-### Firefox OS dziwactwa:
-
-Dostępne są zarówno rodzimych blokuje `window.alert()` i bez blokowania `navigator.notification.alert()`.
-
-### Jeżyna 10 dziwactwa
-
-parametr wywołania zwrotnego `Navigator.Notification.alert ("tekst", wywołanie zwrotne, 'tytuł', 'tekst')` jest przekazywana numer 1.
-
-## navigator.notification.confirm
-
-Wyświetla okno dialogowe potwierdzenia konfigurowalny.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **wiadomość**: komunikat okna dialogowego. *(String)*
-
- * **confirmCallback**: wywołanie zwrotne do wywołania z indeksu z przycisku (1, 2 lub 3), lub gdy okno jest zwolniony bez naciśnij przycisk (0). *(Funkcja)*
-
- * **tytuł**: okno tytuł. *(String)* (Opcjonalna, domyślnie`Confirm`)
-
- * **buttonLabels**: tablica ciągów, określając etykiety przycisków. *(Tablica)* (Opcjonalna, domyślnie [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback` wykonuje, gdy użytkownik naciśnie klawisz jeden z przycisków w oknie dialogowym potwierdzenia.
-
-Wywołanie zwrotne wymaga argumentu `buttonIndex` *(numer)*, który jest indeksem wciśnięty przycisk. Należy zauważyć, że indeks używa, na podstawie jednego indeksowania, więc wartością jest `1`, `2`, `3` itd.
-
-### Przykład
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Firefox OS
- * iOS
- * Tizen
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 i 8 dziwactwa
-
- * Istnieje funkcja wbudowana przeglądarka nie `window.confirm` , ale można go powiązać przypisując:
-
- window.confirm = navigator.notification.confirm;
-
-
- * Wzywa do `alert` i `confirm` są bez blokowania, więc wynik jest tylko dostępnych asynchronicznie.
-
-### Windows dziwactwa
-
- * Na Windows8/8.1 to nie można dodać więcej niż trzy przyciski do instancji MessageDialog.
-
- * Na Windows Phone 8.1 nie jest możliwe wyświetlić okno dialogowe z więcej niż dwoma przyciskami.
-
-### Firefox OS dziwactwa:
-
-Dostępne są zarówno rodzimych blokuje `window.confirm()` i bez blokowania `navigator.notification.confirm()`.
-
-## navigator.notification.prompt
-
-Wyświetla okno dialogowe macierzystego, który bardziej niż przeglądarki `prompt` funkcja.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **wiadomość**: komunikat okna dialogowego. *(String)*
-
- * **promptCallback**: wywołanie zwrotne do wywołania z indeksu z przycisku (1, 2 lub 3), lub gdy okno jest zwolniony bez naciśnij przycisk (0). *(Funkcja)*
-
- * **title**: okno tytuł *(String)* (opcjonalna, domyślnie `polecenia`)
-
- * **buttonLabels**: tablica ciągów, określając przycisk etykiety *(tablica)* (opcjonalna, domyślnie `["OK", "Anuluj"]`)
-
- * **defaultText**: domyślnie pole tekstowe wprowadzania wartości (`String`) (opcjonalna, domyślnie: pusty ciąg)
-
-### promptCallback
-
-`promptCallback` wykonuje, gdy użytkownik naciśnie klawisz jeden z przycisków w oknie dialogowym polecenia. Obiektu `results` przekazane do wywołania zwrotnego zawiera następujące właściwości:
-
- * **buttonIndex**: indeks wciśnięty przycisk. *(Liczba)* Należy zauważyć, że indeks używa, na podstawie jednego indeksowania, więc wartością jest `1`, `2`, `3` itd.
-
- * **input1**: Tekst wprowadzony w oknie polecenia. *(String)*
-
-### Przykład
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * Firefox OS
- * iOS
- * Windows Phone 7 i 8
- * Windows 8
- * Windows
-
-### Dziwactwa Androida
-
- * Android obsługuje maksymalnie trzy przyciski i więcej niż to ignoruje.
-
- * Android 3.0 i nowszych przyciski są wyświetlane w kolejności odwrotnej do urządzenia, które używają tematu Holo.
-
-### Windows dziwactwa
-
- * W systemie Windows wierzyciel okno jest oparte na języku html, ze względu na brak takich natywnego api.
-
-### Firefox OS dziwactwa:
-
-Dostępne są zarówno rodzimych blokuje `window.prompt()` i bez blokowania `navigator.notification.prompt()`.
-
-## navigator.notification.beep
-
-Urządzenie odtwarza sygnał ciągły dźwięk.
-
- navigator.notification.beep(times);
-
-
- * **times**: liczba powtórzeń po sygnale. *(Liczba)*
-
-### Przykład
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * iOS
- * Tizen
- * Windows Phone 7 i 8
- * Windows 8
-
-### Amazon ogień OS dziwactwa
-
- * Amazon ogień OS gra domyślny **Dźwięk powiadomienia** określone w panelu **ekranu/ustawienia i dźwięk**.
-
-### Dziwactwa Androida
-
- * Android gra domyślnie **dzwonek powiadomienia** określone w panelu **ustawień/dźwięk i wyświetlacz**.
-
-### Windows Phone 7 i 8 dziwactwa
-
- * Opiera się na pliku rodzajowego sygnał z rozkładu Cordova.
-
-### Dziwactwa Tizen
-
- * Tizen implementuje dźwięków przez odtwarzania pliku audio za pośrednictwem mediów API.
-
- * Plik dźwiękowy muszą być krótkie, musi znajdować się w podkatalogu `dźwięki` w katalogu głównym aplikacji i musi być o nazwie `beep.wav`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/pl/index.md b/plugins/cordova-plugin-dialogs/doc/pl/index.md
deleted file mode 100644
index 462d5ac..0000000
--- a/plugins/cordova-plugin-dialogs/doc/pl/index.md
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-Ten plugin umożliwia dostęp do niektórych rodzimych okna dialogowego elementy interfejsu użytkownika za pośrednictwem obiektu globalnego `navigator.notification`.
-
-Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Metody
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Pokazuje niestandardowe wpisu lub okno dialogowe. Większość implementacji Cordova używać rodzimych okno dialogowe dla tej funkcji, ale niektóre platformy używać przeglądarki `alert` funkcji, która jest zazwyczaj mniej konfigurowalny.
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
-* **wiadomość**: komunikat okna dialogowego. *(String)*
-
-* **alertCallback**: wywołanie zwrotne do wywołania, gdy okno dialogowe alert jest oddalona. *(Funkcja)*
-
-* **tytuł**: okno tytuł. *(String)* (Opcjonalna, domyślnie`Alert`)
-
-* **buttonName**: Nazwa przycisku. *(String)* (Opcjonalna, domyślnie`OK`)
-
-### Przykład
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 i 8 dziwactwa
-
-* Istnieje wpis nie wbudowana przeglądarka, ale można powiązać w następujący sposób na wywołanie `alert()` w globalnym zasięgu:
-
- window.alert = navigator.notification.alert;
-
-
-* Zarówno `alert` i `confirm` są bez blokowania połączeń, których wyniki są tylko dostępne asynchronicznie.
-
-### Firefox OS dziwactwa:
-
-Dostępne są zarówno rodzimych blokuje `window.alert()` i bez blokowania `navigator.notification.alert()`.
-
-### Jeżyna 10 dziwactwa
-
-parametr wywołania zwrotnego `Navigator.Notification.alert ("tekst", wywołanie zwrotne, 'tytuł', 'tekst')` jest przekazywana numer 1.
-
-## navigator.notification.confirm
-
-Wyświetla okno dialogowe potwierdzenia konfigurowalny.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **wiadomość**: komunikat okna dialogowego. *(String)*
-
-* **confirmCallback**: wywołanie zwrotne do wywołania z indeksu z przycisku (1, 2 lub 3), lub gdy okno jest zwolniony bez naciśnij przycisk (0). *(Funkcja)*
-
-* **tytuł**: okno tytuł. *(String)* (Opcjonalna, domyślnie`Confirm`)
-
-* **buttonLabels**: tablica ciągów, określając etykiety przycisków. *(Tablica)* (Opcjonalna, domyślnie [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback` wykonuje, gdy użytkownik naciśnie klawisz jeden z przycisków w oknie dialogowym potwierdzenia.
-
-Wywołanie zwrotne wymaga argumentu `buttonIndex` *(numer)*, który jest indeksem wciśnięty przycisk. Należy zauważyć, że indeks używa, na podstawie jednego indeksowania, więc wartością jest `1`, `2`, `3` itd.
-
-### Przykład
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 i 8 dziwactwa
-
-* Istnieje funkcja wbudowana przeglądarka nie `window.confirm` , ale można go powiązać przypisując:
-
- window.confirm = navigator.notification.confirm;
-
-
-* Wzywa do `alert` i `confirm` są bez blokowania, więc wynik jest tylko dostępnych asynchronicznie.
-
-### Windows dziwactwa
-
-* Na Windows8/8.1 to nie można dodać więcej niż trzy przyciski do instancji MessageDialog.
-
-* Na Windows Phone 8.1 nie jest możliwe wyświetlić okno dialogowe z więcej niż dwoma przyciskami.
-
-### Firefox OS dziwactwa:
-
-Dostępne są zarówno rodzimych blokuje `window.confirm()` i bez blokowania `navigator.notification.confirm()`.
-
-## navigator.notification.prompt
-
-Wyświetla okno dialogowe macierzystego, który bardziej niż przeglądarki `prompt` funkcja.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **message**: komunikat okna dialogowego. *(String)*
-
-* **promptCallback**: wywołanie zwrotne do wywołania z indeksu z przycisku (1, 2 lub 3), lub gdy okno jest zwolniony bez naciśnij przycisk (0). *(Funkcja)*
-
-* **title**: okno tytuł *(String)* (opcjonalna, domyślnie `polecenia`)
-
-* **buttonLabels**: tablica ciągów, określając przycisk etykiety *(tablica)* (opcjonalna, domyślnie `["OK", "Anuluj"]`)
-
-* **defaultText**: domyślnie pole tekstowe wprowadzania wartości (`String`) (opcjonalna, domyślnie: pusty ciąg)
-
-### promptCallback
-
-`promptCallback` wykonuje, gdy użytkownik naciśnie klawisz jeden z przycisków w oknie dialogowym polecenia. Obiektu `results` przekazane do wywołania zwrotnego zawiera następujące właściwości:
-
-* **buttonIndex**: indeks wciśnięty przycisk. *(Liczba)* Należy zauważyć, że indeks używa, na podstawie jednego indeksowania, więc wartością jest `1`, `2`, `3` itd.
-
-* **input1**: Tekst wprowadzony w oknie polecenia. *(String)*
-
-### Przykład
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* Firefox OS
-* iOS
-* Windows Phone 7 i 8
-* Windows 8
-* Windows
-
-### Dziwactwa Androida
-
-* Android obsługuje maksymalnie trzy przyciski i więcej niż to ignoruje.
-
-* Android 3.0 i nowszych przyciski są wyświetlane w kolejności odwrotnej do urządzenia, które używają tematu Holo.
-
-### Windows dziwactwa
-
-* W systemie Windows wierzyciel okno jest oparte na języku html, ze względu na brak takich natywnego api.
-
-### Firefox OS dziwactwa:
-
-Dostępne są zarówno rodzimych blokuje `window.prompt()` i bez blokowania `navigator.notification.prompt()`.
-
-## navigator.notification.beep
-
-Urządzenie odtwarza sygnał ciągły dźwięk.
-
- navigator.notification.beep(times);
-
-
-* **times**: liczba powtórzeń po sygnale. *(Liczba)*
-
-### Przykład
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* iOS
-* Tizen
-* Windows Phone 7 i 8
-* Windows 8
-
-### Amazon ogień OS dziwactwa
-
-* Amazon ogień OS gra domyślny **Dźwięk powiadomienia** określone w panelu **ekranu/ustawienia i dźwięk**.
-
-### Dziwactwa Androida
-
-* Android gra domyślnie **dzwonek powiadomienia** określone w panelu **ustawień/dźwięk i wyświetlacz**.
-
-### Windows Phone 7 i 8 dziwactwa
-
-* Opiera się na pliku rodzajowego sygnał z rozkładu Cordova.
-
-### Dziwactwa Tizen
-
-* Tizen implementuje dźwięków przez odtwarzania pliku audio za pośrednictwem mediów API.
-
-* Plik dźwiękowy muszą być krótkie, musi znajdować się w podkatalogu `dźwięki` w katalogu głównym aplikacji i musi być o nazwie `beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/doc/ru/index.md b/plugins/cordova-plugin-dialogs/doc/ru/index.md
deleted file mode 100644
index 49474ea..0000000
--- a/plugins/cordova-plugin-dialogs/doc/ru/index.md
+++ /dev/null
@@ -1,247 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-Этот плагин обеспечивает доступ к некоторым элементам собственного диалогового окна пользовательского интерфейса.
-
-## Установка
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## Методы
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-Показывает окно пользовательские оповещения или диалоговое окно. Большинство реализаций Cordova использовать диалоговое окно родной для этой функции, но некоторые платформы браузера `alert` функция, которая как правило менее настраивается.
-
- Navigator.Notification.Alert (сообщение, alertCallback, [название], [buttonName])
-
-
-* **сообщение**: сообщение диалога. *(Строка)*
-
-* **alertCallback**: обратного вызова для вызова, когда закрывается диалоговое окно оповещения. *(Функция)*
-
-* **название**: диалоговое окно название. *(Строка)* (Опционально, по умолчанию`Alert`)
-
-* **buttonName**: имя кнопки. *(Строка)* (Опционально, по умолчанию`OK`)
-
-### Пример
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 и 8
-* Windows 8
-
-### Особенности Windows Phone 7 и 8
-
-* Существует предупреждение не встроенный браузер, но можно привязать один следующим позвонить `alert()` в глобальной области действия:
-
- window.alert = navigator.notification.alert;
-
-
-* Оба `alert` и `confirm` являются не блокировка звонков, результаты которых доступны только асинхронно.
-
-### Firefox OS причуды:
-
-Как родной блокировка `window.alert()` и неблокирующий `navigator.notification.alert()` доступны.
-
-## navigator.notification.confirm
-
-Отображает диалоговое окно Настраиваемый подтверждения.
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **сообщение**: сообщение диалога. *(Строка)*
-
-* **confirmCallback**: обратного вызова с индексом кнопка нажата (1, 2 или 3) или когда диалоговое окно закрывается без нажатия кнопки (0). *(Функция)*
-
-* **название**: диалоговое окно название. *(Строка)* (Опционально, по умолчанию`Confirm`)
-
-* **buttonLabels**: массив строк, указав названия кнопок. *(Массив)* (Не обязательно, по умолчанию [ `OK,Cancel` ])
-
-### confirmCallback
-
-`confirmCallback`Выполняется, когда пользователь нажимает одну из кнопок в диалоговом окне подтверждения.
-
-Аргументом функции обратного вызова `buttonIndex` *(номер)*, который является индекс нажатой кнопки. Обратите внимание, что индекс использует единицы индексации, поэтому значение `1` , `2` , `3` , и т.д.
-
-### Пример
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS
-* iOS
-* Tizen
-* Windows Phone 7 и 8
-* Windows 8
-
-### Особенности Windows Phone 7 и 8
-
-* Нет встроенного браузера функция для `window.confirm` , но его можно привязать путем присвоения:
-
- window.confirm = navigator.notification.confirm;
-
-
-* Вызовы `alert` и `confirm` являются не блокируется, поэтому результат доступен только асинхронно.
-
-### Firefox OS причуды:
-
-Как родной блокировка `window.confirm()` и неблокирующий `navigator.notification.confirm()` доступны.
-
-## navigator.notification.prompt
-
-Отображает родной диалоговое окно более настраиваемый, чем в браузере `prompt` функции.
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **сообщение**: сообщение диалога. *(Строка)*
-
-* **promptCallback**: обратного вызова с индексом кнопка нажата (1, 2 или 3) или когда диалоговое окно закрывается без нажатия кнопки (0). *(Функция)*
-
-* **название**: диалоговое окно название *(String)* (опционально, по умолчанию`Prompt`)
-
-* **buttonLabels**: массив строк, указав кнопку этикетки *(массив)* (опционально, по умолчанию`["OK","Cancel"]`)
-
-* **defaultText**: по умолчанию textbox входное значение ( `String` ) (опционально, по умолчанию: пустая строка)
-
-### promptCallback
-
-`promptCallback`Выполняется, когда пользователь нажимает одну из кнопок в диалоговом окне приглашения. `results`Объект, переданный в метод обратного вызова содержит следующие свойства:
-
-* **buttonIndex**: индекс нажатой кнопки. *(Число)* Обратите внимание, что индекс использует единицы индексации, поэтому значение `1` , `2` , `3` , и т.д.
-
-* **INPUT1**: текст, введенный в диалоговом окне приглашения. *(Строка)*
-
-### Пример
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* Firefox OS
-* iOS
-* Windows Phone 7 и 8
-
-### Особенности Android
-
-* Android поддерживает максимум из трех кнопок и игнорирует больше, чем это.
-
-* На Android 3.0 и более поздних версиях кнопки отображаются в обратном порядке для устройств, которые используют тему холо.
-
-### Firefox OS причуды:
-
-Как родной блокировка `window.prompt()` и неблокирующий `navigator.notification.prompt()` доступны.
-
-## navigator.notification.beep
-
-Устройство воспроизводит звуковой сигнал звук.
-
- navigator.notification.beep(times);
-
-
-* **раз**: количество раз, чтобы повторить сигнал. *(Число)*
-
-### Пример
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* iOS
-* Tizen
-* Windows Phone 7 и 8
-* Windows 8
-
-### Особенности Amazon Fire OS
-
-* Amazon Fire OS играет по умолчанию **Звук уведомления** , указанного на панели **параметров/дисплей и звук** .
-
-### Особенности Android
-
-* Android играет по умолчанию **уведомления рингтон** указанных в панели **настройки/звук и дисплей** .
-
-### Особенности Windows Phone 7 и 8
-
-* Опирается на общий звуковой файл из дистрибутива Кордова.
-
-### Особенности Tizen
-
-* Tizen реализует гудков, воспроизведении аудиофайла через СМИ API.
-
-* Звуковой файл должен быть коротким, должен быть расположен в `sounds` подкаталог корневого каталога приложения и должны быть названы`beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/doc/zh/README.md b/plugins/cordova-plugin-dialogs/doc/zh/README.md
deleted file mode 100644
index c8c26c3..0000000
--- a/plugins/cordova-plugin-dialogs/doc/zh/README.md
+++ /dev/null
@@ -1,275 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-dialogs.svg)](https://travis-ci.org/apache/cordova-plugin-dialogs)
-
-這個外掛程式提供對一些本機對話方塊使用者介面元素,通過全球 `navigator.notification` 物件的訪問。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## 方法
-
- * `navigator.notification.alert`
- * `navigator.notification.confirm`
- * `navigator.notification.prompt`
- * `navigator.notification.beep`
-
-## navigator.notification.alert
-
-顯示一個自訂的警報或對話方塊框。 大多數的科爾多瓦實現使用本機的對話方塊為此功能,但某些平臺上使用瀏覽器的 `alert` 功能,這是通常不那麼可自訂。
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
- * **message**: 消息對話方塊。*(String)*
-
- * **alertCallback**: 當警報對話方塊的被解雇時要調用的回檔。*(函數)*
-
- * **title**: 標題對話方塊。*(String)*(可選,預設值為`Alert`)
-
- * **buttonName**: 按鈕名稱。*(字串)*(可選,預設值為`OK`)
-
-### 示例
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Tizen
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 和 8 怪癖
-
- * 有沒有內置瀏覽器警報,但你可以綁定一個,如下所示調用 `alert()` 在全球範圍內:
-
- window.alert = navigator.notification.alert;
-
-
- * 兩個 `alert` 和 `confirm` 的非阻塞的調用,其中的結果才是可用的非同步。
-
-### 火狐瀏覽器作業系統怪癖:
-
-本機阻止 `window.alert()` 和非阻塞的 `navigator.notification.alert()` 都可。
-
-### 黑莓 10 怪癖
-
-`navigator.notification.alert ('message'、 confirmCallback、 'title'、 'buttonLabels')` 回檔參數被傳遞的數位 1。
-
-## navigator.notification.confirm
-
-顯示一個可自訂的確認對話方塊。
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
- * **message**: 消息對話方塊。*(String)*
-
- * **confirmCallback**: 要用索引 (1、 2 或 3) 按下的按鈕,或者在沒有按下按鈕 (0) 駁回了對話方塊中時調用的回檔。*(函數)*
-
- * **title**: 標題對話方塊。*(字串)*(可選,預設值為`Confirm`)
-
- * **buttonLabels**: 指定按鈕標籤的字串陣列。*(陣列)*(可選,預設值為 [ `OK,Cancel` ])
-
-### confirmCallback
-
-當使用者按下確認對話方塊中的按鈕之一時,將執行 `confirmCallback`。
-
-回檔需要參數 `buttonIndex` *(編號)*,即按下的按鈕的索引。 請注意索引使用一個基於索引,因此值 `1`、 `2`、 `3` 等。
-
-### 示例
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 火狐瀏覽器作業系統
- * iOS
- * Tizen
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### Windows Phone 7 和 8 怪癖
-
- * 有沒有內置的瀏覽器功能的 `window.confirm` ,但你可以將它綁定通過分配:
-
- window.confirm = navigator.notification.confirm;
-
-
- * 調用到 `alert` 和 `confirm` 的非阻塞,所以結果就是只可用以非同步方式。
-
-### Windows 的怪癖
-
- * 在 Windows8/8.1 它是不可能將超過三個按鈕添加到 MessageDialog 實例。
-
- * 在 Windows Phone 8.1 它是不可能顯示有超過兩個按鈕的對話方塊。
-
-### 火狐瀏覽器作業系統怪癖:
-
-本機阻止 `window.confirm()` 和非阻塞的 `navigator.notification.confirm()` 都可。
-
-## navigator.notification.prompt
-
-顯示本機的對話方塊,是可定制的比瀏覽器的 `prompt` 功能。
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
- * **message**: 消息對話方塊。*(String)*
-
- * **promptCallback**: 要用指數 (1、 2 或 3) 按下的按鈕或對話方塊中解雇無 (0) 按下一個按鈕時調用的回檔。*(函數)*
-
- * **title**: 標題對話方塊。*(String)*(可選,預設值為`Alert`)
-
- * **buttonLabels**: 指定按鈕標籤 (可選,預設值為 `["OK","Cancel"]` *(陣列)* 的字串陣列)
-
- * **defaultText**: 預設文字方塊中輸入值 (`字串`) (可選,預設值: 空字串)
-
-### promptCallback
-
-當使用者按下其中一個提示對話方塊中的按鈕時,將執行 `promptCallback`。傳遞給回檔的 `results` 物件包含以下屬性:
-
- * **buttonIndex**: 按下的按鈕的索引。*(數)*請注意索引使用一個基於索引,因此值 `1`、 `2`、 `3` 等。
-
- * **input1**: 在提示對話方塊中輸入的文本。*(字串)*
-
-### 示例
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 火狐瀏覽器作業系統
- * iOS
- * Windows Phone 7 和 8
- * Windows 8
- * Windows
-
-### Android 的怪癖
-
- * Android 支援最多的三個按鈕,並忽略任何更多。
-
- * 在 Android 3.0 及更高版本,使用全息主題的設備以相反的順序顯示按鈕。
-
-### Windows 的怪癖
-
- * 在 Windows 上提示對話方塊是基於 html 的缺乏這種本機 api。
-
-### 火狐瀏覽器作業系統怪癖:
-
-本機阻止 `window.prompt()` 和非阻塞的 `navigator.notification.prompt()` 都可。
-
-## navigator.notification.beep
-
-該設備播放提示音的聲音。
-
- navigator.notification.beep(times);
-
-
- * **beep**: 次數重複在嗶嗶聲。*(數)*
-
-### 示例
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * iOS
- * Tizen
- * Windows Phone 7 和 8
- * Windows 8
-
-### 亞馬遜火 OS 怪癖
-
- * 亞馬遜火 OS 播放預設 **設置/顯示和聲音** 板下指定的 **通知聲音**。
-
-### Android 的怪癖
-
- * 安卓系統播放預設 **通知鈴聲** **設置/聲音和顯示** 面板下指定。
-
-### Windows Phone 7 和 8 怪癖
-
- * 依賴于泛型蜂鳴音檔從科爾多瓦分佈。
-
-### Tizen 怪癖
-
- * Tizen 通過播放音訊檔通過媒體 API 實現的蜂鳴聲。
-
- * 蜂鳴音檔必須很短,必須位於應用程式的根目錄中,一個 `聲音` 子目錄和必須將命名為 `beep.wav`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-dialogs/doc/zh/index.md b/plugins/cordova-plugin-dialogs/doc/zh/index.md
deleted file mode 100644
index b47fc5f..0000000
--- a/plugins/cordova-plugin-dialogs/doc/zh/index.md
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-# cordova-plugin-dialogs
-
-這個外掛程式提供對一些本機對話方塊使用者介面元素,通過全球 `navigator.notification` 物件的訪問。
-
-雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(navigator.notification);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-dialogs
-
-
-## 方法
-
-* `navigator.notification.alert`
-* `navigator.notification.confirm`
-* `navigator.notification.prompt`
-* `navigator.notification.beep`
-
-## navigator.notification.alert
-
-顯示一個自訂的警報或對話方塊框。 大多數的科爾多瓦實現使用本機的對話方塊為此功能,但某些平臺上使用瀏覽器的 `alert` 功能,這是通常不那麼可自訂。
-
- navigator.notification.alert(message, alertCallback, [title], [buttonName])
-
-
-* **message**: 消息對話方塊。*(String)*
-
-* **alertCallback**: 當警報對話方塊的被解雇時要調用的回檔。*(函數)*
-
-* **title**: 標題對話方塊。*(String)*(可選,預設值為`Alert`)
-
-* **buttonName**: 按鈕名稱。*(字串)*(可選,預設值為`OK`)
-
-### 示例
-
- function alertDismissed() {
- // do something
- }
-
- navigator.notification.alert(
- 'You are the winner!', // message
- alertDismissed, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
-
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* 火狐瀏覽器作業系統
-* iOS
-* Tizen
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 和 8 怪癖
-
-* 有沒有內置瀏覽器警報,但你可以綁定一個,如下所示調用 `alert()` 在全球範圍內:
-
- window.alert = navigator.notification.alert;
-
-
-* 兩個 `alert` 和 `confirm` 的非阻塞的調用,其中的結果才是可用的非同步。
-
-### 火狐瀏覽器作業系統怪癖:
-
-本機阻止 `window.alert()` 和非阻塞的 `navigator.notification.alert()` 都可。
-
-### 黑莓 10 怪癖
-
-`navigator.notification.alert ('message'、 confirmCallback、 'title'、 'buttonLabels')` 回檔參數被傳遞的數位 1。
-
-## navigator.notification.confirm
-
-顯示一個可自訂的確認對話方塊。
-
- navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
-
-
-* **message**: 消息對話方塊。*(字串)*
-
-* **confirmCallback**: 要用索引 (1、 2 或 3) 按下的按鈕,或者在沒有按下按鈕 (0) 駁回了對話方塊中時調用的回檔。*(函數)*
-
-* **title**: 標題對話方塊。*(字串)*(可選,預設值為`Confirm`)
-
-* **buttonLabels**: 指定按鈕標籤的字串陣列。*(陣列)*(可選,預設值為 [ `OK,Cancel` ])
-
-### confirmCallback
-
-當使用者按下確認對話方塊中的按鈕之一時,將執行 `confirmCallback`。
-
-回檔需要參數 `buttonIndex` *(編號)*,即按下的按鈕的索引。 請注意索引使用一個基於索引,因此值 `1`、 `2`、 `3` 等。
-
-### 示例
-
- function onConfirm(buttonIndex) {
- alert('You selected button ' + buttonIndex);
- }
-
- navigator.notification.confirm(
- 'You are the winner!', // message
- onConfirm, // callback to invoke with index of button pressed
- 'Game Over', // title
- ['Restart','Exit'] // buttonLabels
- );
-
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* 火狐瀏覽器作業系統
-* iOS
-* Tizen
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### Windows Phone 7 和 8 怪癖
-
-* 有沒有內置的瀏覽器功能的 `window.confirm` ,但你可以將它綁定通過分配:
-
- window.confirm = navigator.notification.confirm;
-
-
-* 調用到 `alert` 和 `confirm` 的非阻塞,所以結果就是只可用以非同步方式。
-
-### Windows 的怪癖
-
-* 在 Windows8/8.1 它是不可能將超過三個按鈕添加到 MessageDialog 實例。
-
-* 在 Windows Phone 8.1 它是不可能顯示有超過兩個按鈕的對話方塊。
-
-### 火狐瀏覽器作業系統怪癖:
-
-本機阻止 `window.confirm()` 和非阻塞的 `navigator.notification.confirm()` 都可。
-
-## navigator.notification.prompt
-
-顯示本機的對話方塊,是可定制的比瀏覽器的 `prompt` 功能。
-
- navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])
-
-
-* **message**: 消息對話方塊。*(String)*
-
-* **promptCallback**: 要用指數 (1、 2 或 3) 按下的按鈕或對話方塊中解雇無 (0) 按下一個按鈕時調用的回檔。*(函數)*
-
-* **title**: 標題對話方塊。*(String)*(可選,預設值為`Alert`)
-
-* **buttonLabels**: 指定按鈕標籤 (可選,預設值為 `["OK","Cancel"]` *(陣列)* 的字串陣列)
-
-* **defaultText**: 預設文字方塊中輸入值 (`字串`) (可選,預設值: 空字串)
-
-### promptCallback
-
-當使用者按下其中一個提示對話方塊中的按鈕時,將執行 `promptCallback`。傳遞給回檔的 `results` 物件包含以下屬性:
-
-* **buttonIndex**: 按下的按鈕的索引。*(數)*請注意索引使用一個基於索引,因此值 `1`、 `2`、 `3` 等。
-
-* **input1**: 在提示對話方塊中輸入的文本。*(字串)*
-
-### 示例
-
- function onPrompt(results) {
- alert("You selected button number " + results.buttonIndex + " and entered " + results.input1);
- }
-
- navigator.notification.prompt(
- 'Please enter your name', // message
- onPrompt, // callback to invoke
- 'Registration', // title
- ['Ok','Exit'], // buttonLabels
- 'Jane Doe' // defaultText
- );
-
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 火狐瀏覽器作業系統
-* iOS
-* Windows Phone 7 和 8
-* Windows 8
-* Windows
-
-### Android 的怪癖
-
-* Android 支援最多的三個按鈕,並忽略任何更多。
-
-* 在 Android 3.0 及更高版本,使用全息主題的設備以相反的順序顯示按鈕。
-
-### Windows 的怪癖
-
-* 在 Windows 上提示對話方塊是基於 html 的缺乏這種本機 api。
-
-### 火狐瀏覽器作業系統怪癖:
-
-本機阻止 `window.prompt()` 和非阻塞的 `navigator.notification.prompt()` 都可。
-
-## navigator.notification.beep
-
-該設備播放提示音的聲音。
-
- navigator.notification.beep(times);
-
-
-* **beep**: 次數重複在嗶嗶聲。*(數)*
-
-### 示例
-
- // Beep twice!
- navigator.notification.beep(2);
-
-
-### 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* iOS
-* Tizen
-* Windows Phone 7 和 8
-* Windows 8
-
-### 亞馬遜火 OS 怪癖
-
-* 亞馬遜火 OS 播放預設 **設置/顯示和聲音** 板下指定的 **通知聲音**。
-
-### Android 的怪癖
-
-* 安卓系統播放預設 **通知鈴聲** **設置/聲音和顯示** 面板下指定。
-
-### Windows Phone 7 和 8 怪癖
-
-* 依賴于泛型蜂鳴音檔從科爾多瓦分佈。
-
-### Tizen 怪癖
-
-* Tizen 通過播放音訊檔通過媒體 API 實現的蜂鳴聲。
-
-* 蜂鳴音檔必須很短,必須位於應用程式的根目錄中,一個 `聲音` 子目錄和必須將命名為 `beep.wav`.
diff --git a/plugins/cordova-plugin-dialogs/package.json b/plugins/cordova-plugin-dialogs/package.json
deleted file mode 100644
index 9400082..0000000
--- a/plugins/cordova-plugin-dialogs/package.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "name": "cordova-plugin-dialogs",
- "version": "1.2.1",
- "description": "Cordova Notification Plugin",
- "cordova": {
- "id": "cordova-plugin-dialogs",
- "platforms": [
- "firefoxos",
- "android",
- "browser",
- "amazon-fireos",
- "ubuntu",
- "ios",
- "blackberry10",
- "wp7",
- "wp8",
- "windows8",
- "windows"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-plugin-dialogs"
- },
- "keywords": [
- "cordova",
- "notification",
- "ecosystem:cordova",
- "cordova-firefoxos",
- "cordova-android",
- "cordova-browser",
- "cordova-amazon-fireos",
- "cordova-ubuntu",
- "cordova-ios",
- "cordova-blackberry10",
- "cordova-wp7",
- "cordova-wp8",
- "cordova-windows8",
- "cordova-windows"
- ],
- "scripts": {
- "test": "npm run jshint",
- "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
- },
- "author": "Apache Software Foundation",
- "license": "Apache-2.0",
- "devDependencies": {
- "jshint": "^2.6.0"
- }
-}
diff --git a/plugins/cordova-plugin-dialogs/plugin.xml b/plugins/cordova-plugin-dialogs/plugin.xml
deleted file mode 100644
index 62d23c9..0000000
--- a/plugins/cordova-plugin-dialogs/plugin.xml
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
- Notification
- Cordova Notification Plugin
- Apache 2.0
- cordova,notification
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
- https://issues.apache.org/jira/browse/CB/component/12320642
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-dialogs/src/android/Notification.java b/plugins/cordova-plugin-dialogs/src/android/Notification.java
deleted file mode 100644
index 9be56c0..0000000
--- a/plugins/cordova-plugin-dialogs/src/android/Notification.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.dialogs;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
-import org.apache.cordova.PluginResult;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.annotation.SuppressLint;
-import android.app.AlertDialog;
-import android.app.AlertDialog.Builder;
-import android.app.ProgressDialog;
-import android.content.DialogInterface;
-import android.media.Ringtone;
-import android.media.RingtoneManager;
-import android.net.Uri;
-import android.widget.EditText;
-import android.widget.TextView;
-
-
-/**
- * This class provides access to notifications on the device.
- *
- * Be aware that this implementation gets called on
- * navigator.notification.{alert|confirm|prompt}, and that there is a separate
- * implementation in org.apache.cordova.CordovaChromeClient that gets
- * called on a simple window.{alert|confirm|prompt}.
- */
-public class Notification extends CordovaPlugin {
-
- private static final String LOG_TAG = "Notification";
-
- public int confirmResult = -1;
- public ProgressDialog spinnerDialog = null;
- public ProgressDialog progressDialog = null;
-
- /**
- * Constructor.
- */
- public Notification() {
- }
-
- /**
- * Executes the request and returns PluginResult.
- *
- * @param action The action to execute.
- * @param args JSONArray of arguments for the plugin.
- * @param callbackContext The callback context used when calling back into JavaScript.
- * @return True when the action was valid, false otherwise.
- */
- public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
- /*
- * Don't run any of these if the current activity is finishing
- * in order to avoid android.view.WindowManager$BadTokenException
- * crashing the app. Just return true here since false should only
- * be returned in the event of an invalid action.
- */
- if(this.cordova.getActivity().isFinishing()) return true;
-
- if (action.equals("beep")) {
- this.beep(args.getLong(0));
- }
- else if (action.equals("alert")) {
- this.alert(args.getString(0), args.getString(1), args.getString(2), callbackContext);
- return true;
- }
- else if (action.equals("confirm")) {
- this.confirm(args.getString(0), args.getString(1), args.getJSONArray(2), callbackContext);
- return true;
- }
- else if (action.equals("prompt")) {
- this.prompt(args.getString(0), args.getString(1), args.getJSONArray(2), args.getString(3), callbackContext);
- return true;
- }
- else if (action.equals("activityStart")) {
- this.activityStart(args.getString(0), args.getString(1));
- }
- else if (action.equals("activityStop")) {
- this.activityStop();
- }
- else if (action.equals("progressStart")) {
- this.progressStart(args.getString(0), args.getString(1));
- }
- else if (action.equals("progressValue")) {
- this.progressValue(args.getInt(0));
- }
- else if (action.equals("progressStop")) {
- this.progressStop();
- }
- else {
- return false;
- }
-
- // Only alert and confirm are async.
- callbackContext.success();
- return true;
- }
-
- //--------------------------------------------------------------------------
- // LOCAL METHODS
- //--------------------------------------------------------------------------
-
- /**
- * Beep plays the default notification ringtone.
- *
- * @param count Number of times to play notification
- */
- public void beep(final long count) {
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
- Ringtone notification = RingtoneManager.getRingtone(cordova.getActivity().getBaseContext(), ringtone);
-
- // If phone is not set to silent mode
- if (notification != null) {
- for (long i = 0; i < count; ++i) {
- notification.play();
- long timeout = 5000;
- while (notification.isPlaying() && (timeout > 0)) {
- timeout = timeout - 100;
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- }
- }
- }
- }
- }
- });
- }
-
- /**
- * Builds and shows a native Android alert with given Strings
- * @param message The message the alert should display
- * @param title The title of the alert
- * @param buttonLabel The label of the button
- * @param callbackContext The callback context
- */
- public synchronized void alert(final String message, final String title, final String buttonLabel, final CallbackContext callbackContext) {
- final CordovaInterface cordova = this.cordova;
-
- Runnable runnable = new Runnable() {
- public void run() {
-
- AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- dlg.setMessage(message);
- dlg.setTitle(title);
- dlg.setCancelable(true);
- dlg.setPositiveButton(buttonLabel,
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, 0));
- }
- });
- dlg.setOnCancelListener(new AlertDialog.OnCancelListener() {
- public void onCancel(DialogInterface dialog)
- {
- dialog.dismiss();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, 0));
- }
- });
-
- changeTextDirection(dlg);
- };
- };
- this.cordova.getActivity().runOnUiThread(runnable);
- }
-
- /**
- * Builds and shows a native Android confirm dialog with given title, message, buttons.
- * This dialog only shows up to 3 buttons. Any labels after that will be ignored.
- * The index of the button pressed will be returned to the JavaScript callback identified by callbackId.
- *
- * @param message The message the dialog should display
- * @param title The title of the dialog
- * @param buttonLabels A comma separated list of button labels (Up to 3 buttons)
- * @param callbackContext The callback context.
- */
- public synchronized void confirm(final String message, final String title, final JSONArray buttonLabels, final CallbackContext callbackContext) {
- final CordovaInterface cordova = this.cordova;
-
- Runnable runnable = new Runnable() {
- public void run() {
- AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- dlg.setMessage(message);
- dlg.setTitle(title);
- dlg.setCancelable(true);
-
- // First button
- if (buttonLabels.length() > 0) {
- try {
- dlg.setNegativeButton(buttonLabels.getString(0),
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, 1));
- }
- });
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on first button.");
- }
- }
-
- // Second button
- if (buttonLabels.length() > 1) {
- try {
- dlg.setNeutralButton(buttonLabels.getString(1),
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, 2));
- }
- });
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on second button.");
- }
- }
-
- // Third button
- if (buttonLabels.length() > 2) {
- try {
- dlg.setPositiveButton(buttonLabels.getString(2),
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, 3));
- }
- });
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on third button.");
- }
- }
- dlg.setOnCancelListener(new AlertDialog.OnCancelListener() {
- public void onCancel(DialogInterface dialog)
- {
- dialog.dismiss();
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, 0));
- }
- });
-
- changeTextDirection(dlg);
- };
- };
- this.cordova.getActivity().runOnUiThread(runnable);
- }
-
- /**
- * Builds and shows a native Android prompt dialog with given title, message, buttons.
- * This dialog only shows up to 3 buttons. Any labels after that will be ignored.
- * The following results are returned to the JavaScript callback identified by callbackId:
- * buttonIndex Index number of the button selected
- * input1 The text entered in the prompt dialog box
- *
- * @param message The message the dialog should display
- * @param title The title of the dialog
- * @param buttonLabels A comma separated list of button labels (Up to 3 buttons)
- * @param callbackContext The callback context.
- */
- public synchronized void prompt(final String message, final String title, final JSONArray buttonLabels, final String defaultText, final CallbackContext callbackContext) {
-
- final CordovaInterface cordova = this.cordova;
-
- Runnable runnable = new Runnable() {
- public void run() {
- final EditText promptInput = new EditText(cordova.getActivity());
- promptInput.setHint(defaultText);
- AlertDialog.Builder dlg = createDialog(cordova); // new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- dlg.setMessage(message);
- dlg.setTitle(title);
- dlg.setCancelable(true);
-
- dlg.setView(promptInput);
-
- final JSONObject result = new JSONObject();
-
- // First button
- if (buttonLabels.length() > 0) {
- try {
- dlg.setNegativeButton(buttonLabels.getString(0),
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- try {
- result.put("buttonIndex",1);
- result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on first button.", e);
- }
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
- }
- });
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on first button.");
- }
- }
-
- // Second button
- if (buttonLabels.length() > 1) {
- try {
- dlg.setNeutralButton(buttonLabels.getString(1),
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- try {
- result.put("buttonIndex",2);
- result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on second button.", e);
- }
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
- }
- });
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on second button.");
- }
- }
-
- // Third button
- if (buttonLabels.length() > 2) {
- try {
- dlg.setPositiveButton(buttonLabels.getString(2),
- new AlertDialog.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- try {
- result.put("buttonIndex",3);
- result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on third button.", e);
- }
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
- }
- });
- } catch (JSONException e) {
- LOG.d(LOG_TAG,"JSONException on third button.");
- }
- }
- dlg.setOnCancelListener(new AlertDialog.OnCancelListener() {
- public void onCancel(DialogInterface dialog){
- dialog.dismiss();
- try {
- result.put("buttonIndex",0);
- result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
- } catch (JSONException e) { e.printStackTrace(); }
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
- }
- });
-
- changeTextDirection(dlg);
- };
- };
- this.cordova.getActivity().runOnUiThread(runnable);
- }
-
- /**
- * Show the spinner.
- *
- * @param title Title of the dialog
- * @param message The message of the dialog
- */
- public synchronized void activityStart(final String title, final String message) {
- if (this.spinnerDialog != null) {
- this.spinnerDialog.dismiss();
- this.spinnerDialog = null;
- }
- final Notification notification = this;
- final CordovaInterface cordova = this.cordova;
- Runnable runnable = new Runnable() {
- public void run() {
- notification.spinnerDialog = createProgressDialog(cordova); // new ProgressDialog(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- notification.spinnerDialog.setTitle(title);
- notification.spinnerDialog.setMessage(message);
- notification.spinnerDialog.setCancelable(true);
- notification.spinnerDialog.setIndeterminate(true);
- notification.spinnerDialog.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- notification.spinnerDialog = null;
- }
- });
- notification.spinnerDialog.show();
- }
- };
- this.cordova.getActivity().runOnUiThread(runnable);
- }
-
- /**
- * Stop spinner.
- */
- public synchronized void activityStop() {
- if (this.spinnerDialog != null) {
- this.spinnerDialog.dismiss();
- this.spinnerDialog = null;
- }
- }
-
- /**
- * Show the progress dialog.
- *
- * @param title Title of the dialog
- * @param message The message of the dialog
- */
- public synchronized void progressStart(final String title, final String message) {
- if (this.progressDialog != null) {
- this.progressDialog.dismiss();
- this.progressDialog = null;
- }
- final Notification notification = this;
- final CordovaInterface cordova = this.cordova;
- Runnable runnable = new Runnable() {
- public void run() {
- notification.progressDialog = createProgressDialog(cordova); // new ProgressDialog(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- notification.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
- notification.progressDialog.setTitle(title);
- notification.progressDialog.setMessage(message);
- notification.progressDialog.setCancelable(true);
- notification.progressDialog.setMax(100);
- notification.progressDialog.setProgress(0);
- notification.progressDialog.setOnCancelListener(
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- notification.progressDialog = null;
- }
- });
- notification.progressDialog.show();
- }
- };
- this.cordova.getActivity().runOnUiThread(runnable);
- }
-
- /**
- * Set value of progress bar.
- *
- * @param value 0-100
- */
- public synchronized void progressValue(int value) {
- if (this.progressDialog != null) {
- this.progressDialog.setProgress(value);
- }
- }
-
- /**
- * Stop progress dialog.
- */
- public synchronized void progressStop() {
- if (this.progressDialog != null) {
- this.progressDialog.dismiss();
- this.progressDialog = null;
- }
- }
-
- @SuppressLint("NewApi")
- private AlertDialog.Builder createDialog(CordovaInterface cordova) {
- int currentapiVersion = android.os.Build.VERSION.SDK_INT;
- if (currentapiVersion >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- return new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- } else {
- return new AlertDialog.Builder(cordova.getActivity());
- }
- }
-
- @SuppressLint("InlinedApi")
- private ProgressDialog createProgressDialog(CordovaInterface cordova) {
- int currentapiVersion = android.os.Build.VERSION.SDK_INT;
- if (currentapiVersion >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- return new ProgressDialog(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
- } else {
- return new ProgressDialog(cordova.getActivity());
- }
- }
-
- @SuppressLint("NewApi")
- private void changeTextDirection(Builder dlg){
- int currentapiVersion = android.os.Build.VERSION.SDK_INT;
- dlg.create();
- AlertDialog dialog = dlg.show();
- if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
- TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
- messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
- }
- }
-}
diff --git a/plugins/cordova-plugin-dialogs/src/blackberry10/index.js b/plugins/cordova-plugin-dialogs/src/blackberry10/index.js
deleted file mode 100644
index 4969a77..0000000
--- a/plugins/cordova-plugin-dialogs/src/blackberry10/index.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-* Copyright 2013 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-/* global qnx, PluginResult */
-
-function showDialog(args, dialogType, result) {
- //Unpack and map the args
- var msg = JSON.parse(decodeURIComponent(args[0])),
- title = JSON.parse(decodeURIComponent(args[1])),
- btnLabel = JSON.parse(decodeURIComponent(args[2]));
-
- if (!Array.isArray(btnLabel)) {
- //Converts to array for (string) and (string,string, ...) cases
- btnLabel = btnLabel.split(",");
- }
-
- if (msg && typeof msg === "string") {
- msg = msg.replace(/^"|"$/g, "").replace(/\\"/g, '"');
- } else {
- result.error("message is undefined");
- return;
- }
-
- var messageObj = {
- title : title,
- htmlmessage : msg,
- dialogType : dialogType,
- optionalButtons : btnLabel
- };
-
- //TODO replace with getOverlayWebview() when available in webplatform
- qnx.webplatform.getWebViews()[2].dialog.show(messageObj, function (data) {
- if (typeof data === "number") {
- //Confirm dialog call back needs to be called with one-based indexing [1,2,3 etc]
- result.callbackOk(++data, false);
- } else {
- //Prompt dialog callback expects object
- result.callbackOk({
- buttonIndex: data.ok ? 1 : 0,
- input1: (data.oktext) ? decodeURIComponent(data.oktext) : ""
- }, false);
- }
- });
-
- result.noResult(true);
-}
-
-module.exports = {
- alert: function (success, fail, args, env) {
- var result = new PluginResult(args, env);
-
- if (Object.keys(args).length < 3) {
- result.error("Notification action - alert arguments not found.");
- } else {
- showDialog(args, "CustomAsk", result);
- }
- },
- confirm: function (success, fail, args, env) {
- var result = new PluginResult(args, env);
-
- if (Object.keys(args).length < 3) {
- result.error("Notification action - confirm arguments not found.");
- } else {
- showDialog(args, "CustomAsk", result);
- }
- },
- prompt: function (success, fail, args, env) {
- var result = new PluginResult(args, env);
-
- if (Object.keys(args).length < 3) {
- result.error("Notification action - prompt arguments not found.");
- } else {
- showDialog(args, "JavaScriptPrompt", result);
- }
- }
-};
diff --git a/plugins/cordova-plugin-dialogs/src/firefoxos/notification.js b/plugins/cordova-plugin-dialogs/src/firefoxos/notification.js
deleted file mode 100644
index aea562d..0000000
--- a/plugins/cordova-plugin-dialogs/src/firefoxos/notification.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var modulemapper = require('cordova/modulemapper');
-
-
-var origOpenFunc = modulemapper.getOriginalSymbol(window, 'window.open');
-
-
-function _empty() {}
-
-
-function modal(message, callback, title, buttonLabels, domObjects) {
- var mainWindow = window;
- var modalWindow = origOpenFunc();
- var modalDocument = modalWindow.document;
-
- modalDocument.write(
- '' +
- '' +
- '' +
- '');
-
- var box = modalDocument.createElement('form');
- box.setAttribute('role', 'dialog');
- // prepare and append empty section
- var section = modalDocument.createElement('section');
- box.appendChild(section);
- // add title
- var boxtitle = modalDocument.createElement('h1');
- boxtitle.appendChild(modalDocument.createTextNode(title));
- section.appendChild(boxtitle);
- // add message
- var boxMessage = modalDocument.createElement('p');
- boxMessage.appendChild(modalDocument.createTextNode(message));
- section.appendChild(boxMessage);
- // inject what's needed
- if (domObjects) {
- section.appendChild(domObjects);
- }
- // add buttons and assign callbackButton on click
- var menu = modalDocument.createElement('menu');
- box.appendChild(menu);
- for (var index = 0; index < buttonLabels.length; index++) {
- // TODO: last button listens to the cancel key
- addButton(buttonLabels[index], (index+1), (index === 0));
- }
- modalDocument.body.appendChild(box);
-
- function addButton(label, index, recommended) {
- var thisButtonCallback = makeCallbackButton(index + 1);
- var button = modalDocument.createElement('button');
- button.appendChild(modalDocument.createTextNode(label));
- button.addEventListener('click', thisButtonCallback, false);
- if (recommended) {
- // TODO: default one listens to Enter key
- button.classList.add('recommend');
- }
- menu.appendChild(button);
- }
-
- // TODO: onUnload listens to the cancel key
- function onUnload() {
- var result = 0;
- if (modalDocument.getElementById('prompt-input')) {
- result = {
- input1: '',
- buttonIndex: 0
- };
- }
- mainWindow.setTimeout(function() {
- callback(result);
- }, 10);
- }
- modalWindow.addEventListener('unload', onUnload, false);
-
- // call callback and destroy modal
- function makeCallbackButton(labelIndex) {
- return function() {
- if (modalWindow) {
- modalWindow.removeEventListener('unload', onUnload, false);
- modalWindow.close();
- }
- // checking if prompt
- var promptInput = modalDocument.getElementById('prompt-input');
- var response;
- if (promptInput) {
- response = {
- input1: promptInput.value,
- buttonIndex: labelIndex
- };
- }
- response = response || labelIndex;
- callback(response);
- };
- }
-}
-
-var Notification = {
- vibrate: function(milliseconds) {
- navigator.vibrate(milliseconds);
- },
- alert: function(successCallback, errorCallback, args) {
- var message = args[0];
- var title = args[1];
- var _buttonLabels = [args[2]];
- var _callback = (successCallback || _empty);
- modal(message, _callback, title, _buttonLabels);
- },
- confirm: function(successCallback, errorCallback, args) {
- var message = args[0];
- var title = args[1];
- var buttonLabels = args[2];
- var _callback = (successCallback || _empty);
- modal(message, _callback, title, buttonLabels);
- },
- prompt: function(successCallback, errorCallback, args) {
- var message = args[0];
- var title = args[1];
- var buttonLabels = args[2];
- var defaultText = args[3];
- var inputParagraph = document.createElement('p');
- inputParagraph.classList.add('input');
- var inputElement = document.createElement('input');
- inputElement.setAttribute('type', 'text');
- inputElement.id = 'prompt-input';
- if (defaultText) {
- inputElement.setAttribute('placeholder', defaultText);
- }
- inputParagraph.appendChild(inputElement);
- modal(message, successCallback, title, buttonLabels, inputParagraph);
- }
-};
-
-
-module.exports = Notification;
-require('cordova/exec/proxy').add('Notification', Notification);
diff --git a/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.bundle/beep.wav b/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.bundle/beep.wav
deleted file mode 100644
index 05f5997..0000000
Binary files a/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.bundle/beep.wav and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.h b/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.h
deleted file mode 100644
index 9253f6a..0000000
--- a/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import
-#import
-
-@interface CDVNotification : CDVPlugin {}
-
-- (void)alert:(CDVInvokedUrlCommand*)command;
-- (void)confirm:(CDVInvokedUrlCommand*)command;
-- (void)prompt:(CDVInvokedUrlCommand*)command;
-- (void)beep:(CDVInvokedUrlCommand*)command;
-
-@end
-
-@interface CDVAlertView : UIAlertView {}
-@property (nonatomic, copy) NSString* callbackId;
-
-@end
diff --git a/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.m b/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.m
deleted file mode 100644
index d1f1e33..0000000
--- a/plugins/cordova-plugin-dialogs/src/ios/CDVNotification.m
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVNotification.h"
-
-#define DIALOG_TYPE_ALERT @"alert"
-#define DIALOG_TYPE_PROMPT @"prompt"
-
-static void soundCompletionCallback(SystemSoundID ssid, void* data);
-static NSMutableArray *alertList = nil;
-
-@implementation CDVNotification
-
-/*
- * showDialogWithMessage - Common method to instantiate the alert view for alert, confirm, and prompt notifications.
- * Parameters:
- * message The alert view message.
- * title The alert view title.
- * buttons The array of customized strings for the buttons.
- * defaultText The input text for the textbox (if textbox exists).
- * callbackId The commmand callback id.
- * dialogType The type of alert view [alert | prompt].
- */
-- (void)showDialogWithMessage:(NSString*)message title:(NSString*)title buttons:(NSArray*)buttons defaultText:(NSString*)defaultText callbackId:(NSString*)callbackId dialogType:(NSString*)dialogType
-{
-
- int count = (int)[buttons count];
-#ifdef __IPHONE_8_0
- if (NSClassFromString(@"UIAlertController")) {
-
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
-
- if ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.3) {
-
- CGRect alertFrame = [UIScreen mainScreen].applicationFrame;
-
- if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
- // swap the values for the app frame since it is now in landscape
- CGFloat temp = alertFrame.size.width;
- alertFrame.size.width = alertFrame.size.height;
- alertFrame.size.height = temp;
- }
-
- alertController.view.frame = alertFrame;
- }
-
- __weak CDVNotification* weakNotif = self;
-
- for (int n = 0; n < count; n++) {
- [alertController addAction:[UIAlertAction actionWithTitle:[buttons objectAtIndex:n]
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action)
- {
- CDVPluginResult* result;
-
- if ([dialogType isEqualToString:DIALOG_TYPE_PROMPT])
- {
- NSString* value0 = [[alertController.textFields objectAtIndex:0] text];
- NSDictionary* info = @{
- @"buttonIndex":@(n + 1),
- @"input1":(value0 ? value0 : [NSNull null])
- };
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:info];
- }
- else
- {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)(n + 1)];
- }
-
- [weakNotif.commandDelegate sendPluginResult:result callbackId:callbackId];
- }]];
- }
-
- if ([dialogType isEqualToString:DIALOG_TYPE_PROMPT]) {
-
- [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
- textField.text = defaultText;
- }];
- }
-
- if(!alertList)
- alertList = [[NSMutableArray alloc] init];
- [alertList addObject:alertController];
-
- if ([alertList count]==1) {
- [self presentAlertcontroller];
- }
-
- }
- else
- {
-#endif
-
- CDVAlertView* alertView = [[CDVAlertView alloc]
- initWithTitle:title
- message:message
- delegate:self
- cancelButtonTitle:nil
- otherButtonTitles:nil];
-
- alertView.callbackId = callbackId;
-
-
-
- for (int n = 0; n < count; n++) {
- [alertView addButtonWithTitle:[buttons objectAtIndex:n]];
- }
-
- if ([dialogType isEqualToString:DIALOG_TYPE_PROMPT]) {
- alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
- UITextField* textField = [alertView textFieldAtIndex:0];
- textField.text = defaultText;
- }
-
- [alertView show];
-#ifdef __IPHONE_8_0
- }
-#endif
-
-}
-
-- (void)alert:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSString* message = [command argumentAtIndex:0];
- NSString* title = [command argumentAtIndex:1];
- NSString* buttons = [command argumentAtIndex:2];
-
- [self showDialogWithMessage:message title:title buttons:@[buttons] defaultText:nil callbackId:callbackId dialogType:DIALOG_TYPE_ALERT];
-}
-
-- (void)confirm:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSString* message = [command argumentAtIndex:0];
- NSString* title = [command argumentAtIndex:1];
- NSArray* buttons = [command argumentAtIndex:2];
-
- [self showDialogWithMessage:message title:title buttons:buttons defaultText:nil callbackId:callbackId dialogType:DIALOG_TYPE_ALERT];
-}
-
-- (void)prompt:(CDVInvokedUrlCommand*)command
-{
- NSString* callbackId = command.callbackId;
- NSString* message = [command argumentAtIndex:0];
- NSString* title = [command argumentAtIndex:1];
- NSArray* buttons = [command argumentAtIndex:2];
- NSString* defaultText = [command argumentAtIndex:3];
-
- [self showDialogWithMessage:message title:title buttons:buttons defaultText:defaultText callbackId:callbackId dialogType:DIALOG_TYPE_PROMPT];
-}
-
-/**
- * Callback invoked when an alert dialog's buttons are clicked.
- */
-- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
-{
- CDVAlertView* cdvAlertView = (CDVAlertView*)alertView;
- CDVPluginResult* result;
-
- // Determine what gets returned to JS based on the alert view type.
- if (alertView.alertViewStyle == UIAlertViewStyleDefault) {
- // For alert and confirm, return button index as int back to JS.
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)(buttonIndex + 1)];
- } else {
- // For prompt, return button index and input text back to JS.
- NSString* value0 = [[alertView textFieldAtIndex:0] text];
- NSDictionary* info = @{
- @"buttonIndex":@(buttonIndex + 1),
- @"input1":(value0 ? value0 : [NSNull null])
- };
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:info];
- }
- [self.commandDelegate sendPluginResult:result callbackId:cdvAlertView.callbackId];
-}
-
-static void playBeep(int count) {
- SystemSoundID completeSound;
- NSInteger cbDataCount = count;
- NSURL* audioPath = [[NSBundle mainBundle] URLForResource:@"CDVNotification.bundle/beep" withExtension:@"wav"];
- #if __has_feature(objc_arc)
- AudioServicesCreateSystemSoundID((__bridge CFURLRef)audioPath, &completeSound);
- #else
- AudioServicesCreateSystemSoundID((CFURLRef)audioPath, &completeSound);
- #endif
- AudioServicesAddSystemSoundCompletion(completeSound, NULL, NULL, soundCompletionCallback, (void*)(cbDataCount-1));
- AudioServicesPlaySystemSound(completeSound);
-}
-
-static void soundCompletionCallback(SystemSoundID ssid, void* data) {
- int count = (int)data;
- AudioServicesRemoveSystemSoundCompletion (ssid);
- AudioServicesDisposeSystemSoundID(ssid);
- if (count > 0) {
- playBeep(count);
- }
-}
-
-- (void)beep:(CDVInvokedUrlCommand*)command
-{
- NSNumber* count = [command argumentAtIndex:0 withDefault:[NSNumber numberWithInt:1]];
- playBeep([count intValue]);
-}
-
--(UIViewController *)getTopPresentedViewController {
- UIViewController *presentingViewController = self.viewController;
- while(presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController isBeingDismissed])
- {
- presentingViewController = presentingViewController.presentedViewController;
- }
- return presentingViewController;
-}
-
--(void)presentAlertcontroller {
-
- __weak CDVNotification* weakNotif = self;
- [self.getTopPresentedViewController presentViewController:[alertList firstObject] animated:YES completion:^{
- [alertList removeObject:[alertList firstObject]];
- if ([alertList count]>0) {
- [weakNotif presentAlertcontroller];
- }
- }];
-
-}
-
-@end
-
-@implementation CDVAlertView
-
-@synthesize callbackId;
-
-@end
diff --git a/plugins/cordova-plugin-dialogs/src/ubuntu/notification.cpp b/plugins/cordova-plugin-dialogs/src/ubuntu/notification.cpp
deleted file mode 100644
index d0adf89..0000000
--- a/plugins/cordova-plugin-dialogs/src/ubuntu/notification.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "notification.h"
-
-#include
-
-void Dialogs::beep(int scId, int ecId, int times) {
- Q_UNUSED(scId)
- Q_UNUSED(ecId)
- Q_UNUSED(times)
-
- _player.setVolume(100);
- _player.setMedia(QUrl::fromLocalFile("/usr/share/sounds/ubuntu/stereo/bell.ogg"));
- _player.play();
-}
-
-void Dialogs::alert(int scId, int ecId, const QString &message, const QString &title, const QString &buttonLabel) {
- QStringList list;
- list.append(buttonLabel);
-
- confirm(scId, ecId, message, title, list);
-}
-
-void Dialogs::confirm(int scId, int ecId, const QString &message, const QString &title, const QStringList &buttonLabels) {
- Q_UNUSED(ecId);
-
- if (_alertCallback) {
- qCritical() << "can't open second dialog";
- return;
- }
- _alertCallback = scId;
-
- QString s1, s2, s3;
- if (buttonLabels.size() > 0)
- s1 = buttonLabels[0];
- if (buttonLabels.size() > 1)
- s2 = buttonLabels[1];
- if (buttonLabels.size() > 2)
- s3 = buttonLabels[2];
-
- QString path = m_cordova->get_app_dir() + "/../qml/notification.qml";
- QString qml = QString("PopupUtils.open(%1, root, { root: root, cordova: cordova, title: %2, text: %3, promptVisible: false, button1Text: %4, button2Text: %5, button3Text: %6 })")
- .arg(CordovaInternal::format(path)).arg(CordovaInternal::format(title)).arg(CordovaInternal::format(message))
- .arg(CordovaInternal::format(s1)).arg(CordovaInternal::format(s2)).arg(CordovaInternal::format(s3));
-
- m_cordova->execQML(qml);
-}
-
-void Dialogs::prompt(int scId, int ecId, const QString &message, const QString &title, const QStringList &buttonLabels, const QString &defaultText) {
- Q_UNUSED(ecId);
-
- if (_alertCallback) {
- qCritical() << "can't open second dialog";
- return;
- }
- _alertCallback = scId;
-
- QString s1, s2, s3;
- if (buttonLabels.size() > 0)
- s1 = buttonLabels[0];
- if (buttonLabels.size() > 1)
- s2 = buttonLabels[1];
- if (buttonLabels.size() > 2)
- s3 = buttonLabels[2];
- QString path = m_cordova->get_app_dir() + "/../qml/notification.qml";
- QString qml = QString("PopupUtils.open(%1, root, { root: root, cordova: cordova, title: %2, text: %3, promptVisible: true, defaultPromptText: %7, button1Text: %4, button2Text: %5, button3Text: %6 })")
- .arg(CordovaInternal::format(path)).arg(CordovaInternal::format(title)).arg(CordovaInternal::format(message))
- .arg(CordovaInternal::format(s1)).arg(CordovaInternal::format(s2))
- .arg(CordovaInternal::format(s3)).arg(CordovaInternal::format(defaultText));
-
- m_cordova->execQML(qml);
-}
diff --git a/plugins/cordova-plugin-dialogs/src/ubuntu/notification.h b/plugins/cordova-plugin-dialogs/src/ubuntu/notification.h
deleted file mode 100644
index 5343073..0000000
--- a/plugins/cordova-plugin-dialogs/src/ubuntu/notification.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef NOTIFICATION_H
-#define NOTIFICATION_H
-
-#include
-#include
-#include
-#include
-
-class Dialogs: public CPlugin {
- Q_OBJECT
-public:
- explicit Dialogs(Cordova *cordova): CPlugin(cordova), _alertCallback(0) {
- }
-
- virtual const QString fullName() override {
- return Dialogs::fullID();
- }
-
- virtual const QString shortName() override {
- return "Notification";
- }
-
- static const QString fullID() {
- return "Notification";
- }
-public slots:
- void beep(int scId, int ecId, int times);
- void alert(int scId, int ecId, const QString &message, const QString &title, const QString &buttonLabel);
- void confirm(int scId, int ecId, const QString &message, const QString &title, const QStringList &buttonLabels);
- void prompt(int scId, int ecId, const QString &message, const QString &title, const QStringList &buttonLabels, const QString &defaultText);
-
- void notificationDialogButtonPressed(int buttonId, const QString &text, bool prompt) {
- if (prompt) {
- QVariantMap res;
- res.insert("buttonIndex", buttonId);
- res.insert("input1", text);
- this->cb(_alertCallback, res);
- } else {
- this->cb(_alertCallback, buttonId);
- }
- _alertCallback = 0;
- }
-
-private:
- int _alertCallback;
- QMediaPlayer _player;
-};
-
-#endif
diff --git a/plugins/cordova-plugin-dialogs/src/ubuntu/notification.qml b/plugins/cordova-plugin-dialogs/src/ubuntu/notification.qml
deleted file mode 100644
index 5fdc7d3..0000000
--- a/plugins/cordova-plugin-dialogs/src/ubuntu/notification.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-import QtQuick 2.0
-import Ubuntu.Components.Popups 0.1
-import Ubuntu.Components 0.1
-
-Dialog {
- id: dialogue
- property string button1Text
- property string button2Text
- property string button3Text
- property bool promptVisible
- property string defaultPromptText
-
- TextField {
- id: prompt
- text: defaultPromptText
- visible: promptVisible
- focus: true
- }
- Button {
- text: button1Text
- color: "orange"
- onClicked: {
- root.exec("Notification", "notificationDialogButtonPressed", [1, prompt.text, promptVisible]);
- PopupUtils.close(dialogue)
- }
- }
- Button {
- text: button2Text
- visible: button2Text.length > 0
- color: "orange"
- onClicked: {
- root.exec("Notification", "notificationDialogButtonPressed", [2, prompt.text, promptVisible]);
- PopupUtils.close(dialogue)
- }
- }
- Button {
- text: button3Text
- visible: button3Text.length > 0
- onClicked: {
- root.exec("Notification", "notificationDialogButtonPressed", [3, prompt.text, promptVisible]);
- PopupUtils.close(dialogue)
- }
- }
-}
diff --git a/plugins/cordova-plugin-dialogs/src/windows/NotificationProxy.js b/plugins/cordova-plugin-dialogs/src/windows/NotificationProxy.js
deleted file mode 100644
index c9c9233..0000000
--- a/plugins/cordova-plugin-dialogs/src/windows/NotificationProxy.js
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*global Windows:true, WinJS, toStaticHTML */
-
-var cordova = require('cordova');
-
-var isAlertShowing = false;
-var alertStack = [];
-
-// CB-8928: When toStaticHTML is undefined, prompt fails to run
-var _cleanHtml = function(html) { return html; };
-if (typeof toStaticHTML !== 'undefined') {
- _cleanHtml = toStaticHTML;
-}
-
-// Windows does not provide native UI for promp dialog so we use some
-// simple html-based implementation until it is available
-function createPromptDialog(title, message, buttons, defaultText, callback) {
-
- var isPhone = cordova.platformId == "windows" && WinJS.Utilities.isPhone;
-
- var dlgWrap = document.createElement("div");
- dlgWrap.style.position = "absolute";
- dlgWrap.style.width = "100%";
- dlgWrap.style.height = "100%";
- dlgWrap.style.backgroundColor = "rgba(0,0,0,0.25)";
- dlgWrap.style.zIndex = "100000";
- dlgWrap.className = "dlgWrap";
-
- var dlg = document.createElement("div");
- dlg.style.width = "100%";
- dlg.style.minHeight = "180px";
- dlg.style.height = "auto";
- dlg.style.overflow = "auto";
- dlg.style.backgroundColor = "white";
- dlg.style.position = "relative";
- dlg.style.lineHeight = "2";
-
- if (isPhone) {
- dlg.style.padding = "0px 5%";
- } else {
- dlg.style.top = "50%"; // center vertically
- dlg.style.transform = "translateY(-50%)";
- dlg.style.padding = "0px 30%";
- }
-
- // dialog layout template
- dlg.innerHTML = _cleanHtml(" " + // title
- " " + // message
- " "); // input fields
-
- dlg.querySelector('#lbl-title').appendChild(document.createTextNode(title));
- dlg.querySelector('#lbl-message').appendChild(document.createTextNode(message));
- dlg.querySelector('#prompt-input').setAttribute('placeholder', defaultText);
-
- function makeButtonCallback(idx) {
- return function () {
- var value = dlg.querySelector('#prompt-input').value;
- dlgWrap.parentNode.removeChild(dlgWrap);
-
- if (callback) {
- callback({ input1: value, buttonIndex: idx });
- }
- };
- }
-
- function addButton(idx, label) {
- var button = document.createElement('button');
- button.style.margin = "8px 0 8px 16px";
- button.style.float = "right";
- button.style.fontSize = "12pt";
- button.tabIndex = idx;
- button.onclick = makeButtonCallback(idx + 1);
- if (idx === 0) {
- button.style.color = "white";
- button.style.backgroundColor = "#464646";
- } else {
- button.style.backgroundColor = "#cccccc";
- }
- button.style.border = "none";
- button.appendChild(document.createTextNode(label));
- dlg.appendChild(button);
- }
-
- // reverse order is used since we align buttons to the right
- for (var idx = buttons.length - 1; idx >= 0; idx--) {
- addButton(idx, buttons[idx]);
- }
-
- dlgWrap.appendChild(dlg);
- document.body.appendChild(dlgWrap);
-
- // make sure input field is under focus
- dlg.querySelector('#prompt-input').focus();
-
- return dlgWrap;
-}
-
-module.exports = {
- alert:function(win, loseX, args) {
-
- if (isAlertShowing) {
- var later = function () {
- module.exports.alert(win, loseX, args);
- };
- alertStack.push(later);
- return;
- }
- isAlertShowing = true;
-
- var message = args[0];
- var _title = args[1];
- var _buttonLabel = args[2];
-
- var md = new Windows.UI.Popups.MessageDialog(message, _title);
- md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
- md.showAsync().then(function() {
- isAlertShowing = false;
- if (win) {
- win();
- }
-
- if (alertStack.length) {
- setTimeout(alertStack.shift(), 0);
- }
-
- });
- },
-
- prompt: function (win, lose, args) {
- if (isAlertShowing) {
- var later = function () {
- module.exports.prompt(win, lose, args);
- };
- alertStack.push(later);
- return;
- }
-
- isAlertShowing = true;
-
- var message = args[0],
- title = args[1],
- buttons = args[2],
- defaultText = args[3];
-
- try {
- createPromptDialog(title, message, buttons, defaultText, function (evt) {
- isAlertShowing = false;
- if (win) {
- win(evt);
- }
- });
-
- } catch (e) {
- // set isAlertShowing flag back to false in case of exception
- isAlertShowing = false;
- if (alertStack.length) {
- setTimeout(alertStack.shift(), 0);
- }
- // rethrow exception
- throw e;
- }
- },
-
- confirm:function(win, loseX, args) {
-
- if (isAlertShowing) {
- var later = function () {
- module.exports.confirm(win, loseX, args);
- };
- alertStack.push(later);
- return;
- }
-
- isAlertShowing = true;
-
- try {
- var message = args[0];
- var _title = args[1];
- var buttons = args[2];
-
- var md = new Windows.UI.Popups.MessageDialog(message, _title);
-
- buttons.forEach(function(buttonLabel) {
- md.commands.append(new Windows.UI.Popups.UICommand(buttonLabel));
- });
-
- md.showAsync().then(function(res) {
- isAlertShowing = false;
- var result = res ? buttons.indexOf(res.label) + 1 : 0;
- if (win) {
- win(result);
- }
- if (alertStack.length) {
- setTimeout(alertStack.shift(), 0);
- }
-
- });
- } catch (e) {
- // set isAlertShowing flag back to false in case of exception
- isAlertShowing = false;
- if (alertStack.length) {
- setTimeout(alertStack.shift(), 0);
- }
- // rethrow exception
- throw e;
- }
- },
-
- beep:function(winX, loseX, args) {
-
- // set a default args if it is not set
- args = args && args.length ? args : ["1"];
-
- var snd = new Audio('ms-winsoundevent:Notification.Default');
- var count = parseInt(args[0]) || 1;
- snd.msAudioCategory = "Alerts";
-
- var onEvent = function () {
- if (count > 0) {
- snd.play();
- } else {
- snd.removeEventListener("ended", onEvent);
- snd = null;
- if (winX) {
- winX(); // notification.js just sends null, but this is future friendly
- }
- }
- count--;
- };
- snd.addEventListener("ended", onEvent);
- onEvent();
-
- }
-};
-
-require("cordova/exec/proxy").add("Notification",module.exports);
diff --git a/plugins/cordova-plugin-dialogs/src/wp/Notification.cs b/plugins/cordova-plugin-dialogs/src/wp/Notification.cs
deleted file mode 100644
index b621684..0000000
--- a/plugins/cordova-plugin-dialogs/src/wp/Notification.cs
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-using System;
-using System.Windows;
-using System.Windows.Controls;
-using Microsoft.Devices;
-using System.Runtime.Serialization;
-using System.Threading;
-using System.Windows.Resources;
-using Microsoft.Phone.Controls;
-using Microsoft.Xna.Framework.Audio;
-using WPCordovaClassLib.Cordova.UI;
-using System.Diagnostics;
-
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
- public class Notification : BaseCommand
- {
- static ProgressBar progressBar = null;
- const int DEFAULT_DURATION = 5;
-
- private NotificationBox notifyBox;
-
- private class NotifBoxData
- {
- public NotificationBox previous {get;set;}
- public string callbackId { get; set; }
- }
-
- private PhoneApplicationPage Page
- {
- get
- {
- PhoneApplicationPage page = null;
- PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
- if (frame != null)
- {
- page = frame.Content as PhoneApplicationPage;
- }
- return page;
- }
- }
-
- // blink api - doesn't look like there is an equivalent api we can use...
-
- [DataContract]
- public class AlertOptions
- {
- [OnDeserializing]
- public void OnDeserializing(StreamingContext context)
- {
- // set defaults
- this.message = "message";
- this.title = "Alert";
- this.buttonLabel = "ok";
- }
-
- ///
- /// message to display in the alert box
- ///
- [DataMember]
- public string message;
-
- ///
- /// title displayed on the alert window
- ///
- [DataMember]
- public string title;
-
- ///
- /// text to display on the button
- ///
- [DataMember]
- public string buttonLabel;
- }
-
- [DataContract]
- public class PromptResult
- {
- [DataMember]
- public int buttonIndex;
-
- [DataMember]
- public string input1;
-
- public PromptResult(int index, string text)
- {
- this.buttonIndex = index;
- this.input1 = text;
- }
- }
-
- public void alert(string options)
- {
- string[] args = JSON.JsonHelper.Deserialize(options);
- AlertOptions alertOpts = new AlertOptions();
- alertOpts.message = args[0];
- alertOpts.title = args[1];
- alertOpts.buttonLabel = args[2];
- string aliasCurrentCommandCallbackId = args[3];
-
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- PhoneApplicationPage page = Page;
- if (page != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- var previous = notifyBox;
- notifyBox = new NotificationBox();
- notifyBox.Tag = new NotifBoxData { previous = previous, callbackId = aliasCurrentCommandCallbackId };
- notifyBox.PageTitle.Text = alertOpts.title;
- notifyBox.SubTitle.Text = alertOpts.message;
- Button btnOK = new Button();
- btnOK.Content = alertOpts.buttonLabel;
- btnOK.Click += new RoutedEventHandler(btnOK_Click);
- btnOK.Tag = 1;
- notifyBox.ButtonPanel.Children.Add(btnOK);
- grid.Children.Add(notifyBox);
-
- if (previous == null)
- {
- page.BackKeyPress += page_BackKeyPress;
- }
- }
- }
- else
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.INSTANTIATION_EXCEPTION));
- }
- });
- }
-
- public void prompt(string options)
- {
- string[] args = JSON.JsonHelper.Deserialize(options);
- string message = args[0];
- string title = args[1];
- string buttonLabelsArray = args[2];
- string[] buttonLabels = JSON.JsonHelper.Deserialize(buttonLabelsArray);
- string defaultText = args[3];
- string aliasCurrentCommandCallbackId = args[4];
-
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- PhoneApplicationPage page = Page;
- if (page != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- var previous = notifyBox;
- notifyBox = new NotificationBox();
- notifyBox.Tag = new NotifBoxData { previous = previous, callbackId = aliasCurrentCommandCallbackId };
- notifyBox.PageTitle.Text = title;
- notifyBox.SubTitle.Text = message;
-
- //TextBox textBox = new TextBox();
- //textBox.Text = defaultText;
- //textBox.AcceptsReturn = true;
- //notifyBox.ContentScroller.Content = textBox;
-
- notifyBox.InputText.Text = defaultText;
- notifyBox.InputText.Visibility = Visibility.Visible;
-
- for (int i = 0; i < buttonLabels.Length; ++i)
- {
- Button button = new Button();
- button.Content = buttonLabels[i];
- button.Tag = i + 1;
- button.Click += promptBoxbutton_Click;
- notifyBox.ButtonPanel.Orientation = Orientation.Vertical;
- notifyBox.ButtonPanel.Children.Add(button);
- }
-
- grid.Children.Add(notifyBox);
- if (previous != null)
- {
- page.BackKeyPress += page_BackKeyPress;
- }
- }
- }
- else
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.INSTANTIATION_EXCEPTION));
- }
- });
- }
-
- public void confirm(string options)
- {
- string[] args = JSON.JsonHelper.Deserialize(options);
- AlertOptions alertOpts = new AlertOptions();
- alertOpts.message = args[0];
- alertOpts.title = args[1];
- alertOpts.buttonLabel = args[2];
- string aliasCurrentCommandCallbackId = args[3];
-
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- PhoneApplicationPage page = Page;
- if (page != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- var previous = notifyBox;
- notifyBox = new NotificationBox();
- notifyBox.Tag = new NotifBoxData { previous = previous, callbackId = aliasCurrentCommandCallbackId };
- notifyBox.PageTitle.Text = alertOpts.title;
- notifyBox.SubTitle.Text = alertOpts.message;
-
- string[] labels = JSON.JsonHelper.Deserialize(alertOpts.buttonLabel);
-
- if (labels == null)
- {
- labels = alertOpts.buttonLabel.Split(',');
- }
-
- for (int n = 0; n < labels.Length; n++)
- {
- Button btn = new Button();
- btn.Content = labels[n];
- btn.Tag = n;
- btn.Click += new RoutedEventHandler(btnOK_Click);
- notifyBox.ButtonPanel.Children.Add(btn);
- }
-
- grid.Children.Add(notifyBox);
- if (previous == null)
- {
- page.BackKeyPress += page_BackKeyPress;
- }
- }
- }
- else
- {
- DispatchCommandResult(new PluginResult(PluginResult.Status.INSTANTIATION_EXCEPTION));
- }
- });
- }
-
- void promptBoxbutton_Click(object sender, RoutedEventArgs e)
- {
- Button button = sender as Button;
- FrameworkElement promptBox = null;
- int buttonIndex = 0;
- string callbackId = string.Empty;
- string text = string.Empty;
- if (button != null)
- {
- buttonIndex = (int)button.Tag;
- promptBox = button.Parent as FrameworkElement;
- while ((promptBox = promptBox.Parent as FrameworkElement) != null &&
- !(promptBox is NotificationBox)) ;
- }
-
- if (promptBox != null)
- {
- NotificationBox box = promptBox as NotificationBox;
-
- text = box.InputText.Text;
-
- PhoneApplicationPage page = Page;
- if (page != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- grid.Children.Remove(promptBox);
- }
-
- NotifBoxData data = promptBox.Tag as NotifBoxData;
- promptBox = data.previous as NotificationBox;
- callbackId = data.callbackId as string;
-
- if (promptBox == null)
- {
- page.BackKeyPress -= page_BackKeyPress;
- }
- }
- }
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new PromptResult(buttonIndex, text)), callbackId);
- }
-
- void page_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
- {
- PhoneApplicationPage page = sender as PhoneApplicationPage;
- string callbackId = "";
- if (page != null && notifyBox != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- grid.Children.Remove(notifyBox);
- NotifBoxData notifBoxData = notifyBox.Tag as NotifBoxData;
- notifyBox = notifBoxData.previous as NotificationBox;
- callbackId = notifBoxData.callbackId as string;
- }
- if (notifyBox == null)
- {
- page.BackKeyPress -= page_BackKeyPress;
- }
- e.Cancel = true;
- }
-
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, 0), callbackId);
- }
-
- void btnOK_Click(object sender, RoutedEventArgs e)
- {
- Button btn = sender as Button;
- FrameworkElement notifBoxParent = null;
- int retVal = 0;
- string callbackId = "";
- if (btn != null)
- {
- retVal = (int)btn.Tag + 1;
-
- notifBoxParent = btn.Parent as FrameworkElement;
- while ((notifBoxParent = notifBoxParent.Parent as FrameworkElement) != null &&
- !(notifBoxParent is NotificationBox)) ;
- }
- if (notifBoxParent != null)
- {
- PhoneApplicationPage page = Page;
- if (page != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- grid.Children.Remove(notifBoxParent);
- }
-
- NotifBoxData notifBoxData = notifBoxParent.Tag as NotifBoxData;
- notifyBox = notifBoxData.previous as NotificationBox;
- callbackId = notifBoxData.callbackId as string;
-
- if (notifyBox == null)
- {
- page.BackKeyPress -= page_BackKeyPress;
- }
- }
-
- }
- DispatchCommandResult(new PluginResult(PluginResult.Status.OK, retVal), callbackId);
- }
-
-
-
- public void beep(string options)
- {
- string[] args = JSON.JsonHelper.Deserialize(options);
- int times = int.Parse(args[0]);
-
- string resourcePath = BaseCommand.GetBaseURL() + "Plugins/cordova-plugin-dialogs/notification-beep.wav";
-
- StreamResourceInfo sri = Application.GetResourceStream(new Uri(resourcePath, UriKind.Relative));
-
- if (sri != null)
- {
- SoundEffect effect = SoundEffect.FromStream(sri.Stream);
- SoundEffectInstance inst = effect.CreateInstance();
- ThreadPool.QueueUserWorkItem((o) =>
- {
- // cannot interact with UI !!
- do
- {
- inst.Play();
- Thread.Sleep(effect.Duration + TimeSpan.FromMilliseconds(100));
- }
- while (--times > 0);
-
- });
-
- }
-
- // TODO: may need a listener to trigger DispatchCommandResult after the alarm has finished executing...
- DispatchCommandResult();
- }
-
- // Display an indeterminate progress indicator
- public void activityStart(string unused)
- {
-
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
-
- if (frame != null)
- {
- PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
-
- if (page != null)
- {
- var temp = page.FindName("LayoutRoot");
- Grid grid = temp as Grid;
- if (grid != null)
- {
- if (progressBar != null)
- {
- grid.Children.Remove(progressBar);
- }
- progressBar = new ProgressBar();
- progressBar.IsIndeterminate = true;
- progressBar.IsEnabled = true;
-
- grid.Children.Add(progressBar);
- }
- }
- }
- });
- }
-
-
- // Remove our indeterminate progress indicator
- public void activityStop(string unused)
- {
- Deployment.Current.Dispatcher.BeginInvoke(() =>
- {
- if (progressBar != null)
- {
- progressBar.IsEnabled = false;
- PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
- if (frame != null)
- {
- PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
- if (page != null)
- {
- Grid grid = page.FindName("LayoutRoot") as Grid;
- if (grid != null)
- {
- grid.Children.Remove(progressBar);
- }
- }
- }
- progressBar = null;
- }
- });
- }
-
- public void vibrate(string vibrateDuration)
- {
-
- int msecs = 200; // set default
-
- try
- {
- string[] args = JSON.JsonHelper.Deserialize(vibrateDuration);
-
- msecs = int.Parse(args[0]);
- if (msecs < 1)
- {
- msecs = 1;
- }
- }
- catch (FormatException)
- {
-
- }
-
- VibrateController.Default.Start(TimeSpan.FromMilliseconds(msecs));
-
- // TODO: may need to add listener to trigger DispatchCommandResult when the vibration ends...
- DispatchCommandResult();
- }
- }
-}
diff --git a/plugins/cordova-plugin-dialogs/src/wp/NotificationBox.xaml b/plugins/cordova-plugin-dialogs/src/wp/NotificationBox.xaml
deleted file mode 100644
index 2d564fb..0000000
--- a/plugins/cordova-plugin-dialogs/src/wp/NotificationBox.xaml
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-dialogs/src/wp/NotificationBox.xaml.cs b/plugins/cordova-plugin-dialogs/src/wp/NotificationBox.xaml.cs
deleted file mode 100644
index 50b2f2a..0000000
--- a/plugins/cordova-plugin-dialogs/src/wp/NotificationBox.xaml.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-
-namespace WPCordovaClassLib.Cordova.UI
-{
- public partial class NotificationBox : UserControl
- {
- public NotificationBox()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/plugins/cordova-plugin-dialogs/src/wp/notification-beep.wav b/plugins/cordova-plugin-dialogs/src/wp/notification-beep.wav
deleted file mode 100644
index d0ad085..0000000
Binary files a/plugins/cordova-plugin-dialogs/src/wp/notification-beep.wav and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/tests/plugin.xml b/plugins/cordova-plugin-dialogs/tests/plugin.xml
deleted file mode 100644
index 498038c..0000000
--- a/plugins/cordova-plugin-dialogs/tests/plugin.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
- Cordova Notification Plugin Tests
- Apache 2.0
-
-
-
-
diff --git a/plugins/cordova-plugin-dialogs/tests/tests.js b/plugins/cordova-plugin-dialogs/tests/tests.js
deleted file mode 100644
index a4cf382..0000000
--- a/plugins/cordova-plugin-dialogs/tests/tests.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* jshint jasmine: true */
-/* global cordova */
-
-exports.defineAutoTests = function () {
- describe('Notification (navigator.notification)', function () {
- it("should exist", function () {
- expect(navigator.notification).toBeDefined();
- });
-
- it("should contain a beep function", function () {
- expect(typeof navigator.notification.beep).toBeDefined();
- expect(typeof navigator.notification.beep).toBe("function");
- });
-
- it("should contain an alert function", function () {
- expect(typeof navigator.notification.alert).toBeDefined();
- expect(typeof navigator.notification.alert).toBe("function");
- });
-
- it("should contain a confirm function", function () {
- expect(typeof navigator.notification.confirm).toBeDefined();
- expect(typeof navigator.notification.confirm).toBe("function");
- });
-
- it("should contain a prompt function", function () {
- expect(typeof navigator.notification.prompt).toBeDefined();
- expect(typeof navigator.notification.prompt).toBe("function");
- });
- });
-};
-
-/******************************************************************************/
-/******************************************************************************/
-/******************************************************************************/
-
-exports.defineManualTests = function (contentEl, createActionButton) {
- var logMessage = function (message) {
- var log = document.getElementById('info');
- var logLine = document.createElement('div');
- logLine.innerHTML = message;
- log.appendChild(logLine);
- };
-
- var clearLog = function () {
- var log = document.getElementById('info');
- log.innerHTML = '';
- };
-
- var beep = function () {
- console.log("beep()");
- navigator.notification.beep(3);
- };
-
- var alertDialog = function (message, title, button) {
- console.log("alertDialog()");
- navigator.notification.alert(message,
- function () {
- console.log("Alert dismissed.");
- },
- title, button);
- console.log("After alert");
- };
-
- var confirmDialogA = function (message, title, buttons) {
- clearLog();
- navigator.notification.confirm(message,
- function (r) {
- if (r === 0) {
- logMessage("Dismissed dialog without making a selection.");
- console.log("Dismissed dialog without making a selection.");
- } else {
- console.log("You selected " + r);
- logMessage("You selected " + (buttons.split(","))[r - 1]);
- }
- },
- title,
- buttons);
- };
-
- var confirmDialogB = function (message, title, buttons) {
- clearLog();
- navigator.notification.confirm(message,
- function (r) {
- if (r === 0) {
- logMessage("Dismissed dialog without making a selection.");
- console.log("Dismissed dialog without making a selection.");
- } else {
- console.log("You selected " + r);
- logMessage("You selected " + buttons[r - 1]);
- }
- },
- title,
- buttons);
- };
-
- var promptDialog = function (message, title, buttons) {
- clearLog();
- navigator.notification.prompt(message,
- function (r) {
- if (r && r.buttonIndex === 0) {
- var msg = "Dismissed dialog";
- if (r.input1) {
- msg += " with input: " + r.input1;
- }
- logMessage(msg);
- console.log(msg);
- } else {
- console.log("You selected " + r.buttonIndex + " and entered: " + r.input1);
- logMessage("You selected " + buttons[r.buttonIndex - 1] + " and entered: " + r.input1);
- }
- },
- title,
- buttons);
- };
-
- /******************************************************************************/
-
- var dialogs_tests = '' +
- 'Expected result: Device will beep (unless device is on silent). Nothing will get updated in status box.' +
- '
Dialog Tests
' +
- '
Dialog boxes will pop up for each of the following tests
' +
- ' ' +
- 'Expected result: Dialog will say "You pressed alert". Press continue to close dialog. Nothing will get updated in status box.' +
- ' ' +
- 'Expected result: Dialog will say "You pressed confirm". Press Yes, No, or Maybe to close dialog. Status box will tell you what option you selected.' +
- ' ' +
- 'Expected result: Dialog will say "You pressed confirm". Press Yes, No, or Maybe, Not Sure to close dialog. Status box will tell you what option you selected, and should use 1-based indexing.' +
- ' ' +
- 'Expected result: Dialog will say "You pressed prompt". Enter any message and press Yes, No, or Maybe, Not Sure to close dialog. Status box will tell you what option you selected and message you entered, and should use 1-based indexing.' +
- ' ' +
- 'Expected result: Dialog will have title "index.html" and say "You pressed alert" Press OK to close dialog. Nothing will get updated in status box.' +
- ' ' +
- 'Expected result: Dialog will have title "index.html" and say "You selected confirm". Press Cancel or OK to close dialog. Nothing will get updated in status box.' +
- ' ' +
- 'Expected result: Dialog will have title "index.html" and say "This is a prompt". "Default value" will be in text box. Press Cancel or OK to close dialog. Nothing will get updated in status box.';
-
- contentEl.innerHTML = '' +
- dialogs_tests;
-
- createActionButton('Beep', function () {
- beep();
- }, 'beep');
-
- createActionButton('Alert Dialog', function () {
- alertDialog('You pressed alert.', 'Alert Dialog', 'Continue');
- }, 'alert');
-
- // WP8.1 detection is necessary since it doesn't support confirm dialogs with more than 2 buttons
- var isRunningOnWP81 = cordova.platformId == "windows" && navigator.userAgent.indexOf('Windows Phone') > -1;
-
- createActionButton('Confirm Dialog - Deprecated', function () {
- var buttons = isRunningOnWP81 ? 'Yes,No' : 'Yes,No,Maybe';
- confirmDialogA('You pressed confirm.', 'Confirm Dialog', buttons);
- }, 'confirm_deprecated');
-
- createActionButton('Confirm Dialog', function () {
- var buttons = isRunningOnWP81 ? ['Yes', 'Actually, No'] : ['Yes', 'No', 'Maybe, Not Sure'];
- confirmDialogB('You pressed confirm.', 'Confirm Dialog', buttons);
- }, 'confirm');
-
- createActionButton('Prompt Dialog', function () {
- promptDialog('You pressed prompt.', 'Prompt Dialog', ['Yes', 'No', 'Maybe, Not Sure']);
- }, 'prompt');
-
- createActionButton('Built-in Alert Dialog', function () {
- if (typeof alert === 'function') {
- alert('You pressed alert');
- }
- }, 'built_in_alert');
-
- createActionButton('Built-in Confirm Dialog', function () {
- if (typeof confirm === 'function') {
- confirm('You selected confirm');
- }
- }, 'built_in_confirm');
-
- createActionButton('Built-in Prompt Dialog', function () {
- if (typeof prompt === 'function') {
- prompt('This is a prompt', 'Default value');
- }
- }, 'built_in_prompt');
-};
diff --git a/plugins/cordova-plugin-dialogs/www/android/notification.js b/plugins/cordova-plugin-dialogs/www/android/notification.js
deleted file mode 100644
index 8936a5c..0000000
--- a/plugins/cordova-plugin-dialogs/www/android/notification.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-/**
- * Provides Android enhanced notification API.
- */
-module.exports = {
- activityStart : function(title, message) {
- // If title and message not specified then mimic Android behavior of
- // using default strings.
- if (typeof title === "undefined" && typeof message == "undefined") {
- title = "Busy";
- message = 'Please wait...';
- }
-
- exec(null, null, 'Notification', 'activityStart', [ title, message ]);
- },
-
- /**
- * Close an activity dialog
- */
- activityStop : function() {
- exec(null, null, 'Notification', 'activityStop', []);
- },
-
- /**
- * Display a progress dialog with progress bar that goes from 0 to 100.
- *
- * @param {String}
- * title Title of the progress dialog.
- * @param {String}
- * message Message to display in the dialog.
- */
- progressStart : function(title, message) {
- exec(null, null, 'Notification', 'progressStart', [ title, message ]);
- },
-
- /**
- * Close the progress dialog.
- */
- progressStop : function() {
- exec(null, null, 'Notification', 'progressStop', []);
- },
-
- /**
- * Set the progress dialog value.
- *
- * @param {Number}
- * value 0-100
- */
- progressValue : function(value) {
- exec(null, null, 'Notification', 'progressValue', [ value ]);
- }
-};
diff --git a/plugins/cordova-plugin-dialogs/www/blackberry10/beep.js b/plugins/cordova-plugin-dialogs/www/blackberry10/beep.js
deleted file mode 100644
index da2e75d..0000000
--- a/plugins/cordova-plugin-dialogs/www/blackberry10/beep.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = function (quantity) {
- var count = 0,
- beepObj;
-
- function callback() {
- if (--count > 0) {
- play();
- } else {
- beepObj.removeEventListener("ended", callback);
- beepObj = null;
- }
- }
-
- function play() {
- //create new object every time due to strage playback behaviour
- beepObj = new Audio('local:///chrome/plugin/cordova-plugin-dialogs/notification-beep.wav');
- beepObj.addEventListener("ended", callback);
- beepObj.play();
- }
-
- count += quantity || 1;
- if (count > 0) {
- play();
- }
-};
diff --git a/plugins/cordova-plugin-dialogs/www/blackberry10/notification-beep.wav b/plugins/cordova-plugin-dialogs/www/blackberry10/notification-beep.wav
deleted file mode 100644
index d0ad085..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/blackberry10/notification-beep.wav and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/browser/notification.js b/plugins/cordova-plugin-dialogs/www/browser/notification.js
deleted file mode 100644
index 1fdfafd..0000000
--- a/plugins/cordova-plugin-dialogs/www/browser/notification.js
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// Platform: browser
-window.navigator.notification = window.navigator.notification || {};
-
-module.exports.alert = window.navigator.notification.alert = function(message, callback) {
- // `notification.alert` executes asynchronously
- setTimeout(function() {
- window.alert(message);
- if (callback) {
- callback();
- }
- }, 0);
-};
-
-
-module.exports.confirm = window.navigator.notification.confirm = function(message, callback) {
- // `notification.confirm` executes asynchronously
- setTimeout(function() {
- var result = window.confirm(message);
- if (callback) {
- if (result) {
- callback(1); // OK
- }
- else {
- callback(2); // Cancel
- }
- }
- }, 0);
-};
-
-
-module.exports.prompt = window.navigator.notification.prompt = function(message, callback, title, buttonLabels, defaultText) {
- // `notification.prompt` executes asynchronously
- setTimeout(function() {
- var result = window.prompt(message, defaultText || '');
- if (callback) {
- if (result === null) {
- callback({ buttonIndex: 2, input1: '' }); // Cancel
- }
- else {
- callback({ buttonIndex: 1, input1: result }); // OK
- }
- }
- }, 0);
-};
-
-
-var audioContext = (function() {
- // Determine if the Audio API is supported by this browser
- var AudioApi = window.AudioContext;
- if (!AudioApi) {
- AudioApi = window.webkitAudioContext;
- }
-
- if (AudioApi) {
- // The Audio API is supported, so create a singleton instance of the AudioContext
- return new AudioApi();
- }
-
- return undefined;
-}());
-
-module.exports.beep = window.navigator.notification.beep = function(times) {
- if (times > 0) {
- var BEEP_DURATION = 700;
- var BEEP_INTERVAL = 300;
-
- if (audioContext) {
- // Start a beep, using the Audio API
- var osc = audioContext.createOscillator();
- osc.type = 0; // sounds like a "beep"
- osc.connect(audioContext.destination);
- osc.start(0);
-
- setTimeout(function() {
- // Stop the beep after the BEEP_DURATION
- osc.stop(0);
-
- if (--times > 0) {
- // Beep again, after a pause
- setTimeout(function() {
- navigator.notification.beep(times);
- }, BEEP_INTERVAL);
- }
-
- }, BEEP_DURATION);
- }
- else if (typeof(console) !== 'undefined' && typeof(console.log) === 'function') {
- // Audio API isn't supported, so just write `beep` to the console
- for (var i = 0; i < times; i++) {
- console.log('Beep!');
- }
- }
- }
-};
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/danger-press.png b/plugins/cordova-plugin-dialogs/www/firefoxos/danger-press.png
deleted file mode 100644
index d7529b5..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/firefoxos/danger-press.png and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/danger.png b/plugins/cordova-plugin-dialogs/www/firefoxos/danger.png
deleted file mode 100644
index 400e3ae..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/firefoxos/danger.png and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/default.png b/plugins/cordova-plugin-dialogs/www/firefoxos/default.png
deleted file mode 100644
index 2ff298a..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/firefoxos/default.png and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/gradient.png b/plugins/cordova-plugin-dialogs/www/firefoxos/gradient.png
deleted file mode 100644
index b288545..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/firefoxos/gradient.png and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/notification.css b/plugins/cordova-plugin-dialogs/www/firefoxos/notification.css
deleted file mode 100644
index 34d92b8..0000000
--- a/plugins/cordova-plugin-dialogs/www/firefoxos/notification.css
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* Main dialog setup */
-form[role="dialog"] {
- background:
- url(../img/pattern.png) repeat left top,
- url(../img/gradient.png) no-repeat left top / 100% 100%;
- overflow: hidden;
- position: absolute;
- z-index: 100;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- padding: 1.5rem 0 7rem;
- font-family: "MozTT", Sans-serif;
- font-size: 0;
- /* Using font-size: 0; we avoid the unwanted visual space (about 3px)
- created by white-spaces and break lines in the code betewen inline-block elements */
- color: #fff;
- text-align: left;
-}
-
-form[role="dialog"]:before {
- content: "";
- display: inline-block;
- vertical-align: middle;
- width: 0.1rem;
- height: 100%;
- margin-left: -0.1rem;
-}
-
-form[role="dialog"] > section {
- font-weight: lighter;
- font-size: 1.8rem;
- color: #FAFAFA;
- padding: 0 1.5rem;
- -moz-box-sizing: padding-box;
- width: 100%;
- display: inline-block;
- overflow-y: scroll;
- max-height: 100%;
- vertical-align: middle;
- white-space: normal;
-}
-
-form[role="dialog"] h1 {
- font-weight: normal;
- font-size: 1.6rem;
- line-height: 1.5em;
- color: #fff;
- margin: 0;
- padding: 0 1.5rem 1rem;
- border-bottom: 0.1rem solid #686868;
-}
-
-/* Menu & buttons setup */
-form[role="dialog"] menu {
- margin: 0;
- padding: 1.5rem;
- padding-bottom: 0.5rem;
- border-top: solid 0.1rem rgba(255, 255, 255, 0.1);
- background: #2d2d2d url(../img/pattern.png) repeat left top;
- display: block;
- overflow: hidden;
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- text-align: center;
-}
-
-form[role="dialog"] menu button::-moz-focus-inner {
- border: none;
- outline: none;
-}
-form[role="dialog"] menu button {
- width: 100%;
- height: 2.4rem;
- margin: 0 0 1rem;
- padding: 0 1.5rem;
- -moz-box-sizing: border-box;
- display: inline-block;
- vertical-align: middle;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- background: #fafafa url(../img/default.png) repeat-x left bottom/ auto 100%;
- border: 0.1rem solid #a6a6a6;
- border-radius: 0.3rem;
- font: 500 1.2rem/2.4rem 'MozTT', Sans-serif;
- color: #333;
- text-align: center;
- text-shadow: 0.1rem 0.1rem 0 rgba(255,255,255,0.3);
- text-decoration: none;
- outline: none;
-}
-
-/* Press (default & recommend) */
-form[role="dialog"] menu button:active,
-form[role="dialog"] menu button.recommend:active,
-a.recommend[role="button"]:active {
- border-color: #008aaa;
- color: #333;
-}
-
-/* Recommend */
-form[role="dialog"] menu button.recommend {
- background-image: url(../img/recommend.png);
- background-color: #00caf2;
- border-color: #008eab;
-}
-
-/* Danger */
-form[role="dialog"] menu button.danger,
-a.danger[role="button"] {
- background-image: url(../img/danger.png);
- background-color: #b70404;
- color: #fff;
- text-shadow: none;
- border-color: #820000;
-}
-
-/* Danger Press */
-form[role="dialog"] menu button.danger:active {
- background-image: url(../img/danger-press.png);
- background-color: #890707;
-}
-
-/* Disabled */
-form[role="dialog"] > menu > button[disabled] {
- background: #5f5f5f;
- color: #4d4d4d;
- text-shadow: none;
- border-color: #4d4d4d;
- pointer-events: none;
-}
-
-
-form[role="dialog"] menu button:nth-child(even) {
- margin-left: 1rem;
-}
-
-form[role="dialog"] menu button,
-form[role="dialog"] menu button:nth-child(odd) {
- margin: 0 0 1rem 0;
-}
-
-form[role="dialog"] menu button {
- width: calc((100% - 1rem) / 2);
-}
-
-form[role="dialog"] menu button.full {
- width: 100%;
-}
-
-/* Specific component code */
-form[role="dialog"] p {
- word-wrap: break-word;
- margin: 1rem 0 0;
- padding: 0 1.5rem 1rem;
- line-height: 3rem;
-}
-
-form[role="dialog"] p img {
- float: left;
- margin-right: 2rem;
-}
-
-form[role="dialog"] p strong {
- font-weight: lighter;
-}
-
-form[role="dialog"] p small {
- font-size: 1.4rem;
- font-weight: normal;
- color: #cbcbcb;
- display: block;
-}
-
-form[role="dialog"] dl {
- border-top: 0.1rem solid #686868;
- margin: 1rem 0 0;
- overflow: hidden;
- padding-top: 1rem;
- font-size: 1.6rem;
- line-height: 2.2rem;
-}
-
-form[role="dialog"] dl > dt {
- clear: both;
- float: left;
- width: 7rem;
- padding-left: 1.5rem;
- font-weight: 500;
- text-align: left;
-}
-
-form[role="dialog"] dl > dd {
- padding-right: 1.5rem;
- font-weight: 300;
- text-overflow: ellipsis;
- vertical-align: top;
- overflow: hidden;
-}
-
-/* input areas */
-input[type="text"],
-input[type="password"],
-input[type="email"],
-input[type="tel"],
-input[type="search"],
-input[type="url"],
-input[type="number"],
-textarea {
- -moz-box-sizing: border-box;
- display: block;
- overflow: hidden;
- width: 100%;
- height: 3rem;
- resize: none;
- padding: 0 1rem;
- font-size: 1.6rem;
- line-height: 3rem;
- border: 0.1rem solid #ccc;
- border-radius: 0.3rem;
- box-shadow: none; /* override the box-shadow from the system (performance issue) */
- background: #fff url(input_areas/images/ui/shadow.png) repeat-x;
-}
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/pattern.png b/plugins/cordova-plugin-dialogs/www/firefoxos/pattern.png
deleted file mode 100644
index af03f56..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/firefoxos/pattern.png and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/firefoxos/recommend.png b/plugins/cordova-plugin-dialogs/www/firefoxos/recommend.png
deleted file mode 100644
index 42aed39..0000000
Binary files a/plugins/cordova-plugin-dialogs/www/firefoxos/recommend.png and /dev/null differ
diff --git a/plugins/cordova-plugin-dialogs/www/notification.js b/plugins/cordova-plugin-dialogs/www/notification.js
deleted file mode 100644
index 44f25c1..0000000
--- a/plugins/cordova-plugin-dialogs/www/notification.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var platform = require('cordova/platform');
-
-/**
- * Provides access to notifications on the device.
- */
-
-module.exports = {
-
- /**
- * Open a native alert dialog, with a customizable title and button text.
- *
- * @param {String} message Message to print in the body of the alert
- * @param {Function} completeCallback The callback that is called when user clicks on a button.
- * @param {String} title Title of the alert dialog (default: Alert)
- * @param {String} buttonLabel Label of the close button (default: OK)
- */
- alert: function(message, completeCallback, title, buttonLabel) {
- var _title = (typeof title === "string" ? title : "Alert");
- var _buttonLabel = (buttonLabel || "OK");
- exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]);
- },
-
- /**
- * Open a native confirm dialog, with a customizable title and button text.
- * The result that the user selects is returned to the result callback.
- *
- * @param {String} message Message to print in the body of the alert
- * @param {Function} resultCallback The callback that is called when user clicks on a button.
- * @param {String} title Title of the alert dialog (default: Confirm)
- * @param {Array} buttonLabels Array of the labels of the buttons (default: ['OK', 'Cancel'])
- */
- confirm: function(message, resultCallback, title, buttonLabels) {
- var _title = (typeof title === "string" ? title : "Confirm");
- var _buttonLabels = (buttonLabels || ["OK", "Cancel"]);
-
- // Strings are deprecated!
- if (typeof _buttonLabels === 'string') {
- console.log("Notification.confirm(string, function, string, string) is deprecated. Use Notification.confirm(string, function, string, array).");
- }
-
- // Some platforms take an array of button label names.
- // Other platforms take a comma separated list.
- // For compatibility, we convert to the desired type based on the platform.
- if (platform.id == "amazon-fireos" || platform.id == "android" || platform.id == "ios" ||
- platform.id == "windowsphone" || platform.id == "firefoxos" || platform.id == "ubuntu" ||
- platform.id == "windows8" || platform.id == "windows") {
-
- if (typeof _buttonLabels === 'string') {
- _buttonLabels = _buttonLabels.split(","); // not crazy about changing the var type here
- }
- } else {
- if (Array.isArray(_buttonLabels)) {
- var buttonLabelArray = _buttonLabels;
- _buttonLabels = buttonLabelArray.toString();
- }
- }
- exec(resultCallback, null, "Notification", "confirm", [message, _title, _buttonLabels]);
- },
-
- /**
- * Open a native prompt dialog, with a customizable title and button text.
- * The following results are returned to the result callback:
- * buttonIndex Index number of the button selected.
- * input1 The text entered in the prompt dialog box.
- *
- * @param {String} message Dialog message to display (default: "Prompt message")
- * @param {Function} resultCallback The callback that is called when user clicks on a button.
- * @param {String} title Title of the dialog (default: "Prompt")
- * @param {Array} buttonLabels Array of strings for the button labels (default: ["OK","Cancel"])
- * @param {String} defaultText Textbox input value (default: empty string)
- */
- prompt: function(message, resultCallback, title, buttonLabels, defaultText) {
- var _message = (typeof message === "string" ? message : "Prompt message");
- var _title = (typeof title === "string" ? title : "Prompt");
- var _buttonLabels = (buttonLabels || ["OK","Cancel"]);
- var _defaultText = (defaultText || "");
- exec(resultCallback, null, "Notification", "prompt", [_message, _title, _buttonLabels, _defaultText]);
- },
-
- /**
- * Causes the device to beep.
- * On Android, the default notification ringtone is played "count" times.
- *
- * @param {Integer} count The number of beeps.
- */
- beep: function(count) {
- var defaultedCount = count || 1;
- exec(null, null, "Notification", "beep", [ defaultedCount ]);
- }
-};
diff --git a/plugins/cordova-plugin-file-transfer/CONTRIBUTING.md b/plugins/cordova-plugin-file-transfer/CONTRIBUTING.md
deleted file mode 100644
index 4c8e6a5..0000000
--- a/plugins/cordova-plugin-file-transfer/CONTRIBUTING.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-# Contributing to Apache Cordova
-
-Anyone can contribute to Cordova. And we need your contributions.
-
-There are multiple ways to contribute: report bugs, improve the docs, and
-contribute code.
-
-For instructions on this, start with the
-[contribution overview](http://cordova.apache.org/contribute/).
-
-The details are explained there, but the important items are:
- - Sign and submit an Apache ICLA (Contributor License Agreement).
- - Have a Jira issue open that corresponds to your contribution.
- - Run the tests so your patch doesn't break existing functionality.
-
-We look forward to your contributions!
diff --git a/plugins/cordova-plugin-file-transfer/LICENSE b/plugins/cordova-plugin-file-transfer/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/plugins/cordova-plugin-file-transfer/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/NOTICE b/plugins/cordova-plugin-file-transfer/NOTICE
deleted file mode 100644
index 46fed23..0000000
--- a/plugins/cordova-plugin-file-transfer/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-This product includes a copy of OkHttp from:
-https://github.com/square/okhttp
diff --git a/plugins/cordova-plugin-file-transfer/README.md b/plugins/cordova-plugin-file-transfer/README.md
deleted file mode 100644
index 5b4b29b..0000000
--- a/plugins/cordova-plugin-file-transfer/README.md
+++ /dev/null
@@ -1,317 +0,0 @@
-
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-# cordova-plugin-file-transfer
-
-This plugin allows you to upload and download files.
-
-This plugin defines global `FileTransfer`, `FileUploadOptions` constructors. Although in the global scope, they are not available until after the `deviceready` event.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-Report issues with this plugin on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20File%20Transfer%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
-
-## Installation
-
- cordova plugin add cordova-plugin-file-transfer
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10
-- Browser
-- Firefox OS**
-- iOS
-- Windows Phone 7 and 8*
-- Windows
-
-\* _Do not support `onprogress` nor `abort()`_
-
-\** _Do not support `onprogress`_
-
-# FileTransfer
-
-The `FileTransfer` object provides a way to upload files using an HTTP
-multi-part POST or PUT request, and to download files.
-
-## Properties
-
-- __onprogress__: Called with a `ProgressEvent` whenever a new chunk of data is transferred. _(Function)_
-
-## Methods
-
-- __upload__: Sends a file to a server.
-
-- __download__: Downloads a file from server.
-
-- __abort__: Aborts an in-progress transfer.
-
-
-## upload
-
-__Parameters__:
-
-- __fileURL__: Filesystem URL representing the file on the device or a [data URI](https://en.wikipedia.org/wiki/Data_URI_scheme). For backwards compatibility, this can also be the full path of the file on the device. (See [Backwards Compatibility Notes](#backwards-compatibility-notes) below)
-
-- __server__: URL of the server to receive the file, as encoded by `encodeURI()`.
-
-- __successCallback__: A callback that is passed a `FileUploadResult` object. _(Function)_
-
-- __errorCallback__: A callback that executes if an error occurs retrieving the `FileUploadResult`. Invoked with a `FileTransferError` object. _(Function)_
-
-- __options__: Optional parameters _(Object)_. Valid keys:
- - __fileKey__: The name of the form element. Defaults to `file`. (DOMString)
- - __fileName__: The file name to use when saving the file on the server. Defaults to `image.jpg`. (DOMString)
- - __httpMethod__: The HTTP method to use - either `PUT` or `POST`. Defaults to `POST`. (DOMString)
- - __mimeType__: The mime type of the data to upload. Defaults to `image/jpeg`. (DOMString)
- - __params__: A set of optional key/value pairs to pass in the HTTP request. (Object, key/value - DOMString)
- - __chunkedMode__: Whether to upload the data in chunked streaming mode. Defaults to `true`. (Boolean)
- - __headers__: A map of header name/header values. Use an array to specify more than one value. On iOS, FireOS, and Android, if a header named Content-Type is present, multipart form data will NOT be used. (Object)
-
-- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true`, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_
-
-### Example
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-### Example with Upload Headers and Progress Events (Android and iOS only)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-## FileUploadResult
-
-A `FileUploadResult` object is passed to the success callback of the
-`FileTransfer` object's `upload()` method.
-
-### Properties
-
-- __bytesSent__: The number of bytes sent to the server as part of the upload. (long)
-
-- __responseCode__: The HTTP response code returned by the server. (long)
-
-- __response__: The HTTP response returned by the server. (DOMString)
-
-- __headers__: The HTTP response headers by the server. (Object)
- - Currently supported on iOS only.
-
-### iOS Quirks
-
-- Does not support `responseCode` or `bytesSent`.
-
-### Browser Quirks
-
-- __withCredentials__: _boolean_ that tells the browser to set the withCredentials flag on the XMLHttpRequest
-
-### Windows Quirks
-
-- An option parameter with empty/null value is excluded in the upload operation due to the Windows API design.
-
-## download
-
-__Parameters__:
-
-- __source__: URL of the server to download the file, as encoded by `encodeURI()`.
-
-- __target__: Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See [Backwards Compatibility Notes](#backwards-compatibility-notes) below)
-
-- __successCallback__: A callback that is passed a `FileEntry` object. _(Function)_
-
-- __errorCallback__: A callback that executes if an error occurs when retrieving the `FileEntry`. Invoked with a `FileTransferError` object. _(Function)_
-
-- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true`, it accepts all security certificates. This is useful because Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_
-
-- __options__: Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc).
-
-### Example
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-### WP8 Quirks
-
-- Download requests is being cached by native implementation. To avoid caching, pass `if-Modified-Since` header to download method.
-
-### Browser Quirks
-
-- __withCredentials__: _boolean_ that tells the browser to set the withCredentials flag on the XMLHttpRequest
-
-## abort
-
-Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object which has an error code of `FileTransferError.ABORT_ERR`.
-
-### Example
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-A `FileTransferError` object is passed to an error callback when an error occurs.
-
-### Properties
-
-- __code__: One of the predefined error codes listed below. (Number)
-
-- __source__: URL to the source. (String)
-
-- __target__: URL to the target. (String)
-
-- __http_status__: HTTP status code. This attribute is only available when a response code is received from the HTTP connection. (Number)
-
-- __body__ Response body. This attribute is only available when a response is received from the HTTP connection. (String)
-
-- __exception__: Either e.getMessage or e.toString (String)
-
-### Constants
-
-- 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-- 2 = `FileTransferError.INVALID_URL_ERR`
-- 3 = `FileTransferError.CONNECTION_ERR`
-- 4 = `FileTransferError.ABORT_ERR`
-- 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Windows Quirks
-
-- The plugin implementation is based on [BackgroundDownloader](https://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.backgroundtransfer.backgrounddownloader.aspx)/[BackgroundUploader](https://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.backgroundtransfer.backgrounduploader.aspx), which entails the latency issues on Windows devices (creation/starting of an operation can take up to a few seconds). You can use XHR or [HttpClient](https://msdn.microsoft.com/en-us/library/windows/apps/windows.web.http.httpclient.aspx) as a quicker alternative for small downloads.
-
-## Backwards Compatibility Notes
-
-Previous versions of this plugin would only accept device-absolute-file-paths as the source for uploads, or as the target for downloads. These paths would typically be of the form:
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-For backwards compatibility, these paths are still accepted, and if your application has recorded paths like these in persistent storage, then they can continue to be used.
-
-These paths were previously exposed in the `fullPath` property of `FileEntry` and `DirectoryEntry` objects returned by the File plugin. New versions of the File plugin however, no longer expose these paths to JavaScript.
-
-If you are upgrading to a new (1.0.0 or newer) version of File, and you have previously been using `entry.fullPath` as arguments to `download()` or `upload()`, then you will need to change your code to use filesystem URLs instead.
-
-`FileEntry.toURL()` and `DirectoryEntry.toURL()` return a filesystem URL of the form:
-
- cdvfile://localhost/persistent/path/to/file
-
-which can be used in place of the absolute file path in both `download()` and `upload()` methods.
diff --git a/plugins/cordova-plugin-file-transfer/RELEASENOTES.md b/plugins/cordova-plugin-file-transfer/RELEASENOTES.md
deleted file mode 100644
index 19591b1..0000000
--- a/plugins/cordova-plugin-file-transfer/RELEASENOTES.md
+++ /dev/null
@@ -1,267 +0,0 @@
-
-# Release Notes
-
-### 1.5.1 (Apr 15, 2016)
-* CB-10536 Removing flaky test assertions about abort callback latency
-* Removing the expectation in `spec.34` for the transfer method to be called.
-* CB-10978 Fix `file-transfer.tests` JSHint issues
-* CB-10782 Occasional failure in file transfer tests causing mobilespec crash
-* CB-10771 Fixing failure when empty string passed as a value for option parameter in upload function
-* CB-10636 Add `JSHint` for plugins
-
-### 1.5.0 (Jan 15, 2016)
-* CB-10208 Fix `file-transfer` multipart form data upload format on **Windows**
-* CB-9837 Add data `URI` support to `file-transfer` upload on **iOS**
-* CB-9600 `FileUploadOptions` params not posted on **iOS**
-* CB-9840 Fallback `file-transfer` `uploadResponse` encoding to `latin1` in case not encoded with `UTF-8` on **iOS**
-* CB-9840 Fallback `file-transfer` upload/download response encoding to `latin1` in case not encoded with `UTF-8` on **iOS**
-* CB-8641 **Windows Phone 8.1** Some `file-transfer` plugin tests occasionally fail in `mobilespec`
-* Adding linting and fixing linter warnings. Reducing timeouts to 7 seconds.
-* CB-10100 updated file dependency to not grab new majors
-* CB-7006 Empty file is created on file transfer if server response is 304
-* CB-10098 `filetransfer.spec.33` is faulty
-* CB-9969 Filetransfer upload error deletes original file
-* CB-10088 `filetransfer spec.10` and `spec.11` test is faulty
-* CB-9969 Filetransfer upload error deletes original file
-* CB-10086 There are two `spec.31` tests for `file-transfer` tests
-* CB-10037 Add progress indicator to file-transfer manual tests
-* CB-9563 Mulptipart form data is used even a header named `Content-Type` is present
-* CB-8863 fix block usage of self
-
-### 1.4.0 (Nov 18, 2015)
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
-* [CB-9879](https://issues.apache.org/jira/browse/CB-9879) `getCookie`s can cause unhandled `NullPointerException`
-* [CB-6928](https://issues.apache.org/jira/browse/CB-6928) Wrong behaviour transferring cacheable content
-* [CB-51](https://issues.apache.org/jira/browse/CB-51) FileTransfer - Support `PUT` Method
-* [CB-9906](https://issues.apache.org/jira/browse/CB-9906) cleanup duplicate code, removed 2nd `isWP8` declaration.
-* [CB-9950](https://issues.apache.org/jira/browse/CB-9950) Unpend Filetransfer spec.27 on **wp8** as custom headers are now supported
-* [CB-9843](https://issues.apache.org/jira/browse/CB-9843) Added **wp8** quirk to test spec 12
-* Fixing contribute link.
-* [CB-8431](https://issues.apache.org/jira/browse/CB-8431) File Transfer tests crash on **Android Lolipop**
-* [CB-9790](https://issues.apache.org/jira/browse/CB-9790) Align `FileUploadOptions` `fileName` and `mimeType` default parameter values to the docs on **iOS**
-* [CB-9385](https://issues.apache.org/jira/browse/CB-9385) Return `FILE_NOT_FOUND_ERR` when receiving `404` code on **iOS**
-* [CB-9791](https://issues.apache.org/jira/browse/CB-9791) Decreased download and upload tests timeout
-
-### 1.3.0 (Sep 18, 2015)
-* Found issue where : is accepted as a valid header, this is obviously wrong
-* [CB-9562](https://issues.apache.org/jira/browse/CB-9562) Fixed incorrect headers handling on Android
-* Fixing headers so they don't accept non-ASCII
-* updated tests to use cordova apache vm
-* [CB-9493](https://issues.apache.org/jira/browse/CB-9493) Fix file paths in file-transfer manual tests
-* [CB-8816](https://issues.apache.org/jira/browse/CB-8816) Add cdvfile:// support on windows
-* [CB-9376](https://issues.apache.org/jira/browse/CB-9376) Fix FileTransfer plugin manual tests issue - 'undefined' in paths
-
-### 1.2.1 (Jul 7, 2015)
-* [CB-9275](https://issues.apache.org/jira/browse/CB-9275) [WP8] Fix build failure on WP8 by using reflection to detect presence of JSON.NET based serialization
-* Updated code per code review.
-* Updated documentation for browser
-* Added option to allow for passing cookies automatically in the browser
-
-### 1.2.0 (Jun 17, 2015)
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-file-transfer documentation translation: cordova-plugin-file-transfer
-* [CB-6503](https://issues.apache.org/jira/browse/CB-6503): Null pointer check for headers in upload (This closes #27)
-* [CB-6503](https://issues.apache.org/jira/browse/CB-6503): Allow payload content-types other than multipart/form-data to be used for upload
-* Fix NoSuchMethodException looking up cookies.
-* fix npm md issue
-* [CB-8951](https://issues.apache.org/jira/browse/CB-8951) (wp8) Handle exceptions in download() and upload() again
-* [wp8] Relaxed engine version requirement, using reflection to see if methods are available
-* Check for the existence of Json.net assembly to determin how we deserialize our headers.
-* relax engine requirement to allow -dev versions
-* Remove verbose console log messages
-* fix bad commit (mine) for cordova-wp8@4.0.0 engine req
-* bump required cordova-wp8 version to 4.0.0
-* This closes #80, This closes #12
-* fix failing test resulting from overlapping async calls
-* [CB-8721](https://issues.apache.org/jira/browse/CB-8721) Fixes incorrect headers and upload params parsing on wp8
-* Replace all slashes in windows path
-
-### 1.1.0 (May 06, 2015)
-* [CB-8951](https://issues.apache.org/jira/browse/CB-8951) Fixed crash related to headers parsing on **wp8**
-* [CB-8933](https://issues.apache.org/jira/browse/CB-8933) Increased download and upload test timeout
-* [CB-6313](https://issues.apache.org/jira/browse/CB-6313) **wp8**: Extra boundary in upload
-* [CB-8761](https://issues.apache.org/jira/browse/CB-8761) **wp8**: Copy cookies from WebBrowser
-
-### 1.0.0 (Apr 15, 2015)
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) bumped version of file dependency
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
-* [CB-8641](https://issues.apache.org/jira/browse/CB-8641) Fixed tests to pass on windows and wp8
-* [CB-8583](https://issues.apache.org/jira/browse/CB-8583) Forces download to overwrite existing target file
-* [CB-8589](https://issues.apache.org/jira/browse/CB-8589) Fixes upload failure when server's response doesn't contain any data
-* [CB-8747](https://issues.apache.org/jira/browse/CB-8747) updated dependency, added peer dependency
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
-* Use TRAVIS_BUILD_DIR, install paramedic by npm
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
-* [CB-8654](https://issues.apache.org/jira/browse/CB-8654) Note WP8 download requests caching in docs
-* [CB-8590](https://issues.apache.org/jira/browse/CB-8590) (Windows) Fixed download.onprogress.lengthComputable
-* [CB-8566](https://issues.apache.org/jira/browse/CB-8566) Integrate TravisCI
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-file-transfer documentation translation: cordova-plugin-file-transfer
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
-* [CB-8495](https://issues.apache.org/jira/browse/CB-8495) Fixed wp8 and wp81 test failures
-* [CB-7957](https://issues.apache.org/jira/browse/CB-7957) Adds support for `browser` platform
-* [CB-8429](https://issues.apache.org/jira/browse/CB-8429) Updated version and RELEASENOTES.md for release 0.5.0 (take 2)
-* Fixes typo, introduced in https://github.com/apache/cordova-plugin-file-transfer/commit/bc43b46
-* [CB-8407](https://issues.apache.org/jira/browse/CB-8407) Use File proxy to construct valid FileEntry for download success callback
-* [CB-8407](https://issues.apache.org/jira/browse/CB-8407) Removes excess path to native path conversion in download method
-* [CB-8429](https://issues.apache.org/jira/browse/CB-8429) Updated version and RELEASENOTES.md for release 0.5.0
-* [CB-7957](https://issues.apache.org/jira/browse/CB-7957) Adds support for `browser` platform
-* [CB-8095](https://issues.apache.org/jira/browse/CB-8095) Fixes JSHint and formatting issues
-* [CB-8095](https://issues.apache.org/jira/browse/CB-8095) Updates tests and documentation
-* [CB-8095](https://issues.apache.org/jira/browse/CB-8095) Rewrite upload method to support progress events properly
-* android: Fix error reporting for unknown uri type on sourceUri instead of targetUri
-
-### 0.5.0 (Feb 04, 2015)
-* [CB-8407](https://issues.apache.org/jira/browse/CB-8407) windows: Fix download of `ms-appdata:///` URIs
-* [CB-8095](https://issues.apache.org/jira/browse/CB-8095) windows: Rewrite upload method to support progress events properly
-* [CB-5059](https://issues.apache.org/jira/browse/CB-5059) android: Add a CookieManager abstraction for pluggable webviews
-* ios: Fix compile warning about implicity int conversion
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use a local copy of DLog macro rather than CordovaLib version
-* [CB-8296](https://issues.apache.org/jira/browse/CB-8296) ios: Fix crash when upload fails and file is not yet created (close #57)
-* Document "body" property on FileTransferError
-* [CB-7912](https://issues.apache.org/jira/browse/CB-7912) ios, android: Update to work with whitelist plugins in Cordova 4.x
-* Error callback should always be called with the FileTransferError object, and not just the code
-* windows: alias appData to Windows.Storage.ApplicationData.current
-* [CB-8093](https://issues.apache.org/jira/browse/CB-8093) Fixes incorrect FileTransferError returned in case of download failure
-
-### 0.4.8 (Dec 02, 2014)
-* [CB-8021](https://issues.apache.org/jira/browse/CB-8021) - adds documentation for `httpMethod` to `doc/index.md`. However, translations still need to be addressed.
-* [CB-7223](https://issues.apache.org/jira/browse/CB-7223) spec.27 marked pending for **wp8**
-* [CB-6900](https://issues.apache.org/jira/browse/CB-6900) fixed `spec.7` for **wp8**
-* [CB-7944](https://issues.apache.org/jira/browse/CB-7944) Pended unsupported auto tests for *Windows*
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-file-transfer documentation translation: cordova-plugin-file-transfer
-
-### 0.4.7 (Oct 03, 2014)
-* Construct proper FileEntry with nativeURL property set
-* [CB-7532](https://issues.apache.org/jira/browse/CB-7532) Handle non-existent download dirs properly
-* [CB-7529](https://issues.apache.org/jira/browse/CB-7529) Adds support for 'ms-appdata' URIs for windows
-
-### 0.4.6 (Sep 17, 2014)
-* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-file-transfer documentation translation
-* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-file-transfer documentation translation
-* [CB-7423](https://issues.apache.org/jira/browse/CB-7423) fix spec28,29 lastProgressEvent not visible to afterEach function
-* Amazon related changes.
-* Remove dupe file windows+windows8 both use the same one
-* [CB-7316](https://issues.apache.org/jira/browse/CB-7316) Updates docs with actual information.
-* [CB-7316](https://issues.apache.org/jira/browse/CB-7316) Adds support for Windows platform, moves \*Proxy files to proper directory.
-* [CB-7316](https://issues.apache.org/jira/browse/CB-7316) Improves current specs compatibility:
-* added documentation for new test
-* [CB-6466](https://issues.apache.org/jira/browse/CB-6466) Fix failing test due to recent url change
-* [CB-6466](https://issues.apache.org/jira/browse/CB-6466) created mobile-spec test
-* Renamed test dir, added nested plugin.xml and test
-* Fixed failing spec.19 on wp8
-* added documentation to manual tests
-* [CB-6961](https://issues.apache.org/jira/browse/CB-6961) port file-transfer tests to framework
-
-### 0.4.5 (Aug 06, 2014)
-* Upload parameters out of order
-* **FirefoxOS** initial implementation
-* [CB-6781](https://issues.apache.org/jira/browse/CB-6781): Expose FileTransferError.exception to application
-* [CB-6928](https://issues.apache.org/jira/browse/CB-6928): Add new error code to documentation
-* [CB-6928](https://issues.apache.org/jira/browse/CB-6928): Handle 304 status code
-* [CB-6928](https://issues.apache.org/jira/browse/CB-6928): Open output stream only if it's necessary.
-* [BlackBerry10] Minor doc correction
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
-* [Windows8] upload uses the provided fileName or the actual fileName
-* [CB-2420](https://issues.apache.org/jira/browse/CB-2420) [Windows8] honor fileKey and param options. This closes #15
-* [CB-6781](https://issues.apache.org/jira/browse/CB-6781): Update new docs to match AlexNennker's changes in PR30
-* [CB-6781](https://issues.apache.org/jira/browse/CB-6781): Continue previous commit with one new instance (This closes #30)
-* [CB-6781](https://issues.apache.org/jira/browse/CB-6781): add the exception text to the error object
-* [CB-6890](https://issues.apache.org/jira/browse/CB-6890): Fix pluginManager access for 4.0.x branch
-
-### 0.4.4 (Jun 05, 2014)
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #21
-* ubuntu: support 'cdvfile' URI
-* [CB-6802](https://issues.apache.org/jira/browse/CB-6802) Add license
-* Upload progress now works also for second file
-* [CB-6706](https://issues.apache.org/jira/browse/CB-6706): Relax dependency on file plugin
-* [CB-3440](https://issues.apache.org/jira/browse/CB-3440) [BlackBerry10] Update implementation to use modules from file plugin
-* [CB-6378](https://issues.apache.org/jira/browse/CB-6378) Use connection.disconnect() instead of stream.close() for thread-safety
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
-* [CB-6466](https://issues.apache.org/jira/browse/CB-6466) Auto-create directories in download
-* [CB-6494](https://issues.apache.org/jira/browse/CB-6494) android: Fix upload of KitKat content URIs
-* Upleveled from android port with following commits: 3c1ff16 Andrew Grieve - [CB-5762](https://issues.apache.org/jira/browse/CB-5762) android: Fix lengthComputable set wrong for gzip downloads 8374b3d Colin Mahoney - [CB-5631](https://issues.apache.org/jira/browse/CB-5631) Removed SimpleTrackingInputStream.read(byte[] buffer) 6f91ac3 Bas Bosman - [CB-4907](https://issues.apache.org/jira/browse/CB-4907) Close stream when we're finished with it 651460f Christoph Neumann - [CB-6000](https://issues.apache.org/jira/browse/CB-6000) Nginx rejects Content-Type without a space before "boundary". 35f80e4 Ian Clelland - [CB-6050](https://issues.apache.org/jira/browse/CB-6050): Use instance method on actual file plugin object to get FileEntry to return on download
-* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Updated version and RELEASENOTES.md for release 0.4.1
-
-### 0.4.3 (Apr 17, 2014)
-* [CB-6422](https://issues.apache.org/jira/browse/CB-6422) [windows8] use cordova/exec/proxy
-* iOS: Fix error where files were not removed on abort
-* [CB-5175](https://issues.apache.org/jira/browse/CB-5175): [ios] CDVFileTransfer asynchronous download (Fixes #24)
-* [ios] Cast id references to NSURL to avoid compiler warnings (Fixes: apache/cordova-plugin-file-transfer#18)
-* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
-* [CB-5762](https://issues.apache.org/jira/browse/CB-5762): [FireOS] android: Fix lengthComputable set wrong for gzip downloads
-* [CB-5631](https://issues.apache.org/jira/browse/CB-5631): [FireOS] Removed SimpleTrackingInputStream.read(byte[] buffer)
-* [CB-4907](https://issues.apache.org/jira/browse/CB-4907): [FireOS] Close stream when we're finished with it
-* [CB-6000](https://issues.apache.org/jira/browse/CB-6000): [FireOS] Nginx rejects Content-Type without a space before "boundary".
-* [CB-6050](https://issues.apache.org/jira/browse/CB-6050): [FireOS] Use instance method on actual file plugin object to get FileEntry to return on download
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
-
-### 0.4.2 (Feb 28, 2014)
-* [CB-6106](https://issues.apache.org/jira/browse/CB-6106) Ensure that nativeURL is used by file transfer download
-* iOS: Fix default value for trustAllHosts on iOS (YES->NO)
-* [CB-6059](https://issues.apache.org/jira/browse/CB-6059) iOS: Stop FileTransfer.download doing IO on the UI thread.
-* [CB-5588](https://issues.apache.org/jira/browse/CB-5588) iOS: Add response headers to upload result
-* [CB-2190](https://issues.apache.org/jira/browse/CB-2190) iOS: Make backgroundTaskId apply to downloads as well. Move backgroundTaskId to the delegate.
-* [CB-6050](https://issues.apache.org/jira/browse/CB-6050) Android: Use instance method on actual file plugin object to get FileEntry to return on download
-* [CB-6000](https://issues.apache.org/jira/browse/CB-6000) Android: Nginx rejects Content-Type without a space before "boundary".
-* [CB-4907](https://issues.apache.org/jira/browse/CB-4907) Android: Close stream when we're finished with it
-* [CB-6022](https://issues.apache.org/jira/browse/CB-6022) Add backwards-compatibility notes to doc
-
-### 0.4.1 (Feb 05, 2014)
-* [CB-5365](https://issues.apache.org/jira/browse/CB-5365) Remove unused exception var to prevent warnings?
-* [CB-2421](https://issues.apache.org/jira/browse/CB-2421) explicitly write the bytesSent,responseCode,result to the FileUploadResult pending release of cordova-plugin-file dependency, added some sanity checks for callbacks
-* iOS: Update for new file plugin api
-* [CB-5631](https://issues.apache.org/jira/browse/CB-5631) Removed SimpleTrackingInputStream.read(byte[] buffer)
-* [CB-5762](https://issues.apache.org/jira/browse/CB-5762) android: Fix lengthComputable set wrong for gzip downloads
-* [CB-4899](https://issues.apache.org/jira/browse/CB-4899) [BlackBerry10] Improve binary file transfer download
-* Delete stale test/ directory
-* [CB-5722](https://issues.apache.org/jira/browse/CB-5722) [BlackBerry10] Update upload function to use native file object
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Delete stale snapshot of plugin docs
-* Remove @1 designation from file plugin dependency until pushed to npm
-* [CB-5466](https://issues.apache.org/jira/browse/CB-5466): Update to work with filesystem URLs
-
-### 0.4.0 (Dec 4, 2013)
-* [CB-5466](https://issues.apache.org/jira/browse/CB-5466): Partial revert; we're not ready yet for FS urls
-* add ubuntu platform
-* [CB-5466](https://issues.apache.org/jira/browse/CB-5466): Minor version bump
-* [CB-5466](https://issues.apache.org/jira/browse/CB-5466): Update FileTransfer plugin to accept filesystem urls
-* Added amazon-fireos platform. Change to use amazon-fireos as the platform if the user agen string contains 'cordova-amazon-fireos'
-
-### 0.3.4 (Oct 28, 2013)
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for file transfer plugin
-* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
-
-### 0.3.3 (Oct 9, 2013)
-* removed un-needed undef check
-* Fix missing headers in Windows 8 upload proxy
-* Fix missing headers in Windows 8 Proxy
-* Fix Windows 8 HTMLAnchorElement return host:80 which force Basic Auth Header to replace options Auth Header
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
-
-### 0.3.2 (Sept 25, 2013)
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
-* [windows8] commandProxy was moved
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) updating core references
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.file-transfer to org.apache.cordova.file-transfer and updating dependency
-* Rename CHANGELOG.md -> RELEASENOTES.md
diff --git a/plugins/cordova-plugin-file-transfer/doc/de/README.md b/plugins/cordova-plugin-file-transfer/doc/de/README.md
deleted file mode 100644
index 03191cb..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/de/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-Plugin-Dokumentation:
-
-Dieses Plugin ermöglicht Ihnen zum Hochladen und Herunterladen von Dateien.
-
-Dieses Plugin wird global `FileTransfer`, `FileUploadOptions` Konstruktoren definiert.
-
-Obwohl im globalen Gültigkeitsbereich, sind sie nicht bis nach dem `deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Unterstützte Plattformen
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Browser
- * Firefox OS **
- * iOS
- * Windows Phone 7 und 8 *
- * Windows 8
- * Windows
-
-\ * *Unterstützen keine `Onprogress` noch `abort()` *
-
-\ ** * `Onprogress` nicht unterstützt*
-
-# FileTransfer
-
-Das `FileTransfer` -Objekt stellt eine Möglichkeit zum Hochladen von Dateien, die mithilfe einer HTTP-mehrteiligen POST oder PUT-Anforderung, und auch Dateien herunterladen.
-
-## Eigenschaften
-
- * **OnProgress**: aufgerufen, wobei ein `ProgressEvent` wann wird eine neue Datenmenge übertragen. *(Funktion)*
-
-## Methoden
-
- * **Upload**: sendet eine Datei an einen Server.
-
- * **Download**: lädt eine Datei vom Server.
-
- * **abort**: Abbruch eine Übertragung in Bearbeitung.
-
-## Upload
-
-**Parameter**:
-
- * **FileURL**: Dateisystem-URL, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten)
-
- * **Server**: URL des Servers, die Datei zu empfangen, wie kodiert`encodeURI()`.
-
- * **successCallback**: ein Rückruf, der ein `FileUploadResult`-Objekt übergeben wird. *(Funktion)*
-
- * **errorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `FileUploadResult`. Mit einem `FileTransferError`-Objekt aufgerufen. *(Funktion)*
-
- * **Optionen**: optionale Parameter *(Objekt)*. Gültige Schlüssel:
-
- * **FileKey**: der Name des Form-Elements. Wird standardmäßig auf `file` . (DOM-String und enthält)
- * **Dateiname**: der Dateiname beim Speichern der Datei auf dem Server verwendet. Wird standardmäßig auf `image.jpg` . (DOM-String und enthält)
- * **httpMethod**: die HTTP-Methode, die-entweder `PUT` oder `POST`. Der Standardwert ist `POST`. (DOM-String und enthält)
- * **mimeType**: den Mime-Typ der Daten hochzuladen. Standardwerte auf `Image/Jpeg`. (DOM-String und enthält)
- * **params**: eine Reihe von optionalen Schlüssel/Wert-Paaren in der HTTP-Anforderung übergeben. (Objekt)
- * **chunkedMode**: ob die Daten in "Chunked" streaming-Modus hochladen. Der Standardwert ist `true`. (Boolean)
- * **headers**: eine Karte von Header-Name-Header-Werte. Verwenden Sie ein Array, um mehr als einen Wert anzugeben. Auf iOS, FireOS und Android wenn ein Content-Type-Header vorhanden ist, werden mehrteilige Formulardaten nicht verwendet werden. (Object)
- * **httpMethod**: die HTTP-Methode zu verwenden, z.B. POST oder PUT. Der Standardwert ist `POST`. (DOM-String enthält)
-
- * **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)*
-
-### Beispiel
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Beispiel mit hochladen Kopf- und Progress-Ereignisse (Android und iOS nur)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Ein `FileUploadResult`-Objekt wird an den Erfolg-Rückruf des `Objekts FileTransfer`-Upload()-Methode übergeben.
-
-### Eigenschaften
-
- * **BytesSent**: die Anzahl der Bytes, die als Teil des Uploads an den Server gesendet. (lange)
-
- * **ResponseCode**: die HTTP-Response-Code vom Server zurückgegeben. (lange)
-
- * **response**: der HTTP-Antwort vom Server zurückgegeben. (DOM-String und enthält)
-
- * **Header**: die HTTP-Response-Header vom Server. (Objekt)
-
- * Derzeit unterstützt auf iOS nur.
-
-### iOS Macken
-
- * Unterstützt keine `responseCode` oder`bytesSent`.
-
-## Download
-
-**Parameter**:
-
- * **source**: URL des Servers, um die Datei herunterzuladen, wie kodiert`encodeURI()`.
-
- * **target**: Dateisystem-Url, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten)
-
- * **SuccessCallback**: ein Rückruf, der übergeben wird ein `FileEntry` Objekt. *(Funktion)*
-
- * **errorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `FileEntry`. Mit einem `FileTransferError`-Objekt aufgerufen. *(Funktion)*
-
- * **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)*
-
- * **Options**: optionale Parameter, derzeit nur unterstützt Kopfzeilen (z. B. Autorisierung (Standardauthentifizierung), etc.).
-
-### Beispiel
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### WP8 Macken
-
- * Downloaden anfordert, wird von native Implementierung zwischengespeichert wird. Um zu vermeiden, Zwischenspeicherung, übergeben `If-Modified-Since` Header Methode herunterladen.
-
-## abort
-
-Bricht einen in-Progress-Transfer. Der Onerror-Rückruf wird ein FileTransferError-Objekt übergeben, die einen Fehlercode FileTransferError.ABORT_ERR hat.
-
-### Beispiel
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-Ein `FileTransferError`-Objekt wird an eine Fehler-Callback übergeben, wenn ein Fehler auftritt.
-
-### Eigenschaften
-
- * **Code**: einer der vordefinierten Fehlercodes aufgeführt. (Anzahl)
-
- * **Quelle**: URL der Quelle. (String)
-
- * **Ziel**: URL zum Ziel. (String)
-
- * **HTTP_STATUS**: HTTP-Statuscode. Dieses Attribut ist nur verfügbar, wenn ein Response-Code aus der HTTP-Verbindung eingeht. (Anzahl)
-
- * **body** Antworttext. Dieses Attribut ist nur verfügbar, wenn eine Antwort von der HTTP-Verbindung eingeht. (String)
-
- * **exception**: entweder e.getMessage oder e.toString (String)
-
-### Konstanten
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Hinweise rückwärts Kompatibilität
-
-Frühere Versionen des Plugins würde nur Gerät-Absolute-Dateipfade als Quelle für Uploads oder als Ziel für Downloads übernehmen. Diese Pfade wäre in der Regel der form
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Für rückwärts Kompatibilität, diese Pfade noch akzeptiert werden, und wenn Ihre Anwendung Pfade wie diese im permanenten Speicher aufgezeichnet hat, dann sie können weiter verwendet werden.
-
-Diese Pfade waren zuvor in der Eigenschaft `fullPath` `FileEntry` und `DirectoryEntry`-Objekte, die durch das Plugin Datei zurückgegeben ausgesetzt. Neue Versionen der die Datei-Erweiterung, jedoch nicht länger werden diese Pfade zu JavaScript.
-
-Wenn Sie ein auf eine neue Upgrade (1.0.0 oder neuere) Version der Datei, und Sie haben zuvor mit `entry.fullPath` als Argumente `download()` oder `upload()`, dann ändern Sie den Code, um die Dateisystem-URLs verwenden müssen.
-
-`FileEntry.toURL()` und `DirectoryEntry.toURL()` zurück, eine Dateisystem-URL in der form
-
- cdvfile://localhost/persistent/path/to/file
-
-
-die anstelle der absoluten Dateipfad in `download()` und `upload()` Methode verwendet werden kann.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/de/index.md b/plugins/cordova-plugin-file-transfer/doc/de/index.md
deleted file mode 100644
index 4081503..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/de/index.md
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-Dieses Plugin ermöglicht Ihnen zum Hochladen und Herunterladen von Dateien.
-
-Dieses Plugin wird global `FileTransfer`, `FileUploadOptions` Konstruktoren definiert.
-
-Obwohl im globalen Gültigkeitsbereich, sind sie nicht bis nach dem `deviceready`-Ereignis.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Installation
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Unterstützte Plattformen
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Browser
-* Firefox OS **
-* iOS
-* Windows Phone 7 und 8 *
-* Windows 8
-* Windows
-
-* *Unterstützen keine `onprogress` noch `abort()`*
-
-* * *`onprogress` nicht unterstützt*
-
-# FileTransfer
-
-Das `FileTransfer`-Objekt bietet eine Möglichkeit zum Hochladen von Dateien, die mithilfe einer HTTP-Anforderung für mehrteiligen POST sowie Informationen zum Herunterladen von Dateien sowie.
-
-## Eigenschaften
-
-* **OnProgress**: aufgerufen, wobei ein `ProgressEvent` wann wird eine neue Datenmenge übertragen. *(Funktion)*
-
-## Methoden
-
-* **Upload**: sendet eine Datei an einen Server.
-
-* **Download**: lädt eine Datei vom Server.
-
-* **abort**: Abbruch eine Übertragung in Bearbeitung.
-
-## Upload
-
-**Parameter**:
-
-* **FileURL**: Dateisystem-URL, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten)
-
-* **Server**: URL des Servers, die Datei zu empfangen, wie kodiert`encodeURI()`.
-
-* **successCallback**: ein Rückruf, der ein `FileUploadResult`-Objekt übergeben wird. *(Funktion)*
-
-* **errorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `FileUploadResult`. Mit einem `FileTransferError`-Objekt aufgerufen. *(Funktion)*
-
-* **Optionen**: optionale Parameter *(Objekt)*. Gültige Schlüssel:
-
- * **FileKey**: der Name des Form-Elements. Wird standardmäßig auf `file` . (DOM-String und enthält)
- * **Dateiname**: der Dateiname beim Speichern der Datei auf dem Server verwendet. Wird standardmäßig auf `image.jpg` . (DOM-String und enthält)
- * **httpMethod**: die HTTP-Methode, die-entweder `PUT` oder `POST`. Der Standardwert ist `POST`. (DOM-String und enthält)
- * **mimeType**: den Mime-Typ der Daten hochzuladen. Standardwerte auf `Image/Jpeg`. (DOM-String und enthält)
- * **params**: eine Reihe von optionalen Schlüssel/Wert-Paaren in der HTTP-Anforderung übergeben. (Objekt)
- * **chunkedMode**: ob die Daten in "Chunked" streaming-Modus hochladen. Der Standardwert ist `true`. (Boolean)
- * **headers**: eine Karte von Header-Name-Header-Werte. Verwenden Sie ein Array, um mehr als einen Wert anzugeben. (Objekt)
-
-* **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)*
-
-### Beispiel
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Beispiel mit hochladen Kopf- und Progress-Ereignisse (Android und iOS nur)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Ein `FileUploadResult`-Objekt wird an den Erfolg-Rückruf des `Objekts FileTransfer`-Upload()-Methode übergeben.
-
-### Eigenschaften
-
-* **BytesSent**: die Anzahl der Bytes, die als Teil des Uploads an den Server gesendet. (lange)
-
-* **ResponseCode**: die HTTP-Response-Code vom Server zurückgegeben. (lange)
-
-* **response**: der HTTP-Antwort vom Server zurückgegeben. (DOM-String und enthält)
-
-* **Header**: die HTTP-Response-Header vom Server. (Objekt)
-
- * Derzeit unterstützt auf iOS nur.
-
-### iOS Macken
-
-* Unterstützt keine `responseCode` oder`bytesSent`.
-
-## Download
-
-**Parameter**:
-
-* **source**: URL des Servers, um die Datei herunterzuladen, wie kodiert`encodeURI()`.
-
-* **target**: Dateisystem-Url, das die Datei auf dem Gerät. Für rückwärts Kompatibilität, dies kann auch der vollständige Pfad der Datei auf dem Gerät sein. (Siehe [rückwärts Kompatibilität Notes] unten)
-
-* **SuccessCallback**: ein Rückruf, der übergeben wird ein `FileEntry` Objekt. *(Funktion)*
-
-* **errorCallback**: ein Rückruf, der ausgeführt wird, tritt ein Fehler beim Abrufen der `FileEntry`. Mit einem `FileTransferError`-Objekt aufgerufen. *(Funktion)*
-
-* **TrustAllHosts**: Optionaler Parameter, wird standardmäßig auf `false` . Wenn legen Sie auf `true` , es akzeptiert alle Sicherheitszertifikate. Dies ist nützlich, da Android selbstsignierte Zertifikate ablehnt. Nicht für den produktiven Einsatz empfohlen. Auf Android und iOS unterstützt. *(Boolean)*
-
-* **Options**: optionale Parameter, derzeit nur unterstützt Kopfzeilen (z. B. Autorisierung (Standardauthentifizierung), etc.).
-
-### Beispiel
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## abort
-
-Bricht einen in-Progress-Transfer. Der Onerror-Rückruf wird ein FileTransferError-Objekt übergeben, die einen Fehlercode FileTransferError.ABORT_ERR hat.
-
-### Beispiel
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-Ein `FileTransferError`-Objekt wird an eine Fehler-Callback übergeben, wenn ein Fehler auftritt.
-
-### Eigenschaften
-
-* **Code**: einer der vordefinierten Fehlercodes aufgeführt. (Anzahl)
-
-* **Quelle**: URL der Quelle. (String)
-
-* **Ziel**: URL zum Ziel. (String)
-
-* **HTTP_STATUS**: HTTP-Statuscode. Dieses Attribut ist nur verfügbar, wenn ein Response-Code aus der HTTP-Verbindung eingeht. (Anzahl)
-
-* **body** Antworttext. Dieses Attribut ist nur verfügbar, wenn eine Antwort von der HTTP-Verbindung eingeht. (String)
-
-* **exception**: entweder e.getMessage oder e.toString (String)
-
-### Konstanten
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Hinweise rückwärts Kompatibilität
-
-Frühere Versionen des Plugins würde nur Gerät-Absolute-Dateipfade als Quelle für Uploads oder als Ziel für Downloads übernehmen. Diese Pfade wäre in der Regel der form
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Für rückwärts Kompatibilität, diese Pfade noch akzeptiert werden, und wenn Ihre Anwendung Pfade wie diese im permanenten Speicher aufgezeichnet hat, dann sie können weiter verwendet werden.
-
-Diese Pfade waren zuvor in der Eigenschaft `fullPath` `FileEntry` und `DirectoryEntry`-Objekte, die durch das Plugin Datei zurückgegeben ausgesetzt. Neue Versionen der die Datei-Erweiterung, jedoch nicht länger werden diese Pfade zu JavaScript.
-
-Wenn Sie ein auf eine neue Upgrade (1.0.0 oder neuere) Version der Datei, und Sie haben zuvor mit `entry.fullPath` als Argumente `download()` oder `upload()`, dann ändern Sie den Code, um die Dateisystem-URLs verwenden müssen.
-
-`FileEntry.toURL()` und `DirectoryEntry.toURL()` zurück, eine Dateisystem-URL in der form
-
- cdvfile://localhost/persistent/path/to/file
-
-
-die anstelle der absoluten Dateipfad in `download()` und `upload()` Methode verwendet werden kann.
diff --git a/plugins/cordova-plugin-file-transfer/doc/es/README.md b/plugins/cordova-plugin-file-transfer/doc/es/README.md
deleted file mode 100644
index 1c8ee3f..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/es/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-Documentación del plugin:
-
-Este plugin te permite cargar y descargar archivos.
-
-Este plugin define global `FileTransfer` , `FileUploadOptions` constructores.
-
-Aunque en el ámbito global, no están disponibles hasta después de la `deviceready` evento.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Instalación
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Plataformas soportadas
-
- * Amazon fire OS
- * Android
- * BlackBerry 10
- * Explorador
- * Firefox OS **
- * iOS
- * Windows Phone 7 y 8 *
- * Windows 8
- * Windows
-
-\ * *No soporta `onprogress` ni `abort()` *
-
-\ ** *No soporta `onprogress` *
-
-# FileTransfer
-
-El objeto `FileTransfer` proporciona una manera para subir archivos utilizando una varias parte solicitud HTTP POST o PUT y descargar archivos, así.
-
-## Propiedades
-
- * **OnProgress**: llama con un `ProgressEvent` cuando se transfiere un nuevo paquete de datos. *(Función)*
-
-## Métodos
-
- * **cargar**: envía un archivo a un servidor.
-
- * **Descargar**: descarga un archivo del servidor.
-
- * **abortar**: aborta una transferencia en curso.
-
-## subir
-
-**Parámetros**:
-
- * **fileURL**: URL de Filesystem que representa el archivo en el dispositivo. Para atrás compatibilidad, esto también puede ser la ruta de acceso completa del archivo en el dispositivo. (Ver [hacia atrás compatibilidad notas] debajo)
-
- * **servidor**: dirección URL del servidor para recibir el archivo, como codificada por`encodeURI()`.
-
- * **successCallback**: una devolución de llamada que se pasa un `FileUploadResult` objeto. *(Función)*
-
- * **errorCallback**: una devolución de llamada que se ejecuta si se produce un error recuperar la `FileUploadResult` . Invocado con un `FileTransferError` objeto. *(Función)*
-
- * **Opciones**: parámetros opcionales *(objeto)*. Teclas válidas:
-
- * **fileKey**: el nombre del elemento de formulario. Por defecto es `file` . (DOMString)
- * **nombre de archivo**: el nombre del archivo a utilizar al guardar el archivo en el servidor. Por defecto es `image.jpg` . (DOMString)
- * **httpMethod**: método HTTP el utilizar - o `PUT` o `POST` . Por defecto es `POST` . (DOMString)
- * **mimeType**: el tipo mime de los datos para cargar. Por defecto es `image/jpeg` . (DOMString)
- * **params**: un conjunto de pares clave/valor opcional para pasar en la petición HTTP. (Objeto)
- * **chunkedMode**: Si desea cargar los datos en modo de transmisión fragmentado. Por defecto es `true` . (Boolean)
- * **headers**: un mapa de nombre de encabezado/valores de encabezado Utilice una matriz para especificar más de un valor. En iOS FireOS y Android, si existe un encabezado llamado Content-Type, datos de un formulario multipart no se utilizará. (Object)
- * **httpMethod**: HTTP el método a utilizar por ejemplo POST o poner. Por defecto `el POST`. (DOMString)
-
- * **trustAllHosts**: parámetro opcional, por defecto es `false` . Si establece en `true` , acepta todos los certificados de seguridad. Esto es útil ya que Android rechaza certificados autofirmados seguridad. No se recomienda para uso productivo. Compatible con iOS y Android. *(boolean)*
-
-### Ejemplo
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Ejemplo con cabeceras de subir y eventos de progreso (Android y iOS solamente)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-A `FileUploadResult` objeto se pasa a la devolución del éxito de la `FileTransfer` del objeto `upload()` método.
-
-### Propiedades
-
- * **bytesSent**: el número de bytes enviados al servidor como parte de la carga. (largo)
-
- * **responseCode**: código de respuesta HTTP el devuelto por el servidor. (largo)
-
- * **respuesta**: respuesta el HTTP devuelto por el servidor. (DOMString)
-
- * **cabeceras**: cabeceras de respuesta HTTP el por el servidor. (Objeto)
-
- * Actualmente compatible con iOS solamente.
-
-### iOS rarezas
-
- * No es compatible con `responseCode` o`bytesSent`.
-
-## descargar
-
-**Parámetros**:
-
- * **fuente**: dirección URL del servidor para descargar el archivo, como codificada por`encodeURI()`.
-
- * **objetivo**: Filesystem url que representa el archivo en el dispositivo. Para atrás compatibilidad, esto también puede ser la ruta de acceso completa del archivo en el dispositivo. (Ver [hacia atrás compatibilidad notas] debajo)
-
- * **successCallback**: una devolución de llamada que se pasa un `FileEntry` objeto. *(Función)*
-
- * **errorCallback**: una devolución de llamada que se ejecuta si se produce un error al recuperar los `FileEntry` . Invocado con un `FileTransferError` objeto. *(Función)*
-
- * **trustAllHosts**: parámetro opcional, por defecto es `false` . Si establece en `true` , acepta todos los certificados de seguridad. Esto es útil porque Android rechaza certificados autofirmados seguridad. No se recomienda para uso productivo. Compatible con iOS y Android. *(boolean)*
-
- * **Opciones**: parámetros opcionales, actualmente sólo soporta cabeceras (como autorización (autenticación básica), etc.).
-
-### Ejemplo
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### Rarezas de WP8
-
- * Descargar pide se almacena en caché por aplicación nativa. Para evitar el almacenamiento en caché, pasar `if-Modified-Since` encabezado para descargar el método.
-
-## abortar
-
-Aborta a una transferencia en curso. El callback onerror se pasa un objeto FileTransferError que tiene un código de error de FileTransferError.ABORT_ERR.
-
-### Ejemplo
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-A `FileTransferError` objeto se pasa a un callback de error cuando se produce un error.
-
-### Propiedades
-
- * **código**: uno de los códigos de error predefinido enumerados a continuación. (Número)
-
- * **fuente**: URL a la fuente. (String)
-
- * **objetivo**: URL a la meta. (String)
-
- * **HTTP_STATUS**: código de estado HTTP. Este atributo sólo está disponible cuando se recibe un código de respuesta de la conexión HTTP. (Número)
-
- * **cuerpo** Cuerpo de la respuesta. Este atributo sólo está disponible cuando se recibe una respuesta de la conexión HTTP. (String)
-
- * **excepción**: cualquier e.getMessage o e.toString (String)
-
-### Constantes
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Al revés notas de compatibilidad
-
-Versiones anteriores de este plugin sólo aceptaría dispositivo-absoluto-archivo-rutas como la fuente de carga, o como destino para las descargas. Estos caminos normalmente sería de la forma
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Para atrás compatibilidad, estos caminos son aceptados todavía, y si su solicitud ha grabado caminos como éstos en almacenamiento persistente, entonces pueden seguir utilizarse.
-
-Estos caminos fueron expuestos anteriormente en el `fullPath` propiedad de `FileEntry` y `DirectoryEntry` objetos devueltos por el plugin de archivo. Las nuevas versiones del archivo plugin, sin embargo, ya no exponen estos caminos a JavaScript.
-
-Si va a actualizar a una nueva (1.0.0 o más reciente) versión del archivo y previamente han estado utilizando `entry.fullPath` como argumentos para `download()` o `upload()` , entonces tendrá que cambiar su código para usar URLs de sistema de archivos en su lugar.
-
-`FileEntry.toURL()`y `DirectoryEntry.toURL()` devolver un filesystem dirección URL de la forma
-
- cdvfile://localhost/persistent/path/to/file
-
-
-que puede ser utilizado en lugar de la ruta del archivo absoluta tanto en `download()` y `upload()` los métodos.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/es/index.md b/plugins/cordova-plugin-file-transfer/doc/es/index.md
deleted file mode 100644
index 981c991..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/es/index.md
+++ /dev/null
@@ -1,262 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-Este plugin te permite cargar y descargar archivos.
-
-Este plugin define global `FileTransfer` , `FileUploadOptions` constructores.
-
-Aunque en el ámbito global, no están disponibles hasta después de la `deviceready` evento.
-
- document.addEventListener ("deviceready", onDeviceReady, false);
- function onDeviceReady() {console.log(FileTransfer)};
-
-
-## Instalación
-
- Cordova plugin añade cordova-plugin-file-transferencia
-
-
-## Plataformas soportadas
-
-* Amazon fire OS
-* Android
-* BlackBerry 10
-* Explorador
-* Firefox OS **
-* iOS
-* Windows Phone 7 y 8 *
-* Windows 8
-* Windows
-
-* *No son compatibles con `onprogress` ni `abort()` *
-
-** *No son compatibles con `onprogress` *
-
-# FileTransfer
-
-El `FileTransfer` objeto proporciona una manera de subir archivos mediante una solicitud HTTP de POST varias parte y para descargar archivos.
-
-## Propiedades
-
-* **OnProgress**: llama con un `ProgressEvent` cuando se transfiere un nuevo paquete de datos. *(Función)*
-
-## Métodos
-
-* **cargar**: envía un archivo a un servidor.
-
-* **Descargar**: descarga un archivo del servidor.
-
-* **abortar**: aborta una transferencia en curso.
-
-## subir
-
-**Parámetros**:
-
-* **fileURL**: URL de Filesystem que representa el archivo en el dispositivo. Para atrás compatibilidad, esto también puede ser la ruta de acceso completa del archivo en el dispositivo. (Ver [hacia atrás compatibilidad notas] debajo)
-
-* **servidor**: dirección URL del servidor para recibir el archivo, como codificada por`encodeURI()`.
-
-* **successCallback**: una devolución de llamada que se pasa un `FileUploadResult` objeto. *(Función)*
-
-* **errorCallback**: una devolución de llamada que se ejecuta si se produce un error recuperar la `FileUploadResult` . Invocado con un `FileTransferError` objeto. *(Función)*
-
-* **Opciones**: parámetros opcionales *(objeto)*. Teclas válidas:
-
- * **fileKey**: el nombre del elemento de formulario. Por defecto es `file` . (DOMString)
- * **nombre de archivo**: el nombre del archivo a utilizar al guardar el archivo en el servidor. Por defecto es `image.jpg` . (DOMString)
- * **httpMethod**: método HTTP el utilizar - o `PUT` o `POST` . Por defecto es `POST` . (DOMString)
- * **mimeType**: el tipo mime de los datos para cargar. Por defecto es `image/jpeg` . (DOMString)
- * **params**: un conjunto de pares clave/valor opcional para pasar en la petición HTTP. (Objeto)
- * **chunkedMode**: Si desea cargar los datos en modo de transmisión fragmentado. Por defecto es `true` . (Boolean)
- * **cabeceras**: un mapa de valores de encabezado nombre/cabecera. Utilice una matriz para especificar más de un valor. (Objeto)
-
-* **trustAllHosts**: parámetro opcional, por defecto es `false` . Si establece en `true` , acepta todos los certificados de seguridad. Esto es útil ya que Android rechaza certificados autofirmados seguridad. No se recomienda para uso productivo. Compatible con iOS y Android. *(boolean)*
-
-### Ejemplo
-
- // !! Asume fileURL variable contiene una dirección URL válida a un archivo de texto en el dispositivo, / / por ejemplo, ganar var cdvfile://localhost/persistent/path/to/file.txt = function (r) {console.log ("código =" + r.responseCode);
- Console.log ("respuesta =" + r.response);
- Console.log ("Sent =" + r.bytesSent);}
-
- var fallar = function (error) {alert ("ha ocurrido un error: código =" + error.code);
- Console.log ("error al cargar el origen" + error.source);
- Console.log ("upload error objetivo" + error.target);}
-
- var opciones = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "prueba";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- Ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, opciones);
-
-
-### Ejemplo con cabeceras de subir y eventos de progreso (Android y iOS solamente)
-
- function win(r) {console.log ("código =" + r.responseCode);
- Console.log ("respuesta =" + r.response);
- Console.log ("Sent =" + r.bytesSent);}
-
- function fail(error) {alert ("ha ocurrido un error: código =" + error.code);
- Console.log ("error al cargar el origen" + error.source);
- Console.log ("upload error objetivo" + error.target);}
-
- var uri = encodeURI ("http://some.server.com/upload.php");
-
- var opciones = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- cabeceras de var ={'headerParam':'headerValue'};
-
- options.headers = encabezados;
-
- var ft = new FileTransfer();
- Ft.OnProgress = function(progressEvent) {si (progressEvent.lengthComputable) {loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } {loadingStatus.increment() más;
- }
- };
- Ft.upload (fileURL, uri, win, fail, opciones);
-
-
-## FileUploadResult
-
-A `FileUploadResult` objeto se pasa a la devolución del éxito de la `FileTransfer` del objeto `upload()` método.
-
-### Propiedades
-
-* **bytesSent**: el número de bytes enviados al servidor como parte de la carga. (largo)
-
-* **responseCode**: código de respuesta HTTP el devuelto por el servidor. (largo)
-
-* **respuesta**: respuesta el HTTP devuelto por el servidor. (DOMString)
-
-* **cabeceras**: cabeceras de respuesta HTTP el por el servidor. (Objeto)
-
- * Actualmente compatible con iOS solamente.
-
-### iOS rarezas
-
-* No es compatible con `responseCode` o`bytesSent`.
-
-## descargar
-
-**Parámetros**:
-
-* **fuente**: dirección URL del servidor para descargar el archivo, como codificada por`encodeURI()`.
-
-* **objetivo**: Filesystem url que representa el archivo en el dispositivo. Para atrás compatibilidad, esto también puede ser la ruta de acceso completa del archivo en el dispositivo. (Ver [hacia atrás compatibilidad notas] debajo)
-
-* **successCallback**: una devolución de llamada que se pasa un `FileEntry` objeto. *(Función)*
-
-* **errorCallback**: una devolución de llamada que se ejecuta si se produce un error al recuperar los `FileEntry` . Invocado con un `FileTransferError` objeto. *(Función)*
-
-* **trustAllHosts**: parámetro opcional, por defecto es `false` . Si establece en `true` , acepta todos los certificados de seguridad. Esto es útil porque Android rechaza certificados autofirmados seguridad. No se recomienda para uso productivo. Compatible con iOS y Android. *(boolean)*
-
-* **Opciones**: parámetros opcionales, actualmente sólo soporta cabeceras (como autorización (autenticación básica), etc.).
-
-### Ejemplo
-
- // !! Asume fileURL variable contiene una dirección URL válida a un camino en el dispositivo, / / por ejemplo, File Transfer var cdvfile://localhost/persistent/path/to/downloads/ = new FileTransfer();
- var uri = encodeURI ("http://some.server.com/download.php");
-
- fileTransfer.download (uri, fileURL, function(entry) {console.log ("descarga completa:" + entry.toURL());
- }, function(error) {console.log ("error al descargar el origen" + error.source);
- Console.log ("descargar error objetivo" + error.target);
- Console.log ("código de error de carga" + error.code);
- }, falso, {encabezados: {"Autorización": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA =="}});
-
-
-## abortar
-
-Aborta a una transferencia en curso. El callback onerror se pasa un objeto FileTransferError que tiene un código de error de FileTransferError.ABORT_ERR.
-
-### Ejemplo
-
- // !! Asume fileURL variable contiene una dirección URL válida a un archivo de texto en el dispositivo, / / por ejemplo, ganar cdvfile://localhost/persistent/path/to/file.txt var function(r) = {console.log ("no se debe llamar.");}
-
- var fallar = function(error) {/ / error.code == FileTransferError.ABORT_ERR alert ("ha ocurrido un error: código =" + error.code);
- Console.log ("error al cargar el origen" + error.source);
- Console.log ("upload error objetivo" + error.target);}
-
- var opciones = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- Ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, opciones);
- Ft.Abort();
-
-
-## FileTransferError
-
-A `FileTransferError` objeto se pasa a un callback de error cuando se produce un error.
-
-### Propiedades
-
-* **código**: uno de los códigos de error predefinido enumerados a continuación. (Número)
-
-* **fuente**: URL a la fuente. (String)
-
-* **objetivo**: URL a la meta. (String)
-
-* **HTTP_STATUS**: código de estado HTTP. Este atributo sólo está disponible cuando se recibe un código de respuesta de la conexión HTTP. (Número)
-
-* **cuerpo** Cuerpo de la respuesta. Este atributo sólo está disponible cuando se recibe una respuesta de la conexión HTTP. (String)
-
-* **excepción**: cualquier e.getMessage o e.toString (String)
-
-### Constantes
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Al revés notas de compatibilidad
-
-Versiones anteriores de este plugin sólo aceptaría dispositivo-absoluto-archivo-rutas como la fuente de carga, o como destino para las descargas. Estos caminos normalmente sería de la forma
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Para atrás compatibilidad, estos caminos son aceptados todavía, y si su solicitud ha grabado caminos como éstos en almacenamiento persistente, entonces pueden seguir utilizarse.
-
-Estos caminos fueron expuestos anteriormente en el `fullPath` propiedad de `FileEntry` y `DirectoryEntry` objetos devueltos por el plugin de archivo. Las nuevas versiones del archivo plugin, sin embargo, ya no exponen estos caminos a JavaScript.
-
-Si va a actualizar a una nueva (1.0.0 o más reciente) versión del archivo y previamente han estado utilizando `entry.fullPath` como argumentos para `download()` o `upload()` , entonces tendrá que cambiar su código para usar URLs de sistema de archivos en su lugar.
-
-`FileEntry.toURL()`y `DirectoryEntry.toURL()` devolver un filesystem dirección URL de la forma
-
- cdvfile://localhost/persistent/path/to/file
-
-
-que puede ser utilizado en lugar de la ruta del archivo absoluta tanto en `download()` y `upload()` los métodos.
diff --git a/plugins/cordova-plugin-file-transfer/doc/fr/README.md b/plugins/cordova-plugin-file-transfer/doc/fr/README.md
deleted file mode 100644
index ca3e18a..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/fr/README.md
+++ /dev/null
@@ -1,270 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-Documentation du plugin :
-
-Ce plugin vous permet de télécharger des fichiers.
-
-Ce plugin définit global `FileTransfer` , `FileUploadOptions` constructeurs.
-
-Bien que dans la portée globale, ils ne sont pas disponibles jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(FileTransfer);}
-
-
-## Installation
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Plates-formes supportées
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Navigateur
- * Firefox OS **
- * iOS
- * Windows Phone 7 et 8 *
- * Windows 8
- * Windows
-
-\ * *Ne supportent pas `onprogress` ni `abort()` *
-
-\ ** *Ne prennent pas en charge les `onprogress` *
-
-# Transfert de fichiers
-
-L'objet de `FileTransfer` fournit un moyen de télécharger des fichiers à l'aide d'une requête HTTP multi-part POST ou PUT et pour télécharger des fichiers.
-
-## Propriétés
-
- * **onprogress** : fonction appelée avec un `ProgressEvent` à chaque fois qu'un nouveau segment de données est transféré. *(Function)*
-
-## Méthodes
-
- * **upload** : envoie un fichier à un serveur.
-
- * **download** : télécharge un fichier depuis un serveur.
-
- * **abort** : annule le transfert en cours.
-
-## upload
-
-**Paramètres**:
-
- * **fileURL** : système de fichiers URL représentant le fichier sur le périphérique. Pour la compatibilité ascendante, cela peut aussi être le chemin complet du fichier sur le périphérique. (Voir [Backwards Compatibility Notes] ci-dessous)
-
- * **server** : l'URL du serveur destiné à recevoir le fichier, encodée via `encodeURI()`.
-
- * **successCallback**: un rappel passé un `FileUploadResult` objet. *(Fonction)*
-
- * **errorCallback**: un rappel qui s'exécute si une erreur survient récupérer la `FileUploadResult` . Appelée avec un `FileTransferError` objet. *(Fonction)*
-
- * **options**: paramètres facultatifs *(objet)*. Clés valides :
-
- * **fileKey**: le nom de l'élément form. Valeur par défaut est `file` . (DOMString)
- * **fileName**: le nom de fichier à utiliser lorsque vous enregistrez le fichier sur le serveur. Valeur par défaut est `image.jpg` . (DOMString)
- * **httpMethod**: méthode de The HTTP à utiliser - soit `PUT` ou `POST` . Valeur par défaut est `POST` . (DOMString)
- * **type MIME**: le type mime des données à télécharger. Valeur par défaut est `image/jpeg` . (DOMString)
- * **params**: un ensemble de paires clé/valeur facultative pour passer dans la requête HTTP. (Objet)
- * **chunkedMode**: s'il faut télécharger les données en mode streaming mémorisé en bloc. Valeur par défaut est `true` . (Boolean)
- * **headers**: une carte des valeurs d'en-tête en-tête/nom. Un tableau permet de spécifier plusieurs valeurs. Sur iOS, FireOS et Android, si un en-tête nommé Content-Type n'est présent, les données de formulaire multipart servira pas. (Object)
- * **httpMethod**: The HTTP méthode à utiliser par exemple poster ou mis. Par défaut, `message`. (DOMString)
-
- * **trustAllHosts**: paramètre facultatif, valeur par défaut est `false` . Si la valeur est `true` , il accepte tous les certificats de sécurité. Ceci est utile car Android rejette des certificats auto-signés. N'est pas recommandé pour une utilisation en production. Supporté sur Android et iOS. *(booléen)*
-
-### Exemple
-
- // !! Suppose fileURL variable contient une URL valide dans un fichier texte sur le périphérique, / / par exemple, cdvfile://localhost/persistent/path/to/file.txt var win = function (r) {console.log ("Code =" + r.responseCode) ;
- Console.log ("réponse =" + r.response) ;
- Console.log ("envoyés =" + r.bytesSent);}
-
- échouer var = function (erreur) {alert ("une erreur est survenue : Code =" + error.code) ;
- Console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log ("erreur de téléchargement cible" + error.target);}
-
- options de var = new FileUploadOptions() ;
- options.fileKey = « fichier » ;
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1) ;
- options.mimeType = « text/plain » ;
-
- var params = {} ;
- params.value1 = « test » ;
- params.Value2 = « param » ;
-
- options.params = params ;
-
- ft var = new FileTransfer() ;
- ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, options) ;
-
-
-### Exemple avec téléchargement du Header et des Progress Events (Android et iOS uniquement)
-
- function win(r) {console.log ("Code =" + r.responseCode) ;
- Console.log ("réponse =" + r.response) ;
- Console.log ("envoyés =" + r.bytesSent);}
-
- function fail(error) {alert ("une erreur est survenue : Code =" + error.code) ;
- Console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log ("erreur de téléchargement cible" + error.target);}
-
- var uri = encodeURI ("http://some.server.com/upload.php") ;
-
- options de var = new FileUploadOptions() ;
- options.fileKey="file" ;
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1) ;
- options.mimeType="text/plain" ;
-
- en-têtes var ={'headerParam':'headerValue'} ;
-
- options.Headers = en-têtes ;
-
- ft var = new FileTransfer() ;
- ft.OnProgress = function(progressEvent) {si (progressEvent.lengthComputable) {loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total) ;
- } else {loadingStatus.increment() ;
- }
- };
- ft.upload (fileURL, uri, win, fail, options) ;
-
-
-## FileUploadResult
-
-A `FileUploadResult` objet est passé au rappel de succès la `FileTransfer` de l'objet `upload()` méthode.
-
-### Propriétés
-
- * **bytesSent** : le nombre d'octets envoyés au serveur dans le cadre du téléchargement. (long)
-
- * **responseCode** : le code de réponse HTTP retourné par le serveur. (long)
-
- * **response** : la réponse HTTP renvoyée par le serveur. (DOMString)
-
- * **en-têtes** : en-têtes de réponse HTTP par le serveur. (Objet)
-
- * Actuellement pris en charge sur iOS seulement.
-
-### Notes au sujet d'iOS
-
- * Ne prend pas en charge les propriétés `responseCode` et `bytesSent`.
-
-## download
-
-**Paramètres**:
-
- * **source** : l'URL du serveur depuis lequel télécharger le fichier, encodée via `encodeURI()`.
-
- * **target** : système de fichiers url représentant le fichier sur le périphérique. Pour la compatibilité ascendante, cela peut aussi être le chemin complet du fichier sur le périphérique. (Voir [Backwards Compatibility Notes] ci-dessous)
-
- * **successCallback** : une callback de succès à laquelle est passée un objet `FileEntry`. *(Function)*
-
- * **errorCallback**: un rappel qui s'exécute si une erreur se produit lors de la récupération du `FileEntry` . Appelée avec un `FileTransferError` objet. *(Fonction)*
-
- * **trustAllHosts**: paramètre facultatif, valeur par défaut est `false` . Si la valeur est `true` , il accepte tous les certificats de sécurité. Ceci peut être utile car Android rejette les certificats auto-signés. N'est pas recommandé pour une utilisation en production. Supporté sur Android et iOS. *(booléen)*
-
- * **options** : paramètres facultatifs, seules les en-têtes sont actuellement supportées (par exemple l'autorisation (authentification basique), etc.).
-
-### Exemple
-
- // !! Suppose fileURL variable contient une URL valide vers un chemin d'accès sur le périphérique, / / par exemple, transfert de fichiers var cdvfile://localhost/persistent/path/to/downloads/ = new FileTransfer() ;
- var uri = encodeURI ("http://some.server.com/download.php") ;
-
- fileTransfer.download (uri, fileURL, function(entry) {console.log ("téléchargement complet:" + entry.toURL()) ;
- }, function(error) {console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log (« erreur de téléchargement cible » + error.target) ;
- Console.log (« code d'erreur de téléchargement » + error.code) ;
- }, faux, {en-têtes: {« Autorisation »: « dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA base == "}}) ;
-
-
-### Quirks wp8
-
- * Télécharger demande est mis en cache par l'implémentation native. Pour éviter la mise en cache, pass `if-Modified-Since` en-tête Télécharger méthode.
-
-## abort
-
-Abandonne un transfert en cours. Le rappel onerror est passé à un objet FileTransferError qui a un code d'erreur de FileTransferError.ABORT_ERR.
-
-### Exemple
-
- // !! Suppose fileURL variable contient une URL valide dans un fichier texte sur le périphérique, / / par exemple, cdvfile://localhost/persistent/path/to/file.txt var win = function(r) {console.log ("ne devrait pas être appelée.");}
-
- var fail = function(error) {/ / error.code == FileTransferError.ABORT_ERR alert ("une erreur est survenue : Code =" + error.code) ;
- Console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log ("erreur de téléchargement cible" + error.target);}
-
- options de var = new FileUploadOptions() ;
- options.fileKey="file" ;
- options.fileName="myphoto.jpg" ;
- options.mimeType="image/jpeg" ;
-
- ft var = new FileTransfer() ;
- ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, options) ;
- ft.Abort() ;
-
-
-## FileTransferError
-
-A `FileTransferError` objet est passé à un rappel d'erreur lorsqu'une erreur survient.
-
-### Propriétés
-
- * **code** : l'un des codes d'erreur prédéfinis énumérés ci-dessous. (Number)
-
- * **source** : l'URI de la source. (String)
-
- * **target**: l'URI de la destination. (String)
-
- * **http_status** : code d'état HTTP. Cet attribut n'est disponible que lorsqu'un code de réponse est fourni via la connexion HTTP. (Number)
-
- * **corps** Corps de réponse. Cet attribut n'est disponible que lorsqu'une réponse est reçue de la connexion HTTP. (String)
-
- * **exception**: soit e.getMessage ou e.toString (String)
-
-### Constantes
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Backwards Compatibility Notes
-
-Les versions précédentes de ce plugin n'accepterait périphérique--fichier-chemins d'accès absolus comme source pour les téléchargements, ou comme cible pour les téléchargements. Ces chemins seraient généralement de la forme
-
- / var/mobile/Applications/< application UUID >/Documents/chemin/vers/fichier (iOS), /storage/emulated/0/path/to/file (Android)
-
-
-Pour vers l'arrière la compatibilité, ces chemins sont toujours acceptés, et si votre application a enregistré des chemins comme celles-ci dans un stockage persistant, alors ils peuvent continuer à être utilisé.
-
-Ces chemins ont été précédemment exposés dans le `fullPath` propriété de `FileEntry` et `DirectoryEntry` les objets retournés par le fichier plugin. Nouvelles versions du fichier plugin, cependant, ne plus exposent ces chemins à JavaScript.
-
-Si vous migrez vers une nouvelle (1.0.0 ou plus récent) version de fichier et vous avez précédemment utilisé `entry.fullPath` comme arguments à `download()` ou `upload()` , alors vous aurez besoin de modifier votre code pour utiliser le système de fichiers URL au lieu de cela.
-
-`FileEntry.toURL()`et `DirectoryEntry.toURL()` retournent une URL de système de fichiers du formulaire
-
- cdvfile://localhost/persistent/path/to/file
-
-
-qui peut être utilisé à la place le chemin d'accès absolu au fichier dans les deux `download()` et `upload()` méthodes.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/fr/index.md b/plugins/cordova-plugin-file-transfer/doc/fr/index.md
deleted file mode 100644
index 6b2bce0..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/fr/index.md
+++ /dev/null
@@ -1,261 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-Ce plugin vous permet de télécharger des fichiers.
-
-Ce plugin définit global `FileTransfer` , `FileUploadOptions` constructeurs.
-
-Bien que dans la portée globale, ils ne sont pas disponibles jusqu'après la `deviceready` événement.
-
- document.addEventListener (« deviceready », onDeviceReady, false) ;
- function onDeviceReady() {console.log(FileTransfer);}
-
-
-## Installation
-
- Cordova plugin ajouter cordova-plugin-file-transfert
-
-
-## Plates-formes prises en charge
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Navigateur
-* Firefox OS **
-* iOS
-* Windows Phone 7 et 8 *
-* Windows 8
-* Windows
-
-* *Ne supportent pas `onprogress` ni `abort()` *
-
-** *Ne prennent pas en charge `onprogress` *
-
-# Transfert de fichiers
-
-Le `FileTransfer` objet fournit un moyen de télécharger des fichiers à l'aide d'une requête HTTP de la poste plusieurs partie et pour télécharger des fichiers aussi bien.
-
-## Propriétés
-
-* **onprogress** : fonction appelée avec un `ProgressEvent` à chaque fois qu'un nouveau segment de données est transféré. *(Function)*
-
-## Méthodes
-
-* **upload** : envoie un fichier à un serveur.
-
-* **download** : télécharge un fichier depuis un serveur.
-
-* **abort** : annule le transfert en cours.
-
-## upload
-
-**Paramètres**:
-
-* **fileURL** : système de fichiers URL représentant le fichier sur le périphérique. Pour la compatibilité ascendante, cela peut aussi être le chemin complet du fichier sur le périphérique. (Voir [Backwards Compatibility Notes] ci-dessous)
-
-* **server** : l'URL du serveur destiné à recevoir le fichier, encodée via `encodeURI()`.
-
-* **successCallback**: un rappel passé un `FileUploadResult` objet. *(Fonction)*
-
-* **errorCallback**: un rappel qui s'exécute si une erreur survient récupérer la `FileUploadResult` . Appelée avec un `FileTransferError` objet. *(Fonction)*
-
-* **options**: paramètres facultatifs *(objet)*. Clés valides :
-
- * **fileKey**: le nom de l'élément form. Valeur par défaut est `file` . (DOMString)
- * **fileName**: le nom de fichier à utiliser lorsque vous enregistrez le fichier sur le serveur. Valeur par défaut est `image.jpg` . (DOMString)
- * **httpMethod**: méthode de The HTTP à utiliser - soit `PUT` ou `POST` . Valeur par défaut est `POST` . (DOMString)
- * **type MIME**: le type mime des données à télécharger. Valeur par défaut est `image/jpeg` . (DOMString)
- * **params**: un ensemble de paires clé/valeur facultative pour passer dans la requête HTTP. (Objet)
- * **chunkedMode**: s'il faut télécharger les données en mode streaming mémorisé en bloc. Valeur par défaut est `true` . (Boolean)
- * **en-têtes**: une carte des valeurs d'en-tête en-tête/nom. Un tableau permet de spécifier plusieurs valeurs. (Objet)
-
-* **trustAllHosts**: paramètre facultatif, valeur par défaut est `false` . Si la valeur `true` , il accepte tous les certificats de sécurité. Ceci est utile car Android rejette des certificats auto-signés. Non recommandé pour une utilisation de production. Supporté sur Android et iOS. *(boolean)*
-
-### Exemple
-
- // !! Suppose fileURL variable contient une URL valide dans un fichier texte sur le périphérique, / / par exemple, cdvfile://localhost/persistent/path/to/file.txt var win = function (r) {console.log ("Code =" + r.responseCode) ;
- Console.log ("réponse =" + r.response) ;
- Console.log ("envoyés =" + r.bytesSent);}
-
- échouer var = function (erreur) {alert ("une erreur est survenue : Code =" + error.code) ;
- Console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log ("erreur de téléchargement cible" + error.target);}
-
- options de var = new FileUploadOptions() ;
- options.fileKey = « fichier » ;
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1) ;
- options.mimeType = « text/plain » ;
-
- var params = {} ;
- params.value1 = « test » ;
- params.Value2 = « param » ;
-
- options.params = params ;
-
- ft var = new FileTransfer() ;
- ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, options) ;
-
-
-### Exemple avec téléchargement du Header et des Progress Events (Android et iOS uniquement)
-
- function win(r) {console.log ("Code =" + r.responseCode) ;
- Console.log ("réponse =" + r.response) ;
- Console.log ("envoyés =" + r.bytesSent);}
-
- function fail(error) {alert ("une erreur est survenue : Code =" + error.code) ;
- Console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log ("erreur de téléchargement cible" + error.target);}
-
- var uri = encodeURI ("http://some.server.com/upload.php") ;
-
- options de var = new FileUploadOptions() ;
- options.fileKey="file" ;
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1) ;
- options.mimeType="text/plain" ;
-
- en-têtes var ={'headerParam':'headerValue'} ;
-
- options.Headers = en-têtes ;
-
- ft var = new FileTransfer() ;
- ft.OnProgress = function(progressEvent) {si (progressEvent.lengthComputable) {loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total) ;
- } else {loadingStatus.increment() ;
- }
- };
- ft.upload (fileURL, uri, win, fail, options) ;
-
-
-## FileUploadResult
-
-A `FileUploadResult` objet est passé au rappel de succès la `FileTransfer` de l'objet `upload()` méthode.
-
-### Propriétés
-
-* **bytesSent** : le nombre d'octets envoyés au serveur dans le cadre du téléchargement. (long)
-
-* **responseCode** : le code de réponse HTTP retourné par le serveur. (long)
-
-* **response** : la réponse HTTP renvoyée par le serveur. (DOMString)
-
-* **en-têtes** : en-têtes de réponse HTTP par le serveur. (Objet)
-
- * Actuellement pris en charge sur iOS seulement.
-
-### iOS Remarques
-
-* Ne prend pas en charge les propriétés `responseCode` et `bytesSent`.
-
-## download
-
-**Paramètres**:
-
-* **source** : l'URL du serveur depuis lequel télécharger le fichier, encodée via `encodeURI()`.
-
-* **target** : système de fichiers url représentant le fichier sur le périphérique. Pour vers l'arrière la compatibilité, cela peut aussi être le chemin d'accès complet du fichier sur le périphérique. (Voir [vers l'arrière compatibilité note] ci-dessous)
-
-* **successCallback** : une callback de succès à laquelle est passée un objet `FileEntry`. *(Function)*
-
-* **errorCallback**: un rappel qui s'exécute si une erreur se produit lors de la récupération du `FileEntry` . Appelée avec un `FileTransferError` objet. *(Fonction)*
-
-* **trustAllHosts**: paramètre facultatif, valeur par défaut est `false` . Si la valeur est `true` , il accepte tous les certificats de sécurité. Ceci peut être utile car Android rejette les certificats auto-signés. N'est pas recommandé pour une utilisation en production. Supporté sur Android et iOS. *(booléen)*
-
-* **options** : paramètres facultatifs, seules les en-têtes sont actuellement supportées (par exemple l'autorisation (authentification basique), etc.).
-
-### Exemple
-
- // !! Suppose fileURL variable contient une URL valide vers un chemin d'accès sur le périphérique, / / par exemple, transfert de fichiers var cdvfile://localhost/persistent/path/to/downloads/ = new FileTransfer() ;
- var uri = encodeURI ("http://some.server.com/download.php") ;
-
- fileTransfer.download (uri, fileURL, function(entry) {console.log ("téléchargement complet:" + entry.toURL()) ;
- }, function(error) {console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log (« erreur de téléchargement cible » + error.target) ;
- Console.log (« code d'erreur de téléchargement » + error.code) ;
- }, faux, {en-têtes: {« Autorisation »: « dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA base == "}}) ;
-
-
-## abort
-
-Abandonne un transfert en cours. Le rappel onerror est passé à un objet FileTransferError qui a un code d'erreur de FileTransferError.ABORT_ERR.
-
-### Exemple
-
- // !! Suppose fileURL variable contient une URL valide dans un fichier texte sur le périphérique, / / par exemple, cdvfile://localhost/persistent/path/to/file.txt var win = function(r) {console.log ("ne devrait pas être appelée.");}
-
- var fail = function(error) {/ / error.code == FileTransferError.ABORT_ERR alert ("une erreur est survenue : Code =" + error.code) ;
- Console.log (« source de l'erreur de téléchargement » + error.source) ;
- Console.log ("erreur de téléchargement cible" + error.target);}
-
- options de var = new FileUploadOptions() ;
- options.fileKey="file" ;
- options.fileName="myphoto.jpg" ;
- options.mimeType="image/jpeg" ;
-
- ft var = new FileTransfer() ;
- ft.upload (fileURL, encodeURI ("http://some.server.com/upload.php"), win, fail, options) ;
- ft.Abort() ;
-
-
-## FileTransferError
-
-A `FileTransferError` objet est passé à un rappel d'erreur lorsqu'une erreur survient.
-
-### Propriétés
-
-* **code** : l'un des codes d'erreur prédéfinis énumérés ci-dessous. (Number)
-
-* **source** : l'URI de la source. (String)
-
-* **target**: l'URI de la destination. (String)
-
-* **http_status** : code d'état HTTP. Cet attribut n'est disponible que lorsqu'un code de réponse est fourni via la connexion HTTP. (Number)
-
-* **corps** Corps de réponse. Cet attribut n'est disponible que lorsqu'une réponse est reçue de la connexion HTTP. (String)
-
-* **exception**: soit e.getMessage ou e.toString (String)
-
-### Constantes
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Backwards Compatibility Notes
-
-Les versions précédentes de ce plugin n'accepterait périphérique--fichier-chemins d'accès absolus comme source pour les téléchargements, ou comme cible pour les téléchargements. Ces chemins seraient généralement de la forme
-
- / var/mobile/Applications/< application UUID >/Documents/chemin/vers/fichier (iOS), /storage/emulated/0/path/to/file (Android)
-
-
-Pour vers l'arrière la compatibilité, ces chemins sont toujours acceptés, et si votre application a enregistré des chemins comme celles-ci dans un stockage persistant, alors ils peuvent continuer à être utilisé.
-
-Ces chemins ont été précédemment exposés dans le `fullPath` propriété de `FileEntry` et `DirectoryEntry` les objets retournés par le fichier plugin. Nouvelles versions du fichier plugin, cependant, ne plus exposent ces chemins à JavaScript.
-
-Si vous migrez vers une nouvelle (1.0.0 ou plus récent) version de fichier et vous avez précédemment utilisé `entry.fullPath` comme arguments à `download()` ou `upload()` , alors vous aurez besoin de modifier votre code pour utiliser le système de fichiers URL au lieu de cela.
-
-`FileEntry.toURL()`et `DirectoryEntry.toURL()` retournent une URL de système de fichiers du formulaire
-
- cdvfile://localhost/persistent/path/to/file
-
-
-qui peut être utilisé à la place le chemin d'accès absolu au fichier dans les deux `download()` et `upload()` méthodes.
diff --git a/plugins/cordova-plugin-file-transfer/doc/it/README.md b/plugins/cordova-plugin-file-transfer/doc/it/README.md
deleted file mode 100644
index 74d4ef5..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/it/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-Documentazione plugin:
-
-Questo plugin permette di caricare e scaricare file.
-
-Questo plugin definisce globale `FileTransfer`, costruttori di `FileUploadOptions`.
-
-Anche se in ambito globale, non sono disponibili fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Piattaforme supportate
-
- * Amazon fuoco OS
- * Android
- * BlackBerry 10
- * Browser
- * Firefox OS**
- * iOS
- * Windows Phone 7 e 8 *
- * Windows 8
- * Windows
-
-\ * *Non supportano `onprogress` né `abort()` *
-
-\ * * *Non supportano `onprogress` *
-
-# FileTransfer
-
-L'oggetto `FileTransfer` fornisce un modo per caricare i file utilizzando una richiesta HTTP multiparte POST o PUT e scaricare file pure.
-
-## Proprietà
-
- * **OnProgress**: chiamata con un `ProgressEvent` ogni volta che un nuovo blocco di dati viene trasferito. *(Funzione)*
-
-## Metodi
-
- * **caricare**: invia un file a un server.
-
- * **Scarica**: Scarica un file dal server.
-
- * **Abort**: interrompe un trasferimento in corso.
-
-## upload
-
-**Parametri**:
-
- * **fileURL**: Filesystem URL che rappresenta il file nel dispositivo. Per indietro la compatibilità, questo può anche essere il percorso completo del file sul dispositivo. (Vedere [indietro compatibilità rileva] qui sotto)
-
- * **server**: URL del server per ricevere il file, come codificato dal`encodeURI()`.
-
- * **successCallback**: un callback che viene passato un oggetto `FileUploadResult`. *(Funzione)*
-
- * **errorCallback**: un callback che viene eseguito se si verifica un errore di recupero `FileUploadResult`. Richiamato con un oggetto `FileTransferError`. *(Funzione)*
-
- * **opzioni**: parametri facoltativi *(oggetto)*. Chiavi valide:
-
- * **fileKey**: il nome dell'elemento form. Valore predefinito è `file` . (DOMString)
- * **nome file**: il nome del file da utilizzare quando si salva il file sul server. Valore predefinito è `image.jpg` . (DOMString)
- * **httpMethod**: metodo HTTP da utilizzare - `PUT` o `POST`. Impostazioni predefinite per `POST`. (DOMString)
- * **mimeType**: il tipo mime dei dati da caricare. Impostazioni predefinite su `image/jpeg`. (DOMString)
- * **params**: un insieme di coppie chiave/valore opzionale per passare nella richiesta HTTP. (Object)
- * **chunkedMode**: se a caricare i dati in modalità streaming chunked. Impostazione predefinita è `true`. (Boolean)
- * **headers**: una mappa di valori di intestazione e nome dell'intestazione. Utilizzare una matrice per specificare più di un valore. Su iOS, FireOS e Android, se è presente, un'intestazione Content-Type il nome dati form multipart non verranno utilizzati. (Object)
- * **httpMethod**: metodo HTTP da utilizzare per esempio POST o PUT. Il valore predefinito è `POST`. (DOMString)
-
- * **trustAllHosts**: parametro opzionale, valore predefinito è `false` . Se impostata su `true` , accetta tutti i certificati di sicurezza. Questo è utile poiché Android respinge i certificati autofirmati sicurezza. Non raccomandato per uso in produzione. Supportato su Android e iOS. *(boolean)*
-
-### Esempio
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Esempio con intestazioni di caricare ed eventi Progress (Android e iOS solo)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Un oggetto `FileUploadResult` viene passato al metodo di callback del metodo `upload()` dell'oggetto `FileTransfer` successo.
-
-### Proprietà
-
- * **bytesSent**: il numero di byte inviati al server come parte dell'upload. (lungo)
-
- * **responseCode**: codice di risposta HTTP restituito dal server. (lungo)
-
- * **risposta**: risposta HTTP restituito dal server. (DOMString)
-
- * **intestazioni**: intestazioni di risposta HTTP dal server. (Oggetto)
-
- * Attualmente supportato solo iOS.
-
-### iOS stranezze
-
- * Non supporta `responseCode` o`bytesSent`.
-
-## Scarica
-
-**Parametri**:
-
- * **fonte**: URL del server per scaricare il file, come codificato dal`encodeURI()`.
-
- * **destinazione**: Filesystem url che rappresenta il file nel dispositivo. Per indietro la compatibilità, questo può anche essere il percorso completo del file sul dispositivo. (Vedere [indietro compatibilità rileva] qui sotto)
-
- * **successCallback**: un callback passato un `FileEntry` oggetto. *(Funzione)*
-
- * **errorCallback**: un callback che viene eseguito se si verifica un errore durante il recupero `FileEntry`. Richiamato con un oggetto `FileTransferError`. *(Function)*
-
- * **trustAllHosts**: parametro opzionale, valore predefinito è `false` . Se impostata su `true` , accetta tutti i certificati di sicurezza. Questo è utile perché Android respinge i certificati autofirmati sicurezza. Non raccomandato per uso in produzione. Supportato su Android e iOS. *(boolean)*
-
- * **opzioni**: parametri facoltativi, attualmente solo supporti intestazioni (ad esempio autorizzazione (autenticazione di base), ecc.).
-
-### Esempio
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### WP8 stranezze
-
- * Il download richiede è nella cache di implementazione nativa. Per evitare la memorizzazione nella cache, passare `if-Modified-Since` intestazione per metodo di download.
-
-## Abort
-
-Interrompe un trasferimento in corso. Il callback onerror viene passato un oggetto FileTransferError che presenta un codice di errore di FileTransferError.ABORT_ERR.
-
-### Esempio
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-Un oggetto `FileTransferError` viene passato a un callback di errore quando si verifica un errore.
-
-### Proprietà
-
- * **codice**: uno dei codici di errore predefiniti elencati di seguito. (Numero)
-
- * **fonte**: URL all'origine. (String)
-
- * **destinazione**: URL di destinazione. (String)
-
- * **http_status**: codice di stato HTTP. Questo attributo è disponibile solo quando viene ricevuto un codice di risposta della connessione HTTP. (Numero)
-
- * **body** Corpo della risposta. Questo attributo è disponibile solo quando viene ricevuta una risposta dalla connessione HTTP. (String)
-
- * **exception**: O e.getMessage o e.toString (String)
-
-### Costanti
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Note di compatibilità all'indietro
-
-Versioni precedenti di questo plugin accetterebbe solo dispositivo-assoluto-percorsi di file come origine per upload, o come destinazione per il download. Questi percorsi si sarebbero generalmente di forma
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Per indietro compatibilità, questi percorsi sono ancora accettati, e se l'applicazione ha registrato percorsi come questi in un archivio permanente, quindi possono continuare a essere utilizzato.
-
-Questi percorsi sono stati precedentemente esposti nella proprietà `fullPath` di `FileEntry` e oggetti `DirectoryEntry` restituiti dal File plugin. Nuove versioni del File plugin, tuttavia, non è più espongono questi percorsi a JavaScript.
-
-Se si esegue l'aggiornamento a una nuova (1.0.0 o più recente) versione del File e si hanno precedentemente utilizzato `entry.fullPath` come argomenti per `download()` o `upload()`, quindi sarà necessario cambiare il codice per utilizzare gli URL filesystem invece.
-
-`FileEntry.toURL()` e `DirectoryEntry.toURL()` restituiscono un filesystem URL del modulo
-
- cdvfile://localhost/persistent/path/to/file
-
-
-che può essere utilizzato al posto del percorso assoluto nei metodi sia `download()` e `upload()`.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/it/index.md b/plugins/cordova-plugin-file-transfer/doc/it/index.md
deleted file mode 100644
index e1b74e3..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/it/index.md
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-Questo plugin permette di caricare e scaricare file.
-
-Questo plugin definisce globale `FileTransfer`, costruttori di `FileUploadOptions`.
-
-Anche se in ambito globale, non sono disponibili fino a dopo l'evento `deviceready`.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Installazione
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Piattaforme supportate
-
-* Amazon fuoco OS
-* Android
-* BlackBerry 10
-* Browser
-* Firefox OS**
-* iOS
-* Windows Phone 7 e 8 *
-* Windows 8
-* Windows
-
-* *Supporto `onprogress` né `abort()`*
-
-** *Non supportano `onprogress`*
-
-# FileTransfer
-
-L'oggetto `FileTransfer` fornisce un modo per caricare i file utilizzando una richiesta HTTP di POST più parte e scaricare file pure.
-
-## Proprietà
-
-* **OnProgress**: chiamata con un `ProgressEvent` ogni volta che un nuovo blocco di dati viene trasferito. *(Funzione)*
-
-## Metodi
-
-* **caricare**: invia un file a un server.
-
-* **Scarica**: Scarica un file dal server.
-
-* **Abort**: interrompe un trasferimento in corso.
-
-## caricare
-
-**Parametri**:
-
-* **fileURL**: Filesystem URL che rappresenta il file nel dispositivo. Per indietro la compatibilità, questo può anche essere il percorso completo del file sul dispositivo. (Vedere [indietro compatibilità rileva] qui sotto)
-
-* **server**: URL del server per ricevere il file, come codificato dal`encodeURI()`.
-
-* **successCallback**: un callback che viene passato un oggetto `FileUploadResult`. *(Funzione)*
-
-* **errorCallback**: un callback che viene eseguito se si verifica un errore di recupero `FileUploadResult`. Richiamato con un oggetto `FileTransferError`. *(Funzione)*
-
-* **opzioni**: parametri facoltativi *(oggetto)*. Chiavi valide:
-
- * **fileKey**: il nome dell'elemento form. Valore predefinito è `file` . (DOMString)
- * **nome file**: il nome del file da utilizzare quando si salva il file sul server. Valore predefinito è `image.jpg` . (DOMString)
- * **httpMethod**: metodo HTTP da utilizzare - `PUT` o `POST`. Impostazioni predefinite per `POST`. (DOMString)
- * **mimeType**: il tipo mime dei dati da caricare. Impostazioni predefinite su `image/jpeg`. (DOMString)
- * **params**: un insieme di coppie chiave/valore opzionale per passare nella richiesta HTTP. (Object)
- * **chunkedMode**: se a caricare i dati in modalità streaming chunked. Impostazione predefinita è `true`. (Boolean)
- * **headers**: mappa di valori nome/intestazione intestazione. Utilizzare una matrice per specificare più valori. (Object)
-
-* **trustAllHosts**: parametro opzionale, valore predefinito è `false` . Se impostata su `true` , accetta tutti i certificati di sicurezza. Questo è utile poiché Android respinge i certificati autofirmati sicurezza. Non raccomandato per uso in produzione. Supportato su Android e iOS. *(boolean)*
-
-### Esempio
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Esempio con intestazioni di caricare ed eventi Progress (Android e iOS solo)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Un oggetto `FileUploadResult` viene passato al metodo di callback del metodo `upload()` dell'oggetto `FileTransfer` successo.
-
-### Proprietà
-
-* **bytesSent**: il numero di byte inviati al server come parte dell'upload. (lungo)
-
-* **responseCode**: codice di risposta HTTP restituito dal server. (lungo)
-
-* **risposta**: risposta HTTP restituito dal server. (DOMString)
-
-* **intestazioni**: intestazioni di risposta HTTP dal server. (Oggetto)
-
- * Attualmente supportato solo iOS.
-
-### iOS stranezze
-
-* Non supporta `responseCode` o`bytesSent`.
-
-## Scarica
-
-**Parametri**:
-
-* **fonte**: URL del server per scaricare il file, come codificato dal`encodeURI()`.
-
-* **destinazione**: Filesystem url che rappresenta il file nel dispositivo. Per indietro la compatibilità, questo può anche essere il percorso completo del file sul dispositivo. (Vedere [indietro compatibilità rileva] qui sotto)
-
-* **successCallback**: un callback passato un `FileEntry` oggetto. *(Funzione)*
-
-* **errorCallback**: un callback che viene eseguito se si verifica un errore durante il recupero `FileEntry`. Richiamato con un oggetto `FileTransferError`. *(Function)*
-
-* **trustAllHosts**: parametro opzionale, valore predefinito è `false` . Se impostata su `true` , accetta tutti i certificati di sicurezza. Questo è utile perché Android respinge i certificati autofirmati sicurezza. Non raccomandato per uso in produzione. Supportato su Android e iOS. *(boolean)*
-
-* **opzioni**: parametri facoltativi, attualmente solo supporti intestazioni (ad esempio autorizzazione (autenticazione di base), ecc.).
-
-### Esempio
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## Abort
-
-Interrompe un trasferimento in corso. Il callback onerror viene passato un oggetto FileTransferError che presenta un codice di errore di FileTransferError.ABORT_ERR.
-
-### Esempio
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-Un oggetto `FileTransferError` viene passato a un callback di errore quando si verifica un errore.
-
-### Proprietà
-
-* **codice**: uno dei codici di errore predefiniti elencati di seguito. (Numero)
-
-* **fonte**: URL all'origine. (String)
-
-* **destinazione**: URL di destinazione. (String)
-
-* **http_status**: codice di stato HTTP. Questo attributo è disponibile solo quando viene ricevuto un codice di risposta della connessione HTTP. (Numero)
-
-* **body** Corpo della risposta. Questo attributo è disponibile solo quando viene ricevuta una risposta dalla connessione HTTP. (String)
-
-* **exception**: O e.getMessage o e.toString (String)
-
-### Costanti
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Note di compatibilità all'indietro
-
-Versioni precedenti di questo plugin accetterebbe solo dispositivo-assoluto-percorsi di file come origine per upload, o come destinazione per il download. Questi percorsi si sarebbero generalmente di forma
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Per indietro compatibilità, questi percorsi sono ancora accettati, e se l'applicazione ha registrato percorsi come questi in un archivio permanente, quindi possono continuare a essere utilizzato.
-
-Questi percorsi sono stati precedentemente esposti nella proprietà `fullPath` di `FileEntry` e oggetti `DirectoryEntry` restituiti dal File plugin. Nuove versioni del File plugin, tuttavia, non è più espongono questi percorsi a JavaScript.
-
-Se si esegue l'aggiornamento a una nuova (1.0.0 o più recente) versione del File e si hanno precedentemente utilizzato `entry.fullPath` come argomenti per `download()` o `upload()`, quindi sarà necessario cambiare il codice per utilizzare gli URL filesystem invece.
-
-`FileEntry.toURL()` e `DirectoryEntry.toURL()` restituiscono un filesystem URL del modulo
-
- cdvfile://localhost/persistent/path/to/file
-
-
-che può essere utilizzato al posto del percorso assoluto nei metodi sia `download()` e `upload()`.
diff --git a/plugins/cordova-plugin-file-transfer/doc/ja/README.md b/plugins/cordova-plugin-file-transfer/doc/ja/README.md
deleted file mode 100644
index a8156a2..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/ja/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-プラグインのマニュアル:
-
-このプラグインは、アップロードし、ファイルをダウンロードすることができます。
-
-このプラグインでは、グローバル `FileTransfer`、`FileUploadOptions` コンス トラクターを定義します。
-
-グローバル スコープでは使用できませんまで `deviceready` イベントの後です。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## サポートされているプラットフォーム
-
- * アマゾン火 OS
- * アンドロイド
- * ブラックベリー 10
- * ブラウザー
- * Firefox の OS * *
- * iOS
- * Windows Phone 7 と 8 *
- * Windows 8
- * Windows
-
-\ * * `Onprogress`も`abort()`をサポートしていません。*
-
-\ * * * `Onprogress`をサポートしていません。*
-
-# 出色
-
-`出色`オブジェクトは、HTTP マルチパート POST または PUT 要求を使用してファイルをアップロードし、同様にファイルをダウンロードする方法を提供します。
-
-## プロパティ
-
- * **onprogress**: と呼ばれる、 `ProgressEvent` データの新しいチャンクが転送されるたびに。*(機能)*
-
-## メソッド
-
- * **アップロード**: サーバーにファイルを送信します。
-
- * **ダウンロード**: サーバーからファイルをダウンロードします。
-
- * **中止**: 進行中の転送を中止します。
-
-## upload
-
-**パラメーター**:
-
- * **fileURL**: デバイス上のファイルを表すファイルシステム URL。 下位互換性は、このことも、デバイス上のファイルの完全パスであります。 (参照してください [後方互換性メモ] の下)
-
- * **サーバー**: によって符号化されるように、ファイルを受信するサーバーの URL`encodeURI()`.
-
- * **successCallback**: `FileUploadResult` オブジェクトが渡されるコールバック。*(機能)*
-
- * **errorCallback**: エラー `FileUploadResult` を取得するが発生した場合に実行されるコールバック。`FileTransferError` オブジェクトを使って呼び出されます。*(機能)*
-
- * **オプション**: 省略可能なパラメーター *(オブジェクト)*。有効なキー:
-
- * **fileKey**: フォーム要素の名前。既定値は `file` です。(,)
- * **ファイル名**: ファイル名、サーバー上のファイルを保存するときに使用します。既定値は `image.jpg` です。(,)
- * **httpMethod**: - `を置く` または `POST` のいずれかを使用する HTTP メソッド。デフォルト `のポスト` です。(,)
- * **mimeType**: アップロードするデータの mime タイプ。`イメージ/jpeg` のデフォルトです。(,)
- * **params**: HTTP リクエストに渡すために任意のキー/値ペアのセット。(オブジェクト)
- * **chunkedMode**: チャンク ストリーミング モードでデータをアップロードするかどうか。デフォルトは `true` です。(ブール値)
- * **headers**: ヘッダー名/ヘッダー値のマップ。 配列を使用して、1 つ以上の値を指定します。 IOS、FireOS、アンドロイドではという名前のコンテンツ タイプ ヘッダーが存在する場合、マルチパート フォーム データは使用されません。 (Object)
- * **httpMethod**: 例えばを使用する HTTP メソッドを POST または PUT です。 デフォルト`のポスト`です。(DOMString)
-
- * **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 これは Android の自己署名入りセキュリティ証明書を拒否するので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)*
-
-### 例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### サンプルのアップロード ヘッダーと進行状況のイベント (Android と iOS のみ)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-`FileUploadResult` オブジェクトは `FileTransfer` オブジェクト `upload()` メソッドの成功時のコールバックに渡されます。
-
-### プロパティ
-
- * **bytesSent**: アップロードの一部としてサーバーに送信されたバイト数。(ロング)
-
- * **記述**: サーバーによって返される HTTP 応答コード。(ロング)
-
- * **応答**: サーバーによって返される HTTP 応答。(,)
-
- * **ヘッダー**: HTTP 応答ヘッダー サーバーによって。(オブジェクト)
-
- * 現在 iOS のみでサポートされます。
-
-### iOS の癖
-
- * サポートしていない `responseCode` または`bytesSent`.
-
-## download
-
-**パラメーター**:
-
- * **ソース**: によって符号化されるように、ファイルをダウンロードするサーバーの URL`encodeURI()`.
-
- * **ターゲット**: デバイス上のファイルを表すファイルシステム url。 下位互換性は、このことも、デバイス上のファイルの完全パスであります。 (参照してください [後方互換性メモ] の下)
-
- * **successCallback**: 渡されたコールバックを `FileEntry` オブジェクト。*(機能)*
-
- * **errorCallback**: `FileEntry` を取得するときにエラーが発生した場合に実行されるコールバック。`FileTransferError` オブジェクトを使って呼び出されます。*(機能)*
-
- * **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 Android は、自己署名入りセキュリティ証明書を拒否しますので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)*
-
- * **オプション**: 省略可能なパラメーターは、現在サポートするヘッダーのみ (認証 (基本認証) など)。
-
-### 例
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### WP8 癖
-
- * ダウンロード要求するネイティブ実装によってキャッシュに格納されています。キャッシュされないように、渡す`以来変更された if`ヘッダー メソッドをダウンロードします。
-
-## abort
-
-進行中の転送を中止します。Onerror コールバックが FileTransferError.ABORT_ERR のエラー コードを持っている FileTransferError オブジェクトに渡されます。
-
-### 例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-`FileTransferError` オブジェクトは、エラーが発生したときにエラー コールバックに渡されます。
-
-### プロパティ
-
- * **コード**: 次のいずれかの定義済みのエラー コード。(数)
-
- * **ソース**: ソースの URL。(文字列)
-
- * **ターゲット**: 先の URL。(文字列)
-
- * **http_status**: HTTP ステータス コード。この属性は、HTTP 接続から応答コードを受信したときにのみ使用できます。(数)
-
- * **body**応答本体。この属性は、HTTP 接続から応答を受信したときにのみ使用できます。(文字列)
-
- * **exception**: どちらか e.getMessage または e.toString (文字列)
-
-### 定数
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## 後方互換性をノートします。
-
-このプラグインの以前のバージョンまたはダウンロードのターゲットとして、アップロードのソースとしてのみデバイス絶対ファイル パスを受け入れるでしょう。これらのパスの形式は、通常
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-下位互換性、これらのパスを使用しても、アプリケーションは、永続的なストレージでこのようなパスを記録している場合、し彼らが引き続き使用されます。
-
-これらのパスの `FileEntry` やファイル プラグインによって返される `DirectoryEntry` オブジェクトの `fullPath` プロパティで公開されていなかった。 新しいプラグインのバージョン、ファイル、ただし、もはや java スクリプトの設定をこれらのパスを公開します。
-
-新しいにアップグレードする場合 (1.0.0 以降) ファイルのバージョン以前を使用している `entry.fullPath` `download()` または `upload()` への引数として、ファイルシステムの Url を代わりに使用するコードを変更する必要があります。
-
-`FileEntry.toURL()` と `DirectoryEntry.toURL()` ファイルシステムの URL を返すフォーム
-
- cdvfile://localhost/persistent/path/to/file
-
-
-`download()`、`upload()` メソッドの絶対ファイル パスの代わりに使用できます。
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/ja/index.md b/plugins/cordova-plugin-file-transfer/doc/ja/index.md
deleted file mode 100644
index f885b3c..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/ja/index.md
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-このプラグインは、アップロードし、ファイルをダウンロードすることができます。
-
-このプラグインでは、グローバル `FileTransfer`、`FileUploadOptions` コンス トラクターを定義します。
-
-グローバル スコープでは使用できませんまで `deviceready` イベントの後です。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## インストール
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## サポートされているプラットフォーム
-
-* アマゾン火 OS
-* アンドロイド
-* ブラックベリー 10
-* ブラウザー
-* Firefox の OS * *
-* iOS
-* Windows Phone 7 と 8 *
-* Windows 8
-* Windows
-
-* *`onprogress` も `abort()` をサポートしていません*
-
-* * *`onprogress` をサポートしていません*
-
-# FileTransfer
-
-`FileTransfer` オブジェクトはマルチパートのポスト、HTTP 要求を使用してファイルをアップロードして同様にファイルをダウンロードする方法を提供します。
-
-## プロパティ
-
-* **onprogress**: と呼ばれる、 `ProgressEvent` データの新しいチャンクが転送されるたびに。*(機能)*
-
-## メソッド
-
-* **アップロード**: サーバーにファイルを送信します。
-
-* **ダウンロード**: サーバーからファイルをダウンロードします。
-
-* **中止**: 進行中の転送を中止します。
-
-## upload
-
-**パラメーター**:
-
-* **fileURL**: デバイス上のファイルを表すファイルシステム URL。 下位互換性は、このことも、デバイス上のファイルの完全パスであります。 (参照してください [後方互換性メモ] の下)
-
-* **サーバー**: によって符号化されるように、ファイルを受信するサーバーの URL`encodeURI()`.
-
-* **successCallback**: `FileUploadResult` オブジェクトが渡されるコールバック。*(機能)*
-
-* **errorCallback**: エラー `FileUploadResult` を取得するが発生した場合に実行されるコールバック。`FileTransferError` オブジェクトを使って呼び出されます。*(機能)*
-
-* **オプション**: 省略可能なパラメーター *(オブジェクト)*。有効なキー:
-
- * **fileKey**: フォーム要素の名前。既定値は `file` です。(,)
- * **ファイル名**: ファイル名、サーバー上のファイルを保存するときに使用します。既定値は `image.jpg` です。(,)
- * **httpMethod**: - `を置く` または `POST` のいずれかを使用する HTTP メソッド。デフォルト `のポスト` です。(,)
- * **mimeType**: アップロードするデータの mime タイプ。`イメージ/jpeg` のデフォルトです。(,)
- * **params**: HTTP リクエストに渡すために任意のキー/値ペアのセット。(オブジェクト)
- * **chunkedMode**: チャンク ストリーミング モードでデータをアップロードするかどうか。デフォルトは `true` です。(ブール値)
- * **headers**: ヘッダーの名前/ヘッダー値のマップ。1 つ以上の値を指定するには、配列を使用します。(オブジェクト)
-
-* **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 これは Android の自己署名入りセキュリティ証明書を拒否するので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)*
-
-### 例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### サンプルのアップロード ヘッダーと進行状況のイベント (Android と iOS のみ)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-`FileUploadResult` オブジェクトは `FileTransfer` オブジェクト `upload()` メソッドの成功時のコールバックに渡されます。
-
-### プロパティ
-
-* **bytesSent**: アップロードの一部としてサーバーに送信されたバイト数。(ロング)
-
-* **記述**: サーバーによって返される HTTP 応答コード。(ロング)
-
-* **応答**: サーバーによって返される HTTP 応答。(,)
-
-* **ヘッダー**: HTTP 応答ヘッダー サーバーによって。(オブジェクト)
-
- * 現在 iOS のみでサポートされます。
-
-### iOS の癖
-
-* サポートしていない `responseCode` または`bytesSent`.
-
-## download
-
-**パラメーター**:
-
-* **ソース**: によって符号化されるように、ファイルをダウンロードするサーバーの URL`encodeURI()`.
-
-* **ターゲット**: デバイス上のファイルを表すファイルシステム url。 下位互換性は、このことも、デバイス上のファイルの完全パスであります。 (参照してください [後方互換性メモ] の下)
-
-* **successCallback**: 渡されたコールバックを `FileEntry` オブジェクト。*(機能)*
-
-* **errorCallback**: `FileEntry` を取得するときにエラーが発生した場合に実行されるコールバック。`FileTransferError` オブジェクトを使って呼び出されます。*(機能)*
-
-* **trustAllHosts**: 省略可能なパラメーターは、デフォルト `false` 。 場合設定 `true` 、セキュリティ証明書をすべて受け付けます。 Android は、自己署名入りセキュリティ証明書を拒否しますので便利です。 運用環境で使用しないでください。 Android と iOS でサポートされています。 *(ブール値)*
-
-* **オプション**: 省略可能なパラメーターは、現在サポートするヘッダーのみ (認証 (基本認証) など)。
-
-### 例
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## abort
-
-進行中の転送を中止します。Onerror コールバックが FileTransferError.ABORT_ERR のエラー コードを持っている FileTransferError オブジェクトに渡されます。
-
-### 例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-`FileTransferError` オブジェクトは、エラーが発生したときにエラー コールバックに渡されます。
-
-### プロパティ
-
-* **コード**: 次のいずれかの定義済みのエラー コード。(数)
-
-* **ソース**: ソースの URL。(文字列)
-
-* **ターゲット**: 先の URL。(文字列)
-
-* **http_status**: HTTP ステータス コード。この属性は、HTTP 接続から応答コードを受信したときにのみ使用できます。(数)
-
-* **body**応答本体。この属性は、HTTP 接続から応答を受信したときにのみ使用できます。(文字列)
-
-* **exception**: どちらか e.getMessage または e.toString (文字列)
-
-### 定数
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## 後方互換性をノートします。
-
-このプラグインの以前のバージョンまたはダウンロードのターゲットとして、アップロードのソースとしてのみデバイス絶対ファイル パスを受け入れるでしょう。これらのパスの形式は、通常
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-下位互換性、これらのパスを使用しても、アプリケーションは、永続的なストレージでこのようなパスを記録している場合、し彼らが引き続き使用されます。
-
-これらのパスの `FileEntry` やファイル プラグインによって返される `DirectoryEntry` オブジェクトの `fullPath` プロパティで公開されていなかった。 新しいプラグインのバージョン、ファイル、ただし、もはや java スクリプトの設定をこれらのパスを公開します。
-
-新しいにアップグレードする場合 (1.0.0 以降) ファイルのバージョン以前を使用している `entry.fullPath` `download()` または `upload()` への引数として、ファイルシステムの Url を代わりに使用するコードを変更する必要があります。
-
-`FileEntry.toURL()` と `DirectoryEntry.toURL()` ファイルシステムの URL を返すフォーム
-
- cdvfile://localhost/persistent/path/to/file
-
-
-`download()`、`upload()` メソッドの絶対ファイル パスの代わりに使用できます。
diff --git a/plugins/cordova-plugin-file-transfer/doc/ko/README.md b/plugins/cordova-plugin-file-transfer/doc/ko/README.md
deleted file mode 100644
index f91e8a2..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/ko/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-플러그인 문서:
-
-이 플러그인을 사용 하면 업로드 및 다운로드 파일 수 있습니다.
-
-이 플러그인 글로벌 `FileTransfer`, `FileUploadOptions` 생성자를 정의합니다.
-
-전역 범위에서 그들은 제공 되지 않습니다 때까지 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## 지원 되는 플랫폼
-
- * 아마존 화재 운영 체제
- * 안 드 로이드
- * 블랙베리 10
- * 브라우저
- * 파이어 폭스 OS * *
- * iOS
- * Windows Phone 7과 8 *
- * 윈도우 8
- * 윈도우
-
-\** `Onprogress` 도 `abort()` 를 지원 하지 않습니다*
-
-\*** `Onprogress` 를 지원 하지 않습니다*
-
-# FileTransfer
-
-`FileTransfer` 개체는 HTTP 다중 파트 POST 또는 PUT 요청을 사용 하 여 파일을 업로드 하 고 또한 파일을 다운로드 하는 방법을 제공 합니다.
-
-## 속성
-
- * **onprogress**:로 불리는 `ProgressEvent` 새로운 양의 데이터를 전송 하는 때마다. *(기능)*
-
-## 메서드
-
- * **업로드**: 파일을 서버에 보냅니다.
-
- * **다운로드**: 서버에서 파일을 다운로드 합니다.
-
- * **중단**: 진행 중인 전송 중단.
-
-## 업로드
-
-**매개 변수**:
-
- * **fileURL**: 장치에 파일을 나타내는 파일 시스템 URL. 에 대 한 이전 버전과 호환성을이 수도 장치에 있는 파일의 전체 경로 수. (참조 [거꾸로 호환성 노트] 아래)
-
- * **서버**: 인코딩 파일 수신 서버의 URL`encodeURI()`.
-
- * **successCallback**: `FileUploadResult` 개체를 전달 하는 콜백. *(기능)*
-
- * **errorCallback**: `FileUploadResult` 검색에 오류가 발생 하면 실행 되는 콜백. `FileTransferError` 개체와 함께 호출 됩니다. *(기능)*
-
- * **옵션**: 선택적 매개 변수 *(개체)*. 유효한 키:
-
- * **fileKey**: form 요소의 이름. 기본값은 `file` . (DOMString)
- * **파일 이름**: 파일 이름을 서버에 파일을 저장할 때 사용 합니다. 기본값은 `image.jpg` . (DOMString)
- * **httpMethod**: `넣어` 또는 `게시물`-사용 하도록 HTTP 메서드. `게시물` 기본값입니다. (DOMString)
- * **mimeType**: 업로드 데이터의 mime 형식을. `이미지/jpeg`의 기본값입니다. (DOMString)
- * **params**: HTTP 요청에 전달할 선택적 키/값 쌍의 집합. (개체)
- * **chunkedMode**: 청크 스트리밍 모드에서 데이터 업로드를 합니다. 기본값은 `true`입니다. (부울)
- * **headers**: 헤더 이름 및 헤더 값의 지도. 배열을 사용 하 여 하나 이상의 값을 지정. IOS, FireOS, 안 드 로이드에 있으면 라는 콘텐츠 형식 헤더, 다중 양식 데이터는 사용할 수 없습니다. (Object)
- * **httpMethod**: HTTP 메서드 예를 사용 하 여 게시 하거나 넣어. `게시물`기본값입니다. (DOMString)
-
- * **trustAllHosts**: 선택적 매개 변수는 기본적으로 `false` . 만약 설정 `true` , 그것은 모든 보안 인증서를 허용 합니다. 이 안 드 로이드 자체 서명 된 보안 인증서를 거부 하기 때문에 유용 합니다. 프로덕션 환경에서 사용 권장 되지 않습니다. 안 드 로이드와 iOS에서 지원. *(부울)*
-
-### 예를 들어
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### 예를 들어 헤더 업로드 및 진행 이벤트 (안 드 로이드와 iOS만)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-`FileUploadResult` 개체 `FileTransfer` 개체의 `원래` 방법의 성공 콜백에 전달 됩니다.
-
-### 속성
-
- * **bytesSent**: 업로드의 일부로 서버에 보낸 바이트 수. (긴)
-
- * **responseCode**: 서버에서 반환 된 HTTP 응답 코드. (긴)
-
- * **response**: 서버에서 반환 되는 HTTP 응답. (DOMString)
-
- * **headers**: 서버에서 HTTP 응답 헤더. (개체)
-
- * 현재 ios만 지원 합니다.
-
-### iOS 단점
-
- * 지원 하지 않는 `responseCode` 또는`bytesSent`.
-
-## download
-
-**매개 변수**:
-
- * **source**: URL로 인코딩된 파일, 다운로드 서버`encodeURI()`.
-
- * **target**: 장치에 파일을 나타내는 파일 시스템 url. 에 대 한 이전 버전과 호환성을이 수도 장치에 있는 파일의 전체 경로 수. (참조 [거꾸로 호환성 노트] 아래)
-
- * **successCallback**: 콜백 전달 되는 `FileEntry` 개체. *(기능)*
-
- * **errorCallback**: `FileEntry`를 검색할 때 오류가 발생 하면 실행 되는 콜백. `FileTransferError` 개체와 함께 호출 됩니다. *(기능)*
-
- * **trustAllHosts**: 선택적 매개 변수는 기본적으로 `false` . 만약 설정 `true` , 그것은 모든 보안 인증서를 허용 합니다. 안 드 로이드 자체 서명 된 보안 인증서를 거부 하기 때문에 유용 합니다. 프로덕션 환경에서 사용 권장 되지 않습니다. 안 드 로이드와 iOS에서 지원. *(부울)*
-
- * **options**: 선택적 매개 변수를 현재 지 원하는 머리글만 (예: 인증 (기본 인증), 등).
-
-### 예를 들어
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### WP8 특수
-
- * 다운로드 요청 기본 구현에 의해 캐시 되 고. 캐싱을 방지 하려면 전달 `if-수정-이후` 헤더를 다운로드 하는 방법.
-
-## abort
-
-진행 중인 전송을 중단합니다. onerror 콜백 FileTransferError.ABORT_ERR의 오류 코드는 FileTransferError 개체를 전달 합니다.
-
-### 예를 들어
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-`FileTransferError` 개체 오류가 발생 하면 오류 콜백에 전달 됩니다.
-
-### 속성
-
- * **code**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된. (수)
-
- * **source**: 소스 URL. (문자열)
-
- * **target**: 대상 URL. (문자열)
-
- * **http_status**: HTTP 상태 코드. 이 특성은 응답 코드를 HTTP 연결에서 수신에 사용할 수 있습니다. (수)
-
- * **body** 응답 본문입니다. 이 특성은 HTTP 연결에서 응답을 받을 때에 사용할 수 있습니다. (문자열)
-
- * **exception**: 어느 e.getMessage 또는 e.toString (문자열)
-
-### 상수
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## 이전 버전과 호환성 노트
-
-이 플러그인의 이전 버전만 업로드에 대 한 소스 또는 다운로드에 대 한 대상 장치 절대 파일 경로 받아들일 것 이다. 이러한 경로 일반적으로 폼의 것
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-대 한 뒤 호환성, 이러한 경로 여전히 허용, 그리고 응용 프로그램이 영구 저장소에서 이와 같은 경로 기록 했다, 그때 그들은 계속할 수 있다면 사용할 수.
-
-이러한 경로 `FileEntry` 및 파일 플러그인에 의해 반환 된 `DirectoryEntry` 개체의 `fullPath` 속성에 노출 되었던. 그러나 파일 플러그인의,, 더 이상 새로운 버전 자바 스크립트이 경로 노출.
-
-새로 업그레이드 하는 경우 (1.0.0 이상) 버전의 파일, 및 이전 사용 하 고 `entry.fullPath` `download()` 또는 `upload()` 인수로 다음 대신 파일 시스템 Url을 사용 하 여 코드를 변경 해야 합니다.
-
-폼의 파일 URL을 반환 하는 `FileEntry.toURL()` 및 `DirectoryEntry.toURL()`
-
- cdvfile://localhost/persistent/path/to/file
-
-
-어떤 `download()` 및 `upload()` 방법에서 절대 파일 경로 대신 사용할 수 있습니다.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/ko/index.md b/plugins/cordova-plugin-file-transfer/doc/ko/index.md
deleted file mode 100644
index a6e39c0..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/ko/index.md
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-이 플러그인을 사용 하면 업로드 및 다운로드 파일 수 있습니다.
-
-이 플러그인 글로벌 `FileTransfer`, `FileUploadOptions` 생성자를 정의합니다.
-
-전역 범위에서 그들은 제공 되지 않습니다 때까지 `deviceready` 이벤트 후.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## 설치
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## 지원 되는 플랫폼
-
-* 아마존 화재 운영 체제
-* 안 드 로이드
-* 블랙베리 10
-* 브라우저
-* 파이어 폭스 OS * *
-* iOS
-* Windows Phone 7과 8 *
-* 윈도우 8
-* 윈도우
-
-* *`onprogress`도 `abort()`를 지원 하지 않습니다*
-
-* * *`onprogress`를 지원 하지 않습니다*
-
-# FileTransfer
-
-`FileTransfer` 개체는 HTTP 다중 파트 POST 요청을 사용 하 여 파일 업로드 뿐만 아니라 파일을 다운로드 하는 방법을 제공 합니다.
-
-## 속성
-
-* **onprogress**:로 불리는 `ProgressEvent` 새로운 양의 데이터를 전송 하는 때마다. *(기능)*
-
-## 메서드
-
-* **업로드**: 파일을 서버에 보냅니다.
-
-* **다운로드**: 서버에서 파일을 다운로드 합니다.
-
-* **중단**: 진행 중인 전송 중단.
-
-## 업로드
-
-**매개 변수**:
-
-* **fileURL**: 장치에 파일을 나타내는 파일 시스템 URL. 에 대 한 이전 버전과 호환성을이 수도 장치에 있는 파일의 전체 경로 수. (참조 [거꾸로 호환성 노트] 아래)
-
-* **서버**: 인코딩 파일 수신 서버의 URL`encodeURI()`.
-
-* **successCallback**: `FileUploadResult` 개체를 전달 하는 콜백. *(기능)*
-
-* **errorCallback**: `FileUploadResult` 검색에 오류가 발생 하면 실행 되는 콜백. `FileTransferError` 개체와 함께 호출 됩니다. *(기능)*
-
-* **옵션**: 선택적 매개 변수 *(개체)*. 유효한 키:
-
- * **fileKey**: form 요소의 이름. 기본값은 `file` . (DOMString)
- * **파일 이름**: 파일 이름을 서버에 파일을 저장할 때 사용 합니다. 기본값은 `image.jpg` . (DOMString)
- * **httpMethod**: `넣어` 또는 `게시물`-사용 하도록 HTTP 메서드. `게시물` 기본값입니다. (DOMString)
- * **mimeType**: 업로드 데이터의 mime 형식을. `이미지/jpeg`의 기본값입니다. (DOMString)
- * **params**: HTTP 요청에 전달할 선택적 키/값 쌍의 집합. (개체)
- * **chunkedMode**: 청크 스트리밍 모드에서 데이터 업로드를 합니다. 기본값은 `true`입니다. (부울)
- * **headers**: 헤더 이름/헤더 값의 지도. 배열을 사용 하 여 하나 이상의 값을 지정 합니다. (개체)
-
-* **trustAllHosts**: 선택적 매개 변수는 기본적으로 `false` . 만약 설정 `true` , 그것은 모든 보안 인증서를 허용 합니다. 이 안 드 로이드 자체 서명 된 보안 인증서를 거부 하기 때문에 유용 합니다. 프로덕션 환경에서 사용 권장 되지 않습니다. 안 드 로이드와 iOS에서 지원. *(부울)*
-
-### 예를 들어
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### 예를 들어 헤더 업로드 및 진행 이벤트 (안 드 로이드와 iOS만)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-`FileUploadResult` 개체 `FileTransfer` 개체의 `원래` 방법의 성공 콜백에 전달 됩니다.
-
-### 속성
-
-* **bytesSent**: 업로드의 일부로 서버에 보낸 바이트 수. (긴)
-
-* **responseCode**: 서버에서 반환 된 HTTP 응답 코드. (긴)
-
-* **response**: 서버에서 반환 되는 HTTP 응답. (DOMString)
-
-* **headers**: 서버에서 HTTP 응답 헤더. (개체)
-
- * 현재 ios만 지원 합니다.
-
-### iOS 단점
-
-* 지원 하지 않는 `responseCode` 또는`bytesSent`.
-
-## download
-
-**매개 변수**:
-
-* **source**: URL로 인코딩된 파일, 다운로드 서버`encodeURI()`.
-
-* **target**: 장치에 파일을 나타내는 파일 시스템 url. 에 대 한 이전 버전과 호환성을이 수도 장치에 있는 파일의 전체 경로 수. (참조 [거꾸로 호환성 노트] 아래)
-
-* **successCallback**: 콜백 전달 되는 `FileEntry` 개체. *(기능)*
-
-* **errorCallback**: `FileEntry`를 검색할 때 오류가 발생 하면 실행 되는 콜백. `FileTransferError` 개체와 함께 호출 됩니다. *(기능)*
-
-* **trustAllHosts**: 선택적 매개 변수는 기본적으로 `false` . 만약 설정 `true` , 그것은 모든 보안 인증서를 허용 합니다. 안 드 로이드 자체 서명 된 보안 인증서를 거부 하기 때문에 유용 합니다. 프로덕션 환경에서 사용 권장 되지 않습니다. 안 드 로이드와 iOS에서 지원. *(부울)*
-
-* **options**: 선택적 매개 변수를 현재 지 원하는 머리글만 (예: 인증 (기본 인증), 등).
-
-### 예를 들어
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## abort
-
-진행 중인 전송을 중단합니다. onerror 콜백 FileTransferError.ABORT_ERR의 오류 코드는 FileTransferError 개체를 전달 합니다.
-
-### 예를 들어
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-`FileTransferError` 개체 오류가 발생 하면 오류 콜백에 전달 됩니다.
-
-### 속성
-
-* **code**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된. (수)
-
-* **source**: 소스 URL. (문자열)
-
-* **target**: 대상 URL. (문자열)
-
-* **http_status**: HTTP 상태 코드. 이 특성은 응답 코드를 HTTP 연결에서 수신에 사용할 수 있습니다. (수)
-
-* **body** 응답 본문입니다. 이 특성은 HTTP 연결에서 응답을 받을 때에 사용할 수 있습니다. (문자열)
-
-* **exception**: 어느 e.getMessage 또는 e.toString (문자열)
-
-### 상수
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## 이전 버전과 호환성 노트
-
-이 플러그인의 이전 버전만 업로드에 대 한 소스 또는 다운로드에 대 한 대상 장치 절대 파일 경로 받아들일 것 이다. 이러한 경로 일반적으로 폼의 것
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-대 한 뒤 호환성, 이러한 경로 여전히 허용, 그리고 응용 프로그램이 영구 저장소에서 이와 같은 경로 기록 했다, 그때 그들은 계속할 수 있다면 사용할 수.
-
-이러한 경로 `FileEntry` 및 파일 플러그인에 의해 반환 된 `DirectoryEntry` 개체의 `fullPath` 속성에 노출 되었던. 그러나 파일 플러그인의,, 더 이상 새로운 버전 자바 스크립트이 경로 노출.
-
-새로 업그레이드 하는 경우 (1.0.0 이상) 버전의 파일, 및 이전 사용 하 고 `entry.fullPath` `download()` 또는 `upload()` 인수로 다음 대신 파일 시스템 Url을 사용 하 여 코드를 변경 해야 합니다.
-
-폼의 파일 URL을 반환 하는 `FileEntry.toURL()` 및 `DirectoryEntry.toURL()`
-
- cdvfile://localhost/persistent/path/to/file
-
-
-어떤 `download()` 및 `upload()` 방법에서 절대 파일 경로 대신 사용할 수 있습니다.
diff --git a/plugins/cordova-plugin-file-transfer/doc/pl/README.md b/plugins/cordova-plugin-file-transfer/doc/pl/README.md
deleted file mode 100644
index c430979..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/pl/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-Plugin dokumentacja:
-
-Plugin pozwala na przesyłanie i pobieranie plików.
-
-Ten plugin określa globalne `FileTransfer`, `FileUploadOptions` konstruktorów.
-
-Chociaż w globalnym zasięgu, są nie dostępne dopiero po `deviceready` imprezie.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Obsługiwane platformy
-
- * Amazon Fire OS
- * Android
- * BlackBerry 10
- * Przeglądarka
- * Firefox OS **
- * iOS
- * Windows Phone 7 i 8 *
- * Windows 8
- * Windows
-
-\ * *Nie obsługują `onprogress` ani `abort()` *
-
-\ ** *Nie obsługują `onprogress` *
-
-# FileTransfer
-
-Obiekt `FileTransfer` zapewnia sposób wgrać pliki za pomocą Multi-część POST lub PUT żądania HTTP i pobierania plików, jak również.
-
-## Właściwości
-
- * **OnProgress**: o nazwie `ProgressEvent` gdy nowy kawałek danych jest przenoszona. *(Funkcja)*
-
-## Metody
-
- * **wgraj**: wysyła plik na serwer.
-
- * **do pobrania**: pliki do pobrania pliku z serwera.
-
- * **przerwać**: przerywa w toku transferu.
-
-## upload
-
-**Parametry**:
-
- * **fileURL**: URL plików reprezentujących pliku na urządzenie. Dla wstecznej kompatybilności, to może również być pełną ścieżkę pliku na urządzenie. (Zobacz [wstecz zgodności zauważa] poniżej)
-
- * **serwer**: adres URL serwera, aby otrzymać plik, jak kodowane przez`encodeURI()`.
-
- * **successCallback**: wywołania zwrotnego, który jest przekazywany obiekt `FileUploadResult`. *(Funkcja)*
-
- * **errorCallback**: wywołanie zwrotne, które wykonuje, jeżeli wystąpi błąd pobierania `FileUploadResult`. Wywoływany z obiektu `FileTransferError`. *(Funkcja)*
-
- * **Opcje**: parametry opcjonalne *(obiektu)*. Ważne klucze:
-
- * **fileKey**: nazwa elementu form. Domyślnie `file` . (DOMString)
- * **Nazwa pliku**: nazwy pliku, aby użyć podczas zapisywania pliku na serwerze. Domyślnie `image.jpg` . (DOMString)
- * **element httpMethod**: Metoda HTTP do użycia - `umieścić` lub `POST`. Domyślnie `POST`. (DOMString)
- * **mimeType**: Typ mime danych do przesłania. Domyślnie do `image/jpeg`. (DOMString)
- * **params**: zestaw par opcjonalny klucz/wartość w żądaniu HTTP. (Obiekt)
- * **chunkedMode**: czy przekazać dane w trybie pakietowego przesyłania strumieniowego. Wartością domyślną jest `true`. (Wartość logiczna)
- * **headers**: Mapa wartości Nazwa/nagłówka nagłówek. Aby określić więcej niż jedną wartość, należy użyć tablicę. Na iOS, FireOS i Android jeśli nagłówek o nazwie Content-Type jest obecny, wieloczęściowa forma nie danych. (Object)
- * **element httpMethod**: Metoda HTTP np. POST lub PUT. Ustawienia domyślne do `POST`. (DOMString)
-
- * **trustAllHosts**: parametr opcjonalny, domyślnie `false` . Jeśli zestaw `true` , to akceptuje wszystkie certyfikaty bezpieczeństwa. Jest to przydatne, ponieważ Android odrzuca Certyfikaty samopodpisane. Nie zaleca się do użytku produkcyjnego. Obsługiwane na Androida i iOS. *(wartość logiczna)*
-
-### Przykład
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Przykład z Prześlij nagłówki i zdarzeń postępu (Android i iOS tylko)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Obiekt `FileUploadResult` jest przekazywana do sukcesu wywołania zwrotnego metody `upload() służącą` obiektu `FileTransfer`.
-
-### Właściwości
-
- * **bytesSent**: liczba bajtów wysłanych do serwera jako część upload. (długie)
-
- * **responseCode**: kod odpowiedzi HTTP, zwracane przez serwer. (długie)
-
- * **odpowiedź**: HTTP odpowiedzi zwracane przez serwer. (DOMString)
-
- * **nagłówki**: nagłówki HTTP odpowiedzi przez serwer. (Obiekt)
-
- * Obecnie obsługiwane na iOS tylko.
-
-### Dziwactwa iOS
-
- * Nie obsługuje `responseCode` lub`bytesSent`.
-
-## download
-
-**Parametry**:
-
- * **Źródło**: adres URL serwera, aby pobrać plik, jak kodowane przez`encodeURI()`.
-
- * **cel**: url plików reprezentujących pliku na urządzenie. Dla wstecznej kompatybilności, to może również być pełną ścieżkę pliku na urządzenie. (Zobacz [wstecz zgodności zauważa] poniżej)
-
- * **successCallback**: wywołania zwrotnego, który jest przekazywany `FileEntry` obiektu. *(Funkcja)*
-
- * **errorCallback**: wywołanie zwrotne, które wykonuje, jeśli wystąpi błąd podczas pobierania `FileEntry`. Wywoływany z obiektu `FileTransferError`. *(Funkcja)*
-
- * **trustAllHosts**: parametr opcjonalny, domyślnie `false` . Jeśli zestaw `true` , to akceptuje wszystkie certyfikaty bezpieczeństwa. Jest to przydatne, ponieważ Android odrzuca Certyfikaty samopodpisane. Nie zaleca się do użytku produkcyjnego. Obsługiwane na Androida i iOS. *(wartość logiczna)*
-
- * **Opcje**: parametry opcjonalne, obecnie tylko obsługuje nagłówki (takie jak autoryzacja (uwierzytelnianie podstawowe), itp.).
-
-### Przykład
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### WP8 dziwactwa
-
- * Pobierz wnioski są buforowane przez rodzimych realizacji. Aby uniknąć, buforowanie, przekazać `if-Modified-Since` nagłówka do pobrania Metoda.
-
-## abort
-
-Przerywa w toku transferu. Onerror callback jest przekazywany obiekt FileTransferError, który kod błędu z FileTransferError.ABORT_ERR.
-
-### Przykład
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-Obiekt `FileTransferError` jest przekazywana do błąd wywołania zwrotnego, gdy wystąpi błąd.
-
-### Właściwości
-
- * **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej. (Liczba)
-
- * **Źródło**: URL do źródła. (String)
-
- * **cel**: adres URL do docelowego. (String)
-
- * **HTTP_STATUS**: kod stanu HTTP. Ten atrybut jest dostępna tylko po otrzymaniu kodu odpowiedzi z połączenia HTTP. (Liczba)
-
- * **body** Treść odpowiedzi. Ten atrybut jest dostępna tylko wtedy, gdy odpowiedź jest otrzymanych od połączenia HTTP. (String)
-
- * **exception**: albo e.getMessage lub e.toString (String)
-
-### Stałe
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Do tyłu zgodności stwierdza
-
-Poprzednie wersje tego pluginu tylko zaakceptować urządzenia bezwzględnych ścieżek jako źródło dla przekazywania, lub w celu pobrania. Te ścieżki będzie zazwyczaj formy
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Do tyłu zgodności, akceptowane są jeszcze te ścieżki, i jeśli aplikacja nagrał ścieżki, jak te w trwałej pamięci, następnie można nadal stosować.
-
-Te ścieżki były narażone wcześniej we właściwości `fullPath` `FileEntry` i `DirectoryEntry` obiektów zwróconych przez wtyczki pliku. Nowe wersje pliku plugin, jednak już wystawiać te ścieżki do JavaScript.
-
-Jeśli uaktualniasz nowy (1.0.0 lub nowsza) wersja pliku i mieć wcześniej przy `entry.fullPath` jako argumenty `download()` lub `upload() służącą`, a następnie trzeba będzie zmienić kod aby używać adresów URL plików zamiast.
-
-`FileEntry.toURL()` i `DirectoryEntry.toURL()` zwraca adres URL plików formularza
-
- cdvfile://localhost/persistent/path/to/file
-
-
-które mogą być używane zamiast bezwzględna ścieżka zarówno `download()` i `metody upload()` metody.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/pl/index.md b/plugins/cordova-plugin-file-transfer/doc/pl/index.md
deleted file mode 100644
index ff9b557..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/pl/index.md
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-Plugin pozwala na przesyłanie i pobieranie plików.
-
-Ten plugin określa globalne `FileTransfer`, `FileUploadOptions` konstruktorów.
-
-Chociaż w globalnym zasięgu, są nie dostępne dopiero po `deviceready` imprezie.
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## Instalacja
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Obsługiwane platformy
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Przeglądarka
-* Firefox OS **
-* iOS
-* Windows Phone 7 i 8 *
-* Windows 8
-* Windows
-
-* *Nie obsługują `onprogress` ani `abort()`*
-
-* * *Nie obsługują `onprogress`*
-
-# FileTransfer
-
-Obiekt `FileTransfer` zapewnia sposób wgrać pliki przy użyciu żądania HTTP wieloczęściowe POST i pobierania plików, jak również.
-
-## Właściwości
-
-* **OnProgress**: o nazwie `ProgressEvent` gdy nowy kawałek danych jest przenoszona. *(Funkcja)*
-
-## Metody
-
-* **wgraj**: wysyła plik na serwer.
-
-* **do pobrania**: pliki do pobrania pliku z serwera.
-
-* **przerwać**: przerywa w toku transferu.
-
-## upload
-
-**Parametry**:
-
-* **fileURL**: URL plików reprezentujących pliku na urządzenie. Dla wstecznej kompatybilności, to może również być pełną ścieżkę pliku na urządzenie. (Zobacz [wstecz zgodności zauważa] poniżej)
-
-* **serwer**: adres URL serwera, aby otrzymać plik, jak kodowane przez`encodeURI()`.
-
-* **successCallback**: wywołania zwrotnego, który jest przekazywany obiekt `FileUploadResult`. *(Funkcja)*
-
-* **errorCallback**: wywołanie zwrotne, które wykonuje, jeżeli wystąpi błąd pobierania `FileUploadResult`. Wywoływany z obiektu `FileTransferError`. *(Funkcja)*
-
-* **Opcje**: parametry opcjonalne *(obiektu)*. Ważne klucze:
-
- * **fileKey**: nazwa elementu form. Domyślnie `file` . (DOMString)
- * **Nazwa pliku**: nazwy pliku, aby użyć podczas zapisywania pliku na serwerze. Domyślnie `image.jpg` . (DOMString)
- * **element httpMethod**: Metoda HTTP do użycia - `umieścić` lub `POST`. Domyślnie `POST`. (DOMString)
- * **mimeType**: Typ mime danych do przesłania. Domyślnie do `image/jpeg`. (DOMString)
- * **params**: zestaw par opcjonalny klucz/wartość w żądaniu HTTP. (Obiekt)
- * **chunkedMode**: czy przekazać dane w trybie pakietowego przesyłania strumieniowego. Wartością domyślną jest `true`. (Wartość logiczna)
- * **headers**: Mapa wartości Nazwa/nagłówka nagłówek. Aby określić więcej niż jedną wartość, należy użyć tablicę. (Obiekt)
-
-* **trustAllHosts**: parametr opcjonalny, domyślnie `false` . Jeśli zestaw `true` , to akceptuje wszystkie certyfikaty bezpieczeństwa. Jest to przydatne, ponieważ Android odrzuca Certyfikaty samopodpisane. Nie zaleca się do użytku produkcyjnego. Obsługiwane na Androida i iOS. *(wartość logiczna)*
-
-### Przykład
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Przykład z Prześlij nagłówki i zdarzeń postępu (Android i iOS tylko)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Obiekt `FileUploadResult` jest przekazywana do sukcesu wywołania zwrotnego metody `upload() służącą` obiektu `FileTransfer`.
-
-### Właściwości
-
-* **bytesSent**: liczba bajtów wysłanych do serwera jako część upload. (długie)
-
-* **responseCode**: kod odpowiedzi HTTP, zwracane przez serwer. (długie)
-
-* **odpowiedź**: HTTP odpowiedzi zwracane przez serwer. (DOMString)
-
-* **nagłówki**: nagłówki HTTP odpowiedzi przez serwer. (Obiekt)
-
- * Obecnie obsługiwane na iOS tylko.
-
-### Dziwactwa iOS
-
-* Nie obsługuje `responseCode` lub`bytesSent`.
-
-## download
-
-**Parametry**:
-
-* **Źródło**: adres URL serwera, aby pobrać plik, jak kodowane przez`encodeURI()`.
-
-* **cel**: url plików reprezentujących pliku na urządzenie. Dla wstecznej kompatybilności, to może również być pełną ścieżkę pliku na urządzenie. (Zobacz [wstecz zgodności zauważa] poniżej)
-
-* **successCallback**: wywołania zwrotnego, który jest przekazywany `FileEntry` obiektu. *(Funkcja)*
-
-* **errorCallback**: wywołanie zwrotne, które wykonuje, jeśli wystąpi błąd podczas pobierania `FileEntry`. Wywoływany z obiektu `FileTransferError`. *(Funkcja)*
-
-* **trustAllHosts**: parametr opcjonalny, domyślnie `false` . Jeśli zestaw `true` , to akceptuje wszystkie certyfikaty bezpieczeństwa. Jest to przydatne, ponieważ Android odrzuca Certyfikaty samopodpisane. Nie zaleca się do użytku produkcyjnego. Obsługiwane na Androida i iOS. *(wartość logiczna)*
-
-* **Opcje**: parametry opcjonalne, obecnie tylko obsługuje nagłówki (takie jak autoryzacja (uwierzytelnianie podstawowe), itp.).
-
-### Przykład
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## abort
-
-Przerywa w toku transferu. Onerror callback jest przekazywany obiekt FileTransferError, który kod błędu z FileTransferError.ABORT_ERR.
-
-### Przykład
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-Obiekt `FileTransferError` jest przekazywana do błąd wywołania zwrotnego, gdy wystąpi błąd.
-
-### Właściwości
-
-* **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej. (Liczba)
-
-* **Źródło**: URL do źródła. (String)
-
-* **cel**: adres URL do docelowego. (String)
-
-* **HTTP_STATUS**: kod stanu HTTP. Ten atrybut jest dostępna tylko po otrzymaniu kodu odpowiedzi z połączenia HTTP. (Liczba)
-
-* **body** Treść odpowiedzi. Ten atrybut jest dostępna tylko wtedy, gdy odpowiedź jest otrzymanych od połączenia HTTP. (String)
-
-* **exception**: albo e.getMessage lub e.toString (String)
-
-### Stałe
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Do tyłu zgodności stwierdza
-
-Poprzednie wersje tego pluginu tylko zaakceptować urządzenia bezwzględnych ścieżek jako źródło dla przekazywania, lub w celu pobrania. Te ścieżki będzie zazwyczaj formy
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Do tyłu zgodności, akceptowane są jeszcze te ścieżki, i jeśli aplikacja nagrał ścieżki, jak te w trwałej pamięci, następnie można nadal stosować.
-
-Te ścieżki były narażone wcześniej we właściwości `fullPath` `FileEntry` i `DirectoryEntry` obiektów zwróconych przez wtyczki pliku. Nowe wersje pliku plugin, jednak już wystawiać te ścieżki do JavaScript.
-
-Jeśli uaktualniasz nowy (1.0.0 lub nowsza) wersja pliku i mieć wcześniej przy `entry.fullPath` jako argumenty `download()` lub `upload() służącą`, a następnie trzeba będzie zmienić kod aby używać adresów URL plików zamiast.
-
-`FileEntry.toURL()` i `DirectoryEntry.toURL()` zwraca adres URL plików formularza
-
- cdvfile://localhost/persistent/path/to/file
-
-
-które mogą być używane zamiast bezwzględna ścieżka zarówno `download()` i `metody upload()` metody.
diff --git a/plugins/cordova-plugin-file-transfer/doc/ru/index.md b/plugins/cordova-plugin-file-transfer/doc/ru/index.md
deleted file mode 100644
index cdd5a15..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/ru/index.md
+++ /dev/null
@@ -1,290 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-Этот плагин позволяет вам загружать и скачивать файлы.
-
-## Установка
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## Поддерживаемые платформы
-
-* Amazon Fire OS
-* Android
-* BlackBerry 10
-* Firefox OS **
-* iOS
-* Windows Phone 7 и 8 *
-* Windows 8 ***|
-* Windows ***|
-
-* *Не поддерживают `onprogress` , ни `abort()` *
-
-** *Не поддерживает `onprogress` *
-
-Частичная поддержка `onprogress` для закачки метод. `onprogress` вызывается с пустой ход событий благодаря Windows limitations_
-
-# FileTransfer
-
-`FileTransfer`Объект предоставляет способ для загрузки файлов с помощью нескольких частей запроса POST HTTP и для загрузки файлов, а также.
-
-## Параметры
-
-* **OnProgress**: называется с `ProgressEvent` всякий раз, когда новый фрагмент данных передается. *(Функция)*
-
-## Методы
-
-* **добавлено**: отправляет файл на сервер.
-
-* **скачать**: Скачать файл с сервера.
-
-* **прервать**: прерывает передачу в прогресс.
-
-## загрузить
-
-**Параметры**:
-
-* **fileURL**: файловой системы URL-адрес, представляющий файл на устройстве. Для обратной совместимости, это также может быть полный путь к файлу на устройстве. (См. [обратной совместимости отмечает] ниже)
-
-* **сервер**: URL-адрес сервера, чтобы получить файл, как закодированные`encodeURI()`.
-
-* **successCallback**: обратного вызова, передаваемого `Metadata` объект. *(Функция)*
-
-* **errorCallback**: обратного вызова, который выполняется в случае получения ошибки `Metadata` . Вызываемый с `FileTransferError` объект. *(Функция)*
-
-* **опции**: необязательные параметры *(объект)*. Допустимые ключи:
-
- * **fileKey**: имя элемента form. По умолчанию `file` . (DOMString)
- * **имя файла**: имя файла для использования при сохранении файла на сервере. По умолчанию `image.jpg` . (DOMString)
- * **mimeType**: mime-тип данных для загрузки. По умолчанию `image/jpeg` . (DOMString)
- * **params**: набор пар дополнительный ключ/значение для передачи в HTTP-запросе. (Объект)
- * **chunkedMode**: следует ли загружать данные в фрагментарности потоковом режиме. По умолчанию `true` . (Логическое значение)
- * **заголовки**: Карта значений заголовок имя заголовка. Используйте массив для указания более одного значения. (Объект)
-
-* **trustAllHosts**: необязательный параметр, по умолчанию `false` . Если значение `true` , она принимает все сертификаты безопасности. Это полезно, поскольку Android отвергает самозаверяющие сертификаты. Не рекомендуется для использования в производстве. Поддерживается на Android и iOS. *(логическое значение)*
-
-### Пример
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### Пример с загружать заголовки и события Progress (Android и iOS только)
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-Объект `FileUploadResult` передается на успех обратного вызова метода `upload()` объекта `FileTransfer`.
-
-### Параметры
-
-* **bytesSent**: количество байт, отправленных на сервер как часть загрузки. (длинная)
-
-* **responseCode**: код ответа HTTP, возвращаемых сервером. (длинная)
-
-* **ответ**: ответ HTTP, возвращаемых сервером. (DOMString)
-
-* **заголовки**: заголовки ответов HTTP-сервером. (Объект)
-
- * В настоящее время поддерживается только для iOS.
-
-### Особенности iOS
-
-* Не поддерживает `responseCode` или`bytesSent`.
-
-## Скачать
-
-**Параметры**:
-
-* **источник**: URL-адрес сервера для загрузки файла, как закодированные`encodeURI()`.
-
-* **Цель**: файловой системы URL-адрес, представляющий файл на устройстве. Для обратной совместимости, это также может быть полный путь к файлу на устройстве. (См. [обратной совместимости отмечает] ниже)
-
-* **successCallback**: обратного вызова, передаваемого `FileEntry` объект. *(Функция)*
-
-* **errorCallback**: обратного вызова, который выполняется, если возникает ошибка при получении `Metadata` . Вызываемый с `FileTransferError` объект. *(Функция)*
-
-* **trustAllHosts**: необязательный параметр, по умолчанию `false` . Если значение `true` , она принимает все сертификаты безопасности. Это полезно, потому что Android отвергает самозаверяющие сертификаты. Не рекомендуется для использования в производстве. Поддерживается на Android и iOS. *(логическое значение)*
-
-* **опции**: необязательные параметры, в настоящее время только поддерживает заголовки (например авторизации (базовая аутентификация) и т.д.).
-
-### Пример
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## прервать
-
-Прерывает передачу в прогресс. Onerror обратного вызова передается объект FileTransferError, который имеет код ошибки FileTransferError.ABORT_ERR.
-
-### Пример
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-A `FileTransferError` при ошибке обратного вызова передается объект, при возникновении ошибки.
-
-### Параметры
-
-* **код**: один из кодов стандартных ошибок, перечисленные ниже. (Число)
-
-* **источник**: URL-адрес источника. (Строка)
-
-* **Цель**: URL-адрес к целевому объекту. (Строка)
-
-* **http_status**: код состояния HTTP. Этот атрибут доступен только при код ответа от HTTP-соединения. (Число)
-
-* **исключение**: либо e.getMessage или e.toString (строка)
-
-### Константы
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## Обратной совместимости отмечает
-
-Предыдущие версии этого плагина будет принимать только устройства Абсолют файлам как источник для закачки, или как целевых для загрузок. Обычно эти пути бы формы
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-Для обратной совместимости, по-прежнему принимаются эти пути, и если ваше приложение зарегистрировано пути как в постоянное хранилище, то они могут продолжать использоваться.
-
-Эти пути ранее были видны в `fullPath` свойства `FileEntry` и `DirectoryEntry` объекты, возвращаемые файл плагина. Новые версии файла плагина, однако, не подвергать эти пути в JavaScript.
-
-Если вы переходите на новый (1.0.0 или новее) версию файла и вы ранее использовали `entry.fullPath` в качестве аргументов `download()` или `upload()` , то вам необходимо будет изменить код для использования файловой системы URL вместо.
-
-`FileEntry.toURL()`и `DirectoryEntry.toURL()` возвращает URL-адрес формы файловой системы
-
- cdvfile://localhost/persistent/path/to/file
-
-
-которые могут быть использованы вместо абсолютного пути в обоих `download()` и `upload()` методы.
diff --git a/plugins/cordova-plugin-file-transfer/doc/zh/README.md b/plugins/cordova-plugin-file-transfer/doc/zh/README.md
deleted file mode 100644
index 5399b04..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/zh/README.md
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-[![Build Status](https://travis-ci.org/apache/cordova-plugin-file-transfer.svg)](https://travis-ci.org/apache/cordova-plugin-file-transfer)
-
-外掛程式檔:
-
-這個外掛程式允許你上傳和下載檔案。
-
-這個外掛程式定義全域 `FileTransfer`,`FileUploadOptions` 的建構函式。
-
-雖然在全球範圍內,他們不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## 支援的平臺
-
- * 亞馬遜火 OS
- * Android 系統
- * 黑莓 10
- * 瀏覽器
- * 火狐瀏覽器的作業系統 * *
- * iOS
- * Windows Phone 7 和 8 *
- * Windows 8
- * Windows
-
-\ **不支援`onprogress`也`abort()` *
-
-\ * **不支援`onprogress` *
-
-# 檔案傳輸
-
-`FileTransfer`物件提供上傳檔使用 HTTP 多部分職位或付諸表決的請求,並將檔以及下載的方式。
-
-## 屬性
-
- * **onprogress**: 使用調用 `ProgressEvent` 每當一塊新的資料傳輸。*(函數)*
-
-## 方法
-
- * **upload**: 將檔發送到伺服器。
-
- * **download**: 從伺服器上下載檔案。
-
- * **abort**: 中止正在進行轉讓。
-
-## upload
-
-**參數**:
-
- * **fileURL**: 表示檔在設備上的檔案系統 URL。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面)
-
- * **server**: 伺服器以接收該檔,由編碼的 URL`encodeURI()`.
-
- * **successCallback**: 一個通過一個 `FileUploadResult` 物件的回檔。*(函數)*
-
- * **errorCallback**: 如果發生錯誤,檢索 `FileUploadResult` 執行一個回檔。使用 `FileTransferError` 物件調用。*(函數)*
-
- * **options**: 可選參數*(物件)*。有效的金鑰:
-
- * **fileKey**: 表單元素的名稱。預設值為 `file` 。() DOMString
- * **fileName**: 要保存在伺服器上的檔時使用的檔案名稱。預設值為 `image.jpg` 。() DOMString
- * **httpMethod**: HTTP 方法使用-`PUT` 或 `POST`。預設值為 `POST`。() DOMString
- * **mimeType**: 要上載的資料的 mime 類型。預設設置為 `image/jpeg`。() DOMString
- * **params**: 一組要在 HTTP 要求中傳遞的可選的鍵值對。(物件)
- * **chunkedMode**: 是否要分塊的流式處理模式中的資料上載。預設值為 `true`。(布林值)
- * **headers**: 地圖的標頭名稱/標頭值。 使用陣列來指定多個值。 IOS、 FireOS,和安卓系統,如果已命名的內容類型標頭存在,多部分表單資料不被使用。 (Object)
- * **httpMethod**: HTTP 方法,例如使用張貼或放。 預設為`開機自檢`。() DOMString
-
- * **trustAllHosts**: 可選參數,預設值為 `false` 。 如果設置為 `true` ,它可以接受的所有安全證書。 這是有用的因為 android 系統拒絕自簽名的安全證書。 不建議供生產使用。 在 Android 和 iOS 上受支援。 *(布林值)*
-
-### 示例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### 與上傳的標頭和進度事件 (Android 和 iOS 只) 的示例
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-`FileUploadResult` 物件將傳遞給該 `檔案傳輸` 物件的 `upload()` 方法的成功回檔。
-
-### 屬性
-
- * **bytesSent**: 作為上載的一部分發送到伺服器的位元組數。(長)
-
- * **responseCode**: 由伺服器返回的 HTTP 回應代碼。(長)
-
- * **response**: 由伺服器返回的 HTTP 回應。() DOMString
-
- * **headers**: 由伺服器的 HTTP 回應標頭。(物件)
-
- * 目前支援的 iOS 只。
-
-### iOS 的怪癖
-
- * 不支援 `responseCode` 或`bytesSent`.
-
-## download
-
-**參數**:
-
- * **source**: 要下載的檔,如由編碼的伺服器的 URL`encodeURI()`.
-
- * **target**: 表示檔在設備上的檔案系統 url。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面)
-
- * **successCallback**: 傳遞一個回檔 `FileEntry` 物件。*(函數)*
-
- * **errorCallback**: 如果檢索 `FileEntry` 時發生錯誤,則執行一個回檔。使用 `FileTransferError` 物件調用。*(函數)*
-
- * **trustAllHosts**: 可選參數,預設值為 `false` 。 如果設置為 `true` ,它可以接受的所有安全證書。 這是有用的因為 Android 拒絕自行簽署式安全證書。 不建議供生產使用。 在 Android 和 iOS 上受支援。 *(布林值)*
-
- * **options**: 可選參數,目前只支援標題 (如授權 (基本驗證) 等)。
-
-### 示例
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-### WP8 的怪癖
-
- * 下載請求由本機實現被緩存。若要避免緩存,傳遞`如果修改自`郵件頭以下載方法。
-
-## abort
-
-中止正在進行轉讓。Onerror 回檔傳遞一個 FileTransferError 物件具有 FileTransferError.ABORT_ERR 錯誤代碼。
-
-### 示例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-當發生錯誤時,`FileTransferError` 物件將傳遞給錯誤回檔。
-
-### 屬性
-
- * **code**: 下面列出的預定義的錯誤代碼之一。(人數)
-
- * **source**: 源的 URL。(字串)
-
- * **target**: 到目標 URL。(字串)
-
- * **HTTP_status**: HTTP 狀態碼。從 HTTP 連接收到一個回應代碼時,此屬性才可用。(人數)
-
- * **body**回應正文。此屬性只能是可用的當該 HTTP 連接收到答覆。(字串)
-
- * **exception**: 要麼 e.getMessage 或 e.toString (字串)
-
-### 常量
-
- * 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
- * 2 = `FileTransferError.INVALID_URL_ERR`
- * 3 = `FileTransferError.CONNECTION_ERR`
- * 4 = `FileTransferError.ABORT_ERR`
- * 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## 向後相容性注意到
-
-以前版本的這個外掛程式才會接受設備-絕對檔路徑作為源對於上載,或用於下載的目標。這些路徑通常會在表單
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-為向後相容性,這些路徑仍會被接受,和如果您的應用程式已錄得像這些在持久性存儲的路徑,然後他們可以繼續使用。
-
-這些路徑被以前暴露在 `FileEntry` 和由檔外掛程式返回的 `DirectoryEntry` 物件的 `fullPath` 屬性中。 新版本的檔的外掛程式,但是,不再公開這些 JavaScript 的路徑。
-
-如果您要升級到新 (1.0.0 或更高版本) 版本的檔,和你以前一直在使用 `entry.fullPath` 作為參數到 `download()` 或 `upload()`,那麼你將需要更改代碼以使用檔案系統的 Url 來代替。
-
-`FileEntry.toURL()` 和 `DirectoryEntry.toURL()` 返回的表單檔案 URL
-
- cdvfile://localhost/persistent/path/to/file
-
-
-它可以用在 `download()` 和 `upload()` 兩種方法中的絕對檔路徑位置。
\ No newline at end of file
diff --git a/plugins/cordova-plugin-file-transfer/doc/zh/index.md b/plugins/cordova-plugin-file-transfer/doc/zh/index.md
deleted file mode 100644
index b3af1eb..0000000
--- a/plugins/cordova-plugin-file-transfer/doc/zh/index.md
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-# cordova-plugin-file-transfer
-
-這個外掛程式允許你上傳和下載檔案。
-
-這個外掛程式定義全域 `FileTransfer`,`FileUploadOptions` 的建構函式。
-
-雖然在全球範圍內,他們不可用直到 `deviceready` 事件之後。
-
- document.addEventListener("deviceready", onDeviceReady, false);
- function onDeviceReady() {
- console.log(FileTransfer);
- }
-
-
-## 安裝
-
- cordova plugin add cordova-plugin-file-transfer
-
-
-## 支援的平臺
-
-* 亞馬遜火 OS
-* Android 系統
-* 黑莓 10
-* 瀏覽器
-* 火狐瀏覽器的作業系統 * *
-* iOS
-* Windows Phone 7 和 8 *
-* Windows 8
-* Windows
-
-* *不支援 `onprogress` 也 `abort()`*
-
-* * *不支援 `onprogress`*
-
-# FileTransfer
-
-`FileTransfer` 物件提供一種使用 HTTP 多部分 POST 請求的檔上傳,下載檔案以及方式。
-
-## 屬性
-
-* **onprogress**: 使用調用 `ProgressEvent` 每當一塊新的資料傳輸。*(函數)*
-
-## 方法
-
-* **upload**: 將檔發送到伺服器。
-
-* **download**: 從伺服器上下載檔案。
-
-* **abort**: 中止正在進行轉讓。
-
-## upload
-
-**參數**:
-
-* **fileURL**: 表示檔在設備上的檔案系統 URL。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面)
-
-* **server**: 伺服器以接收該檔,由編碼的 URL`encodeURI()`.
-
-* **successCallback**: 一個通過一個 `FileUploadResult` 物件的回檔。*(函數)*
-
-* **errorCallback**: 如果發生錯誤,檢索 `FileUploadResult` 執行一個回檔。使用 `FileTransferError` 物件調用。*(函數)*
-
-* **options**: 可選參數*(物件)*。有效的金鑰:
-
- * **fileKey**: 表單元素的名稱。預設值為 `file` 。() DOMString
- * **fileName**: 要保存在伺服器上的檔時使用的檔案名稱。預設值為 `image.jpg` 。() DOMString
- * **httpMethod**: HTTP 方法使用-`PUT` 或 `POST`。預設值為 `POST`。() DOMString
- * **mimeType**: 要上載的資料的 mime 類型。預設設置為 `image/jpeg`。() DOMString
- * **params**: 一組要在 HTTP 要求中傳遞的可選的鍵值對。(物件)
- * **chunkedMode**: 是否要分塊的流式處理模式中的資料上載。預設值為 `true`。(布林值)
- * **headers**: 地圖的標頭名稱/標頭值。使用陣列來指定多個值。(物件)
-
-* **trustAllHosts**: 可選參數,預設值為 `false` 。 如果設置為 `true` ,它接受的所有安全證書。 這是有用的因為 android 系統拒絕自簽名的安全證書。 不建議供生產使用。 支援 Android 和 iOS。 *(布林值)*
-
-### 示例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function (r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- var fail = function (error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey = "file";
- options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
- options.mimeType = "text/plain";
-
- var params = {};
- params.value1 = "test";
- params.value2 = "param";
-
- options.params = params;
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-
-### 與上傳的標頭和進度事件 (Android 和 iOS 只) 的示例
-
- function win(r) {
- console.log("Code = " + r.responseCode);
- console.log("Response = " + r.response);
- console.log("Sent = " + r.bytesSent);
- }
-
- function fail(error) {
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var uri = encodeURI("http://some.server.com/upload.php");
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
- options.mimeType="text/plain";
-
- var headers={'headerParam':'headerValue'};
-
- options.headers = headers;
-
- var ft = new FileTransfer();
- ft.onprogress = function(progressEvent) {
- if (progressEvent.lengthComputable) {
- loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
- } else {
- loadingStatus.increment();
- }
- };
- ft.upload(fileURL, uri, win, fail, options);
-
-
-## FileUploadResult
-
-`FileUploadResult` 物件將傳遞給該 `檔案傳輸` 物件的 `upload()` 方法的成功回檔。
-
-### 屬性
-
-* **bytesSent**: 作為上載的一部分發送到伺服器的位元組數。(長)
-
-* **responseCode**: 由伺服器返回的 HTTP 回應代碼。(長)
-
-* **response**: 由伺服器返回的 HTTP 回應。() DOMString
-
-* **headers**: 由伺服器的 HTTP 回應標頭。(物件)
-
- * 目前支援的 iOS 只。
-
-### iOS 的怪癖
-
-* 不支援 `responseCode` 或`bytesSent`.
-
-## download
-
-**參數**:
-
-* **source**: 要下載的檔,如由編碼的伺服器的 URL`encodeURI()`.
-
-* **target**: 表示檔在設備上的檔案系統 url。 為向後相容性,這也可以將設備上的檔的完整路徑。 (請參見 [向後相容性注意到] 下面)
-
-* **successCallback**: 傳遞一個回檔 `FileEntry` 物件。*(函數)*
-
-* **errorCallback**: 如果檢索 `FileEntry` 時發生錯誤,則執行一個回檔。使用 `FileTransferError` 物件調用。*(函數)*
-
-* **trustAllHosts**: 可選參數,預設值為 `false` 。 如果設置為 `true` ,它可以接受的所有安全證書。 這是有用的因為 Android 拒絕自行簽署式安全證書。 不建議供生產使用。 在 Android 和 iOS 上受支援。 *(布林值)*
-
-* **options**: 可選參數,目前只支援標題 (如授權 (基本驗證) 等)。
-
-### 示例
-
- // !! Assumes variable fileURL contains a valid URL to a path on the device,
- // for example, cdvfile://localhost/persistent/path/to/downloads/
-
- var fileTransfer = new FileTransfer();
- var uri = encodeURI("http://some.server.com/download.php");
-
- fileTransfer.download(
- uri,
- fileURL,
- function(entry) {
- console.log("download complete: " + entry.toURL());
- },
- function(error) {
- console.log("download error source " + error.source);
- console.log("download error target " + error.target);
- console.log("upload error code" + error.code);
- },
- false,
- {
- headers: {
- "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
- }
- }
- );
-
-
-## abort
-
-中止正在進行轉讓。Onerror 回檔傳遞一個 FileTransferError 物件具有 FileTransferError.ABORT_ERR 錯誤代碼。
-
-### 示例
-
- // !! Assumes variable fileURL contains a valid URL to a text file on the device,
- // for example, cdvfile://localhost/persistent/path/to/file.txt
-
- var win = function(r) {
- console.log("Should not be called.");
- }
-
- var fail = function(error) {
- // error.code == FileTransferError.ABORT_ERR
- alert("An error has occurred: Code = " + error.code);
- console.log("upload error source " + error.source);
- console.log("upload error target " + error.target);
- }
-
- var options = new FileUploadOptions();
- options.fileKey="file";
- options.fileName="myphoto.jpg";
- options.mimeType="image/jpeg";
-
- var ft = new FileTransfer();
- ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
- ft.abort();
-
-
-## FileTransferError
-
-當發生錯誤時,`FileTransferError` 物件將傳遞給錯誤回檔。
-
-### 屬性
-
-* **code**: 下面列出的預定義的錯誤代碼之一。(人數)
-
-* **source**: 源的 URL。(字串)
-
-* **target**: 到目標 URL。(字串)
-
-* **HTTP_status**: HTTP 狀態碼。從 HTTP 連接收到一個回應代碼時,此屬性才可用。(人數)
-
-* **body**回應正文。此屬性只能是可用的當該 HTTP 連接收到答覆。(字串)
-
-* **exception**: 要麼 e.getMessage 或 e.toString (字串)
-
-### 常量
-
-* 1 = `FileTransferError.FILE_NOT_FOUND_ERR`
-* 2 = `FileTransferError.INVALID_URL_ERR`
-* 3 = `FileTransferError.CONNECTION_ERR`
-* 4 = `FileTransferError.ABORT_ERR`
-* 5 = `FileTransferError.NOT_MODIFIED_ERR`
-
-## 向後相容性注意到
-
-以前版本的這個外掛程式才會接受設備-絕對檔路徑作為源對於上載,或用於下載的目標。這些路徑通常會在表單
-
- /var/mobile/Applications//Documents/path/to/file (iOS)
- /storage/emulated/0/path/to/file (Android)
-
-
-為向後相容性,這些路徑仍會被接受,和如果您的應用程式已錄得像這些在持久性存儲的路徑,然後他們可以繼續使用。
-
-這些路徑被以前暴露在 `FileEntry` 和由檔外掛程式返回的 `DirectoryEntry` 物件的 `fullPath` 屬性中。 新版本的檔的外掛程式,但是,不再公開這些 JavaScript 的路徑。
-
-如果您要升級到新 (1.0.0 或更高版本) 版本的檔,和你以前一直在使用 `entry.fullPath` 作為參數到 `download()` 或 `upload()`,那麼你將需要更改代碼以使用檔案系統的 Url 來代替。
-
-`FileEntry.toURL()` 和 `DirectoryEntry.toURL()` 返回的表單檔案 URL
-
- cdvfile://localhost/persistent/path/to/file
-
-
-它可以用在 `download()` 和 `upload()` 兩種方法中的絕對檔路徑位置。
diff --git a/plugins/cordova-plugin-file-transfer/package.json b/plugins/cordova-plugin-file-transfer/package.json
deleted file mode 100644
index 82000be..0000000
--- a/plugins/cordova-plugin-file-transfer/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "cordova-plugin-file-transfer",
- "version": "1.5.1",
- "description": "Cordova File Transfer Plugin",
- "cordova": {
- "id": "cordova-plugin-file-transfer",
- "platforms": [
- "android",
- "amazon-fireos",
- "ubuntu",
- "blackberry10",
- "ios",
- "wp7",
- "wp8",
- "windows8",
- "windows",
- "firefoxos",
- "browser"
- ]
- },
- "scripts": {
- "test": "npm run lint && npm run style",
- "lint": "jshint www && jshint src && jshint tests",
- "style": "jscs tests/tests.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-plugin-file-transfer"
- },
- "keywords": [
- "cordova",
- "file",
- "transfer",
- "ecosystem:cordova",
- "cordova-android",
- "cordova-amazon-fireos",
- "cordova-ubuntu",
- "cordova-blackberry10",
- "cordova-ios",
- "cordova-wp7",
- "cordova-wp8",
- "cordova-windows8",
- "cordova-windows",
- "cordova-firefoxos",
- "cordova-browser"
- ],
- "peerDependencies": {
- "cordova-plugin-file": "^3.0.0"
- },
- "author": "Apache Software Foundation",
- "license": "Apache-2.0",
- "devDependencies": {
- "jscs": "^2.6.0",
- "jshint": "^2.8.0"
- }
-}
diff --git a/plugins/cordova-plugin-file-transfer/plugin.xml b/plugins/cordova-plugin-file-transfer/plugin.xml
deleted file mode 100644
index a855288..0000000
--- a/plugins/cordova-plugin-file-transfer/plugin.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
- File Transfer
- Cordova File Transfer Plugin
- Apache 2.0
- cordova,file,transfer
- https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git
- https://issues.apache.org/jira/browse/CB/component/12320650
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/cordova-plugin-file-transfer/src/amazon/FileTransfer.java b/plugins/cordova-plugin-file-transfer/src/amazon/FileTransfer.java
deleted file mode 100644
index 1563a39..0000000
--- a/plugins/cordova-plugin-file-transfer/src/amazon/FileTransfer.java
+++ /dev/null
@@ -1,898 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.Inflater;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.cordova.Config;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
-import org.apache.cordova.PluginResult;
-import org.apache.cordova.file.FileUtils;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.net.Uri;
-import android.os.Build;
-import android.util.Log;
-import com.amazon.android.webkit.AmazonCookieManager;
-
-public class FileTransfer extends CordovaPlugin {
-
- private static final String LOG_TAG = "FileTransfer";
- private static final String LINE_START = "--";
- private static final String LINE_END = "\r\n";
- private static final String BOUNDARY = "+++++";
-
- public static int FILE_NOT_FOUND_ERR = 1;
- public static int INVALID_URL_ERR = 2;
- public static int CONNECTION_ERR = 3;
- public static int ABORTED_ERR = 4;
-
- private static HashMap activeRequests = new HashMap();
- private static final int MAX_BUFFER_SIZE = 16 * 1024;
-
- private static final class RequestContext {
- String source;
- String target;
- File targetFile;
- CallbackContext callbackContext;
- InputStream currentInputStream;
- OutputStream currentOutputStream;
- boolean aborted;
- RequestContext(String source, String target, CallbackContext callbackContext) {
- this.source = source;
- this.target = target;
- this.callbackContext = callbackContext;
- }
- void sendPluginResult(PluginResult pluginResult) {
- synchronized (this) {
- if (!aborted) {
- callbackContext.sendPluginResult(pluginResult);
- }
- }
- }
- }
-
- /**
- * Adds an interface method to an InputStream to return the number of bytes
- * read from the raw stream. This is used to track total progress against
- * the HTTP Content-Length header value from the server.
- */
- private static abstract class TrackingInputStream extends FilterInputStream {
- public TrackingInputStream(final InputStream in) {
- super(in);
- }
- public abstract long getTotalRawBytesRead();
- }
-
- private static class ExposedGZIPInputStream extends GZIPInputStream {
- public ExposedGZIPInputStream(final InputStream in) throws IOException {
- super(in);
- }
- public Inflater getInflater() {
- return inf;
- }
- }
-
- /**
- * Provides raw bytes-read tracking for a GZIP input stream. Reports the
- * total number of compressed bytes read from the input, rather than the
- * number of uncompressed bytes.
- */
- private static class TrackingGZIPInputStream extends TrackingInputStream {
- private ExposedGZIPInputStream gzin;
- public TrackingGZIPInputStream(final ExposedGZIPInputStream gzin) throws IOException {
- super(gzin);
- this.gzin = gzin;
- }
- public long getTotalRawBytesRead() {
- return gzin.getInflater().getBytesRead();
- }
- }
-
- /**
- * Provides simple total-bytes-read tracking for an existing InputStream
- */
- private static class SimpleTrackingInputStream extends TrackingInputStream {
- private long bytesRead = 0;
- public SimpleTrackingInputStream(InputStream stream) {
- super(stream);
- }
-
- private int updateBytesRead(int newBytesRead) {
- if (newBytesRead != -1) {
- bytesRead += newBytesRead;
- }
- return newBytesRead;
- }
-
- @Override
- public int read() throws IOException {
- return updateBytesRead(super.read());
- }
-
- // Note: FilterInputStream delegates read(byte[] bytes) to the below method,
- // so we don't override it or else double count (CB-5631).
- @Override
- public int read(byte[] bytes, int offset, int count) throws IOException {
- return updateBytesRead(super.read(bytes, offset, count));
- }
-
- public long getTotalRawBytesRead() {
- return bytesRead;
- }
- }
-
- @Override
- public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
- if (action.equals("upload") || action.equals("download")) {
- String source = args.getString(0);
- String target = args.getString(1);
-
- if (action.equals("upload")) {
- try {
- source = URLDecoder.decode(source, "UTF-8");
- upload(source, target, args, callbackContext);
- } catch (UnsupportedEncodingException e) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "UTF-8 error."));
- }
- } else {
- download(source, target, args, callbackContext);
- }
- return true;
- } else if (action.equals("abort")) {
- String objectId = args.getString(0);
- abort(objectId);
- callbackContext.success();
- return true;
- }
- return false;
- }
-
- private static void addHeadersToRequest(URLConnection connection, JSONObject headers) {
- try {
- for (Iterator> iter = headers.keys(); iter.hasNext(); ) {
- String headerKey = iter.next().toString();
- JSONArray headerValues = headers.optJSONArray(headerKey);
- if (headerValues == null) {
- headerValues = new JSONArray();
- headerValues.put(headers.getString(headerKey));
- }
- connection.setRequestProperty(headerKey, headerValues.getString(0));
- for (int i = 1; i < headerValues.length(); ++i) {
- connection.addRequestProperty(headerKey, headerValues.getString(i));
- }
- }
- } catch (JSONException e1) {
- // No headers to be manipulated!
- }
- }
-
- /**
- * Uploads the specified file to the server URL provided using an HTTP multipart request.
- * @param source Full path of the file on the file system
- * @param target URL of the server to receive the file
- * @param args JSON Array of args
- * @param callbackContext callback id for optional progress reports
- *
- * args[2] fileKey Name of file request parameter
- * args[3] fileName File name to be used on server
- * args[4] mimeType Describes file content type
- * args[5] params key:value pairs of user-defined parameters
- * @return FileUploadResult containing result of upload request
- */
- private void upload(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
- Log.d(LOG_TAG, "upload " + source + " to " + target);
-
- // Setup the options
- final String fileKey = getArgument(args, 2, "file");
- final String fileName = getArgument(args, 3, "image.jpg");
- final String mimeType = getArgument(args, 4, "image/jpeg");
- final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5);
- final boolean trustEveryone = args.optBoolean(6);
- // Always use chunked mode unless set to false as per API
- final boolean chunkedMode = args.optBoolean(7) || args.isNull(7);
- // Look for headers on the params map for backwards compatibility with older Cordova versions.
- final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers") : args.optJSONObject(8);
- final String objectId = args.getString(9);
- final String httpMethod = getArgument(args, 10, "POST");
-
- final CordovaResourceApi resourceApi = webView.getResourceApi();
-
- Log.d(LOG_TAG, "fileKey: " + fileKey);
- Log.d(LOG_TAG, "fileName: " + fileName);
- Log.d(LOG_TAG, "mimeType: " + mimeType);
- Log.d(LOG_TAG, "params: " + params);
- Log.d(LOG_TAG, "trustEveryone: " + trustEveryone);
- Log.d(LOG_TAG, "chunkedMode: " + chunkedMode);
- Log.d(LOG_TAG, "headers: " + headers);
- Log.d(LOG_TAG, "objectId: " + objectId);
- Log.d(LOG_TAG, "httpMethod: " + httpMethod);
-
- final Uri targetUri = resourceApi.remapUri(Uri.parse(target));
- // Accept a path or a URI for the source.
- Uri tmpSrc = Uri.parse(source);
- final Uri sourceUri = resourceApi.remapUri(
- tmpSrc.getScheme() != null ? tmpSrc : Uri.fromFile(new File(source)));
-
- int uriType = CordovaResourceApi.getUriType(targetUri);
- final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
- if (uriType != CordovaResourceApi.URI_TYPE_HTTP && !useHttps) {
- JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0);
- Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- return;
- }
-
- final RequestContext context = new RequestContext(source, target, callbackContext);
- synchronized (activeRequests) {
- activeRequests.put(objectId, context);
- }
-
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- if (context.aborted) {
- return;
- }
- HttpURLConnection conn = null;
- HostnameVerifier oldHostnameVerifier = null;
- SSLSocketFactory oldSocketFactory = null;
- int totalBytes = 0;
- int fixedLength = -1;
- try {
- // Create return object
- FileUploadResult result = new FileUploadResult();
- FileProgressResult progress = new FileProgressResult();
-
- //------------------ CLIENT REQUEST
- // Open a HTTP connection to the URL based on protocol
- conn = resourceApi.createHttpConnection(targetUri);
- if (useHttps && trustEveryone) {
- // Setup the HTTPS connection class to trust everyone
- HttpsURLConnection https = (HttpsURLConnection)conn;
- oldSocketFactory = trustAllHosts(https);
- // Save the current hostnameVerifier
- oldHostnameVerifier = https.getHostnameVerifier();
- // Setup the connection not to verify hostnames
- https.setHostnameVerifier(DO_NOT_VERIFY);
- }
-
- // Allow Inputs
- conn.setDoInput(true);
-
- // Allow Outputs
- conn.setDoOutput(true);
-
- // Don't use a cached copy.
- conn.setUseCaches(false);
-
- // Use a post method.
- conn.setRequestMethod(httpMethod);
-
- // if we specified a Content-Type header, don't do multipart form upload
- boolean multipartFormUpload = (headers == null) || !headers.has("Content-Type");
- if (multipartFormUpload) {
- conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
- }
- // Set the cookies on the response
- String cookie = AmazonCookieManager.getInstance().getCookie(target);
- if (cookie != null) {
- conn.setRequestProperty("Cookie", cookie);
- }
-
- // Handle the other headers
- if (headers != null) {
- addHeadersToRequest(conn, headers);
- }
-
- /*
- * Store the non-file portions of the multipart data as a string, so that we can add it
- * to the contentSize, since it is part of the body of the HTTP request.
- */
- StringBuilder beforeData = new StringBuilder();
- try {
- for (Iterator> iter = params.keys(); iter.hasNext();) {
- Object key = iter.next();
- if(!String.valueOf(key).equals("headers"))
- {
- beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
- beforeData.append("Content-Disposition: form-data; name=\"").append(key.toString()).append('"');
- beforeData.append(LINE_END).append(LINE_END);
- beforeData.append(params.getString(key.toString()));
- beforeData.append(LINE_END);
- }
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
-
- beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
- beforeData.append("Content-Disposition: form-data; name=\"").append(fileKey).append("\";");
- beforeData.append(" filename=\"").append(fileName).append('"').append(LINE_END);
- beforeData.append("Content-Type: ").append(mimeType).append(LINE_END).append(LINE_END);
- byte[] beforeDataBytes = beforeData.toString().getBytes("UTF-8");
- byte[] tailParamsBytes = (LINE_END + LINE_START + BOUNDARY + LINE_START + LINE_END).getBytes("UTF-8");
-
-
- // Get a input stream of the file on the phone
- OpenForReadResult readResult = resourceApi.openForRead(sourceUri);
-
- int stringLength = beforeDataBytes.length + tailParamsBytes.length;
- if (readResult.length >= 0) {
- fixedLength = (int)readResult.length;
- if (multipartFormUpload)
- fixedLength += stringLength;
- progress.setLengthComputable(true);
- progress.setTotal(fixedLength);
- }
- Log.d(LOG_TAG, "Content Length: " + fixedLength);
- // setFixedLengthStreamingMode causes and OutOfMemoryException on pre-Froyo devices.
- // http://code.google.com/p/android/issues/detail?id=3164
- // It also causes OOM if HTTPS is used, even on newer devices.
- boolean useChunkedMode = chunkedMode && (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps);
- useChunkedMode = useChunkedMode || (fixedLength == -1);
-
- if (useChunkedMode) {
- conn.setChunkedStreamingMode(MAX_BUFFER_SIZE);
- // Although setChunkedStreamingMode sets this header, setting it explicitly here works
- // around an OutOfMemoryException when using https.
- conn.setRequestProperty("Transfer-Encoding", "chunked");
- } else {
- conn.setFixedLengthStreamingMode(fixedLength);
- }
-
- conn.connect();
-
- OutputStream sendStream = null;
- try {
- sendStream = conn.getOutputStream();
- synchronized (context) {
- if (context.aborted) {
- return;
- }
- context.currentOutputStream = sendStream;
- }
-
- if (multipartFormUpload) {
- //We don't want to change encoding, we just want this to write for all Unicode.
- sendStream.write(beforeDataBytes);
- totalBytes += beforeDataBytes.length;
- }
- // create a buffer of maximum size
- int bytesAvailable = readResult.inputStream.available();
- int bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
- byte[] buffer = new byte[bufferSize];
-
- // read file and write it into form...
- int bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-
- long prevBytesRead = 0;
- while (bytesRead > 0) {
- result.setBytesSent(totalBytes);
- sendStream.write(buffer, 0, bytesRead);
- totalBytes += bytesRead;
- if (totalBytes > prevBytesRead + 102400) {
- prevBytesRead = totalBytes;
- Log.d(LOG_TAG, "Uploaded " + totalBytes + " of " + fixedLength + " bytes");
- }
- bytesAvailable = readResult.inputStream.available();
- bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
- bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-
- // Send a progress event.
- progress.setLoaded(totalBytes);
- PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
- progressResult.setKeepCallback(true);
- context.sendPluginResult(progressResult);
- }
-
- if (multipartFormUpload) {
- // send multipart form data necessary after file data...
- sendStream.write(tailParamsBytes);
- totalBytes += tailParamsBytes.length;
- }
- sendStream.flush();
- } finally {
- safeClose(readResult.inputStream);
- safeClose(sendStream);
- }
- context.currentOutputStream = null;
- Log.d(LOG_TAG, "Sent " + totalBytes + " of " + fixedLength);
-
- //------------------ read the SERVER RESPONSE
- String responseString;
- int responseCode = conn.getResponseCode();
- Log.d(LOG_TAG, "response code: " + responseCode);
- Log.d(LOG_TAG, "response headers: " + conn.getHeaderFields());
- TrackingInputStream inStream = null;
- try {
- inStream = getInputStream(conn);
- synchronized (context) {
- if (context.aborted) {
- return;
- }
- context.currentInputStream = inStream;
- }
-
- ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(1024, conn.getContentLength()));
- byte[] buffer = new byte[1024];
- int bytesRead = 0;
- // write bytes to file
- while ((bytesRead = inStream.read(buffer)) > 0) {
- out.write(buffer, 0, bytesRead);
- }
- responseString = out.toString("UTF-8");
- } finally {
- context.currentInputStream = null;
- safeClose(inStream);
- }
-
- Log.d(LOG_TAG, "got response from server");
- Log.d(LOG_TAG, responseString.substring(0, Math.min(256, responseString.length())));
-
- // send request and retrieve response
- result.setResponseCode(responseCode);
- result.setResponse(responseString);
-
- context.sendPluginResult(new PluginResult(PluginResult.Status.OK, result.toJSONObject()));
- } catch (FileNotFoundException e) {
- JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, conn);
- Log.e(LOG_TAG, error.toString(), e);
- context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- } catch (IOException e) {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
- Log.e(LOG_TAG, error.toString(), e);
- Log.e(LOG_TAG, "Failed after uploading " + totalBytes + " of " + fixedLength + " bytes.");
- context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- context.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- } catch (Throwable t) {
- // Shouldn't happen, but will
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
- Log.e(LOG_TAG, error.toString(), t);
- context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- } finally {
- synchronized (activeRequests) {
- activeRequests.remove(objectId);
- }
-
- if (conn != null) {
- // Revert back to the proper verifier and socket factories
- // Revert back to the proper verifier and socket factories
- if (trustEveryone && useHttps) {
- HttpsURLConnection https = (HttpsURLConnection) conn;
- https.setHostnameVerifier(oldHostnameVerifier);
- https.setSSLSocketFactory(oldSocketFactory);
- }
- }
- }
- }
- });
- }
-
- private static void safeClose(Closeable stream) {
- if (stream != null) {
- try {
- stream.close();
- } catch (IOException e) {
- }
- }
- }
-
- private static TrackingInputStream getInputStream(URLConnection conn) throws IOException {
- String encoding = conn.getContentEncoding();
- if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
- return new TrackingGZIPInputStream(new ExposedGZIPInputStream(conn.getInputStream()));
- }
- return new SimpleTrackingInputStream(conn.getInputStream());
- }
-
- // always verify the host - don't check for certificate
- private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {
- public boolean verify(String hostname, SSLSession session) {
- return true;
- }
- };
- // Create a trust manager that does not validate certificate chains
- private static final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
- public java.security.cert.X509Certificate[] getAcceptedIssuers() {
- return new java.security.cert.X509Certificate[] {};
- }
-
- public void checkClientTrusted(X509Certificate[] chain,
- String authType) throws CertificateException {
- }
-
- public void checkServerTrusted(X509Certificate[] chain,
- String authType) throws CertificateException {
- }
- } };
-
- /**
- * This function will install a trust manager that will blindly trust all SSL
- * certificates. The reason this code is being added is to enable developers
- * to do development using self signed SSL certificates on their web server.
- *
- * The standard HttpsURLConnection class will throw an exception on self
- * signed certificates if this code is not run.
- */
- private static SSLSocketFactory trustAllHosts(HttpsURLConnection connection) {
- // Install the all-trusting trust manager
- SSLSocketFactory oldFactory = connection.getSSLSocketFactory();
- try {
- // Install our all trusting manager
- SSLContext sc = SSLContext.getInstance("TLS");
- sc.init(null, trustAllCerts, new java.security.SecureRandom());
- SSLSocketFactory newFactory = sc.getSocketFactory();
- connection.setSSLSocketFactory(newFactory);
- } catch (Exception e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return oldFactory;
- }
-
- private static JSONObject createFileTransferError(int errorCode, String source, String target, URLConnection connection) {
-
- int httpStatus = 0;
- StringBuilder bodyBuilder = new StringBuilder();
- String body = null;
- if (connection != null) {
- try {
- if (connection instanceof HttpURLConnection) {
- httpStatus = ((HttpURLConnection)connection).getResponseCode();
- InputStream err = ((HttpURLConnection) connection).getErrorStream();
- if(err != null)
- {
- BufferedReader reader = new BufferedReader(new InputStreamReader(err, "UTF-8"));
- try {
- String line = reader.readLine();
- while(line != null) {
- bodyBuilder.append(line);
- line = reader.readLine();
- if(line != null) {
- bodyBuilder.append('\n');
- }
- }
- body = bodyBuilder.toString();
- } finally {
- reader.close();
- }
- }
- }
- // IOException can leave connection object in a bad state, so catch all exceptions.
- } catch (Throwable e) {
- Log.w(LOG_TAG, "Error getting HTTP status code from connection.", e);
- }
- }
-
- return createFileTransferError(errorCode, source, target, body, httpStatus);
- }
-
- /**
- * Create an error object based on the passed in errorCode
- * @param errorCode the error
- * @return JSONObject containing the error
- */
- private static JSONObject createFileTransferError(int errorCode, String source, String target, String body, Integer httpStatus) {
- JSONObject error = null;
- try {
- error = new JSONObject();
- error.put("code", errorCode);
- error.put("source", source);
- error.put("target", target);
- if(body != null)
- {
- error.put("body", body);
- }
- if (httpStatus != null) {
- error.put("http_status", httpStatus);
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return error;
- }
-
- /**
- * Convenience method to read a parameter from the list of JSON args.
- * @param args the args passed to the Plugin
- * @param position the position to retrieve the arg from
- * @param defaultString the default to be used if the arg does not exist
- * @return String with the retrieved value
- */
- private static String getArgument(JSONArray args, int position, String defaultString) {
- String arg = defaultString;
- if (args.length() > position) {
- arg = args.optString(position);
- if (arg == null || "null".equals(arg)) {
- arg = defaultString;
- }
- }
- return arg;
- }
-
- /**
- * Downloads a file form a given URL and saves it to the specified directory.
- *
- * @param source URL of the server to receive the file
- * @param target Full path of the file on the file system
- */
- private void download(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
- Log.d(LOG_TAG, "download " + source + " to " + target);
-
- final CordovaResourceApi resourceApi = webView.getResourceApi();
-
- final boolean trustEveryone = args.optBoolean(2);
- final String objectId = args.getString(3);
- final JSONObject headers = args.optJSONObject(4);
-
- final Uri sourceUri = resourceApi.remapUri(Uri.parse(source));
- // Accept a path or a URI for the source.
- Uri tmpTarget = Uri.parse(target);
- final Uri targetUri = resourceApi.remapUri(
- tmpTarget.getScheme() != null ? tmpTarget : Uri.fromFile(new File(target)));
-
- int uriType = CordovaResourceApi.getUriType(sourceUri);
- final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
- final boolean isLocalTransfer = !useHttps && uriType != CordovaResourceApi.URI_TYPE_HTTP;
- if (uriType == CordovaResourceApi.URI_TYPE_UNKNOWN) {
- JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0);
- Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- return;
- }
-
- // TODO: refactor to also allow resources & content:
- if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
- Log.w(LOG_TAG, "Source URL is not in white list: '" + source + "'");
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, null, 401);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- return;
- }
-
-
- final RequestContext context = new RequestContext(source, target, callbackContext);
- synchronized (activeRequests) {
- activeRequests.put(objectId, context);
- }
-
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- if (context.aborted) {
- return;
- }
- HttpURLConnection connection = null;
- HostnameVerifier oldHostnameVerifier = null;
- SSLSocketFactory oldSocketFactory = null;
- File file = null;
- PluginResult result = null;
- TrackingInputStream inputStream = null;
-
- OutputStream outputStream = null;
- try {
- OpenForReadResult readResult = null;
- outputStream = resourceApi.openOutputStream(targetUri);
-
- file = resourceApi.mapUriToFile(targetUri);
- context.targetFile = file;
-
- Log.d(LOG_TAG, "Download file:" + sourceUri);
-
- FileProgressResult progress = new FileProgressResult();
-
- if (isLocalTransfer) {
- readResult = resourceApi.openForRead(sourceUri);
- if (readResult.length != -1) {
- progress.setLengthComputable(true);
- progress.setTotal(readResult.length);
- }
- inputStream = new SimpleTrackingInputStream(readResult.inputStream);
- } else {
- // connect to server
- // Open a HTTP connection to the URL based on protocol
- connection = resourceApi.createHttpConnection(sourceUri);
- if (useHttps && trustEveryone) {
- // Setup the HTTPS connection class to trust everyone
- HttpsURLConnection https = (HttpsURLConnection)connection;
- oldSocketFactory = trustAllHosts(https);
- // Save the current hostnameVerifier
- oldHostnameVerifier = https.getHostnameVerifier();
- // Setup the connection not to verify hostnames
- https.setHostnameVerifier(DO_NOT_VERIFY);
- }
-
- connection.setRequestMethod("GET");
-
- // TODO: Make OkHttp use this AmazonCookieManager by default.
- String cookie = AmazonCookieManager.getInstance().getCookie(sourceUri.toString());
- if(cookie != null)
- {
- connection.setRequestProperty("cookie", cookie);
- }
-
- // This must be explicitly set for gzip progress tracking to work.
- connection.setRequestProperty("Accept-Encoding", "gzip");
-
- // Handle the other headers
- if (headers != null) {
- addHeadersToRequest(connection, headers);
- }
-
- connection.connect();
-
- if (connection.getContentEncoding() == null || connection.getContentEncoding().equalsIgnoreCase("gzip")) {
- // Only trust content-length header if we understand
- // the encoding -- identity or gzip
- if (connection.getContentLength() != -1) {
- progress.setLengthComputable(true);
- progress.setTotal(connection.getContentLength());
- }
- }
- inputStream = getInputStream(connection);
- }
-
- try {
- synchronized (context) {
- if (context.aborted) {
- return;
- }
- context.currentInputStream = inputStream;
- }
-
- // write bytes to file
- byte[] buffer = new byte[MAX_BUFFER_SIZE];
- int bytesRead = 0;
- while ((bytesRead = inputStream.read(buffer)) > 0) {
- outputStream.write(buffer, 0, bytesRead);
- // Send a progress event.
- progress.setLoaded(inputStream.getTotalRawBytesRead());
- PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
- progressResult.setKeepCallback(true);
- context.sendPluginResult(progressResult);
- }
- } finally {
- context.currentInputStream = null;
- safeClose(inputStream);
- safeClose(outputStream);
- }
-
- Log.d(LOG_TAG, "Saved file: " + target);
-
- // create FileEntry object
- FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File");
- if (filePlugin != null) {
- JSONObject fileEntry = filePlugin.getEntryForFile(file);
- if (fileEntry != null) {
- result = new PluginResult(PluginResult.Status.OK, fileEntry);
- } else {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
- Log.e(LOG_TAG, "File plugin cannot represent download path");
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- }
- } else {
- Log.e(LOG_TAG, "File plugin not found; cannot save downloaded file");
- result = new PluginResult(PluginResult.Status.ERROR, "File plugin not found; cannot save downloaded file");
- }
-
- } catch (FileNotFoundException e) {
- JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, connection);
- Log.e(LOG_TAG, error.toString(), e);
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- } catch (IOException e) {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
- Log.e(LOG_TAG, error.toString(), e);
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- result = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
- } catch (Throwable e) {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
- Log.e(LOG_TAG, error.toString(), e);
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- } finally {
- safeClose(outputStream);
- synchronized (activeRequests) {
- activeRequests.remove(objectId);
- }
-
- if (connection != null) {
- // Revert back to the proper verifier and socket factories
- if (trustEveryone && useHttps) {
- HttpsURLConnection https = (HttpsURLConnection) connection;
- https.setHostnameVerifier(oldHostnameVerifier);
- https.setSSLSocketFactory(oldSocketFactory);
- }
- }
-
- if (result == null) {
- result = new PluginResult(PluginResult.Status.ERROR, createFileTransferError(CONNECTION_ERR, source, target, connection));
- }
- // Remove incomplete download.
- if (result.getStatus() != PluginResult.Status.OK.ordinal() && file != null) {
- file.delete();
- }
- context.sendPluginResult(result);
- }
- }
- });
- }
-
- /**
- * Abort an ongoing upload or download.
- */
- private void abort(String objectId) {
- final RequestContext context;
- synchronized (activeRequests) {
- context = activeRequests.remove(objectId);
- }
- if (context != null) {
- File file = context.targetFile;
- if (file != null) {
- file.delete();
- }
- // Trigger the abort callback immediately to minimize latency between it and abort() being called.
- JSONObject error = createFileTransferError(ABORTED_ERR, context.source, context.target, null, -1);
- synchronized (context) {
- context.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, error));
- context.aborted = true;
- }
- // Closing the streams can block, so execute on a background thread.
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- synchronized (context) {
- safeClose(context.currentInputStream);
- safeClose(context.currentOutputStream);
- }
- }
- });
- }
- }
-}
diff --git a/plugins/cordova-plugin-file-transfer/src/android/FileProgressResult.java b/plugins/cordova-plugin-file-transfer/src/android/FileProgressResult.java
deleted file mode 100644
index 76a7b13..0000000
--- a/plugins/cordova-plugin-file-transfer/src/android/FileProgressResult.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Encapsulates in-progress status of uploading or downloading a file to a remote server.
- */
-public class FileProgressResult {
-
- private boolean lengthComputable = false; // declares whether total is known
- private long loaded = 0; // bytes sent so far
- private long total = 0; // bytes total, if known
-
- public boolean getLengthComputable() {
- return lengthComputable;
- }
-
- public void setLengthComputable(boolean computable) {
- this.lengthComputable = computable;
- }
-
- public long getLoaded() {
- return loaded;
- }
-
- public void setLoaded(long bytes) {
- this.loaded = bytes;
- }
-
- public long getTotal() {
- return total;
- }
-
- public void setTotal(long bytes) {
- this.total = bytes;
- }
-
- public JSONObject toJSONObject() throws JSONException {
- return new JSONObject(
- "{loaded:" + loaded +
- ",total:" + total +
- ",lengthComputable:" + (lengthComputable ? "true" : "false") + "}");
- }
-}
diff --git a/plugins/cordova-plugin-file-transfer/src/android/FileTransfer.java b/plugins/cordova-plugin-file-transfer/src/android/FileTransfer.java
deleted file mode 100644
index b9b99dc..0000000
--- a/plugins/cordova-plugin-file-transfer/src/android/FileTransfer.java
+++ /dev/null
@@ -1,1024 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.HttpURLConnection;
-import java.net.URLConnection;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.Inflater;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.cordova.Config;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
-import org.apache.cordova.PluginManager;
-import org.apache.cordova.PluginResult;
-import org.apache.cordova.Whitelist;
-import org.apache.cordova.file.FileUtils;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.net.Uri;
-import android.os.Build;
-import android.util.Log;
-import android.webkit.CookieManager;
-
-public class FileTransfer extends CordovaPlugin {
-
- private static final String LOG_TAG = "FileTransfer";
- private static final String LINE_START = "--";
- private static final String LINE_END = "\r\n";
- private static final String BOUNDARY = "+++++";
-
- public static int FILE_NOT_FOUND_ERR = 1;
- public static int INVALID_URL_ERR = 2;
- public static int CONNECTION_ERR = 3;
- public static int ABORTED_ERR = 4;
- public static int NOT_MODIFIED_ERR = 5;
-
- private static HashMap activeRequests = new HashMap();
- private static final int MAX_BUFFER_SIZE = 16 * 1024;
-
- private static final class RequestContext {
- String source;
- String target;
- File targetFile;
- CallbackContext callbackContext;
- HttpURLConnection connection;
- boolean aborted;
- RequestContext(String source, String target, CallbackContext callbackContext) {
- this.source = source;
- this.target = target;
- this.callbackContext = callbackContext;
- }
- void sendPluginResult(PluginResult pluginResult) {
- synchronized (this) {
- if (!aborted) {
- callbackContext.sendPluginResult(pluginResult);
- }
- }
- }
- }
-
- /**
- * Adds an interface method to an InputStream to return the number of bytes
- * read from the raw stream. This is used to track total progress against
- * the HTTP Content-Length header value from the server.
- */
- private static abstract class TrackingInputStream extends FilterInputStream {
- public TrackingInputStream(final InputStream in) {
- super(in);
- }
- public abstract long getTotalRawBytesRead();
- }
-
- private static class ExposedGZIPInputStream extends GZIPInputStream {
- public ExposedGZIPInputStream(final InputStream in) throws IOException {
- super(in);
- }
- public Inflater getInflater() {
- return inf;
- }
- }
-
- /**
- * Provides raw bytes-read tracking for a GZIP input stream. Reports the
- * total number of compressed bytes read from the input, rather than the
- * number of uncompressed bytes.
- */
- private static class TrackingGZIPInputStream extends TrackingInputStream {
- private ExposedGZIPInputStream gzin;
- public TrackingGZIPInputStream(final ExposedGZIPInputStream gzin) throws IOException {
- super(gzin);
- this.gzin = gzin;
- }
- public long getTotalRawBytesRead() {
- return gzin.getInflater().getBytesRead();
- }
- }
-
- /**
- * Provides simple total-bytes-read tracking for an existing InputStream
- */
- private static class SimpleTrackingInputStream extends TrackingInputStream {
- private long bytesRead = 0;
- public SimpleTrackingInputStream(InputStream stream) {
- super(stream);
- }
-
- private int updateBytesRead(int newBytesRead) {
- if (newBytesRead != -1) {
- bytesRead += newBytesRead;
- }
- return newBytesRead;
- }
-
- @Override
- public int read() throws IOException {
- return updateBytesRead(super.read());
- }
-
- // Note: FilterInputStream delegates read(byte[] bytes) to the below method,
- // so we don't override it or else double count (CB-5631).
- @Override
- public int read(byte[] bytes, int offset, int count) throws IOException {
- return updateBytesRead(super.read(bytes, offset, count));
- }
-
- public long getTotalRawBytesRead() {
- return bytesRead;
- }
- }
-
- @Override
- public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
- if (action.equals("upload") || action.equals("download")) {
- String source = args.getString(0);
- String target = args.getString(1);
-
- if (action.equals("upload")) {
- upload(source, target, args, callbackContext);
- } else {
- download(source, target, args, callbackContext);
- }
- return true;
- } else if (action.equals("abort")) {
- String objectId = args.getString(0);
- abort(objectId);
- callbackContext.success();
- return true;
- }
- return false;
- }
-
- private static void addHeadersToRequest(URLConnection connection, JSONObject headers) {
- try {
- for (Iterator> iter = headers.keys(); iter.hasNext(); ) {
- /* RFC 2616 says that non-ASCII characters and control
- * characters are not allowed in header names or values.
- * Additionally, spaces are not allowed in header names.
- * RFC 2046 Quoted-printable encoding may be used to encode
- * arbitrary characters, but we donon- not do that encoding here.
- */
- String headerKey = iter.next().toString();
- String cleanHeaderKey = headerKey.replaceAll("\\n","")
- .replaceAll("\\s+","")
- .replaceAll(":", "")
- .replaceAll("[^\\x20-\\x7E]+", "");
-
- JSONArray headerValues = headers.optJSONArray(headerKey);
- if (headerValues == null) {
- headerValues = new JSONArray();
-
- /* RFC 2616 also says that any amount of consecutive linear
- * whitespace within a header value can be replaced with a
- * single space character, without affecting the meaning of
- * that value.
- */
-
- String headerValue = headers.getString(headerKey);
- String finalValue = headerValue.replaceAll("\\s+", " ").replaceAll("\\n"," ").replaceAll("[^\\x20-\\x7E]+", " ");
- headerValues.put(finalValue);
- }
-
- //Use the clean header key, not the one that we passed in
- connection.setRequestProperty(cleanHeaderKey, headerValues.getString(0));
- for (int i = 1; i < headerValues.length(); ++i) {
- connection.addRequestProperty(headerKey, headerValues.getString(i));
- }
- }
- } catch (JSONException e1) {
- // No headers to be manipulated!
- }
- }
-
- private String getCookies(final String target) {
- boolean gotCookie = false;
- String cookie = null;
- Class webViewClass = webView.getClass();
- try {
- Method gcmMethod = webViewClass.getMethod("getCookieManager");
- Class iccmClass = gcmMethod.getReturnType();
- Method gcMethod = iccmClass.getMethod("getCookie", String.class);
-
- cookie = (String)gcMethod.invoke(
- iccmClass.cast(
- gcmMethod.invoke(webView)
- ), target);
-
- gotCookie = true;
- } catch (NoSuchMethodException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- } catch (ClassCastException e) {
- }
-
- if (!gotCookie && CookieManager.getInstance() != null) {
- cookie = CookieManager.getInstance().getCookie(target);
- }
-
- return cookie;
- }
-
- /**
- * Uploads the specified file to the server URL provided using an HTTP multipart request.
- * @param source Full path of the file on the file system
- * @param target URL of the server to receive the file
- * @param args JSON Array of args
- * @param callbackContext callback id for optional progress reports
- *
- * args[2] fileKey Name of file request parameter
- * args[3] fileName File name to be used on server
- * args[4] mimeType Describes file content type
- * args[5] params key:value pairs of user-defined parameters
- * @return FileUploadResult containing result of upload request
- */
- private void upload(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
- Log.d(LOG_TAG, "upload " + source + " to " + target);
-
- // Setup the options
- final String fileKey = getArgument(args, 2, "file");
- final String fileName = getArgument(args, 3, "image.jpg");
- final String mimeType = getArgument(args, 4, "image/jpeg");
- final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5);
- final boolean trustEveryone = args.optBoolean(6);
- // Always use chunked mode unless set to false as per API
- final boolean chunkedMode = args.optBoolean(7) || args.isNull(7);
- // Look for headers on the params map for backwards compatibility with older Cordova versions.
- final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers") : args.optJSONObject(8);
- final String objectId = args.getString(9);
- final String httpMethod = getArgument(args, 10, "POST");
-
- final CordovaResourceApi resourceApi = webView.getResourceApi();
-
- Log.d(LOG_TAG, "fileKey: " + fileKey);
- Log.d(LOG_TAG, "fileName: " + fileName);
- Log.d(LOG_TAG, "mimeType: " + mimeType);
- Log.d(LOG_TAG, "params: " + params);
- Log.d(LOG_TAG, "trustEveryone: " + trustEveryone);
- Log.d(LOG_TAG, "chunkedMode: " + chunkedMode);
- Log.d(LOG_TAG, "headers: " + headers);
- Log.d(LOG_TAG, "objectId: " + objectId);
- Log.d(LOG_TAG, "httpMethod: " + httpMethod);
-
- final Uri targetUri = resourceApi.remapUri(Uri.parse(target));
- // Accept a path or a URI for the source.
- Uri tmpSrc = Uri.parse(source);
- final Uri sourceUri = resourceApi.remapUri(
- tmpSrc.getScheme() != null ? tmpSrc : Uri.fromFile(new File(source)));
-
- int uriType = CordovaResourceApi.getUriType(targetUri);
- final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
- if (uriType != CordovaResourceApi.URI_TYPE_HTTP && !useHttps) {
- JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0, null);
- Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- return;
- }
-
- final RequestContext context = new RequestContext(source, target, callbackContext);
- synchronized (activeRequests) {
- activeRequests.put(objectId, context);
- }
-
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- if (context.aborted) {
- return;
- }
- HttpURLConnection conn = null;
- HostnameVerifier oldHostnameVerifier = null;
- SSLSocketFactory oldSocketFactory = null;
- int totalBytes = 0;
- int fixedLength = -1;
- try {
- // Create return object
- FileUploadResult result = new FileUploadResult();
- FileProgressResult progress = new FileProgressResult();
-
- //------------------ CLIENT REQUEST
- // Open a HTTP connection to the URL based on protocol
- conn = resourceApi.createHttpConnection(targetUri);
- if (useHttps && trustEveryone) {
- // Setup the HTTPS connection class to trust everyone
- HttpsURLConnection https = (HttpsURLConnection)conn;
- oldSocketFactory = trustAllHosts(https);
- // Save the current hostnameVerifier
- oldHostnameVerifier = https.getHostnameVerifier();
- // Setup the connection not to verify hostnames
- https.setHostnameVerifier(DO_NOT_VERIFY);
- }
-
- // Allow Inputs
- conn.setDoInput(true);
-
- // Allow Outputs
- conn.setDoOutput(true);
-
- // Don't use a cached copy.
- conn.setUseCaches(false);
-
- // Use a post method.
- conn.setRequestMethod(httpMethod);
-
- // if we specified a Content-Type header, don't do multipart form upload
- boolean multipartFormUpload = (headers == null) || !headers.has("Content-Type");
- if (multipartFormUpload) {
- conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
- }
-
- // Set the cookies on the response
- String cookie = getCookies(target);
-
- if (cookie != null) {
- conn.setRequestProperty("Cookie", cookie);
- }
-
- // Handle the other headers
- if (headers != null) {
- addHeadersToRequest(conn, headers);
- }
-
- /*
- * Store the non-file portions of the multipart data as a string, so that we can add it
- * to the contentSize, since it is part of the body of the HTTP request.
- */
- StringBuilder beforeData = new StringBuilder();
- try {
- for (Iterator> iter = params.keys(); iter.hasNext();) {
- Object key = iter.next();
- if(!String.valueOf(key).equals("headers"))
- {
- beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
- beforeData.append("Content-Disposition: form-data; name=\"").append(key.toString()).append('"');
- beforeData.append(LINE_END).append(LINE_END);
- beforeData.append(params.getString(key.toString()));
- beforeData.append(LINE_END);
- }
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
-
- beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
- beforeData.append("Content-Disposition: form-data; name=\"").append(fileKey).append("\";");
- beforeData.append(" filename=\"").append(fileName).append('"').append(LINE_END);
- beforeData.append("Content-Type: ").append(mimeType).append(LINE_END).append(LINE_END);
- byte[] beforeDataBytes = beforeData.toString().getBytes("UTF-8");
- byte[] tailParamsBytes = (LINE_END + LINE_START + BOUNDARY + LINE_START + LINE_END).getBytes("UTF-8");
-
-
- // Get a input stream of the file on the phone
- OpenForReadResult readResult = resourceApi.openForRead(sourceUri);
-
- int stringLength = beforeDataBytes.length + tailParamsBytes.length;
- if (readResult.length >= 0) {
- fixedLength = (int)readResult.length;
- if (multipartFormUpload)
- fixedLength += stringLength;
- progress.setLengthComputable(true);
- progress.setTotal(fixedLength);
- }
- Log.d(LOG_TAG, "Content Length: " + fixedLength);
- // setFixedLengthStreamingMode causes and OutOfMemoryException on pre-Froyo devices.
- // http://code.google.com/p/android/issues/detail?id=3164
- // It also causes OOM if HTTPS is used, even on newer devices.
- boolean useChunkedMode = chunkedMode && (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps);
- useChunkedMode = useChunkedMode || (fixedLength == -1);
-
- if (useChunkedMode) {
- conn.setChunkedStreamingMode(MAX_BUFFER_SIZE);
- // Although setChunkedStreamingMode sets this header, setting it explicitly here works
- // around an OutOfMemoryException when using https.
- conn.setRequestProperty("Transfer-Encoding", "chunked");
- } else {
- conn.setFixedLengthStreamingMode(fixedLength);
- }
-
- conn.connect();
-
- OutputStream sendStream = null;
- try {
- sendStream = conn.getOutputStream();
- synchronized (context) {
- if (context.aborted) {
- return;
- }
- context.connection = conn;
- }
-
- if (multipartFormUpload) {
- //We don't want to change encoding, we just want this to write for all Unicode.
- sendStream.write(beforeDataBytes);
- totalBytes += beforeDataBytes.length;
- }
-
- // create a buffer of maximum size
- int bytesAvailable = readResult.inputStream.available();
- int bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
- byte[] buffer = new byte[bufferSize];
-
- // read file and write it into form...
- int bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-
- long prevBytesRead = 0;
- while (bytesRead > 0) {
- totalBytes += bytesRead;
- result.setBytesSent(totalBytes);
- sendStream.write(buffer, 0, bytesRead);
- if (totalBytes > prevBytesRead + 102400) {
- prevBytesRead = totalBytes;
- Log.d(LOG_TAG, "Uploaded " + totalBytes + " of " + fixedLength + " bytes");
- }
- bytesAvailable = readResult.inputStream.available();
- bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
- bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-
- // Send a progress event.
- progress.setLoaded(totalBytes);
- PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
- progressResult.setKeepCallback(true);
- context.sendPluginResult(progressResult);
- }
-
- if (multipartFormUpload) {
- // send multipart form data necessary after file data...
- sendStream.write(tailParamsBytes);
- totalBytes += tailParamsBytes.length;
- }
- sendStream.flush();
- } finally {
- safeClose(readResult.inputStream);
- safeClose(sendStream);
- }
- synchronized (context) {
- context.connection = null;
- }
- Log.d(LOG_TAG, "Sent " + totalBytes + " of " + fixedLength);
-
- //------------------ read the SERVER RESPONSE
- String responseString;
- int responseCode = conn.getResponseCode();
- Log.d(LOG_TAG, "response code: " + responseCode);
- Log.d(LOG_TAG, "response headers: " + conn.getHeaderFields());
- TrackingInputStream inStream = null;
- try {
- inStream = getInputStream(conn);
- synchronized (context) {
- if (context.aborted) {
- return;
- }
- context.connection = conn;
- }
-
- ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(1024, conn.getContentLength()));
- byte[] buffer = new byte[1024];
- int bytesRead = 0;
- // write bytes to file
- while ((bytesRead = inStream.read(buffer)) > 0) {
- out.write(buffer, 0, bytesRead);
- }
- responseString = out.toString("UTF-8");
- } finally {
- synchronized (context) {
- context.connection = null;
- }
- safeClose(inStream);
- }
-
- Log.d(LOG_TAG, "got response from server");
- Log.d(LOG_TAG, responseString.substring(0, Math.min(256, responseString.length())));
-
- // send request and retrieve response
- result.setResponseCode(responseCode);
- result.setResponse(responseString);
-
- context.sendPluginResult(new PluginResult(PluginResult.Status.OK, result.toJSONObject()));
- } catch (FileNotFoundException e) {
- JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, conn, e);
- Log.e(LOG_TAG, error.toString(), e);
- context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- } catch (IOException e) {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn, e);
- Log.e(LOG_TAG, error.toString(), e);
- Log.e(LOG_TAG, "Failed after uploading " + totalBytes + " of " + fixedLength + " bytes.");
- context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- context.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
- } catch (Throwable t) {
- // Shouldn't happen, but will
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn, t);
- Log.e(LOG_TAG, error.toString(), t);
- context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- } finally {
- synchronized (activeRequests) {
- activeRequests.remove(objectId);
- }
-
- if (conn != null) {
- // Revert back to the proper verifier and socket factories
- // Revert back to the proper verifier and socket factories
- if (trustEveryone && useHttps) {
- HttpsURLConnection https = (HttpsURLConnection) conn;
- https.setHostnameVerifier(oldHostnameVerifier);
- https.setSSLSocketFactory(oldSocketFactory);
- }
- }
- }
- }
- });
- }
-
- private static void safeClose(Closeable stream) {
- if (stream != null) {
- try {
- stream.close();
- } catch (IOException e) {
- }
- }
- }
-
- private static TrackingInputStream getInputStream(URLConnection conn) throws IOException {
- String encoding = conn.getContentEncoding();
- if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
- return new TrackingGZIPInputStream(new ExposedGZIPInputStream(conn.getInputStream()));
- }
- return new SimpleTrackingInputStream(conn.getInputStream());
- }
-
- // always verify the host - don't check for certificate
- private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {
- public boolean verify(String hostname, SSLSession session) {
- return true;
- }
- };
- // Create a trust manager that does not validate certificate chains
- private static final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
- public java.security.cert.X509Certificate[] getAcceptedIssuers() {
- return new java.security.cert.X509Certificate[] {};
- }
-
- public void checkClientTrusted(X509Certificate[] chain,
- String authType) throws CertificateException {
- }
-
- public void checkServerTrusted(X509Certificate[] chain,
- String authType) throws CertificateException {
- }
- } };
-
- /**
- * This function will install a trust manager that will blindly trust all SSL
- * certificates. The reason this code is being added is to enable developers
- * to do development using self signed SSL certificates on their web server.
- *
- * The standard HttpsURLConnection class will throw an exception on self
- * signed certificates if this code is not run.
- */
- private static SSLSocketFactory trustAllHosts(HttpsURLConnection connection) {
- // Install the all-trusting trust manager
- SSLSocketFactory oldFactory = connection.getSSLSocketFactory();
- try {
- // Install our all trusting manager
- SSLContext sc = SSLContext.getInstance("TLS");
- sc.init(null, trustAllCerts, new java.security.SecureRandom());
- SSLSocketFactory newFactory = sc.getSocketFactory();
- connection.setSSLSocketFactory(newFactory);
- } catch (Exception e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return oldFactory;
- }
-
- private static JSONObject createFileTransferError(int errorCode, String source, String target, URLConnection connection, Throwable throwable) {
-
- int httpStatus = 0;
- StringBuilder bodyBuilder = new StringBuilder();
- String body = null;
- if (connection != null) {
- try {
- if (connection instanceof HttpURLConnection) {
- httpStatus = ((HttpURLConnection)connection).getResponseCode();
- InputStream err = ((HttpURLConnection) connection).getErrorStream();
- if(err != null)
- {
- BufferedReader reader = new BufferedReader(new InputStreamReader(err, "UTF-8"));
- try {
- String line = reader.readLine();
- while(line != null) {
- bodyBuilder.append(line);
- line = reader.readLine();
- if(line != null) {
- bodyBuilder.append('\n');
- }
- }
- body = bodyBuilder.toString();
- } finally {
- reader.close();
- }
- }
- }
- // IOException can leave connection object in a bad state, so catch all exceptions.
- } catch (Throwable e) {
- Log.w(LOG_TAG, "Error getting HTTP status code from connection.", e);
- }
- }
-
- return createFileTransferError(errorCode, source, target, body, httpStatus, throwable);
- }
-
- /**
- * Create an error object based on the passed in errorCode
- * @param errorCode the error
- * @return JSONObject containing the error
- */
- private static JSONObject createFileTransferError(int errorCode, String source, String target, String body, Integer httpStatus, Throwable throwable) {
- JSONObject error = null;
- try {
- error = new JSONObject();
- error.put("code", errorCode);
- error.put("source", source);
- error.put("target", target);
- if(body != null)
- {
- error.put("body", body);
- }
- if (httpStatus != null) {
- error.put("http_status", httpStatus);
- }
- if (throwable != null) {
- String msg = throwable.getMessage();
- if (msg == null || "".equals(msg)) {
- msg = throwable.toString();
- }
- error.put("exception", msg);
- }
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- }
- return error;
- }
-
- /**
- * Convenience method to read a parameter from the list of JSON args.
- * @param args the args passed to the Plugin
- * @param position the position to retrieve the arg from
- * @param defaultString the default to be used if the arg does not exist
- * @return String with the retrieved value
- */
- private static String getArgument(JSONArray args, int position, String defaultString) {
- String arg = defaultString;
- if (args.length() > position) {
- arg = args.optString(position);
- if (arg == null || "null".equals(arg)) {
- arg = defaultString;
- }
- }
- return arg;
- }
-
- /**
- * Downloads a file form a given URL and saves it to the specified directory.
- *
- * @param source URL of the server to receive the file
- * @param target Full path of the file on the file system
- */
- private void download(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
- Log.d(LOG_TAG, "download " + source + " to " + target);
-
- final CordovaResourceApi resourceApi = webView.getResourceApi();
-
- final boolean trustEveryone = args.optBoolean(2);
- final String objectId = args.getString(3);
- final JSONObject headers = args.optJSONObject(4);
-
- final Uri sourceUri = resourceApi.remapUri(Uri.parse(source));
- // Accept a path or a URI for the source.
- Uri tmpTarget = Uri.parse(target);
- final Uri targetUri = resourceApi.remapUri(
- tmpTarget.getScheme() != null ? tmpTarget : Uri.fromFile(new File(target)));
-
- int uriType = CordovaResourceApi.getUriType(sourceUri);
- final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
- final boolean isLocalTransfer = !useHttps && uriType != CordovaResourceApi.URI_TYPE_HTTP;
- if (uriType == CordovaResourceApi.URI_TYPE_UNKNOWN) {
- JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0, null);
- Log.e(LOG_TAG, "Unsupported URI: " + sourceUri);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- return;
- }
-
- /* This code exists for compatibility between 3.x and 4.x versions of Cordova.
- * Previously the CordovaWebView class had a method, getWhitelist, which would
- * return a Whitelist object. Since the fixed whitelist is removed in Cordova 4.x,
- * the correct call now is to shouldAllowRequest from the plugin manager.
- */
- Boolean shouldAllowRequest = null;
- if (isLocalTransfer) {
- shouldAllowRequest = true;
- }
- if (shouldAllowRequest == null) {
- try {
- Method gwl = webView.getClass().getMethod("getWhitelist");
- Whitelist whitelist = (Whitelist)gwl.invoke(webView);
- shouldAllowRequest = whitelist.isUrlWhiteListed(source);
- } catch (NoSuchMethodException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- }
- if (shouldAllowRequest == null) {
- try {
- Method gpm = webView.getClass().getMethod("getPluginManager");
- PluginManager pm = (PluginManager)gpm.invoke(webView);
- Method san = pm.getClass().getMethod("shouldAllowRequest", String.class);
- shouldAllowRequest = (Boolean)san.invoke(pm, source);
- } catch (NoSuchMethodException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- }
-
- if (!Boolean.TRUE.equals(shouldAllowRequest)) {
- Log.w(LOG_TAG, "Source URL is not in white list: '" + source + "'");
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, null, 401, null);
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
- return;
- }
-
-
- final RequestContext context = new RequestContext(source, target, callbackContext);
- synchronized (activeRequests) {
- activeRequests.put(objectId, context);
- }
-
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- if (context.aborted) {
- return;
- }
- HttpURLConnection connection = null;
- HostnameVerifier oldHostnameVerifier = null;
- SSLSocketFactory oldSocketFactory = null;
- File file = null;
- PluginResult result = null;
- TrackingInputStream inputStream = null;
- boolean cached = false;
-
- OutputStream outputStream = null;
- try {
- OpenForReadResult readResult = null;
-
- file = resourceApi.mapUriToFile(targetUri);
- context.targetFile = file;
-
- Log.d(LOG_TAG, "Download file:" + sourceUri);
-
- FileProgressResult progress = new FileProgressResult();
-
- if (isLocalTransfer) {
- readResult = resourceApi.openForRead(sourceUri);
- if (readResult.length != -1) {
- progress.setLengthComputable(true);
- progress.setTotal(readResult.length);
- }
- inputStream = new SimpleTrackingInputStream(readResult.inputStream);
- } else {
- // connect to server
- // Open a HTTP connection to the URL based on protocol
- connection = resourceApi.createHttpConnection(sourceUri);
- if (useHttps && trustEveryone) {
- // Setup the HTTPS connection class to trust everyone
- HttpsURLConnection https = (HttpsURLConnection)connection;
- oldSocketFactory = trustAllHosts(https);
- // Save the current hostnameVerifier
- oldHostnameVerifier = https.getHostnameVerifier();
- // Setup the connection not to verify hostnames
- https.setHostnameVerifier(DO_NOT_VERIFY);
- }
-
- connection.setRequestMethod("GET");
-
- // TODO: Make OkHttp use this CookieManager by default.
- String cookie = getCookies(sourceUri.toString());
-
- if(cookie != null)
- {
- connection.setRequestProperty("cookie", cookie);
- }
-
- // This must be explicitly set for gzip progress tracking to work.
- connection.setRequestProperty("Accept-Encoding", "gzip");
-
- // Handle the other headers
- if (headers != null) {
- addHeadersToRequest(connection, headers);
- }
-
- connection.connect();
- if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {
- cached = true;
- connection.disconnect();
- Log.d(LOG_TAG, "Resource not modified: " + source);
- JSONObject error = createFileTransferError(NOT_MODIFIED_ERR, source, target, connection, null);
- result = new PluginResult(PluginResult.Status.ERROR, error);
- } else {
- if (connection.getContentEncoding() == null || connection.getContentEncoding().equalsIgnoreCase("gzip")) {
- // Only trust content-length header if we understand
- // the encoding -- identity or gzip
- if (connection.getContentLength() != -1) {
- progress.setLengthComputable(true);
- progress.setTotal(connection.getContentLength());
- }
- }
- inputStream = getInputStream(connection);
- }
- }
-
- if (!cached) {
- try {
- synchronized (context) {
- if (context.aborted) {
- return;
- }
- context.connection = connection;
- }
-
- // write bytes to file
- byte[] buffer = new byte[MAX_BUFFER_SIZE];
- int bytesRead = 0;
- outputStream = resourceApi.openOutputStream(targetUri);
- while ((bytesRead = inputStream.read(buffer)) > 0) {
- outputStream.write(buffer, 0, bytesRead);
- // Send a progress event.
- progress.setLoaded(inputStream.getTotalRawBytesRead());
- PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
- progressResult.setKeepCallback(true);
- context.sendPluginResult(progressResult);
- }
- } finally {
- synchronized (context) {
- context.connection = null;
- }
- safeClose(inputStream);
- safeClose(outputStream);
- }
-
- Log.d(LOG_TAG, "Saved file: " + target);
-
-
- // create FileEntry object
- Class webViewClass = webView.getClass();
- PluginManager pm = null;
- try {
- Method gpm = webViewClass.getMethod("getPluginManager");
- pm = (PluginManager) gpm.invoke(webView);
- } catch (NoSuchMethodException e) {
- } catch (IllegalAccessException e) {
- } catch (InvocationTargetException e) {
- }
- if (pm == null) {
- try {
- Field pmf = webViewClass.getField("pluginManager");
- pm = (PluginManager)pmf.get(webView);
- } catch (NoSuchFieldException e) {
- } catch (IllegalAccessException e) {
- }
- }
- file = resourceApi.mapUriToFile(targetUri);
- context.targetFile = file;
- FileUtils filePlugin = (FileUtils) pm.getPlugin("File");
- if (filePlugin != null) {
- JSONObject fileEntry = filePlugin.getEntryForFile(file);
- if (fileEntry != null) {
- result = new PluginResult(PluginResult.Status.OK, fileEntry);
- } else {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection, null);
- Log.e(LOG_TAG, "File plugin cannot represent download path");
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- }
- } else {
- Log.e(LOG_TAG, "File plugin not found; cannot save downloaded file");
- result = new PluginResult(PluginResult.Status.ERROR, "File plugin not found; cannot save downloaded file");
- }
- }
- } catch (FileNotFoundException e) {
- JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, connection, e);
- Log.e(LOG_TAG, error.toString(), e);
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- } catch (IOException e) {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection, e);
- Log.e(LOG_TAG, error.toString(), e);
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- } catch (JSONException e) {
- Log.e(LOG_TAG, e.getMessage(), e);
- result = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
- } catch (Throwable e) {
- JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection, e);
- Log.e(LOG_TAG, error.toString(), e);
- result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
- } finally {
- synchronized (activeRequests) {
- activeRequests.remove(objectId);
- }
-
- if (connection != null) {
- // Revert back to the proper verifier and socket factories
- if (trustEveryone && useHttps) {
- HttpsURLConnection https = (HttpsURLConnection) connection;
- https.setHostnameVerifier(oldHostnameVerifier);
- https.setSSLSocketFactory(oldSocketFactory);
- }
- }
-
- if (result == null) {
- result = new PluginResult(PluginResult.Status.ERROR, createFileTransferError(CONNECTION_ERR, source, target, connection, null));
- }
- // Remove incomplete download.
- if (!cached && result.getStatus() != PluginResult.Status.OK.ordinal() && file != null) {
- file.delete();
- }
- context.sendPluginResult(result);
- }
- }
- });
- }
-
- /**
- * Abort an ongoing upload or download.
- */
- private void abort(String objectId) {
- final RequestContext context;
- synchronized (activeRequests) {
- context = activeRequests.remove(objectId);
- }
- if (context != null) {
- // Closing the streams can block, so execute on a background thread.
- cordova.getThreadPool().execute(new Runnable() {
- public void run() {
- synchronized (context) {
- File file = context.targetFile;
- if (file != null) {
- file.delete();
- }
- // Trigger the abort callback immediately to minimize latency between it and abort() being called.
- JSONObject error = createFileTransferError(ABORTED_ERR, context.source, context.target, null, -1, null);
- context.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, error));
- context.aborted = true;
- if (context.connection != null) {
- try {
- context.connection.disconnect();
- } catch (Exception e) {
- Log.e(LOG_TAG, "CB-8431 Catch workaround for fatal exception", e);
- }
- }
- }
- }
- });
- }
- }
-}
diff --git a/plugins/cordova-plugin-file-transfer/src/android/FileUploadResult.java b/plugins/cordova-plugin-file-transfer/src/android/FileUploadResult.java
deleted file mode 100644
index c24ea78..0000000
--- a/plugins/cordova-plugin-file-transfer/src/android/FileUploadResult.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Encapsulates the result and/or status of uploading a file to a remote server.
- */
-public class FileUploadResult {
-
- private long bytesSent = 0; // bytes sent
- private int responseCode = -1; // HTTP response code
- private String response = null; // HTTP response
- private String objectId = null; // FileTransfer object id
-
- public long getBytesSent() {
- return bytesSent;
- }
-
- public void setBytesSent(long bytes) {
- this.bytesSent = bytes;
- }
-
- public int getResponseCode() {
- return responseCode;
- }
-
- public void setResponseCode(int responseCode) {
- this.responseCode = responseCode;
- }
-
- public String getResponse() {
- return response;
- }
-
- public void setResponse(String response) {
- this.response = response;
- }
-
- public String getObjectId() {
- return objectId;
- }
-
- public void setObjectId(String objectId) {
- this.objectId = objectId;
- }
-
- public JSONObject toJSONObject() throws JSONException {
- return new JSONObject(
- "{bytesSent:" + bytesSent +
- ",responseCode:" + responseCode +
- ",response:" + JSONObject.quote(response) +
- ",objectId:" + JSONObject.quote(objectId) + "}");
- }
-}
diff --git a/plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.h b/plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.h
deleted file mode 100644
index bb5fa13..0000000
--- a/plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import
-#import "CDVFile.h"
-
-enum CDVFileTransferError {
- FILE_NOT_FOUND_ERR = 1,
- INVALID_URL_ERR = 2,
- CONNECTION_ERR = 3,
- CONNECTION_ABORTED = 4,
- NOT_MODIFIED = 5
-};
-typedef int CDVFileTransferError;
-
-enum CDVFileTransferDirection {
- CDV_TRANSFER_UPLOAD = 1,
- CDV_TRANSFER_DOWNLOAD = 2,
-};
-typedef int CDVFileTransferDirection;
-
-// Magic value within the options dict used to set a cookie.
-extern NSString* const kOptionsKeyCookie;
-
-@interface CDVFileTransfer : CDVPlugin {}
-
-- (void)upload:(CDVInvokedUrlCommand*)command;
-- (void)download:(CDVInvokedUrlCommand*)command;
-- (NSString*)escapePathComponentForUrlString:(NSString*)urlString;
-
-// Visible for testing.
-- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData;
-- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target;
-
-- (NSMutableDictionary*)createFileTransferError:(int)code
- AndSource:(NSString*)source
- AndTarget:(NSString*)target
- AndHttpStatus:(int)httpStatus
- AndBody:(NSString*)body;
-@property (nonatomic, strong) NSOperationQueue* queue;
-@property (readonly) NSMutableDictionary* activeTransfers;
-@end
-
-@class CDVFileTransferEntityLengthRequest;
-
-@interface CDVFileTransferDelegate : NSObject {}
-
-- (void)updateBytesExpected:(long long)newBytesExpected;
-- (void)cancelTransfer:(NSURLConnection*)connection;
-
-@property (strong) NSMutableData* responseData; // atomic
-@property (nonatomic, strong) NSDictionary* responseHeaders;
-@property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTaskID;
-@property (nonatomic, strong) CDVFileTransfer* command;
-@property (nonatomic, assign) CDVFileTransferDirection direction;
-@property (nonatomic, strong) NSURLConnection* connection;
-@property (nonatomic, copy) NSString* callbackId;
-@property (nonatomic, copy) NSString* objectId;
-@property (nonatomic, copy) NSString* source;
-@property (nonatomic, copy) NSString* target;
-@property (nonatomic, copy) NSURL* targetURL;
-@property (nonatomic, copy) NSString* mimeType;
-@property (assign) int responseCode; // atomic
-@property (nonatomic, assign) long long bytesTransfered;
-@property (nonatomic, assign) long long bytesExpected;
-@property (nonatomic, assign) BOOL trustAllHosts;
-@property (strong) NSFileHandle* targetFileHandle;
-@property (nonatomic, strong) CDVFileTransferEntityLengthRequest* entityLengthRequest;
-@property (nonatomic, strong) CDVFile *filePlugin;
-
-@end
diff --git a/plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.m b/plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.m
deleted file mode 100644
index 4775a6d..0000000
--- a/plugins/cordova-plugin-file-transfer/src/ios/CDVFileTransfer.m
+++ /dev/null
@@ -1,845 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import
-#import "CDVFileTransfer.h"
-#import "CDVLocalFilesystem.h"
-
-#import
-#import
-#import
-#import
-
-#ifndef DLog
-#ifdef DEBUG
- #define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
-#else
- #define DLog(...)
-#endif
-#endif
-
-@interface CDVFileTransfer ()
-// Sets the requests headers for the request.
-- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req;
-// Creates a delegate to handle an upload.
-- (CDVFileTransferDelegate*)delegateForUploadCommand:(CDVInvokedUrlCommand*)command;
-// Creates an NSData* for the file for the given upload arguments.
-- (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command;
-@end
-
-// Buffer size to use for streaming uploads.
-static const NSUInteger kStreamBufferSize = 32768;
-// Magic value within the options dict used to set a cookie.
-NSString* const kOptionsKeyCookie = @"__cookie";
-// Form boundary for multi-part requests.
-NSString* const kFormBoundary = @"+++++org.apache.cordova.formBoundary";
-
-// Writes the given data to the stream in a blocking way.
-// If successful, returns bytesToWrite.
-// If the stream was closed on the other end, returns 0.
-// If there was an error, returns -1.
-static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
-{
- UInt8* bytes = (UInt8*)[data bytes];
- long long bytesToWrite = [data length];
- long long totalBytesWritten = 0;
-
- while (totalBytesWritten < bytesToWrite) {
- CFIndex result = CFWriteStreamWrite(stream,
- bytes + totalBytesWritten,
- bytesToWrite - totalBytesWritten);
- if (result < 0) {
- CFStreamError error = CFWriteStreamGetError(stream);
- NSLog(@"WriteStreamError domain: %ld error: %ld", error.domain, (long)error.error);
- return result;
- } else if (result == 0) {
- return result;
- }
- totalBytesWritten += result;
- }
-
- return totalBytesWritten;
-}
-
-@implementation CDVFileTransfer
-@synthesize activeTransfers;
-
-- (void)pluginInitialize {
- activeTransfers = [[NSMutableDictionary alloc] init];
-}
-
-- (NSString*)escapePathComponentForUrlString:(NSString*)urlString
-{
- NSRange schemeAndHostRange = [urlString rangeOfString:@"://.*?/" options:NSRegularExpressionSearch];
-
- if (schemeAndHostRange.length == 0) {
- return urlString;
- }
-
- NSInteger schemeAndHostEndIndex = NSMaxRange(schemeAndHostRange);
- NSString* schemeAndHost = [urlString substringToIndex:schemeAndHostEndIndex];
- NSString* pathComponent = [urlString substringFromIndex:schemeAndHostEndIndex];
- pathComponent = [pathComponent stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-
- return [schemeAndHost stringByAppendingString:pathComponent];
-}
-
-- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req
-{
- [req setValue:@"XMLHttpRequest" forHTTPHeaderField:@"X-Requested-With"];
-
- NSString* userAgent = [self.commandDelegate userAgent];
- if (userAgent) {
- [req setValue:userAgent forHTTPHeaderField:@"User-Agent"];
- }
-
- for (NSString* headerName in headers) {
- id value = [headers objectForKey:headerName];
- if (!value || (value == [NSNull null])) {
- value = @"null";
- }
-
- // First, remove an existing header if one exists.
- [req setValue:nil forHTTPHeaderField:headerName];
-
- if (![value isKindOfClass:[NSArray class]]) {
- value = [NSArray arrayWithObject:value];
- }
-
- // Then, append all header values.
- for (id __strong subValue in value) {
- // Convert from an NSNumber -> NSString.
- if ([subValue respondsToSelector:@selector(stringValue)]) {
- subValue = [subValue stringValue];
- }
- if ([subValue isKindOfClass:[NSString class]]) {
- [req addValue:subValue forHTTPHeaderField:headerName];
- }
- }
- }
-}
-
-- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData
-{
- // arguments order from js: [filePath, server, fileKey, fileName, mimeType, params, debug, chunkedMode]
- // however, params is a JavaScript object and during marshalling is put into the options dict,
- // thus debug and chunkedMode are the 6th and 7th arguments
- NSString* target = [command argumentAtIndex:0];
- NSString* server = [command argumentAtIndex:1];
- NSString* fileKey = [command argumentAtIndex:2 withDefault:@"file"];
- NSString* fileName = [command argumentAtIndex:3 withDefault:@"image.jpg"];
- NSString* mimeType = [command argumentAtIndex:4 withDefault:@"image/jpeg"];
- NSDictionary* options = [command argumentAtIndex:5 withDefault:nil];
- // BOOL trustAllHosts = [[command argumentAtIndex:6 withDefault:[NSNumber numberWithBool:YES]] boolValue]; // allow self-signed certs
- BOOL chunkedMode = [[command argumentAtIndex:7 withDefault:[NSNumber numberWithBool:YES]] boolValue];
- NSDictionary* headers = [command argumentAtIndex:8 withDefault:nil];
- // Allow alternative http method, default to POST. JS side checks
- // for allowed methods, currently PUT or POST (forces POST for
- // unrecognised values)
- NSString* httpMethod = [command argumentAtIndex:10 withDefault:@"POST"];
- CDVPluginResult* result = nil;
- CDVFileTransferError errorCode = 0;
-
- // NSURL does not accepts URLs with spaces in the path. We escape the path in order
- // to be more lenient.
- NSURL* url = [NSURL URLWithString:server];
-
- if (!url) {
- errorCode = INVALID_URL_ERR;
- NSLog(@"File Transfer Error: Invalid server URL %@", server);
- } else if (!fileData) {
- errorCode = FILE_NOT_FOUND_ERR;
- }
-
- if (errorCode > 0) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:errorCode AndSource:target AndTarget:server]];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return nil;
- }
-
- NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:url];
-
- [req setHTTPMethod:httpMethod];
-
- // Magic value to set a cookie
- if ([options objectForKey:kOptionsKeyCookie]) {
- [req setValue:[options objectForKey:kOptionsKeyCookie] forHTTPHeaderField:@"Cookie"];
- [req setHTTPShouldHandleCookies:NO];
- }
-
- // if we specified a Content-Type header, don't do multipart form upload
- BOOL multipartFormUpload = [headers objectForKey:@"Content-Type"] == nil;
- if (multipartFormUpload) {
- NSString* contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", kFormBoundary];
- [req setValue:contentType forHTTPHeaderField:@"Content-Type"];
- }
- [self applyRequestHeaders:headers toRequest:req];
-
- NSData* formBoundaryData = [[NSString stringWithFormat:@"--%@\r\n", kFormBoundary] dataUsingEncoding:NSUTF8StringEncoding];
- NSMutableData* postBodyBeforeFile = [NSMutableData data];
-
- for (NSString* key in options) {
- id val = [options objectForKey:key];
- if (!val || (val == [NSNull null]) || [key isEqualToString:kOptionsKeyCookie]) {
- continue;
- }
- // if it responds to stringValue selector (eg NSNumber) get the NSString
- if ([val respondsToSelector:@selector(stringValue)]) {
- val = [val stringValue];
- }
- // finally, check whether it is a NSString (for dataUsingEncoding selector below)
- if (![val isKindOfClass:[NSString class]]) {
- continue;
- }
-
- [postBodyBeforeFile appendData:formBoundaryData];
- [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] dataUsingEncoding:NSUTF8StringEncoding]];
- [postBodyBeforeFile appendData:[val dataUsingEncoding:NSUTF8StringEncoding]];
- [postBodyBeforeFile appendData:[@"\r\n" dataUsingEncoding : NSUTF8StringEncoding]];
- }
-
- [postBodyBeforeFile appendData:formBoundaryData];
- [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", fileKey, fileName] dataUsingEncoding:NSUTF8StringEncoding]];
- if (mimeType != nil) {
- [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n", mimeType] dataUsingEncoding:NSUTF8StringEncoding]];
- }
- [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Length: %ld\r\n\r\n", (long)[fileData length]] dataUsingEncoding:NSUTF8StringEncoding]];
-
- DLog(@"fileData length: %d", [fileData length]);
- NSData* postBodyAfterFile = [[NSString stringWithFormat:@"\r\n--%@--\r\n", kFormBoundary] dataUsingEncoding:NSUTF8StringEncoding];
-
- long long totalPayloadLength = [fileData length];
- if (multipartFormUpload) {
- totalPayloadLength += [postBodyBeforeFile length] + [postBodyAfterFile length];
- }
-
- [req setValue:[[NSNumber numberWithLongLong:totalPayloadLength] stringValue] forHTTPHeaderField:@"Content-Length"];
-
- if (chunkedMode) {
- CFReadStreamRef readStream = NULL;
- CFWriteStreamRef writeStream = NULL;
- CFStreamCreateBoundPair(NULL, &readStream, &writeStream, kStreamBufferSize);
- [req setHTTPBodyStream:CFBridgingRelease(readStream)];
-
- [self.commandDelegate runInBackground:^{
- if (CFWriteStreamOpen(writeStream)) {
- if (multipartFormUpload) {
- NSData* chunks[] = { postBodyBeforeFile, fileData, postBodyAfterFile };
- int numChunks = sizeof(chunks) / sizeof(chunks[0]);
-
- for (int i = 0; i < numChunks; ++i) {
- // Allow uploading of an empty file
- if (chunks[i].length == 0) {
- continue;
- }
-
- CFIndex result = WriteDataToStream(chunks[i], writeStream);
- if (result <= 0) {
- break;
- }
- }
- } else {
- WriteDataToStream(fileData, writeStream);
- }
- } else {
- NSLog(@"FileTransfer: Failed to open writeStream");
- }
- CFWriteStreamClose(writeStream);
- CFRelease(writeStream);
- }];
- } else {
- if (multipartFormUpload) {
- [postBodyBeforeFile appendData:fileData];
- [postBodyBeforeFile appendData:postBodyAfterFile];
- [req setHTTPBody:postBodyBeforeFile];
- } else {
- [req setHTTPBody:fileData];
- }
- }
- return req;
-}
-
-- (CDVFileTransferDelegate*)delegateForUploadCommand:(CDVInvokedUrlCommand*)command
-{
- NSString* source = [command argumentAtIndex:0];
- NSString* server = [command argumentAtIndex:1];
- BOOL trustAllHosts = [[command argumentAtIndex:6 withDefault:[NSNumber numberWithBool:NO]] boolValue]; // allow self-signed certs
- NSString* objectId = [command argumentAtIndex:9];
-
- CDVFileTransferDelegate* delegate = [[CDVFileTransferDelegate alloc] init];
-
- delegate.command = self;
- delegate.callbackId = command.callbackId;
- delegate.direction = CDV_TRANSFER_UPLOAD;
- delegate.objectId = objectId;
- delegate.source = source;
- delegate.target = server;
- delegate.trustAllHosts = trustAllHosts;
- delegate.filePlugin = [self.commandDelegate getCommandInstance:@"File"];
-
- return delegate;
-}
-
-- (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command
-{
- NSString* source = (NSString*)[command argumentAtIndex:0];
- NSString* server = [command argumentAtIndex:1];
- NSError* __autoreleasing err = nil;
-
- if ([source hasPrefix:@"data:"] && [source rangeOfString:@"base64"].location != NSNotFound) {
- NSRange commaRange = [source rangeOfString: @","];
- if (commaRange.location == NSNotFound) {
- // Return error is there is no comma
- __weak CDVFileTransfer* weakSelf = self;
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[weakSelf createFileTransferError:INVALID_URL_ERR AndSource:source AndTarget:server]];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- if (commaRange.location + 1 > source.length - 1) {
- // Init as an empty data
- NSData *fileData = [[NSData alloc] init];
- [self uploadData:fileData command:command];
- return;
- }
-
- NSData *fileData = [[NSData alloc] initWithBase64EncodedString:[source substringFromIndex:(commaRange.location + 1)] options:NSDataBase64DecodingIgnoreUnknownCharacters];
- [self uploadData:fileData command:command];
- return;
- }
-
- CDVFilesystemURL *sourceURL = [CDVFilesystemURL fileSystemURLWithString:source];
- NSObject *fs;
- if (sourceURL) {
- // Try to get a CDVFileSystem which will handle this file.
- // This requires talking to the current CDVFile plugin.
- fs = [[self.commandDelegate getCommandInstance:@"File"] filesystemForURL:sourceURL];
- }
- if (fs) {
- __weak CDVFileTransfer* weakSelf = self;
- [fs readFileAtURL:sourceURL start:0 end:-1 callback:^(NSData *fileData, NSString *mimeType, CDVFileError err) {
- if (err) {
- // We couldn't find the asset. Send the appropriate error.
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[weakSelf createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]];
- [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- } else {
- [weakSelf uploadData:fileData command:command];
- }
- }];
- return;
- } else {
- // Extract the path part out of a file: URL.
- NSString* filePath = [source hasPrefix:@"/"] ? [source copy] : [(NSURL *)[NSURL URLWithString:source] path];
- if (filePath == nil) {
- // We couldn't find the asset. Send the appropriate error.
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- // Memory map the file so that it can be read efficiently even if it is large.
- NSData* fileData = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:&err];
-
- if (err != nil) {
- NSLog(@"Error opening file %@: %@", source, err);
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- } else {
- [self uploadData:fileData command:command];
- }
- }
-}
-
-- (void)upload:(CDVInvokedUrlCommand*)command
-{
- // fileData and req are split into helper functions to ease the unit testing of delegateForUpload.
- // First, get the file data. This method will call `uploadData:command`.
- [self fileDataForUploadCommand:command];
-}
-
-- (void)uploadData:(NSData*)fileData command:(CDVInvokedUrlCommand*)command
-{
- NSURLRequest* req = [self requestForUploadCommand:command fileData:fileData];
-
- if (req == nil) {
- return;
- }
- CDVFileTransferDelegate* delegate = [self delegateForUploadCommand:command];
- delegate.connection = [[NSURLConnection alloc] initWithRequest:req delegate:delegate startImmediately:NO];
- if (self.queue == nil) {
- self.queue = [[NSOperationQueue alloc] init];
- }
- [delegate.connection setDelegateQueue:self.queue];
-
- // sets a background task ID for the transfer object.
- delegate.backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
- [delegate cancelTransfer:delegate.connection];
- }];
-
- @synchronized (activeTransfers) {
- activeTransfers[delegate.objectId] = delegate;
- }
- [delegate.connection start];
-}
-
-- (void)abort:(CDVInvokedUrlCommand*)command
-{
- NSString* objectId = [command argumentAtIndex:0];
-
- @synchronized (activeTransfers) {
- CDVFileTransferDelegate* delegate = activeTransfers[objectId];
- if (delegate != nil) {
- [delegate cancelTransfer:delegate.connection];
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:CONNECTION_ABORTED AndSource:delegate.source AndTarget:delegate.target]];
- [self.commandDelegate sendPluginResult:result callbackId:delegate.callbackId];
- }
- }
-}
-
-- (void)download:(CDVInvokedUrlCommand*)command
-{
- DLog(@"File Transfer downloading file...");
- NSString* source = [command argumentAtIndex:0];
- NSString* target = [command argumentAtIndex:1];
- BOOL trustAllHosts = [[command argumentAtIndex:2 withDefault:[NSNumber numberWithBool:NO]] boolValue]; // allow self-signed certs
- NSString* objectId = [command argumentAtIndex:3];
- NSDictionary* headers = [command argumentAtIndex:4 withDefault:nil];
-
- CDVPluginResult* result = nil;
- CDVFileTransferError errorCode = 0;
-
- NSURL* targetURL;
-
- if ([target hasPrefix:@"/"]) {
- /* Backwards-compatibility:
- * Check here to see if it looks like the user passed in a raw filesystem path. (Perhaps they had the path saved, and were previously using it with the old version of File). If so, normalize it by removing empty path segments, and check with File to see if any of the installed filesystems will handle it. If so, then we will end up with a filesystem url to use for the remainder of this operation.
- */
- target = [target stringByReplacingOccurrencesOfString:@"//" withString:@"/"];
- targetURL = [[self.commandDelegate getCommandInstance:@"File"] fileSystemURLforLocalPath:target].url;
- } else {
- targetURL = [NSURL URLWithString:target];
- }
-
- NSURL* sourceURL = [NSURL URLWithString:source];
-
- if (!sourceURL) {
- errorCode = INVALID_URL_ERR;
- NSLog(@"File Transfer Error: Invalid server URL %@", source);
- } else if (![targetURL isFileURL]) {
- CDVFilesystemURL *fsURL = [CDVFilesystemURL fileSystemURLWithString:target];
- if (!fsURL) {
- errorCode = FILE_NOT_FOUND_ERR;
- NSLog(@"File Transfer Error: Invalid file path or URL %@", target);
- }
- }
-
- if (errorCode > 0) {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:errorCode AndSource:source AndTarget:target]];
- [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
- return;
- }
-
- NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:sourceURL];
- [self applyRequestHeaders:headers toRequest:req];
-
- CDVFileTransferDelegate* delegate = [[CDVFileTransferDelegate alloc] init];
- delegate.command = self;
- delegate.direction = CDV_TRANSFER_DOWNLOAD;
- delegate.callbackId = command.callbackId;
- delegate.objectId = objectId;
- delegate.source = source;
- delegate.target = [targetURL absoluteString];
- delegate.targetURL = targetURL;
- delegate.trustAllHosts = trustAllHosts;
- delegate.filePlugin = [self.commandDelegate getCommandInstance:@"File"];
- delegate.backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
- [delegate cancelTransfer:delegate.connection];
- }];
-
- delegate.connection = [[NSURLConnection alloc] initWithRequest:req delegate:delegate startImmediately:NO];
-
- if (self.queue == nil) {
- self.queue = [[NSOperationQueue alloc] init];
- }
- [delegate.connection setDelegateQueue:self.queue];
-
- @synchronized (activeTransfers) {
- activeTransfers[delegate.objectId] = delegate;
- }
- // Downloads can take time
- // sending this to a new thread calling the download_async method
- dispatch_async(
- dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL),
- ^(void) { [delegate.connection start];}
- );
-}
-
-- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target
-{
- NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:3];
-
- [result setObject:[NSNumber numberWithInt:code] forKey:@"code"];
- if (source != nil) {
- [result setObject:source forKey:@"source"];
- }
- if (target != nil) {
- [result setObject:target forKey:@"target"];
- }
- NSLog(@"FileTransferError %@", result);
-
- return result;
-}
-
-- (NSMutableDictionary*)createFileTransferError:(int)code
- AndSource:(NSString*)source
- AndTarget:(NSString*)target
- AndHttpStatus:(int)httpStatus
- AndBody:(NSString*)body
-{
- NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:5];
-
- [result setObject:[NSNumber numberWithInt:code] forKey:@"code"];
- if (source != nil) {
- [result setObject:source forKey:@"source"];
- }
- if (target != nil) {
- [result setObject:target forKey:@"target"];
- }
- [result setObject:[NSNumber numberWithInt:httpStatus] forKey:@"http_status"];
- if (body != nil) {
- [result setObject:body forKey:@"body"];
- }
- NSLog(@"FileTransferError %@", result);
-
- return result;
-}
-
-- (void)onReset {
- @synchronized (activeTransfers) {
- while ([activeTransfers count] > 0) {
- CDVFileTransferDelegate* delegate = [activeTransfers allValues][0];
- [delegate cancelTransfer:delegate.connection];
- }
- }
-}
-
-@end
-
-@interface CDVFileTransferEntityLengthRequest : NSObject {
- NSURLConnection* _connection;
- CDVFileTransferDelegate* __weak _originalDelegate;
-}
-
-- (CDVFileTransferEntityLengthRequest*)initWithOriginalRequest:(NSURLRequest*)originalRequest andDelegate:(CDVFileTransferDelegate*)originalDelegate;
-
-@end
-
-@implementation CDVFileTransferEntityLengthRequest
-
-- (CDVFileTransferEntityLengthRequest*)initWithOriginalRequest:(NSURLRequest*)originalRequest andDelegate:(CDVFileTransferDelegate*)originalDelegate
-{
- if (self) {
- DLog(@"Requesting entity length for GZIPped content...");
-
- NSMutableURLRequest* req = [originalRequest mutableCopy];
- [req setHTTPMethod:@"HEAD"];
- [req setValue:@"identity" forHTTPHeaderField:@"Accept-Encoding"];
-
- _originalDelegate = originalDelegate;
- _connection = [NSURLConnection connectionWithRequest:req delegate:self];
- }
- return self;
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response
-{
- DLog(@"HEAD request returned; content-length is %lld", [response expectedContentLength]);
- [_originalDelegate updateBytesExpected:[response expectedContentLength]];
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
-{}
-
-- (void)connectionDidFinishLoading:(NSURLConnection*)connection
-{}
-
-@end
-
-@implementation CDVFileTransferDelegate
-
-@synthesize callbackId, connection = _connection, source, target, responseData, responseHeaders, command, bytesTransfered, bytesExpected, direction, responseCode, objectId, targetFileHandle, filePlugin;
-
-- (void)connectionDidFinishLoading:(NSURLConnection*)connection
-{
- NSString* uploadResponse = nil;
- NSString* downloadResponse = nil;
- NSMutableDictionary* uploadResult;
- CDVPluginResult* result = nil;
-
- NSLog(@"File Transfer Finished with response code %d", self.responseCode);
-
- if (self.direction == CDV_TRANSFER_UPLOAD) {
- uploadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
- if (uploadResponse == nil) {
- uploadResponse = [[NSString alloc] initWithData: self.responseData encoding:NSISOLatin1StringEncoding];
- }
-
- if ((self.responseCode >= 200) && (self.responseCode < 300)) {
- // create dictionary to return FileUploadResult object
- uploadResult = [NSMutableDictionary dictionaryWithCapacity:3];
- if (uploadResponse != nil) {
- [uploadResult setObject:uploadResponse forKey:@"response"];
- [uploadResult setObject:self.responseHeaders forKey:@"headers"];
- }
- [uploadResult setObject:[NSNumber numberWithLongLong:self.bytesTransfered] forKey:@"bytesSent"];
- [uploadResult setObject:[NSNumber numberWithInt:self.responseCode] forKey:@"responseCode"];
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:uploadResult];
- } else {
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:uploadResponse]];
- }
- }
- if (self.direction == CDV_TRANSFER_DOWNLOAD) {
- if (self.targetFileHandle) {
- [self.targetFileHandle closeFile];
- self.targetFileHandle = nil;
- DLog(@"File Transfer Download success");
-
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self.filePlugin makeEntryForURL:self.targetURL]];
- } else {
- downloadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
- if (downloadResponse == nil) {
- downloadResponse = [[NSString alloc] initWithData: self.responseData encoding:NSISOLatin1StringEncoding];
- }
-
- CDVFileTransferError errorCode = self.responseCode == 404 ? FILE_NOT_FOUND_ERR
- : (self.responseCode == 304 ? NOT_MODIFIED : CONNECTION_ERR);
- result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:errorCode AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:downloadResponse]];
- }
- }
-
- [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-
- // remove connection for activeTransfers
- @synchronized (command.activeTransfers) {
- [command.activeTransfers removeObjectForKey:objectId];
- // remove background id task in case our upload was done in the background
- [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTaskID];
- self.backgroundTaskID = UIBackgroundTaskInvalid;
- }
-}
-
-- (void)removeTargetFile
-{
- NSFileManager* fileMgr = [NSFileManager defaultManager];
-
- NSString *targetPath = [self targetFilePath];
- if ([fileMgr fileExistsAtPath:targetPath])
- {
- [fileMgr removeItemAtPath:targetPath error:nil];
- }
-}
-
-- (void)cancelTransfer:(NSURLConnection*)connection
-{
- [connection cancel];
- @synchronized (self.command.activeTransfers) {
- CDVFileTransferDelegate* delegate = self.command.activeTransfers[self.objectId];
- [self.command.activeTransfers removeObjectForKey:self.objectId];
- [[UIApplication sharedApplication] endBackgroundTask:delegate.backgroundTaskID];
- delegate.backgroundTaskID = UIBackgroundTaskInvalid;
- }
-
- if (self.direction == CDV_TRANSFER_DOWNLOAD) {
- [self removeTargetFile];
- }
-}
-
-- (void)cancelTransferWithError:(NSURLConnection*)connection errorMessage:(NSString*)errorMessage
-{
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsDictionary:[self.command createFileTransferError:FILE_NOT_FOUND_ERR AndSource:self.source AndTarget:self.target AndHttpStatus:self.responseCode AndBody:errorMessage]];
-
- NSLog(@"File Transfer Error: %@", errorMessage);
- [self cancelTransfer:connection];
- [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-}
-
-- (NSString *)targetFilePath
-{
- NSString *path = nil;
- CDVFilesystemURL *sourceURL = [CDVFilesystemURL fileSystemURLWithString:self.target];
- if (sourceURL && sourceURL.fileSystemName != nil) {
- // This requires talking to the current CDVFile plugin
- NSObject *fs = [self.filePlugin filesystemForURL:sourceURL];
- path = [fs filesystemPathForURL:sourceURL];
- } else {
- // Extract the path part out of a file: URL.
- path = [self.target hasPrefix:@"/"] ? [self.target copy] : [(NSURL *)[NSURL URLWithString:self.target] path];
- }
- return path;
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response
-{
- NSError* __autoreleasing error = nil;
-
- self.mimeType = [response MIMEType];
- self.targetFileHandle = nil;
-
- // required for iOS 4.3, for some reason; response is
- // a plain NSURLResponse, not the HTTP subclass
- if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
- NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response;
-
- self.responseCode = (int)[httpResponse statusCode];
- self.bytesExpected = [response expectedContentLength];
- self.responseHeaders = [httpResponse allHeaderFields];
- if ((self.direction == CDV_TRANSFER_DOWNLOAD) && (self.responseCode == 200) && (self.bytesExpected == NSURLResponseUnknownLength)) {
- // Kick off HEAD request to server to get real length
- // bytesExpected will be updated when that response is returned
- self.entityLengthRequest = [[CDVFileTransferEntityLengthRequest alloc] initWithOriginalRequest:connection.currentRequest andDelegate:self];
- }
- } else if ([response.URL isFileURL]) {
- NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:[response.URL path] error:nil];
- self.responseCode = 200;
- self.bytesExpected = [attr[NSFileSize] longLongValue];
- } else {
- self.responseCode = 200;
- self.bytesExpected = NSURLResponseUnknownLength;
- }
- if ((self.direction == CDV_TRANSFER_DOWNLOAD) && (self.responseCode >= 200) && (self.responseCode < 300)) {
- // Download response is okay; begin streaming output to file
- NSString *filePath = [self targetFilePath];
- if (filePath == nil) {
- // We couldn't find the asset. Send the appropriate error.
- [self cancelTransferWithError:connection errorMessage:[NSString stringWithFormat:@"Could not create target file"]];
- return;
- }
-
- NSString* parentPath = [filePath stringByDeletingLastPathComponent];
-
- // create parent directories if needed
- if ([[NSFileManager defaultManager] createDirectoryAtPath:parentPath withIntermediateDirectories:YES attributes:nil error:&error] == NO) {
- if (error) {
- [self cancelTransferWithError:connection errorMessage:[NSString stringWithFormat:@"Could not create path to save downloaded file: %@", [error localizedDescription]]];
- } else {
- [self cancelTransferWithError:connection errorMessage:@"Could not create path to save downloaded file"];
- }
- return;
- }
- // create target file
- if ([[NSFileManager defaultManager] createFileAtPath:filePath contents:nil attributes:nil] == NO) {
- [self cancelTransferWithError:connection errorMessage:@"Could not create target file"];
- return;
- }
- // open target file for writing
- self.targetFileHandle = [NSFileHandle fileHandleForWritingAtPath:filePath];
- if (self.targetFileHandle == nil) {
- [self cancelTransferWithError:connection errorMessage:@"Could not open target file for writing"];
- }
- DLog(@"Streaming to file %@", filePath);
- }
-}
-
-- (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error
-{
- NSString* body = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:body]];
-
- NSLog(@"File Transfer Error: %@", [error localizedDescription]);
-
- [self cancelTransfer:connection];
- [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
-{
- self.bytesTransfered += data.length;
- if (self.targetFileHandle) {
- [self.targetFileHandle writeData:data];
- } else {
- [self.responseData appendData:data];
- }
- [self updateProgress];
-}
-
-- (void)updateBytesExpected:(long long)newBytesExpected
-{
- DLog(@"Updating bytesExpected to %lld", newBytesExpected);
- self.bytesExpected = newBytesExpected;
- [self updateProgress];
-}
-
-- (void)updateProgress
-{
- if (self.direction == CDV_TRANSFER_DOWNLOAD) {
- BOOL lengthComputable = (self.bytesExpected != NSURLResponseUnknownLength);
- // If the response is GZipped, and we have an outstanding HEAD request to get
- // the length, then hold off on sending progress events.
- if (!lengthComputable && (self.entityLengthRequest != nil)) {
- return;
- }
- NSMutableDictionary* downloadProgress = [NSMutableDictionary dictionaryWithCapacity:3];
- [downloadProgress setObject:[NSNumber numberWithBool:lengthComputable] forKey:@"lengthComputable"];
- [downloadProgress setObject:[NSNumber numberWithLongLong:self.bytesTransfered] forKey:@"loaded"];
- [downloadProgress setObject:[NSNumber numberWithLongLong:self.bytesExpected] forKey:@"total"];
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:downloadProgress];
- [result setKeepCallbackAsBool:true];
- [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
-}
-
-- (void)connection:(NSURLConnection*)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
-{
- if (self.direction == CDV_TRANSFER_UPLOAD) {
- NSMutableDictionary* uploadProgress = [NSMutableDictionary dictionaryWithCapacity:3];
-
- [uploadProgress setObject:[NSNumber numberWithBool:true] forKey:@"lengthComputable"];
- [uploadProgress setObject:[NSNumber numberWithLongLong:totalBytesWritten] forKey:@"loaded"];
- [uploadProgress setObject:[NSNumber numberWithLongLong:totalBytesExpectedToWrite] forKey:@"total"];
- CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:uploadProgress];
- [result setKeepCallbackAsBool:true];
- [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
- }
- self.bytesTransfered = totalBytesWritten;
-}
-
-// for self signed certificates
-- (void)connection:(NSURLConnection*)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge*)challenge
-{
- if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
- if (self.trustAllHosts) {
- NSURLCredential* credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
- [challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
- }
- [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
- } else {
- [challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge];
- }
-}
-
-- (id)init
-{
- if ((self = [super init])) {
- self.responseData = [NSMutableData data];
- self.targetFileHandle = nil;
- }
- return self;
-}
-
-@end
diff --git a/plugins/cordova-plugin-file-transfer/src/ubuntu/file-transfer.cpp b/plugins/cordova-plugin-file-transfer/src/ubuntu/file-transfer.cpp
deleted file mode 100644
index 5b1adea..0000000
--- a/plugins/cordova-plugin-file-transfer/src/ubuntu/file-transfer.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- *
- * Copyright 2013 Canonical Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#include "file-transfer.h"
-#include
-#include
-
-static void SetHeaders(QNetworkRequest &request, const QVariantMap &headers) {
- for (const QString &key: headers.keys()) {
- QVariant val = *headers.find(key);
- QString value = val.toString();
- if (val.userType() == QMetaType::QVariantList || val.userType() == QMetaType::QStringList) {
- QList list = val.toList();
- for (QVariant v: list) {
- if (value.size())
- value += ", ";
- value += v.toString();
- }
- }
- request.setRawHeader(key.toUtf8(), value.toUtf8());
- }
-}
-
-void FileTransfer::download(int scId, int ecId, const QString& url, const QString &target, bool /*trustAllHost*/, int id, const QVariantMap &headers) {
- QSharedPointer request(new FileTransferRequest(_manager, scId, ecId, id, this));
-
- assert(_id2request.find(id) == _id2request.end());
-
- _id2request.insert(id, request);
-
- request->connect(request.data(), &FileTransferRequest::done, [&]() {
- auto it = _id2request.find(id);
- while (it != _id2request.end() && it.key() == id) {
- if (it.value().data() == request.data()) {
- _id2request.erase(it);
- break;
- }
- it++;
- }
- });
- request->download(url, target, headers);
-}
-
-void FileTransfer::upload(int scId, int ecId, const QString &fileURI, const QString& url, const QString& fileKey, const QString& fileName, const QString& mimeType,
- const QVariantMap & params, bool /*trustAllHosts*/, bool /*chunkedMode*/, const QVariantMap &headers, int id, const QString &/*httpMethod*/) {
- QSharedPointer request(new FileTransferRequest(_manager, scId, ecId, id, this));
-
- assert(_id2request.find(id) == _id2request.end());
-
- _id2request.insert(id, request);
-
- request->connect(request.data(), &FileTransferRequest::done, [&]() {
- auto it = _id2request.find(id);
- while (it != _id2request.end() && it.key() == id) {
- if (it.value().data() == request.data()) {
- _id2request.erase(it);
- break;
- }
- it++;
- }
- });
- request->upload(url, fileURI, fileKey, fileName, mimeType, params, headers);
-}
-
-void FileTransfer::abort(int scId, int ecId, int id) {
- Q_UNUSED(scId)
- Q_UNUSED(ecId)
-
- auto it = _id2request.find(id);
- while (it != _id2request.end() && it.key() == id) {
- (*it)->abort();
- it++;
- }
-}
-
-void FileTransferRequest::download(const QString& uri, const QString &targetURI, const QVariantMap &headers) {
- QUrl url(uri);
- QNetworkRequest request;
-
- QSharedPointer filePlugin(_plugin->cordova()->getPlugin());
-
- if (!filePlugin.data())
- return;
-
- if (!url.isValid()) {
- QVariantMap map;
- map.insert("code", INVALID_URL_ERR);
- map.insert("source", uri);
- map.insert("target", targetURI);
- _plugin->cb(_ecId, map);
- emit done();
- return;
- }
-
- request.setUrl(url);
- if (url.password().size() || url.userName().size()) {
- QString headerData = "Basic " + (url.userName() + ":" + url.password()).toLocal8Bit().toBase64();
- request.setRawHeader("Authorization", headerData.toLocal8Bit());
- }
- SetHeaders(request, headers);
- _reply = QSharedPointer(_manager.get(request));
-
- _reply->connect(_reply.data(), &QNetworkReply::finished, [this, targetURI, uri, filePlugin]() {
- if (!_scId || _reply->error() != QNetworkReply::NoError)
- return;
-
- QPair f1(dynamic_cast(filePlugin.data())->resolveURI(targetURI));
-
- QFile res(f1.second.absoluteFilePath());
- if (!f1.first || !res.open(QIODevice::WriteOnly)) {
- QVariantMap map;
- map.insert("code", INVALID_URL_ERR);
- map.insert("source", uri);
- map.insert("target", targetURI);
- _plugin->cb(_ecId, map);
- emit done();
- return;
- }
- res.write(_reply->readAll());
-
- _plugin->cb(_scId, dynamic_cast(filePlugin.data())->file2map(f1.second));
-
- emit done();
- });
- _reply->connect(_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
- _reply->connect(_reply.data(), SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(progress(qint64, qint64)));
-}
-
-void FileTransferRequest::upload(const QString& _url, const QString& fileURI, QString fileKey, QString fileName, QString mimeType, const QVariantMap ¶ms, const QVariantMap &headers) {
- QUrl url(_url);
- QNetworkRequest request;
-
- QSharedPointer filePlugin(_plugin->cordova()->getPlugin