2 Revīzijas

Autors SHA1 Ziņojums Datums
  Manuel a5d9f1bbed Merge branch 'master' of https://git.ccom.uprrp.edu/CCOM4030/kilometro0 5 gadus atpakaļ
  Manuel 43d70cf802 Anadiendo el codigo de contactos aunque no funciona 5 gadus atpakaļ
100 mainītis faili ar 28217 papildinājumiem un 22 dzēšanām
  1. 114
    0
      .vscode/launch.json
  2. Binārs
      km0App/.gradle/5.6.2/executionHistory/executionHistory.bin
  3. Binārs
      km0App/.gradle/5.6.2/executionHistory/executionHistory.lock
  4. Binārs
      km0App/.gradle/5.6.2/fileChanges/last-build.bin
  5. Binārs
      km0App/.gradle/5.6.2/fileHashes/fileHashes.lock
  6. 0
    0
      km0App/.gradle/5.6.2/gc.properties
  7. Binārs
      km0App/.gradle/buildOutputCleanup/buildOutputCleanup.lock
  8. 2
    0
      km0App/.gradle/buildOutputCleanup/cache.properties
  9. 1
    0
      km0App/.vscode/plugins.json
  10. 80
    0
      km0App/.vscode/typings/cordova/cordova.d.ts
  11. 1
    0
      km0App/jsconfig.json
  12. 10
    7
      km0App/node_modules/cordova-android/package.json
  13. 10
    7
      km0App/node_modules/cordova-browser/package.json
  14. 11
    8
      km0App/node_modules/cordova-ios/package.json
  15. 202
    0
      km0App/node_modules/cordova-plugin-android-permissions/LICENSE
  16. 123
    0
      km0App/node_modules/cordova-plugin-android-permissions/README.md
  17. 96
    0
      km0App/node_modules/cordova-plugin-android-permissions/package.json
  18. 46
    0
      km0App/node_modules/cordova-plugin-android-permissions/plugin.xml
  19. 157
    0
      km0App/node_modules/cordova-plugin-android-permissions/src/android/com/android/plugins/Permissions.java
  20. 194
    0
      km0App/node_modules/cordova-plugin-android-permissions/www/permissions-dummy.js
  21. 194
    0
      km0App/node_modules/cordova-plugin-android-permissions/www/permissions.js
  22. 230
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/README.md
  23. 93
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/package.json
  24. 53
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/plugin.xml
  25. 213
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/src/android/ContactsManager.java
  26. 48
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/src/ios/CDVContactsPhoneNumbers.h
  27. 172
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/src/ios/CDVContactsPhoneNumbers.m
  28. 55
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/www/ContactsPhoneNumbers.d.ts
  29. 42
    0
      km0App/node_modules/cordova-plugin-contacts-phonenumbers/www/contactsPhoneNumbers.js
  30. 28
    0
      km0App/node_modules/cordova-plugin-contacts/.appveyor.yml
  31. 22
    0
      km0App/node_modules/cordova-plugin-contacts/.github/PULL_REQUEST_TEMPLATE.md
  32. 24
    0
      km0App/node_modules/cordova-plugin-contacts/.jshintrc
  33. 67
    0
      km0App/node_modules/cordova-plugin-contacts/.travis.yml
  34. 37
    0
      km0App/node_modules/cordova-plugin-contacts/CONTRIBUTING.md
  35. 202
    0
      km0App/node_modules/cordova-plugin-contacts/LICENSE
  36. 6
    0
      km0App/node_modules/cordova-plugin-contacts/NOTICE
  37. 907
    0
      km0App/node_modules/cordova-plugin-contacts/README.md
  38. 283
    0
      km0App/node_modules/cordova-plugin-contacts/RELEASENOTES.md
  39. 422
    0
      km0App/node_modules/cordova-plugin-contacts/appium-tests/common/common.spec.js
  40. 41
    0
      km0App/node_modules/cordova-plugin-contacts/appium-tests/helpers/contactsHelper.js
  41. 735
    0
      km0App/node_modules/cordova-plugin-contacts/doc/de/README.md
  42. 719
    0
      km0App/node_modules/cordova-plugin-contacts/doc/de/index.md
  43. 732
    0
      km0App/node_modules/cordova-plugin-contacts/doc/es/README.md
  44. 652
    0
      km0App/node_modules/cordova-plugin-contacts/doc/es/index.md
  45. 668
    0
      km0App/node_modules/cordova-plugin-contacts/doc/fr/README.md
  46. 652
    0
      km0App/node_modules/cordova-plugin-contacts/doc/fr/index.md
  47. 735
    0
      km0App/node_modules/cordova-plugin-contacts/doc/it/README.md
  48. 719
    0
      km0App/node_modules/cordova-plugin-contacts/doc/it/index.md
  49. 735
    0
      km0App/node_modules/cordova-plugin-contacts/doc/ja/README.md
  50. 719
    0
      km0App/node_modules/cordova-plugin-contacts/doc/ja/index.md
  51. 735
    0
      km0App/node_modules/cordova-plugin-contacts/doc/ko/README.md
  52. 719
    0
      km0App/node_modules/cordova-plugin-contacts/doc/ko/index.md
  53. 735
    0
      km0App/node_modules/cordova-plugin-contacts/doc/pl/README.md
  54. 719
    0
      km0App/node_modules/cordova-plugin-contacts/doc/pl/index.md
  55. 709
    0
      km0App/node_modules/cordova-plugin-contacts/doc/ru/index.md
  56. 735
    0
      km0App/node_modules/cordova-plugin-contacts/doc/zh/README.md
  57. 719
    0
      km0App/node_modules/cordova-plugin-contacts/doc/zh/index.md
  58. 141
    0
      km0App/node_modules/cordova-plugin-contacts/package.json
  59. 237
    0
      km0App/node_modules/cordova-plugin-contacts/plugin.xml
  60. 194
    0
      km0App/node_modules/cordova-plugin-contacts/src/android/ContactAccessor.java
  61. 2388
    0
      km0App/node_modules/cordova-plugin-contacts/src/android/ContactAccessorSdk5.java
  62. 59
    0
      km0App/node_modules/cordova-plugin-contacts/src/android/ContactInfoDTO.java
  63. 307
    0
      km0App/node_modules/cordova-plugin-contacts/src/android/ContactManager.java
  64. 31
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactActivity.js
  65. 35
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactAddress.js
  66. 35
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactError.js
  67. 32
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactField.js
  68. 55
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactFindOptions.js
  69. 44
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactName.js
  70. 31
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactNews.js
  71. 27
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactOrganization.js
  72. 28
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactPhoto.js
  73. 225
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/contactConsts.js
  74. 230
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/contactUtils.js
  75. 357
    0
      km0App/node_modules/cordova-plugin-contacts/src/blackberry10/index.js
  76. 33
    0
      km0App/node_modules/cordova-plugin-contacts/src/browser/ContactsProxy.js
  77. 467
    0
      km0App/node_modules/cordova-plugin-contacts/src/firefoxos/ContactsProxy.js
  78. 148
    0
      km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContact.h
  79. 1764
    0
      km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContact.m
  80. 160
    0
      km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContacts.h
  81. 613
    0
      km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContacts.m
  82. 576
    0
      km0App/node_modules/cordova-plugin-contacts/src/ubuntu/contacts.cpp
  83. 70
    0
      km0App/node_modules/cordova-plugin-contacts/src/ubuntu/contacts.h
  84. 430
    0
      km0App/node_modules/cordova-plugin-contacts/src/windows/ContactProxy.js
  85. 130
    0
      km0App/node_modules/cordova-plugin-contacts/src/windows8/ContactProxy.js
  86. 73
    0
      km0App/node_modules/cordova-plugin-contacts/src/wp/ContactPicker.xaml
  87. 125
    0
      km0App/node_modules/cordova-plugin-contacts/src/wp/ContactPicker.xaml.cs
  88. 122
    0
      km0App/node_modules/cordova-plugin-contacts/src/wp/ContactPickerTask.cs
  89. 592
    0
      km0App/node_modules/cordova-plugin-contacts/src/wp/Contacts.cs
  90. 335
    0
      km0App/node_modules/cordova-plugin-contacts/src/wp/ContactsHelper.cs
  91. 14
    0
      km0App/node_modules/cordova-plugin-contacts/tests/package.json
  92. 31
    0
      km0App/node_modules/cordova-plugin-contacts/tests/plugin.xml
  93. 1097
    0
      km0App/node_modules/cordova-plugin-contacts/tests/tests.js
  94. 337
    0
      km0App/node_modules/cordova-plugin-contacts/types/index.d.ts
  95. 140
    0
      km0App/node_modules/cordova-plugin-contacts/www/Contact.js
  96. 46
    0
      km0App/node_modules/cordova-plugin-contacts/www/ContactAddress.js
  97. 43
    0
      km0App/node_modules/cordova-plugin-contacts/www/ContactError.js
  98. 37
    0
      km0App/node_modules/cordova-plugin-contacts/www/ContactField.js
  99. 55
    0
      km0App/node_modules/cordova-plugin-contacts/www/ContactFieldType.js
  100. 0
    0
      km0App/node_modules/cordova-plugin-contacts/www/ContactFindOptions.js

+ 114
- 0
.vscode/launch.json Parādīt failu

@@ -0,0 +1,114 @@
1
+{
2
+    // Use IntelliSense to learn about possible attributes.
3
+    // Hover to view descriptions of existing attributes.
4
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+    "version": "0.2.0",
6
+    "configurations": [
7
+        {
8
+            "name": "Run Android on device",
9
+            "type": "cordova",
10
+            "request": "launch",
11
+            "platform": "android",
12
+            "target": "device",
13
+            "port": 9222,
14
+            "sourceMaps": true,
15
+            "cwd": "${workspaceFolder}",
16
+            "ionicLiveReload": false
17
+        },
18
+        {
19
+            "name": "Run iOS on device",
20
+            "type": "cordova",
21
+            "request": "launch",
22
+            "platform": "ios",
23
+            "target": "device",
24
+            "port": 9220,
25
+            "sourceMaps": true,
26
+            "cwd": "${workspaceFolder}",
27
+            "ionicLiveReload": false
28
+        },
29
+        {
30
+            "name": "Attach to running android on device",
31
+            "type": "cordova",
32
+            "request": "attach",
33
+            "platform": "android",
34
+            "target": "device",
35
+            "port": 9222,
36
+            "sourceMaps": true,
37
+            "cwd": "${workspaceFolder}"
38
+        },
39
+        {
40
+            "name": "Attach to running iOS on device",
41
+            "type": "cordova",
42
+            "request": "attach",
43
+            "platform": "ios",
44
+            "target": "device",
45
+            "port": 9220,
46
+            "sourceMaps": true,
47
+            "cwd": "${workspaceFolder}"
48
+        },
49
+        {
50
+            "name": "Run Android on emulator",
51
+            "type": "cordova",
52
+            "request": "launch",
53
+            "platform": "android",
54
+            "target": "emulator",
55
+            "port": 9222,
56
+            "sourceMaps": true,
57
+            "cwd": "${workspaceFolder}",
58
+            "ionicLiveReload": false
59
+        },
60
+        {
61
+            "name": "Attach to running android on emulator",
62
+            "type": "cordova",
63
+            "request": "attach",
64
+            "platform": "android",
65
+            "target": "emulator",
66
+            "port": 9222,
67
+            "sourceMaps": true,
68
+            "cwd": "${workspaceFolder}"
69
+        },
70
+        {
71
+            "name": "Serve to the browser (ionic serve)",
72
+            "type": "cordova",
73
+            "request": "launch",
74
+            "platform": "serve",
75
+            "cwd": "${workspaceFolder}",
76
+            "devServerAddress": "localhost",
77
+            "sourceMaps": true,
78
+            "ionicLiveReload": true
79
+        },
80
+        {
81
+            "name": "Simulate Android in browser",
82
+            "type": "cordova",
83
+            "request": "launch",
84
+            "platform": "android",
85
+            "target": "chrome",
86
+            "simulatePort": 8000,
87
+            "livereload": true,
88
+            "sourceMaps": true,
89
+            "cwd": "${workspaceFolder}"
90
+        },
91
+        {
92
+            "name": "Simulate iOS in browser",
93
+            "type": "cordova",
94
+            "request": "launch",
95
+            "platform": "ios",
96
+            "target": "chrome",
97
+            "simulatePort": 8000,
98
+            "livereload": true,
99
+            "sourceMaps": true,
100
+            "cwd": "${workspaceFolder}"
101
+        },
102
+        {
103
+            "name": "Run Browser",
104
+            "type": "cordova",
105
+            "request": "launch",
106
+            "platform": "browser",
107
+            "target": "chrome",
108
+            "simulatePort": 8000,
109
+            "livereload": true,
110
+            "sourceMaps": true,
111
+            "cwd": "${workspaceFolder}"
112
+        }
113
+    ]
114
+}

Binārs
km0App/.gradle/5.6.2/executionHistory/executionHistory.bin Parādīt failu


Binārs
km0App/.gradle/5.6.2/executionHistory/executionHistory.lock Parādīt failu


Binārs
km0App/.gradle/5.6.2/fileChanges/last-build.bin Parādīt failu


Binārs
km0App/.gradle/5.6.2/fileHashes/fileHashes.lock Parādīt failu


+ 0
- 0
km0App/.gradle/5.6.2/gc.properties Parādīt failu


Binārs
km0App/.gradle/buildOutputCleanup/buildOutputCleanup.lock Parādīt failu


+ 2
- 0
km0App/.gradle/buildOutputCleanup/cache.properties Parādīt failu

@@ -0,0 +1,2 @@
1
+#Thu Oct 24 08:46:16 AST 2019
2
+gradle.version=5.6.2

+ 1
- 0
km0App/.vscode/plugins.json Parādīt failu

@@ -0,0 +1 @@
1
+{"plugins":["cordova-plugin-whitelist","cordova-plugin-contacts"]}

+ 80
- 0
km0App/.vscode/typings/cordova/cordova.d.ts Parādīt failu

@@ -0,0 +1,80 @@
1
+// Type definitions for Apache Cordova
2
+// Project: http://cordova.apache.org
3
+// Definitions by: Microsoft Open Technologies Inc. <http://msopentech.com>
4
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
5
+//
6
+// Copyright (c) Microsoft Open Technologies, Inc.
7
+// Licensed under the MIT license.
8
+
9
+interface Cordova {
10
+    /** Invokes native functionality by specifying corresponding service name, action and optional parameters.
11
+     * @param success A success callback function.
12
+     * @param fail An error callback function.
13
+     * @param service The service name to call on the native side (corresponds to a native class).
14
+     * @param action The action name to call on the native side (generally corresponds to the native class method).
15
+     * @param args An array of arguments to pass into the native environment.
16
+     */
17
+    exec(success: () => any, fail: () => any, service: string, action: string, args?: string[]): void;
18
+    /** Gets the operating system name. */
19
+    platformId: string;
20
+    /** Gets Cordova framework version */
21
+    version: string;
22
+    /** Defines custom logic as a Cordova module. Other modules can later access it using module name provided. */
23
+    define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void;
24
+    /** Access a Cordova module by name. */
25
+    require(moduleName: string): any;
26
+    /** Namespace for Cordova plugin functionality */
27
+    plugins:CordovaPlugins;
28
+}
29
+
30
+interface CordovaPlugins {}
31
+
32
+interface Document {
33
+    addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void;
34
+    addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
35
+    addEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void;
36
+    addEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
37
+    addEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void;
38
+    addEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
39
+    addEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
40
+    addEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
41
+    addEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
42
+    addEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
43
+
44
+    removeEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void;
45
+    removeEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
46
+    removeEventListener(type: "resume", listener: (ev: Event) => any, useCapture?: boolean): void;
47
+    removeEventListener(type: "backbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
48
+    removeEventListener(type: "menubutton", listener: (ev: Event) => any, useCapture?: boolean): void;
49
+    removeEventListener(type: "searchbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
50
+    removeEventListener(type: "startcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
51
+    removeEventListener(type: "endcallbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
52
+    removeEventListener(type: "volumedownbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
53
+    removeEventListener(type: "volumeupbutton", listener: (ev: Event) => any, useCapture?: boolean): void;
54
+
55
+    addEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void;
56
+    removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void;
57
+}
58
+
59
+interface Window {
60
+  cordova:Cordova;
61
+}
62
+
63
+// cordova/argscheck module
64
+interface ArgsCheck {
65
+    checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void;
66
+    getValue(value?: any, defaultValue?: any): any;
67
+    enableChecks: boolean;
68
+}
69
+
70
+// cordova/urlutil module
71
+interface UrlUtil {
72
+    makeAbsolute(url: string): string
73
+}
74
+
75
+/** Apache Cordova instance */
76
+declare var cordova: Cordova;
77
+
78
+declare module 'cordova' {
79
+    export = cordova;
80
+}

+ 1
- 0
km0App/jsconfig.json Parādīt failu

@@ -0,0 +1 @@
1
+{}

+ 10
- 7
km0App/node_modules/cordova-android/package.json Parādīt failu

@@ -6,14 +6,14 @@
6 6
   "_location": "/cordova-android",
7 7
   "_phantomChildren": {},
8 8
   "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "cordova-android@^8.0.0",
12
-    "name": "cordova-android",
13 9
     "escapedName": "cordova-android",
10
+    "fetchSpec": "^8.0.0",
11
+    "name": "cordova-android",
12
+    "raw": "cordova-android@^8.0.0",
14 13
     "rawSpec": "^8.0.0",
14
+    "registry": true,
15 15
     "saveSpec": null,
16
-    "fetchSpec": "^8.0.0"
16
+    "type": "range"
17 17
   },
18 18
   "_requiredBy": [
19 19
     "#USER",
@@ -64,8 +64,8 @@
64 64
   "homepage": "https://github.com/apache/cordova-android#readme",
65 65
   "keywords": [
66 66
     "android",
67
-    "cordova",
68
-    "apache"
67
+    "apache",
68
+    "cordova"
69 69
   ],
70 70
   "license": "Apache-2.0",
71 71
   "main": "bin/templates/cordova/Api.js",
@@ -80,6 +80,9 @@
80 80
       "text"
81 81
     ]
82 82
   },
83
+  "optionalDependencies": {},
84
+  "readme": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#  KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n-->\n\n[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-android?branch=master)](https://ci.appveyor.com/project/Humbedooh/cordova-android)\n[![Build Status](https://travis-ci.org/apache/cordova-android.svg?branch=master)](https://travis-ci.org/apache/cordova-android)\n[![codecov.io](https://codecov.io/github/apache/cordova-android/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-android?branch=master)\n\n# Cordova Android\n\nCordova Android is an Android application library that allows for Cordova-based\nprojects to be built for the Android Platform. Cordova based applications are,\nat the core, applications written with web technology: HTML, CSS and JavaScript.\n\n[Apache Cordova](https://cordova.apache.org) is a project of The Apache Software Foundation (ASF).\n\n## Requires\n\n- Java JDK 1.8 or greater\n- Android SDK [http://developer.android.com](http://developer.android.com)\n\n\n## Cordova Android Developer Tools\n\nWe recommend using the [Cordova command-line tool](https://www.npmjs.com/package/cordova) to create projects and be able to easily install plugins.\n\nHowever, the following scripts can be used instead:\n\n    ./bin/create [path package activity] ... creates the ./example app or a cordova android project\n    ./bin/check_reqs ....................... checks that your environment is set up for cordova-android development\n    ./bin/update [path] .................... updates an existing cordova-android project to the version of the framework\n\nThese commands live in a generated Cordova Android project. Any interactions with the emulator require you to have an AVD defined.\n\n    ./cordova/clean ........................ cleans the project\n    ./cordova/build ........................ calls `clean` then compiles the project\n    ./cordova/log   ........................ streams device or emulator logs to STDOUT\n    ./cordova/run   ........................ calls `build` then deploys to a connected Android device. If no Android device is detected, will launch an emulator and deploy to it.\n    ./cordova/version ...................... returns the cordova-android version of the current project\n\n## Using Android Studio\n\n1. Create a project\n2. Import it via \"Non-Android Studio Project\"\n\n## Running the Native Tests\n\nThe `test/` directory in this project contains an Android test project that can\nbe used to run different kinds of native tests. Check out the\n[README contained therein](test/README.md) for more details!\n",
85
+  "readmeFilename": "README.md",
83 86
   "repository": {
84 87
     "type": "git",
85 88
     "url": "git+https://github.com/apache/cordova-android.git"

+ 10
- 7
km0App/node_modules/cordova-browser/package.json Parādīt failu

@@ -6,14 +6,14 @@
6 6
   "_location": "/cordova-browser",
7 7
   "_phantomChildren": {},
8 8
   "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "cordova-browser@^6.0.0",
12
-    "name": "cordova-browser",
13 9
     "escapedName": "cordova-browser",
10
+    "fetchSpec": "^6.0.0",
11
+    "name": "cordova-browser",
12
+    "raw": "cordova-browser@^6.0.0",
14 13
     "rawSpec": "^6.0.0",
14
+    "registry": true,
15 15
     "saveSpec": null,
16
-    "fetchSpec": "^6.0.0"
16
+    "type": "range"
17 17
   },
18 18
   "_requiredBy": [
19 19
     "#USER",
@@ -73,9 +73,9 @@
73 73
   },
74 74
   "homepage": "https://github.com/apache/cordova-browser#readme",
75 75
   "keywords": [
76
-    "cordova",
76
+    "apache",
77 77
     "browser",
78
-    "apache"
78
+    "cordova"
79 79
   ],
80 80
   "license": "Apache-2.0",
81 81
   "main": "bin/template/cordova/Api.js",
@@ -90,6 +90,9 @@
90 90
       "text"
91 91
     ]
92 92
   },
93
+  "optionalDependencies": {},
94
+  "readme": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#  KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n-->\n\n[![Build status](https://travis-ci.org/apache/cordova-browser.svg?branch=master )](https://travis-ci.org/apache/cordova-browser.svg?branch=master )\n[![Build Status](https://ci.appveyor.com/api/projects/status/4oan2jjn7nlgfay3/branch/master?svg=true)](https://ci.appveyor.com/api/projects/status/4oan2jjn7nlgfay3/branch/master?svg=true)\n\n# Cordova Browser\n\nTarget modern web browsers to build Apache Cordova based applications.\n\n# Goals\n\n- Browser targeted deployment\n- Surfacing native platform incompatibilities from the open web platform\n\n# PWA support\n\n## cordova-browser now includes support for progressive web apps (PWAs)\n\n- if your project supplies a `manifest.json` in the `www/` dir, it will be used\n    - a `manifest.json` will be generated otherwise\n- if your js code registers a service worker, it will also be used\n\n\n",
95
+  "readmeFilename": "README.md",
93 96
   "repository": {
94 97
     "type": "git",
95 98
     "url": "git+https://github.com/apache/cordova-browser.git"

+ 11
- 8
km0App/node_modules/cordova-ios/package.json Parādīt failu

@@ -6,14 +6,14 @@
6 6
   "_location": "/cordova-ios",
7 7
   "_phantomChildren": {},
8 8
   "_requested": {
9
-    "type": "range",
10
-    "registry": true,
11
-    "raw": "cordova-ios@^5.0.0",
12
-    "name": "cordova-ios",
13 9
     "escapedName": "cordova-ios",
10
+    "fetchSpec": "^5.0.0",
11
+    "name": "cordova-ios",
12
+    "raw": "cordova-ios@^5.0.0",
14 13
     "rawSpec": "^5.0.0",
14
+    "registry": true,
15 15
     "saveSpec": null,
16
-    "fetchSpec": "^5.0.0"
16
+    "type": "range"
17 17
   },
18 18
   "_requiredBy": [
19 19
     "#USER",
@@ -61,11 +61,11 @@
61 61
   },
62 62
   "homepage": "https://github.com/apache/cordova-ios#readme",
63 63
   "keywords": [
64
-    "ios",
65
-    "cordova",
66 64
     "apache",
65
+    "cordova",
66
+    "cordova:platform",
67 67
     "ecosystem:cordova",
68
-    "cordova:platform"
68
+    "ios"
69 69
   ],
70 70
   "license": "Apache-2.0",
71 71
   "main": "bin/templates/scripts/cordova/Api.js",
@@ -79,6 +79,9 @@
79 79
       "text"
80 80
     ]
81 81
   },
82
+  "optionalDependencies": {},
83
+  "readme": "<!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#  KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n-->\n\n[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-ios?branch=master)](https://ci.appveyor.com/project/Humbedooh/cordova-ios)\n[![Build Status](https://travis-ci.org/apache/cordova-ios.svg?branch=master)](https://travis-ci.org/apache/cordova-ios)\n[![codecov.io](https://codecov.io/github/apache/cordova-ios/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-ios?branch=master)\n\nCordova iOS\n=============================================================\nCordova iOS is an iOS application library that allows for Cordova-based projects to be built for the iOS Platform. Cordova based applications are, at the core, applications written with web technology: HTML, CSS and JavaScript.\n\n<a href=\"http://cordova.apache.org\">Apache Cordova</a> is a project of <a href=\"http://apache.org\">The Apache Software Foundation (ASF)</a>.\n\nRequires:\n\n* Xcode 9.x (deprecated), 10, or greater. Download it at [http://developer.apple.com/downloads](http://developer.apple.com/downloads) or the [Mac App Store](http://itunes.apple.com/us/app/xcode/id497799835?mt=12).\n* [node.js](https://nodejs.org)\n\nCreate a Cordova project\n-------------------------------------------------------------\n\nFollow the instructions in the [**Command-Line Usage** section](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface) of [http://docs.cordova.io](http://docs.cordova.io)\n\nTo use a **shared CordovaLib**, for example in development, link the appropriate cordova-ios platform folder path:\n\n    cordova platform add --link /path/to/cordova-ios\n\nUpdating a Cordova project\n-------------------------------------------------------------\n\nWhen you install a new cordova-cli version that comes with a new iOS platform version, from within your project:\n\n    cordova platform rm ios\n    cordova platform add ios\n\nTests\n--------------------------------------------------------------------\n\n1. Run `npm install`\n2. Run `npm test`\n\nFuther reading\n-----\n* [http://cordova.apache.org/](http://cordova.apache.org/)\n* [http://wiki.apache.org/cordova/](http://wiki.apache.org/cordova/)\n",
84
+  "readmeFilename": "README.md",
82 85
   "repository": {
83 86
     "type": "git",
84 87
     "url": "git+https://github.com/apache/cordova-ios.git"

+ 202
- 0
km0App/node_modules/cordova-plugin-android-permissions/LICENSE Parādīt failu

@@ -0,0 +1,202 @@
1
+                                 Apache License
2
+                           Version 2.0, January 2004
3
+                        http://www.apache.org/licenses/
4
+
5
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+   1. Definitions.
8
+
9
+      "License" shall mean the terms and conditions for use, reproduction,
10
+      and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+      "Licensor" shall mean the copyright owner or entity authorized by
13
+      the copyright owner that is granting the License.
14
+
15
+      "Legal Entity" shall mean the union of the acting entity and all
16
+      other entities that control, are controlled by, or are under common
17
+      control with that entity. For the purposes of this definition,
18
+      "control" means (i) the power, direct or indirect, to cause the
19
+      direction or management of such entity, whether by contract or
20
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+      outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+      "You" (or "Your") shall mean an individual or Legal Entity
24
+      exercising permissions granted by this License.
25
+
26
+      "Source" form shall mean the preferred form for making modifications,
27
+      including but not limited to software source code, documentation
28
+      source, and configuration files.
29
+
30
+      "Object" form shall mean any form resulting from mechanical
31
+      transformation or translation of a Source form, including but
32
+      not limited to compiled object code, generated documentation,
33
+      and conversions to other media types.
34
+
35
+      "Work" shall mean the work of authorship, whether in Source or
36
+      Object form, made available under the License, as indicated by a
37
+      copyright notice that is included in or attached to the work
38
+      (an example is provided in the Appendix below).
39
+
40
+      "Derivative Works" shall mean any work, whether in Source or Object
41
+      form, that is based on (or derived from) the Work and for which the
42
+      editorial revisions, annotations, elaborations, or other modifications
43
+      represent, as a whole, an original work of authorship. For the purposes
44
+      of this License, Derivative Works shall not include works that remain
45
+      separable from, or merely link (or bind by name) to the interfaces of,
46
+      the Work and Derivative Works thereof.
47
+
48
+      "Contribution" shall mean any work of authorship, including
49
+      the original version of the Work and any modifications or additions
50
+      to that Work or Derivative Works thereof, that is intentionally
51
+      submitted to Licensor for inclusion in the Work by the copyright owner
52
+      or by an individual or Legal Entity authorized to submit on behalf of
53
+      the copyright owner. For the purposes of this definition, "submitted"
54
+      means any form of electronic, verbal, or written communication sent
55
+      to the Licensor or its representatives, including but not limited to
56
+      communication on electronic mailing lists, source code control systems,
57
+      and issue tracking systems that are managed by, or on behalf of, the
58
+      Licensor for the purpose of discussing and improving the Work, but
59
+      excluding communication that is conspicuously marked or otherwise
60
+      designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+      "Contributor" shall mean Licensor and any individual or Legal Entity
63
+      on behalf of whom a Contribution has been received by Licensor and
64
+      subsequently incorporated within the Work.
65
+
66
+   2. Grant of Copyright License. Subject to the terms and conditions of
67
+      this License, each Contributor hereby grants to You a perpetual,
68
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+      copyright license to reproduce, prepare Derivative Works of,
70
+      publicly display, publicly perform, sublicense, and distribute the
71
+      Work and such Derivative Works in Source or Object form.
72
+
73
+   3. Grant of Patent License. Subject to the terms and conditions of
74
+      this License, each Contributor hereby grants to You a perpetual,
75
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+      (except as stated in this section) patent license to make, have made,
77
+      use, offer to sell, sell, import, and otherwise transfer the Work,
78
+      where such license applies only to those patent claims licensable
79
+      by such Contributor that are necessarily infringed by their
80
+      Contribution(s) alone or by combination of their Contribution(s)
81
+      with the Work to which such Contribution(s) was submitted. If You
82
+      institute patent litigation against any entity (including a
83
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+      or a Contribution incorporated within the Work constitutes direct
85
+      or contributory patent infringement, then any patent licenses
86
+      granted to You under this License for that Work shall terminate
87
+      as of the date such litigation is filed.
88
+
89
+   4. Redistribution. You may reproduce and distribute copies of the
90
+      Work or Derivative Works thereof in any medium, with or without
91
+      modifications, and in Source or Object form, provided that You
92
+      meet the following conditions:
93
+
94
+      (a) You must give any other recipients of the Work or
95
+          Derivative Works a copy of this License; and
96
+
97
+      (b) You must cause any modified files to carry prominent notices
98
+          stating that You changed the files; and
99
+
100
+      (c) You must retain, in the Source form of any Derivative Works
101
+          that You distribute, all copyright, patent, trademark, and
102
+          attribution notices from the Source form of the Work,
103
+          excluding those notices that do not pertain to any part of
104
+          the Derivative Works; and
105
+
106
+      (d) If the Work includes a "NOTICE" text file as part of its
107
+          distribution, then any Derivative Works that You distribute must
108
+          include a readable copy of the attribution notices contained
109
+          within such NOTICE file, excluding those notices that do not
110
+          pertain to any part of the Derivative Works, in at least one
111
+          of the following places: within a NOTICE text file distributed
112
+          as part of the Derivative Works; within the Source form or
113
+          documentation, if provided along with the Derivative Works; or,
114
+          within a display generated by the Derivative Works, if and
115
+          wherever such third-party notices normally appear. The contents
116
+          of the NOTICE file are for informational purposes only and
117
+          do not modify the License. You may add Your own attribution
118
+          notices within Derivative Works that You distribute, alongside
119
+          or as an addendum to the NOTICE text from the Work, provided
120
+          that such additional attribution notices cannot be construed
121
+          as modifying the License.
122
+
123
+      You may add Your own copyright statement to Your modifications and
124
+      may provide additional or different license terms and conditions
125
+      for use, reproduction, or distribution of Your modifications, or
126
+      for any such Derivative Works as a whole, provided Your use,
127
+      reproduction, and distribution of the Work otherwise complies with
128
+      the conditions stated in this License.
129
+
130
+   5. Submission of Contributions. Unless You explicitly state otherwise,
131
+      any Contribution intentionally submitted for inclusion in the Work
132
+      by You to the Licensor shall be under the terms and conditions of
133
+      this License, without any additional terms or conditions.
134
+      Notwithstanding the above, nothing herein shall supersede or modify
135
+      the terms of any separate license agreement you may have executed
136
+      with Licensor regarding such Contributions.
137
+
138
+   6. Trademarks. This License does not grant permission to use the trade
139
+      names, trademarks, service marks, or product names of the Licensor,
140
+      except as required for reasonable and customary use in describing the
141
+      origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+   7. Disclaimer of Warranty. Unless required by applicable law or
144
+      agreed to in writing, Licensor provides the Work (and each
145
+      Contributor provides its Contributions) on an "AS IS" BASIS,
146
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+      implied, including, without limitation, any warranties or conditions
148
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+      PARTICULAR PURPOSE. You are solely responsible for determining the
150
+      appropriateness of using or redistributing the Work and assume any
151
+      risks associated with Your exercise of permissions under this License.
152
+
153
+   8. Limitation of Liability. In no event and under no legal theory,
154
+      whether in tort (including negligence), contract, or otherwise,
155
+      unless required by applicable law (such as deliberate and grossly
156
+      negligent acts) or agreed to in writing, shall any Contributor be
157
+      liable to You for damages, including any direct, indirect, special,
158
+      incidental, or consequential damages of any character arising as a
159
+      result of this License or out of the use or inability to use the
160
+      Work (including but not limited to damages for loss of goodwill,
161
+      work stoppage, computer failure or malfunction, or any and all
162
+      other commercial damages or losses), even if such Contributor
163
+      has been advised of the possibility of such damages.
164
+
165
+   9. Accepting Warranty or Additional Liability. While redistributing
166
+      the Work or Derivative Works thereof, You may choose to offer,
167
+      and charge a fee for, acceptance of support, warranty, indemnity,
168
+      or other liability obligations and/or rights consistent with this
169
+      License. However, in accepting such obligations, You may act only
170
+      on Your own behalf and on Your sole responsibility, not on behalf
171
+      of any other Contributor, and only if You agree to indemnify,
172
+      defend, and hold each Contributor harmless for any liability
173
+      incurred by, or claims asserted against, such Contributor by reason
174
+      of your accepting any such warranty or additional liability.
175
+
176
+   END OF TERMS AND CONDITIONS
177
+
178
+   APPENDIX: How to apply the Apache License to your work.
179
+
180
+      To apply the Apache License to your work, attach the following
181
+      boilerplate notice, with the fields enclosed by brackets "{}"
182
+      replaced with your own identifying information. (Don't include
183
+      the brackets!)  The text should be enclosed in the appropriate
184
+      comment syntax for the file format. We also recommend that a
185
+      file or class name and description of purpose be included on the
186
+      same "printed page" as the copyright notice for easier
187
+      identification within third-party archives.
188
+
189
+   Copyright {yyyy} {name of copyright owner}
190
+
191
+   Licensed under the Apache License, Version 2.0 (the "License");
192
+   you may not use this file except in compliance with the License.
193
+   You may obtain a copy of the License at
194
+
195
+       http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+   Unless required by applicable law or agreed to in writing, software
198
+   distributed under the License is distributed on an "AS IS" BASIS,
199
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+   See the License for the specific language governing permissions and
201
+   limitations under the License.
202
+

+ 123
- 0
km0App/node_modules/cordova-plugin-android-permissions/README.md Parādīt failu

@@ -0,0 +1,123 @@
1
+Android permission Cordova plugin
2
+========
3
+
4
+This plugin is designed for supporting Android new permissions checking mechanism.
5
+
6
+Since Android 6.0, the Android permissions checking mechanism has been changed. In the past, the permissions were granted by users when they decide to install the app. Now, the permissions should be granted by a user when he/she is using the app.
7
+
8
+For old Android plugins you (developers) are using may not support this new mechanism or already stop updating. So either to find a new plugin to solving this problem, nor trying to add the mechanism in the old plugin. If you don't want to do those, you can try this plugin.
9
+
10
+As a convenience we support browser and iOS platforms as well. But this plugin will simple reply that any permission checked of requested was granted.
11
+
12
+Installation
13
+--------
14
+
15
+```bash
16
+cordova plugin add cordova-plugin-android-permissions
17
+```
18
+
19
+※ Support Android SDK >= 14
20
+
21
+Usage
22
+--------
23
+
24
+### API
25
+
26
+```javascript
27
+var permissions = cordova.plugins.permissions;
28
+permissions.checkPermission(permission, successCallback, errorCallback);
29
+permissions.requestPermission(permission, successCallback, errorCallback);
30
+permissions.requestPermissions(permissions, successCallback, errorCallback);
31
+```
32
+
33
+#### Deprecated API - still work now, will not support in the future.
34
+```javascript
35
+permissions.hasPermission(permission, successCallback, errorCallback);
36
+permissions.hasPermission(successCallback, errorCallback, permission);
37
+permissions.requestPermission(successCallback, errorCallback, permission);
38
+```
39
+
40
+### Permission Name
41
+
42
+Following the Android design. See [Manifest.permission](http://developer.android.com/intl/zh-tw/reference/android/Manifest.permission.html).
43
+```javascript
44
+// Example
45
+permissions.ACCESS_COARSE_LOCATION
46
+permissions.CAMERA
47
+permissions.GET_ACCOUNTS
48
+permissions.READ_CONTACTS
49
+permissions.READ_CALENDAR
50
+...
51
+```
52
+
53
+## Examples
54
+```js
55
+var permissions = cordova.plugins.permissions;
56
+```
57
+
58
+#### Quick check
59
+```js
60
+
61
+permissions.hasPermission(permissions.CAMERA, function( status ){
62
+  if ( status.hasPermission ) {
63
+    console.log("Yes :D ");
64
+  }
65
+  else {
66
+    console.warn("No :( ");
67
+  }
68
+});
69
+```
70
+#### Quick request
71
+```js
72
+permissions.requestPermission(permissions.CAMERA, success, error);
73
+
74
+function error() {
75
+  console.warn('Camera permission is not turned on');
76
+}
77
+
78
+function success( status ) {
79
+  if( !status.hasPermission ) error();
80
+}
81
+```
82
+#### Example multiple permissions
83
+```js
84
+var list = [
85
+  permissions.CAMERA,
86
+  permissions.GET_ACCOUNTS
87
+];
88
+
89
+permissions.hasPermission(list, callback, null);
90
+
91
+function error() {
92
+  console.warn('Camera or Accounts permission is not turned on');
93
+}
94
+
95
+function success( status ) {
96
+  if( !status.hasPermission ) {
97
+  
98
+    permissions.requestPermissions(
99
+      list,
100
+      function(status) {
101
+        if( !status.hasPermission ) error();
102
+      },
103
+      error);
104
+  }
105
+}
106
+```
107
+
108
+License
109
+--------
110
+
111
+    Copyright (C) 2016 Jason Yang
112
+
113
+    Licensed under the Apache License, Version 2.0 (the "License");
114
+    you may not use this file except in compliance with the License.
115
+    You may obtain a copy of the License at
116
+
117
+       http://www.apache.org/licenses/LICENSE-2.0
118
+
119
+    Unless required by applicable law or agreed to in writing, software
120
+    distributed under the License is distributed on an "AS IS" BASIS,
121
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122
+    See the License for the specific language governing permissions and
123
+    limitations under the License.

+ 96
- 0
km0App/node_modules/cordova-plugin-android-permissions/package.json Parādīt failu

@@ -0,0 +1,96 @@
1
+{
2
+  "_args": [
3
+    [
4
+      "cordova-plugin-android-permissions",
5
+      "/home/manodg/Documents/kilometro0/km0App"
6
+    ]
7
+  ],
8
+  "_from": "cordova-plugin-android-permissions@latest",
9
+  "_hasShrinkwrap": false,
10
+  "_id": "cordova-plugin-android-permissions@1.0.2",
11
+  "_inCache": true,
12
+  "_installable": true,
13
+  "_location": "/cordova-plugin-android-permissions",
14
+  "_nodeVersion": "10.16.2",
15
+  "_npmOperationalInternal": {
16
+    "host": "s3://npm-registry-packages",
17
+    "tmp": "tmp/cordova-plugin-android-permissions_1.0.2_1571061856339_0.05585259418496635"
18
+  },
19
+  "_npmUser": {
20
+    "email": "jason760924@gmail.com",
21
+    "name": "jasonyang"
22
+  },
23
+  "_npmVersion": "6.9.0",
24
+  "_phantomChildren": {},
25
+  "_requested": {
26
+    "name": "cordova-plugin-android-permissions",
27
+    "raw": "cordova-plugin-android-permissions",
28
+    "rawSpec": "",
29
+    "scope": null,
30
+    "spec": "latest",
31
+    "type": "tag"
32
+  },
33
+  "_requiredBy": [
34
+    "/"
35
+  ],
36
+  "_resolved": "https://registry.npmjs.org/cordova-plugin-android-permissions/-/cordova-plugin-android-permissions-1.0.2.tgz",
37
+  "_shasum": "e26556ff11a560dffa33a5915d27fe9d44b3c248",
38
+  "_shrinkwrap": null,
39
+  "_spec": "cordova-plugin-android-permissions",
40
+  "_where": "/home/manodg/Documents/kilometro0/km0App",
41
+  "author": {
42
+    "name": "Jason Yang"
43
+  },
44
+  "bugs": {
45
+    "url": "https://github.com/NeoLSN/cordova-plugin-android-permission/issues"
46
+  },
47
+  "cordova": {
48
+    "id": "cordova-plugin-android-permissions",
49
+    "platforms": [
50
+      "android",
51
+      "browser",
52
+      "ios"
53
+    ]
54
+  },
55
+  "dependencies": {},
56
+  "description": "Android 6.0 permissions check.",
57
+  "devDependencies": {},
58
+  "directories": {},
59
+  "dist": {
60
+    "fileCount": 7,
61
+    "integrity": "sha512-Eb7Cf3lk9RydSYqmUzBAEVTT/EU+opV2yvyqkgZZAB/RVfHxsla/1wzHq0PBwAFjHIrxBAGZrOpJFVKc1SxtuA==",
62
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpIBgCRA9TVsSAnZWagAABDkP/1JqmQ3OLZD718d/BOc9\nFLncYZVoAy3EN8lrdRT0dVWI7/mAe+a2mOUKShNLQZy3ZSX0miP5VzdfR7Qo\nF+80L4LDryY8/3yWcK+ihfUMT5S6B431tCIc4u4+m2rmFPvz+yGuBOhg0Mri\nkPDFslXqW+JM51AuBO9t9C9OYccAwy49NU5A9K3RAnXaso+o7M75cjtHDUdU\n/FEc7PSBo7DJiBYLbp5JTNw08Vx1e7qYyMtfK2WzOSMuT96htBzs71WnBGb0\nQbOzPdG4XHvSq4bnF/vffhfM4A+b5qNa2WAIhfUGOj6lYJqTIO7gpd/3Zsa3\niwBYr6WMky7ILuw3obPneDheIBSnsZyus2x45SzpmnCltsoUAEYf4YXGDaM4\nQTxs52nxzHKHf/3LKqM2SruGu5lcwcZzQg9Ly21SjdGtuHsvm1O2PBsxmd7e\nV4BA/Rd5cz3KWNoh+uvwZTzxMeS1wb9CxGlhEueqqQFkI0E0VDDG1x5jHSlt\n7bf9xsaENQLiiFwVwtV0WRFphat/SnJ2Rt7bUeudGzrB0ZYNW3g0gSrwax2s\nhmtTm4GTCaxafQX3ReyTxVrIRGqLGtXNqOuW+V4T3ZSJqovzNbfj4hWrs7EU\nDaizpMEQFjmZuRzvZX7fwe23mX4mF9om+u4o1RkR+ZKoc2GL1e9UtK1T4NBY\nssj5\r\n=dvxe\r\n-----END PGP SIGNATURE-----\r\n",
63
+    "shasum": "e26556ff11a560dffa33a5915d27fe9d44b3c248",
64
+    "tarball": "https://registry.npmjs.org/cordova-plugin-android-permissions/-/cordova-plugin-android-permissions-1.0.2.tgz",
65
+    "unpackedSize": 47488
66
+  },
67
+  "engines": [
68
+    {
69
+      "name": "cordova",
70
+      "version": ">=5.0.0"
71
+    }
72
+  ],
73
+  "gitHead": "43ababbc419f5ede0846236d341c93cc6f4efe4e",
74
+  "homepage": "https://github.com/NeoLSN/cordova-plugin-android-permission#readme",
75
+  "keywords": [
76
+    "cordova-android",
77
+    "cordova-browser",
78
+    "cordova-ios",
79
+    "ecosystem:cordova"
80
+  ],
81
+  "license": "Apache 2.0",
82
+  "maintainers": [
83
+    {
84
+      "name": "jasonyang",
85
+      "email": "jason760924@gmail.com"
86
+    }
87
+  ],
88
+  "name": "cordova-plugin-android-permissions",
89
+  "optionalDependencies": {},
90
+  "readme": "ERROR: No README data found!",
91
+  "repository": {
92
+    "type": "git",
93
+    "url": "git+https://github.com/NeoLSN/cordova-plugin-android-permission.git"
94
+  },
95
+  "version": "1.0.2"
96
+}

+ 46
- 0
km0App/node_modules/cordova-plugin-android-permissions/plugin.xml Parādīt failu

@@ -0,0 +1,46 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
+        xmlns:android="http://schemas.android.com/apk/res/android"
4
+        id="cordova-plugin-android-permissions"
5
+        version="1.0.2">
6
+
7
+  <name>Permissions</name>
8
+
9
+  <description>Android permissions support library.</description>
10
+
11
+  <author>Jason Yang</author>
12
+
13
+  <engines>
14
+    <engine name="cordova" version=">=5.0.0"/>
15
+  </engines>
16
+
17
+  <!-- android -->
18
+  <platform name="android">
19
+    <js-module src="www/permissions.js" name="Permissions">
20
+      <clobbers target="cordova.plugins.permissions" />
21
+    </js-module>
22
+
23
+    <config-file target="res/xml/config.xml" parent="/*">
24
+      <feature name="Permissions">
25
+        <param name="android-package" value="com.android.plugins.Permissions" />
26
+      </feature>
27
+    </config-file>
28
+
29
+    <source-file src="src/android/com/android/plugins/Permissions.java" target-dir="src/com/android/plugins"/>
30
+  </platform>
31
+
32
+  <!-- browser -->
33
+  <platform name="browser">
34
+    <js-module src="www/permissions-dummy.js" name="Permissions">
35
+      <clobbers target="cordova.plugins.permissions" />
36
+    </js-module>
37
+  </platform>
38
+
39
+  <!-- ios -->
40
+  <platform name="ios">
41
+    <js-module src="www/permissions-dummy.js" name="Permissions">
42
+      <clobbers target="cordova.plugins.permissions" />
43
+    </js-module>
44
+  </platform>
45
+
46
+</plugin>

+ 157
- 0
km0App/node_modules/cordova-plugin-android-permissions/src/android/com/android/plugins/Permissions.java Parādīt failu

@@ -0,0 +1,157 @@
1
+package com.android.plugins;
2
+
3
+import android.os.Build;
4
+
5
+import org.apache.cordova.CallbackContext;
6
+import org.apache.cordova.CordovaPlugin;
7
+import org.json.JSONArray;
8
+import org.json.JSONException;
9
+import org.json.JSONObject;
10
+
11
+/**
12
+ * Created by JasonYang on 2016/3/11.
13
+ */
14
+public class Permissions extends CordovaPlugin {
15
+
16
+    private static final String ACTION_CHECK_PERMISSION = "checkPermission";
17
+    private static final String ACTION_REQUEST_PERMISSION = "requestPermission";
18
+    private static final String ACTION_REQUEST_PERMISSIONS = "requestPermissions";
19
+
20
+    private static final int REQUEST_CODE_ENABLE_PERMISSION = 55433;
21
+
22
+    private static final String KEY_ERROR = "error";
23
+    private static final String KEY_MESSAGE = "message";
24
+    private static final String KEY_RESULT_PERMISSION = "hasPermission";
25
+
26
+    private CallbackContext permissionsCallback;
27
+
28
+    @Override
29
+    public boolean execute(String action, final JSONArray args, final CallbackContext callbackContext) throws JSONException {
30
+        if (ACTION_CHECK_PERMISSION.equals(action)) {
31
+            cordova.getThreadPool().execute(new Runnable() {
32
+                public void run() {
33
+                    checkPermissionAction(callbackContext, args);
34
+                }
35
+            });
36
+            return true;
37
+        } else if (ACTION_REQUEST_PERMISSION.equals(action) || ACTION_REQUEST_PERMISSIONS.equals(action)) {
38
+            cordova.getThreadPool().execute(new Runnable() {
39
+                public void run() {
40
+                    try {
41
+                        requestPermissionAction(callbackContext, args);
42
+                    } catch (Exception e) {
43
+                        e.printStackTrace();
44
+                        JSONObject returnObj = new JSONObject();
45
+                        addProperty(returnObj, KEY_ERROR, ACTION_REQUEST_PERMISSION);
46
+                        addProperty(returnObj, KEY_MESSAGE, "Request permission has been denied.");
47
+                        callbackContext.error(returnObj);
48
+                        permissionsCallback = null;
49
+                    }
50
+                }
51
+            });
52
+            return true;
53
+        }
54
+        return false;
55
+    }
56
+
57
+    @Override
58
+    public void onRequestPermissionResult(int requestCode, String[] permissions, int[] grantResults) throws JSONException {
59
+        if (permissionsCallback == null) {
60
+            return;
61
+        }
62
+
63
+        JSONObject returnObj = new JSONObject();
64
+        if (permissions != null && permissions.length > 0) {
65
+            //Call checkPermission again to verify
66
+            boolean hasAllPermissions = hasAllPermissions(permissions);
67
+            addProperty(returnObj, KEY_RESULT_PERMISSION, hasAllPermissions);
68
+            permissionsCallback.success(returnObj);
69
+        } else {
70
+            addProperty(returnObj, KEY_ERROR, ACTION_REQUEST_PERMISSION);
71
+            addProperty(returnObj, KEY_MESSAGE, "Unknown error.");
72
+            permissionsCallback.error(returnObj);
73
+        }
74
+        permissionsCallback = null;
75
+    }
76
+
77
+    private void checkPermissionAction(CallbackContext callbackContext, JSONArray permission) {
78
+        if (permission == null || permission.length() == 0 || permission.length() > 1) {
79
+            JSONObject returnObj = new JSONObject();
80
+            addProperty(returnObj, KEY_ERROR, ACTION_CHECK_PERMISSION);
81
+            addProperty(returnObj, KEY_MESSAGE, "One time one permission only.");
82
+            callbackContext.error(returnObj);
83
+        } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
84
+            JSONObject returnObj = new JSONObject();
85
+            addProperty(returnObj, KEY_RESULT_PERMISSION, true);
86
+            callbackContext.success(returnObj);
87
+        } else {
88
+            try {
89
+                JSONObject returnObj = new JSONObject();
90
+                addProperty(returnObj, KEY_RESULT_PERMISSION, cordova.hasPermission(permission.getString(0)));
91
+                callbackContext.success(returnObj);
92
+            } catch (JSONException e) {
93
+                e.printStackTrace();
94
+            }
95
+        }
96
+    }
97
+
98
+    private void requestPermissionAction(CallbackContext callbackContext, JSONArray permissions) throws Exception {
99
+        if (permissions == null || permissions.length() == 0) {
100
+            JSONObject returnObj = new JSONObject();
101
+            addProperty(returnObj, KEY_ERROR, ACTION_REQUEST_PERMISSION);
102
+            addProperty(returnObj, KEY_MESSAGE, "At least one permission.");
103
+            callbackContext.error(returnObj);
104
+        } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
105
+            JSONObject returnObj = new JSONObject();
106
+            addProperty(returnObj, KEY_RESULT_PERMISSION, true);
107
+            callbackContext.success(returnObj);
108
+        } else if (hasAllPermissions(permissions)) {
109
+            JSONObject returnObj = new JSONObject();
110
+            addProperty(returnObj, KEY_RESULT_PERMISSION, true);
111
+            callbackContext.success(returnObj);
112
+        } else {
113
+            permissionsCallback = callbackContext;
114
+            String[] permissionArray = getPermissions(permissions);
115
+            cordova.requestPermissions(this, REQUEST_CODE_ENABLE_PERMISSION, permissionArray);
116
+        }
117
+    }
118
+
119
+    private String[] getPermissions(JSONArray permissions) {
120
+        String[] stringArray = new String[permissions.length()];
121
+        for (int i = 0; i < permissions.length(); i++) {
122
+            try {
123
+                stringArray[i] = permissions.getString(i);
124
+            } catch (JSONException ignored) {
125
+                //Believe exception only occurs when adding duplicate keys, so just ignore it
126
+            }
127
+        }
128
+        return stringArray;
129
+    }
130
+
131
+    private boolean hasAllPermissions(JSONArray permissions) throws JSONException {
132
+        return hasAllPermissions(getPermissions(permissions));
133
+    }
134
+
135
+    private boolean hasAllPermissions(String[] permissions) throws JSONException {
136
+
137
+        for (String permission : permissions) {
138
+            if(!cordova.hasPermission(permission)) {
139
+                return false;
140
+            }
141
+        }
142
+
143
+        return true;
144
+    }
145
+
146
+    private void addProperty(JSONObject obj, String key, Object value) {
147
+        try {
148
+            if (value == null) {
149
+                obj.put(key, JSONObject.NULL);
150
+            } else {
151
+                obj.put(key, value);
152
+            }
153
+        } catch (JSONException ignored) {
154
+            //Believe exception only occurs when adding duplicate keys, so just ignore it
155
+        }
156
+    }
157
+}

+ 194
- 0
km0App/node_modules/cordova-plugin-android-permissions/www/permissions-dummy.js Parādīt failu

@@ -0,0 +1,194 @@
1
+var permissionsName = 'Permissions';
2
+
3
+function Permissions() {
4
+
5
+    this.ACCESS_CHECKIN_PROPERTIES = 'android.permission.ACCESS_CHECKIN_PROPERTIES';
6
+    this.ACCESS_COARSE_LOCATION = 'android.permission.ACCESS_COARSE_LOCATION';
7
+    this.ACCESS_FINE_LOCATION = 'android.permission.ACCESS_FINE_LOCATION';
8
+    this.ACCESS_LOCATION_EXTRA_COMMANDS = 'android.permission.ACCESS_LOCATION_EXTRA_COMMANDS';
9
+    this.ACCESS_MOCK_LOCATION = 'android.permission.ACCESS_MOCK_LOCATION';
10
+    this.ACCESS_NETWORK_STATE = 'android.permission.ACCESS_NETWORK_STATE';
11
+    this.ACCESS_SURFACE_FLINGER = 'android.permission.ACCESS_SURFACE_FLINGER';
12
+    this.ACCESS_WIFI_STATE = 'android.permission.ACCESS_WIFI_STATE';
13
+    this.ACCOUNT_MANAGER = 'android.permission.ACCOUNT_MANAGER';
14
+    this.ADD_VOICEMAIL = 'com.android.voicemail.permission.ADD_VOICEMAIL';
15
+    this.AUTHENTICATE_ACCOUNTS = 'android.permission.AUTHENTICATE_ACCOUNTS';
16
+    this.BATTERY_STATS = 'android.permission.BATTERY_STATS';
17
+    this.BIND_ACCESSIBILITY_SERVICE = 'android.permission.BIND_ACCESSIBILITY_SERVICE';
18
+    this.BIND_APPWIDGET = 'android.permission.BIND_APPWIDGET';
19
+    this.BIND_CARRIER_MESSAGING_SERVICE = 'android.permission.BIND_CARRIER_MESSAGING_SERVICE';
20
+    this.BIND_DEVICE_ADMIN = 'android.permission.BIND_DEVICE_ADMIN';
21
+    this.BIND_DREAM_SERVICE = 'android.permission.BIND_DREAM_SERVICE';
22
+    this.BIND_INPUT_METHOD = 'android.permission.BIND_INPUT_METHOD';
23
+    this.BIND_NFC_SERVICE = 'android.permission.BIND_NFC_SERVICE';
24
+    this.BIND_NOTIFICATION_LISTENER_SERVICE = 'android.permission.BIND_NOTIFICATION_LISTENER_SERVICE';
25
+    this.BIND_PRINT_SERVICE = 'android.permission.BIND_PRINT_SERVICE';
26
+    this.BIND_REMOTEVIEWS = 'android.permission.BIND_REMOTEVIEWS';
27
+    this.BIND_TEXT_SERVICE = 'android.permission.BIND_TEXT_SERVICE';
28
+    this.BIND_TV_INPUT = 'android.permission.BIND_TV_INPUT';
29
+    this.BIND_VOICE_INTERACTION = 'android.permission.BIND_VOICE_INTERACTION';
30
+    this.BIND_VPN_SERVICE = 'android.permission.BIND_VPN_SERVICE';
31
+    this.BIND_WALLPAPER = 'android.permission.BIND_WALLPAPER';
32
+    this.BLUETOOTH = 'android.permission.BLUETOOTH';
33
+    this.BLUETOOTH_ADMIN = 'android.permission.BLUETOOTH_ADMIN';
34
+    this.BLUETOOTH_PRIVILEGED = 'android.permission.BLUETOOTH_PRIVILEGED';
35
+    this.BODY_SENSORS = 'android.permission.BODY_SENSORS';
36
+    this.BRICK = 'android.permission.BRICK';
37
+    this.BROADCAST_PACKAGE_REMOVED = 'android.permission.BROADCAST_PACKAGE_REMOVED';
38
+    this.BROADCAST_SMS = 'android.permission.BROADCAST_SMS';
39
+    this.BROADCAST_STICKY = 'android.permission.BROADCAST_STICKY';
40
+    this.BROADCAST_WAP_PUSH = 'android.permission.BROADCAST_WAP_PUSH';
41
+    this.CALL_PHONE = 'android.permission.CALL_PHONE';
42
+    this.CALL_PRIVILEGED = 'android.permission.CALL_PRIVILEGED';
43
+    this.CAMERA = 'android.permission.CAMERA';
44
+    this.CAPTURE_AUDIO_OUTPUT = 'android.permission.CAPTURE_AUDIO_OUTPUT';
45
+    this.CAPTURE_SECURE_VIDEO_OUTPUT = 'android.permission.CAPTURE_SECURE_VIDEO_OUTPUT';
46
+    this.CAPTURE_VIDEO_OUTPUT = 'android.permission.CAPTURE_VIDEO_OUTPUT';
47
+    this.CHANGE_COMPONENT_ENABLED_STATE = 'android.permission.CHANGE_COMPONENT_ENABLED_STATE';
48
+    this.CHANGE_CONFIGURATION = 'android.permission.CHANGE_CONFIGURATION';
49
+    this.CHANGE_NETWORK_STATE = 'android.permission.CHANGE_NETWORK_STATE';
50
+    this.CHANGE_WIFI_MULTICAST_STATE = 'android.permission.CHANGE_WIFI_MULTICAST_STATE';
51
+    this.CHANGE_WIFI_STATE = 'android.permission.CHANGE_WIFI_STATE';
52
+    this.CLEAR_APP_CACHE = 'android.permission.CLEAR_APP_CACHE';
53
+    this.CLEAR_APP_USER_DATA = 'android.permission.CLEAR_APP_USER_DATA';
54
+    this.CONTROL_LOCATION_UPDATES = 'android.permission.CONTROL_LOCATION_UPDATES';
55
+    this.DELETE_CACHE_FILES = 'android.permission.DELETE_CACHE_FILES';
56
+    this.DELETE_PACKAGES = 'android.permission.DELETE_PACKAGES';
57
+    this.DEVICE_POWER = 'android.permission.DEVICE_POWER';
58
+    this.DIAGNOSTIC = 'android.permission.DIAGNOSTIC';
59
+    this.DISABLE_KEYGUARD = 'android.permission.DISABLE_KEYGUARD';
60
+    this.DUMP = 'android.permission.DUMP';
61
+    this.EXPAND_STATUS_BAR = 'android.permission.EXPAND_STATUS_BAR';
62
+    this.FACTORY_TEST = 'android.permission.FACTORY_TEST';
63
+    this.FLASHLIGHT = 'android.permission.FLASHLIGHT';
64
+    this.FORCE_BACK = 'android.permission.FORCE_BACK';
65
+    this.GET_ACCOUNTS = 'android.permission.GET_ACCOUNTS';
66
+    this.GET_PACKAGE_SIZE = 'android.permission.GET_PACKAGE_SIZE';
67
+    this.GET_TASKS = 'android.permission.GET_TASKS';
68
+    this.GET_TOP_ACTIVITY_INFO = 'android.permission.GET_TOP_ACTIVITY_INFO';
69
+    this.GLOBAL_SEARCH = 'android.permission.GLOBAL_SEARCH';
70
+    this.HARDWARE_TEST = 'android.permission.HARDWARE_TEST';
71
+    this.INJECT_EVENTS = 'android.permission.INJECT_EVENTS';
72
+    this.INSTALL_LOCATION_PROVIDER = 'android.permission.INSTALL_LOCATION_PROVIDER';
73
+    this.INSTALL_PACKAGES = 'android.permission.INSTALL_PACKAGES';
74
+    this.INSTALL_SHORTCUT = 'com.android.launcher.permission.INSTALL_SHORTCUT';
75
+    this.INTERNAL_SYSTEM_WINDOW = 'android.permission.INTERNAL_SYSTEM_WINDOW';
76
+    this.INTERNET = 'android.permission.INTERNET';
77
+    this.KILL_BACKGROUND_PROCESSES = 'android.permission.KILL_BACKGROUND_PROCESSES';
78
+    this.LOCATION_HARDWARE = 'android.permission.LOCATION_HARDWARE';
79
+    this.MANAGE_ACCOUNTS = 'android.permission.MANAGE_ACCOUNTS';
80
+    this.MANAGE_APP_TOKENS = 'android.permission.MANAGE_APP_TOKENS';
81
+    this.MANAGE_DOCUMENTS = 'android.permission.MANAGE_DOCUMENTS';
82
+    this.MASTER_CLEAR = 'android.permission.MASTER_CLEAR';
83
+    this.MEDIA_CONTENT_CONTROL = 'android.permission.MEDIA_CONTENT_CONTROL';
84
+    this.MODIFY_AUDIO_SETTINGS = 'android.permission.MODIFY_AUDIO_SETTINGS';
85
+    this.MODIFY_PHONE_STATE = 'android.permission.MODIFY_PHONE_STATE';
86
+    this.MOUNT_FORMAT_FILESYSTEMS = 'android.permission.MOUNT_FORMAT_FILESYSTEMS';
87
+    this.MOUNT_UNMOUNT_FILESYSTEMS = 'android.permission.MOUNT_UNMOUNT_FILESYSTEMS';
88
+    this.NFC = 'android.permission.NFC';
89
+    this.PERSISTENT_ACTIVITY = 'android.permission.PERSISTENT_ACTIVITY';
90
+    this.PROCESS_OUTGOING_CALLS = 'android.permission.PROCESS_OUTGOING_CALLS';
91
+    this.READ_CALENDAR = 'android.permission.READ_CALENDAR';
92
+    this.READ_CALL_LOG = 'android.permission.READ_CALL_LOG';
93
+    this.READ_CONTACTS = 'android.permission.READ_CONTACTS';
94
+    this.READ_EXTERNAL_STORAGE = 'android.permission.READ_EXTERNAL_STORAGE';
95
+    this.READ_FRAME_BUFFER = 'android.permission.READ_FRAME_BUFFER';
96
+    this.READ_HISTORY_BOOKMARKS = 'com.android.browser.permission.READ_HISTORY_BOOKMARKS';
97
+    this.READ_INPUT_STATE = 'android.permission.READ_INPUT_STATE';
98
+    this.READ_LOGS = 'android.permission.READ_LOGS';
99
+    this.READ_PHONE_STATE = 'android.permission.READ_PHONE_STATE';
100
+    this.READ_PROFILE = 'android.permission.READ_PROFILE';
101
+    this.READ_SMS = 'android.permission.READ_SMS';
102
+    this.READ_SOCIAL_STREAM = 'android.permission.READ_SOCIAL_STREAM';
103
+    this.READ_SYNC_SETTINGS = 'android.permission.READ_SYNC_SETTINGS';
104
+    this.READ_SYNC_STATS = 'android.permission.READ_SYNC_STATS';
105
+    this.READ_USER_DICTIONARY = 'android.permission.READ_USER_DICTIONARY';
106
+    this.READ_VOICEMAIL = 'com.android.voicemail.permission.READ_VOICEMAIL';
107
+    this.REBOOT = 'android.permission.REBOOT';
108
+    this.RECEIVE_BOOT_COMPLETED = 'android.permission.RECEIVE_BOOT_COMPLETED';
109
+    this.RECEIVE_MMS = 'android.permission.RECEIVE_MMS';
110
+    this.RECEIVE_SMS = 'android.permission.RECEIVE_SMS';
111
+    this.RECEIVE_WAP_PUSH = 'android.permission.RECEIVE_WAP_PUSH';
112
+    this.RECORD_AUDIO = 'android.permission.RECORD_AUDIO';
113
+    this.REORDER_TASKS = 'android.permission.REORDER_TASKS';
114
+    this.RESTART_PACKAGES = 'android.permission.RESTART_PACKAGES';
115
+    this.SEND_RESPOND_VIA_MESSAGE = 'android.permission.SEND_RESPOND_VIA_MESSAGE';
116
+    this.SEND_SMS = 'android.permission.SEND_SMS';
117
+    this.SET_ACTIVITY_WATCHER = 'android.permission.SET_ACTIVITY_WATCHER';
118
+    this.SET_ALARM = 'com.android.alarm.permission.SET_ALARM';
119
+    this.SET_ALWAYS_FINISH = 'android.permission.SET_ALWAYS_FINISH';
120
+    this.SET_ANIMATION_SCALE = 'android.permission.SET_ANIMATION_SCALE';
121
+    this.SET_DEBUG_APP = 'android.permission.SET_DEBUG_APP';
122
+    this.SET_ORIENTATION = 'android.permission.SET_ORIENTATION';
123
+    this.SET_POINTER_SPEED = 'android.permission.SET_POINTER_SPEED';
124
+    this.SET_PREFERRED_APPLICATIONS = 'android.permission.SET_PREFERRED_APPLICATIONS';
125
+    this.SET_PROCESS_LIMIT = 'android.permission.SET_PROCESS_LIMIT';
126
+    this.SET_TIME = 'android.permission.SET_TIME';
127
+    this.SET_TIME_ZONE = 'android.permission.SET_TIME_ZONE';
128
+    this.SET_WALLPAPER = 'android.permission.SET_WALLPAPER';
129
+    this.SET_WALLPAPER_HINTS = 'android.permission.SET_WALLPAPER_HINTS';
130
+    this.SIGNAL_PERSISTENT_PROCESSES = 'android.permission.SIGNAL_PERSISTENT_PROCESSES';
131
+    this.STATUS_BAR = 'android.permission.STATUS_BAR';
132
+    this.SUBSCRIBED_FEEDS_READ = 'android.permission.SUBSCRIBED_FEEDS_READ';
133
+    this.SUBSCRIBED_FEEDS_WRITE = 'android.permission.SUBSCRIBED_FEEDS_WRITE';
134
+    this.SYSTEM_ALERT_WINDOW = 'android.permission.SYSTEM_ALERT_WINDOW';
135
+    this.TRANSMIT_IR = 'android.permission.TRANSMIT_IR';
136
+    this.UNINSTALL_SHORTCUT = 'com.android.launcher.permission.UNINSTALL_SHORTCUT';
137
+    this.UPDATE_DEVICE_STATS = 'android.permission.UPDATE_DEVICE_STATS';
138
+    this.USE_CREDENTIALS = 'android.permission.USE_CREDENTIALS';
139
+    this.USE_SIP = 'android.permission.USE_SIP';
140
+    this.VIBRATE = 'android.permission.VIBRATE';
141
+    this.WAKE_LOCK = 'android.permission.WAKE_LOCK';
142
+    this.WRITE_APN_SETTINGS = 'android.permission.WRITE_APN_SETTINGS';
143
+    this.WRITE_CALENDAR = 'android.permission.WRITE_CALENDAR';
144
+    this.WRITE_CALL_LOG = 'android.permission.WRITE_CALL_LOG';
145
+    this.WRITE_CONTACTS = 'android.permission.WRITE_CONTACTS';
146
+    this.WRITE_EXTERNAL_STORAGE = 'android.permission.WRITE_EXTERNAL_STORAGE';
147
+    this.WRITE_GSERVICES = 'android.permission.WRITE_GSERVICES';
148
+    this.WRITE_HISTORY_BOOKMARKS = 'com.android.browser.permission.WRITE_HISTORY_BOOKMARKS';
149
+    this.WRITE_PROFILE = 'android.permission.WRITE_PROFILE';
150
+    this.WRITE_SECURE_SETTINGS = 'android.permission.WRITE_SECURE_SETTINGS';
151
+    this.WRITE_SETTINGS = 'android.permission.WRITE_SETTINGS';
152
+    this.WRITE_SMS = 'android.permission.WRITE_SMS';
153
+    this.WRITE_SOCIAL_STREAM = 'android.permission.WRITE_SOCIAL_STREAM';
154
+    this.WRITE_SYNC_SETTINGS = 'android.permission.WRITE_SYNC_SETTINGS';
155
+    this.WRITE_USER_DICTIONARY = 'android.permission.WRITE_USER_DICTIONARY';
156
+    this.WRITE_VOICEMAIL = 'com.android.voicemail.permission.WRITE_VOICEMAIL';
157
+}
158
+
159
+function deprecated(name) {
160
+  console.warn("Calling cordova.plugins.permissions." + name + " with the successCallback as first argument is deprecated");
161
+  console.warn("The new signature is '" + name + "(permission, successCallback, errorCallback)'");
162
+}
163
+
164
+Permissions.prototype = {
165
+    checkPermission: function(permission, successCallback, errorCallback) {
166
+        successCallback( {hasPermission: true} );
167
+    },
168
+    requestPermission: function(permission, successCallback, errorCallback) {
169
+        if (typeof permission === "function") {
170
+            deprecated("requestPermission");
171
+            successCallback = arguments[0];
172
+            errorCallback = arguments[1];
173
+            permission = arguments[2];
174
+        }
175
+        successCallback( {hasPermission: true} );
176
+    },
177
+    requestPermissions: function(permissions, successCallback, errorCallback) {
178
+        successCallback( {hasPermission: true} );
179
+    }
180
+};
181
+
182
+Permissions.prototype.hasPermission = function (permission, successCallback, errorCallback) {
183
+    console.warn("hasPermission() function deprecated. Considers using checkPermission()");
184
+
185
+    if (typeof permission === "function") {
186
+        deprecated("hasPermission");
187
+        successCallback = arguments[0];
188
+        errorCallback = arguments[1];
189
+        permission = arguments[2];
190
+    }
191
+    this.checkPermission.call(this, permission, successCallback, errorCallback);
192
+};
193
+
194
+module.exports = new Permissions();

+ 194
- 0
km0App/node_modules/cordova-plugin-android-permissions/www/permissions.js Parādīt failu

@@ -0,0 +1,194 @@
1
+var permissionsName = 'Permissions';
2
+
3
+function Permissions() {
4
+
5
+    this.ACCESS_CHECKIN_PROPERTIES = 'android.permission.ACCESS_CHECKIN_PROPERTIES';
6
+    this.ACCESS_COARSE_LOCATION = 'android.permission.ACCESS_COARSE_LOCATION';
7
+    this.ACCESS_FINE_LOCATION = 'android.permission.ACCESS_FINE_LOCATION';
8
+    this.ACCESS_LOCATION_EXTRA_COMMANDS = 'android.permission.ACCESS_LOCATION_EXTRA_COMMANDS';
9
+    this.ACCESS_MOCK_LOCATION = 'android.permission.ACCESS_MOCK_LOCATION';
10
+    this.ACCESS_NETWORK_STATE = 'android.permission.ACCESS_NETWORK_STATE';
11
+    this.ACCESS_SURFACE_FLINGER = 'android.permission.ACCESS_SURFACE_FLINGER';
12
+    this.ACCESS_WIFI_STATE = 'android.permission.ACCESS_WIFI_STATE';
13
+    this.ACCOUNT_MANAGER = 'android.permission.ACCOUNT_MANAGER';
14
+    this.ADD_VOICEMAIL = 'com.android.voicemail.permission.ADD_VOICEMAIL';
15
+    this.AUTHENTICATE_ACCOUNTS = 'android.permission.AUTHENTICATE_ACCOUNTS';
16
+    this.BATTERY_STATS = 'android.permission.BATTERY_STATS';
17
+    this.BIND_ACCESSIBILITY_SERVICE = 'android.permission.BIND_ACCESSIBILITY_SERVICE';
18
+    this.BIND_APPWIDGET = 'android.permission.BIND_APPWIDGET';
19
+    this.BIND_CARRIER_MESSAGING_SERVICE = 'android.permission.BIND_CARRIER_MESSAGING_SERVICE';
20
+    this.BIND_DEVICE_ADMIN = 'android.permission.BIND_DEVICE_ADMIN';
21
+    this.BIND_DREAM_SERVICE = 'android.permission.BIND_DREAM_SERVICE';
22
+    this.BIND_INPUT_METHOD = 'android.permission.BIND_INPUT_METHOD';
23
+    this.BIND_NFC_SERVICE = 'android.permission.BIND_NFC_SERVICE';
24
+    this.BIND_NOTIFICATION_LISTENER_SERVICE = 'android.permission.BIND_NOTIFICATION_LISTENER_SERVICE';
25
+    this.BIND_PRINT_SERVICE = 'android.permission.BIND_PRINT_SERVICE';
26
+    this.BIND_REMOTEVIEWS = 'android.permission.BIND_REMOTEVIEWS';
27
+    this.BIND_TEXT_SERVICE = 'android.permission.BIND_TEXT_SERVICE';
28
+    this.BIND_TV_INPUT = 'android.permission.BIND_TV_INPUT';
29
+    this.BIND_VOICE_INTERACTION = 'android.permission.BIND_VOICE_INTERACTION';
30
+    this.BIND_VPN_SERVICE = 'android.permission.BIND_VPN_SERVICE';
31
+    this.BIND_WALLPAPER = 'android.permission.BIND_WALLPAPER';
32
+    this.BLUETOOTH = 'android.permission.BLUETOOTH';
33
+    this.BLUETOOTH_ADMIN = 'android.permission.BLUETOOTH_ADMIN';
34
+    this.BLUETOOTH_PRIVILEGED = 'android.permission.BLUETOOTH_PRIVILEGED';
35
+    this.BODY_SENSORS = 'android.permission.BODY_SENSORS';
36
+    this.BRICK = 'android.permission.BRICK';
37
+    this.BROADCAST_PACKAGE_REMOVED = 'android.permission.BROADCAST_PACKAGE_REMOVED';
38
+    this.BROADCAST_SMS = 'android.permission.BROADCAST_SMS';
39
+    this.BROADCAST_STICKY = 'android.permission.BROADCAST_STICKY';
40
+    this.BROADCAST_WAP_PUSH = 'android.permission.BROADCAST_WAP_PUSH';
41
+    this.CALL_PHONE = 'android.permission.CALL_PHONE';
42
+    this.CALL_PRIVILEGED = 'android.permission.CALL_PRIVILEGED';
43
+    this.CAMERA = 'android.permission.CAMERA';
44
+    this.CAPTURE_AUDIO_OUTPUT = 'android.permission.CAPTURE_AUDIO_OUTPUT';
45
+    this.CAPTURE_SECURE_VIDEO_OUTPUT = 'android.permission.CAPTURE_SECURE_VIDEO_OUTPUT';
46
+    this.CAPTURE_VIDEO_OUTPUT = 'android.permission.CAPTURE_VIDEO_OUTPUT';
47
+    this.CHANGE_COMPONENT_ENABLED_STATE = 'android.permission.CHANGE_COMPONENT_ENABLED_STATE';
48
+    this.CHANGE_CONFIGURATION = 'android.permission.CHANGE_CONFIGURATION';
49
+    this.CHANGE_NETWORK_STATE = 'android.permission.CHANGE_NETWORK_STATE';
50
+    this.CHANGE_WIFI_MULTICAST_STATE = 'android.permission.CHANGE_WIFI_MULTICAST_STATE';
51
+    this.CHANGE_WIFI_STATE = 'android.permission.CHANGE_WIFI_STATE';
52
+    this.CLEAR_APP_CACHE = 'android.permission.CLEAR_APP_CACHE';
53
+    this.CLEAR_APP_USER_DATA = 'android.permission.CLEAR_APP_USER_DATA';
54
+    this.CONTROL_LOCATION_UPDATES = 'android.permission.CONTROL_LOCATION_UPDATES';
55
+    this.DELETE_CACHE_FILES = 'android.permission.DELETE_CACHE_FILES';
56
+    this.DELETE_PACKAGES = 'android.permission.DELETE_PACKAGES';
57
+    this.DEVICE_POWER = 'android.permission.DEVICE_POWER';
58
+    this.DIAGNOSTIC = 'android.permission.DIAGNOSTIC';
59
+    this.DISABLE_KEYGUARD = 'android.permission.DISABLE_KEYGUARD';
60
+    this.DUMP = 'android.permission.DUMP';
61
+    this.EXPAND_STATUS_BAR = 'android.permission.EXPAND_STATUS_BAR';
62
+    this.FACTORY_TEST = 'android.permission.FACTORY_TEST';
63
+    this.FLASHLIGHT = 'android.permission.FLASHLIGHT';
64
+    this.FORCE_BACK = 'android.permission.FORCE_BACK';
65
+    this.GET_ACCOUNTS = 'android.permission.GET_ACCOUNTS';
66
+    this.GET_PACKAGE_SIZE = 'android.permission.GET_PACKAGE_SIZE';
67
+    this.GET_TASKS = 'android.permission.GET_TASKS';
68
+    this.GET_TOP_ACTIVITY_INFO = 'android.permission.GET_TOP_ACTIVITY_INFO';
69
+    this.GLOBAL_SEARCH = 'android.permission.GLOBAL_SEARCH';
70
+    this.HARDWARE_TEST = 'android.permission.HARDWARE_TEST';
71
+    this.INJECT_EVENTS = 'android.permission.INJECT_EVENTS';
72
+    this.INSTALL_LOCATION_PROVIDER = 'android.permission.INSTALL_LOCATION_PROVIDER';
73
+    this.INSTALL_PACKAGES = 'android.permission.INSTALL_PACKAGES';
74
+    this.INSTALL_SHORTCUT = 'com.android.launcher.permission.INSTALL_SHORTCUT';
75
+    this.INTERNAL_SYSTEM_WINDOW = 'android.permission.INTERNAL_SYSTEM_WINDOW';
76
+    this.INTERNET = 'android.permission.INTERNET';
77
+    this.KILL_BACKGROUND_PROCESSES = 'android.permission.KILL_BACKGROUND_PROCESSES';
78
+    this.LOCATION_HARDWARE = 'android.permission.LOCATION_HARDWARE';
79
+    this.MANAGE_ACCOUNTS = 'android.permission.MANAGE_ACCOUNTS';
80
+    this.MANAGE_APP_TOKENS = 'android.permission.MANAGE_APP_TOKENS';
81
+    this.MANAGE_DOCUMENTS = 'android.permission.MANAGE_DOCUMENTS';
82
+    this.MASTER_CLEAR = 'android.permission.MASTER_CLEAR';
83
+    this.MEDIA_CONTENT_CONTROL = 'android.permission.MEDIA_CONTENT_CONTROL';
84
+    this.MODIFY_AUDIO_SETTINGS = 'android.permission.MODIFY_AUDIO_SETTINGS';
85
+    this.MODIFY_PHONE_STATE = 'android.permission.MODIFY_PHONE_STATE';
86
+    this.MOUNT_FORMAT_FILESYSTEMS = 'android.permission.MOUNT_FORMAT_FILESYSTEMS';
87
+    this.MOUNT_UNMOUNT_FILESYSTEMS = 'android.permission.MOUNT_UNMOUNT_FILESYSTEMS';
88
+    this.NFC = 'android.permission.NFC';
89
+    this.PERSISTENT_ACTIVITY = 'android.permission.PERSISTENT_ACTIVITY';
90
+    this.PROCESS_OUTGOING_CALLS = 'android.permission.PROCESS_OUTGOING_CALLS';
91
+    this.READ_CALENDAR = 'android.permission.READ_CALENDAR';
92
+    this.READ_CALL_LOG = 'android.permission.READ_CALL_LOG';
93
+    this.READ_CONTACTS = 'android.permission.READ_CONTACTS';
94
+    this.READ_EXTERNAL_STORAGE = 'android.permission.READ_EXTERNAL_STORAGE';
95
+    this.READ_FRAME_BUFFER = 'android.permission.READ_FRAME_BUFFER';
96
+    this.READ_HISTORY_BOOKMARKS = 'com.android.browser.permission.READ_HISTORY_BOOKMARKS';
97
+    this.READ_INPUT_STATE = 'android.permission.READ_INPUT_STATE';
98
+    this.READ_LOGS = 'android.permission.READ_LOGS';
99
+    this.READ_PHONE_STATE = 'android.permission.READ_PHONE_STATE';
100
+    this.READ_PROFILE = 'android.permission.READ_PROFILE';
101
+    this.READ_SMS = 'android.permission.READ_SMS';
102
+    this.READ_SOCIAL_STREAM = 'android.permission.READ_SOCIAL_STREAM';
103
+    this.READ_SYNC_SETTINGS = 'android.permission.READ_SYNC_SETTINGS';
104
+    this.READ_SYNC_STATS = 'android.permission.READ_SYNC_STATS';
105
+    this.READ_USER_DICTIONARY = 'android.permission.READ_USER_DICTIONARY';
106
+    this.READ_VOICEMAIL = 'com.android.voicemail.permission.READ_VOICEMAIL';
107
+    this.REBOOT = 'android.permission.REBOOT';
108
+    this.RECEIVE_BOOT_COMPLETED = 'android.permission.RECEIVE_BOOT_COMPLETED';
109
+    this.RECEIVE_MMS = 'android.permission.RECEIVE_MMS';
110
+    this.RECEIVE_SMS = 'android.permission.RECEIVE_SMS';
111
+    this.RECEIVE_WAP_PUSH = 'android.permission.RECEIVE_WAP_PUSH';
112
+    this.RECORD_AUDIO = 'android.permission.RECORD_AUDIO';
113
+    this.REORDER_TASKS = 'android.permission.REORDER_TASKS';
114
+    this.RESTART_PACKAGES = 'android.permission.RESTART_PACKAGES';
115
+    this.SEND_RESPOND_VIA_MESSAGE = 'android.permission.SEND_RESPOND_VIA_MESSAGE';
116
+    this.SEND_SMS = 'android.permission.SEND_SMS';
117
+    this.SET_ACTIVITY_WATCHER = 'android.permission.SET_ACTIVITY_WATCHER';
118
+    this.SET_ALARM = 'com.android.alarm.permission.SET_ALARM';
119
+    this.SET_ALWAYS_FINISH = 'android.permission.SET_ALWAYS_FINISH';
120
+    this.SET_ANIMATION_SCALE = 'android.permission.SET_ANIMATION_SCALE';
121
+    this.SET_DEBUG_APP = 'android.permission.SET_DEBUG_APP';
122
+    this.SET_ORIENTATION = 'android.permission.SET_ORIENTATION';
123
+    this.SET_POINTER_SPEED = 'android.permission.SET_POINTER_SPEED';
124
+    this.SET_PREFERRED_APPLICATIONS = 'android.permission.SET_PREFERRED_APPLICATIONS';
125
+    this.SET_PROCESS_LIMIT = 'android.permission.SET_PROCESS_LIMIT';
126
+    this.SET_TIME = 'android.permission.SET_TIME';
127
+    this.SET_TIME_ZONE = 'android.permission.SET_TIME_ZONE';
128
+    this.SET_WALLPAPER = 'android.permission.SET_WALLPAPER';
129
+    this.SET_WALLPAPER_HINTS = 'android.permission.SET_WALLPAPER_HINTS';
130
+    this.SIGNAL_PERSISTENT_PROCESSES = 'android.permission.SIGNAL_PERSISTENT_PROCESSES';
131
+    this.STATUS_BAR = 'android.permission.STATUS_BAR';
132
+    this.SUBSCRIBED_FEEDS_READ = 'android.permission.SUBSCRIBED_FEEDS_READ';
133
+    this.SUBSCRIBED_FEEDS_WRITE = 'android.permission.SUBSCRIBED_FEEDS_WRITE';
134
+    this.SYSTEM_ALERT_WINDOW = 'android.permission.SYSTEM_ALERT_WINDOW';
135
+    this.TRANSMIT_IR = 'android.permission.TRANSMIT_IR';
136
+    this.UNINSTALL_SHORTCUT = 'com.android.launcher.permission.UNINSTALL_SHORTCUT';
137
+    this.UPDATE_DEVICE_STATS = 'android.permission.UPDATE_DEVICE_STATS';
138
+    this.USE_CREDENTIALS = 'android.permission.USE_CREDENTIALS';
139
+    this.USE_SIP = 'android.permission.USE_SIP';
140
+    this.VIBRATE = 'android.permission.VIBRATE';
141
+    this.WAKE_LOCK = 'android.permission.WAKE_LOCK';
142
+    this.WRITE_APN_SETTINGS = 'android.permission.WRITE_APN_SETTINGS';
143
+    this.WRITE_CALENDAR = 'android.permission.WRITE_CALENDAR';
144
+    this.WRITE_CALL_LOG = 'android.permission.WRITE_CALL_LOG';
145
+    this.WRITE_CONTACTS = 'android.permission.WRITE_CONTACTS';
146
+    this.WRITE_EXTERNAL_STORAGE = 'android.permission.WRITE_EXTERNAL_STORAGE';
147
+    this.WRITE_GSERVICES = 'android.permission.WRITE_GSERVICES';
148
+    this.WRITE_HISTORY_BOOKMARKS = 'com.android.browser.permission.WRITE_HISTORY_BOOKMARKS';
149
+    this.WRITE_PROFILE = 'android.permission.WRITE_PROFILE';
150
+    this.WRITE_SECURE_SETTINGS = 'android.permission.WRITE_SECURE_SETTINGS';
151
+    this.WRITE_SETTINGS = 'android.permission.WRITE_SETTINGS';
152
+    this.WRITE_SMS = 'android.permission.WRITE_SMS';
153
+    this.WRITE_SOCIAL_STREAM = 'android.permission.WRITE_SOCIAL_STREAM';
154
+    this.WRITE_SYNC_SETTINGS = 'android.permission.WRITE_SYNC_SETTINGS';
155
+    this.WRITE_USER_DICTIONARY = 'android.permission.WRITE_USER_DICTIONARY';
156
+    this.WRITE_VOICEMAIL = 'com.android.voicemail.permission.WRITE_VOICEMAIL';
157
+}
158
+
159
+function deprecated(name) {
160
+  console.warn("Calling cordova.plugins.permissions." + name + " with the successCallback as first argument is deprecated");
161
+  console.warn("The new signature is '" + name + "(permission, successCallback, errorCallback)'");
162
+}
163
+
164
+Permissions.prototype = {
165
+    checkPermission: function(permission, successCallback, errorCallback) {
166
+        cordova.exec(successCallback, errorCallback, permissionsName, 'checkPermission', [permission]);
167
+    },
168
+    requestPermission: function(permission, successCallback, errorCallback) {
169
+        if (typeof permission === "function") {
170
+            deprecated("requestPermission");
171
+            successCallback = arguments[0];
172
+            errorCallback = arguments[1];
173
+            permission = arguments[2];
174
+        }
175
+        cordova.exec(successCallback, errorCallback, permissionsName, 'requestPermission', [permission]);
176
+    },
177
+    requestPermissions: function(permissions, successCallback, errorCallback) {
178
+        cordova.exec(successCallback, errorCallback, permissionsName, 'requestPermissions', permissions);
179
+    }
180
+};
181
+
182
+Permissions.prototype.hasPermission = function (permission, successCallback, errorCallback) {
183
+    console.warn("hasPermission() function deprecated. Considers using checkPermission()");
184
+
185
+    if (typeof permission === "function") {
186
+        deprecated("hasPermission");
187
+        successCallback = arguments[0];
188
+        errorCallback = arguments[1];
189
+        permission = arguments[2];
190
+    }
191
+    this.checkPermission.call(this, permission, successCallback, errorCallback);
192
+};
193
+
194
+module.exports = new Permissions();

+ 230
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/README.md Parādīt failu

@@ -0,0 +1,230 @@
1
+# ContactsPhoneNumbers
2
+Cross-platform plugin for Cordova / PhoneGap to list all the contacts with at least a phone number.
3
+
4
+## Installing the plugin ##
5
+```
6
+cordova plugin add cordova-plugin-contacts-phonenumbers
7
+```
8
+or use this repository (unstable)
9
+```
10
+cordova plugin add https://github.com/dbaq/cordova-plugin-contacts-phone-numbers.git
11
+```
12
+## Using the plugin ##
13
+The plugin creates the object `navigator.contactsPhoneNumbers` with the methods
14
+
15
+  `list(success, fail)`
16
+
17
+A full example could be:
18
+
19
+```
20
+   //
21
+   //
22
+   // after deviceready
23
+   //
24
+   //
25
+   navigator.contactsPhoneNumbers.list(function(contacts) {
26
+      console.log(contacts.length + ' contacts found');
27
+      for(var i = 0; i < contacts.length; i++) {
28
+         console.log(contacts[i].id + " - " + contacts[i].displayName);
29
+         for(var j = 0; j < contacts[i].phoneNumbers.length; j++) {
30
+            var phone = contacts[i].phoneNumbers[j];
31
+            console.log("===> " + phone.type + "  " + phone.number + " (" + phone.normalizedNumber+ ")");
32
+         }
33
+      }
34
+   }, function(error) {
35
+      console.error(error);
36
+   });
37
+
38
+```
39
+
40
+## JSON Response format
41
+
42
+The success callback function contains an array of contacts.
43
+
44
+Each entry contains:
45
+
46
+   * the unique contact id
47
+   * the name of the contact (first name, last name, display name)
48
+   * an array containing the number, the normalizedNumber and the type of the number (```WORK```, ```MOBILE```, ```HOME``` or ```OTHER```)
49
+
50
+Here is a sample of what you can get:
51
+
52
+```
53
+    [{
54
+        "id": "1",
55
+        "firstName": "Kate",
56
+        "middleName": "",
57
+        "lastName": "Bell",
58
+        "displayName": "Kate Bell",
59
+        "thumbnail": null,
60
+        "phoneNumbers": [{
61
+            "number": "(555) 564-8583",
62
+            "normalizedNumber": "(555) 564-8583",
63
+            "type": "MOBILE"
64
+        }, {
65
+            "number": "(415) 555-3695",
66
+            "normalizedNumber": "(415) 555-3695",
67
+            "type": "OTHER"
68
+        }]
69
+    }, {
70
+        "id": "2",
71
+        "firstName": "Daniel",
72
+        "middleName": "",
73
+        "lastName": "Higgins",
74
+        "displayName": "Daniel Higgins",
75
+        "thumbnail": null,
76
+        "phoneNumbers": [{
77
+            "number": "555-478-7672",
78
+            "normalizedNumber": "555-478-7672",
79
+            "type": "HOME"
80
+        }, {
81
+            "number": "(408) 555-5270",
82
+            "normalizedNumber": "(408) 555-5270",
83
+            "type": "MOBILE"
84
+        }, {
85
+            "number": "(408) 555-3514",
86
+            "normalizedNumber": "(408) 555-3514",
87
+            "type": "OTHER"
88
+        }]
89
+    }, {
90
+        "id": "3",
91
+        "firstName": "John",
92
+        "middleName": "Paul",
93
+        "lastName": "Appleseed",
94
+        "displayName": "John Paul Appleseed",
95
+        "thumbnail": "content://com.android.contacts/contacts/49/photo",
96
+        "phoneNumbers": [{
97
+            "number": "888-555-5512",
98
+            "normalizedNumber": "888-555-5512",
99
+            "type": "MOBILE"
100
+        }, {
101
+            "number": "888-555-1212",
102
+            "normalizedNumber": "888-555-1212",
103
+            "type": "HOME"
104
+        }]
105
+    }]
106
+```
107
+
108
+## Behaviour
109
+
110
+The plugin retrieves **ONLY** the contacts containing one or more phone numbers. It does not allow to modify them (use [the official cordova contacts plugin for that](https://github.com/apache/cordova-plugin-contacts)).
111
+
112
+With the official plugin, it is difficult and inefficient[1] to retrieve the list of all the contacts with at least a phone number (for Android at least). I needed a fastest way to retrieve a simple list containing just the name and the list of phone numbers.
113
+
114
+If you need more fields like the email address or if you also need to retrieve the contacts without email address, we can add an option, open an issue and I'll see what I can do.
115
+
116
+**[1]** When I say *difficult and inefficient*, it is because on Android, all your Gmail contacts are returned as a contact. [See this issue on stackoverflow](http://stackoverflow.com/questions/20406564/phonegap-contacts-api-android-return-only-phone-contacts-and-not-gmail-conta). With the official plugin you have to retrieve all the contacts and then iterate over the result to filter out what you want.
117
+
118
+I executed a small benchmark on my Nexus 5 with Lollipop. The code calls both plugins and displays the result in the console. On this phone I have 1028 contacts but only 71 contacts have at least a phone number. Of course the performances depends on the number of contacts with phone numbers.
119
+
120
+**cordova-plugin-contacts**
121
+
122
+    *  1 call:
123
+        try 1: 2.527s
124
+        try 2: 2.581s
125
+        try 3: 2.221s
126
+
127
+        => average of 2.443s
128
+
129
+    * 10 calls:
130
+        try 1: 6.048s
131
+        try 2: 9.196s
132
+        try 3: 8.981s
133
+
134
+        => average of 8.075s for 10 calls
135
+
136
+**cordova-plugin-contacts-phone-numbers**
137
+
138
+    *  1 call
139
+        try 1: 0.145s
140
+        try 2: 0.185s
141
+        try 3: 0.286s
142
+
143
+        => average of 0.205s
144
+
145
+    * 10 calls:
146
+        try 1: 1.195s
147
+        try 2: 1.211s
148
+        try 3: 1.351s
149
+
150
+        => average of 1.252s for 10 calls
151
+
152
+## iOS and Android
153
+
154
+The plugin works with iOS and Android.
155
+
156
+iOS does not provide a normalized number like Android. So number === normalizedNumber for iOS.
157
+
158
+The thumbnail is not returned on iOS, if you want iOS support, feel free to open a PR.
159
+
160
+The Android code is heavily inspired from the official plugin with some tweaks to improve the perfomances.
161
+
162
+## Donations
163
+
164
+If your app is successful or if you are working for a company, please consider donating some beer money :beer::
165
+
166
+[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/dbaq/10)
167
+
168
+Keep in mind that I am maintaining this repository on my free time so thank you for considering a donation. :+1:
169
+
170
+## Contributing
171
+
172
+Thanks for considering contributing to this project.
173
+
174
+### Finding something to do
175
+
176
+Ask, or pick an issue and comment on it announcing your desire to work on it. Ideally wait until we assign it to you to minimize work duplication.
177
+
178
+### Reporting an issue
179
+
180
+- Search existing issues before raising a new one.
181
+
182
+- Include as much detail as possible.
183
+
184
+### Pull requests
185
+
186
+- Make it clear in the issue tracker what you are working on, so that someone else doesn't duplicate the work.
187
+
188
+- Use a feature branch, not master.
189
+
190
+- Rebase your feature branch onto origin/master before raising the PR.
191
+
192
+- Keep up to date with changes in master so your PR is easy to merge.
193
+
194
+- Be descriptive in your PR message: what is it for, why is it needed, etc.
195
+
196
+- Make sure the tests pass
197
+
198
+- Squash related commits as much as possible.
199
+
200
+### Coding style
201
+
202
+- Try to match the existing indent style.
203
+
204
+- Don't mix platform-specific stuff into the main code.
205
+
206
+
207
+
208
+## Licence ##
209
+
210
+The MIT License
211
+
212
+Copyright (c) 2013 Didier Baquier
213
+
214
+Permission is hereby granted, free of charge, to any person obtaining a copy
215
+of this software and associated documentation files (the "Software"), to deal
216
+in the Software without restriction, including without limitation the rights
217
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
218
+copies of the Software, and to permit persons to whom the Software is
219
+furnished to do so, subject to the following conditions:
220
+
221
+The above copyright notice and this permission notice shall be included in
222
+all copies or substantial portions of the Software.
223
+
224
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
225
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
226
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
227
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
228
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
229
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
230
+THE SOFTWARE.

+ 93
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/package.json Parādīt failu

@@ -0,0 +1,93 @@
1
+{
2
+  "_args": [
3
+    [
4
+      "cordova-plugin-contacts-phonenumbers",
5
+      "/home/manodg/Documents/kilometro0/km0App"
6
+    ]
7
+  ],
8
+  "_from": "cordova-plugin-contacts-phonenumbers@latest",
9
+  "_hasShrinkwrap": false,
10
+  "_id": "cordova-plugin-contacts-phonenumbers@0.0.12",
11
+  "_inCache": true,
12
+  "_installable": true,
13
+  "_location": "/cordova-plugin-contacts-phonenumbers",
14
+  "_nodeVersion": "11.1.0",
15
+  "_npmOperationalInternal": {
16
+    "host": "s3://npm-registry-packages",
17
+    "tmp": "tmp/cordova-plugin-contacts-phonenumbers_0.0.12_1551108529626_0.7774231082117682"
18
+  },
19
+  "_npmUser": {
20
+    "email": "didier.baquier@gmail.com",
21
+    "name": "dbaq"
22
+  },
23
+  "_npmVersion": "6.4.1",
24
+  "_phantomChildren": {},
25
+  "_requested": {
26
+    "name": "cordova-plugin-contacts-phonenumbers",
27
+    "raw": "cordova-plugin-contacts-phonenumbers",
28
+    "rawSpec": "",
29
+    "scope": null,
30
+    "spec": "latest",
31
+    "type": "tag"
32
+  },
33
+  "_requiredBy": [
34
+    "/"
35
+  ],
36
+  "_resolved": "https://registry.npmjs.org/cordova-plugin-contacts-phonenumbers/-/cordova-plugin-contacts-phonenumbers-0.0.12.tgz",
37
+  "_shasum": "c37220257d11abe0b9a86bc18785bbaa21e27d69",
38
+  "_shrinkwrap": null,
39
+  "_spec": "cordova-plugin-contacts-phonenumbers",
40
+  "_where": "/home/manodg/Documents/kilometro0/km0App",
41
+  "author": {
42
+    "name": "Didier Baquier"
43
+  },
44
+  "bugs": {
45
+    "url": "https://github.com/dbaq/cordova-plugin-contacts-phone-numbers/issues"
46
+  },
47
+  "cordova": {
48
+    "id": "cordova-plugin-contacts-phonenumbers",
49
+    "platforms": [
50
+      "android",
51
+      "ios"
52
+    ]
53
+  },
54
+  "dependencies": {},
55
+  "description": "Cordova Plugin to List Contacts Phone Numbers ",
56
+  "devDependencies": {},
57
+  "directories": {},
58
+  "dist": {
59
+    "fileCount": 8,
60
+    "integrity": "sha512-nE9hrJnhpVXXTWAlAi/6MWSxY1Amm1InRfkiOLXazAKFm9HjkVqT80zefjB0Y/KgFolpLsRZn5wS745tTotXPA==",
61
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdAmyCRA9TVsSAnZWagAAmEUQAJTJTe6RaQwqPmzp2W4n\nO7/LTTJoaQ3k+yHWfx3KzWIZhKvJz3+vBdxs5J2c193l0HEQYNf0iPWHY/GG\nGwmuV9coT68lAYvaxN8dQmFn66cWZW+hYQlzYlNn5tq37aMBrAtwvaYGKOrV\nCXKHAVBO8OOr4CSW5Kv7RM7Xz9+ll7gTG4gaApcGoB4THn8nwdqaTpOe8f2Q\nYzVEC4rGGKNfzxzNfcDH0TrHYLlFm/yOyXlfrbKXBFVl6V/doq+UGbw3ra5B\ns22ovVBT9B+gVrJ0JKJR2YwJCj847Y7G1vNwpXJXCR+tkiHGl5Ea3HvjA5BB\nGYvgKjZLBb/YeAizkyRUWCL/W5/c89L5h74o4TSd3VclDG9b1+U3DB6F/A8N\nCu/JJ6yryiWjzD4R4xIA0b2BYnQ8b9BnVQfU/B7z2hswVcYkai9omBHuDvOd\n7qhwDRq26vvSpSPukL7+eG5C2feNOcIGoDGHCFhQe9onhjJsjWKNgnQvMwe+\nbMgkU6Q/Pdd0eNNgaRjA+Qd41HjPx0cbQGkdr9nPvAoFlKxjq9JJs7bEbSoV\nLBcn6c7jbdt//gXLgxIkTWEn8ya2FURg37xSSm5KyMJAAd9ZFbkVflVK4/pA\nPj0MNtvNjp2LU0kGRiAAUW4dou3lXQhyB2qHFAi9btfhJ8xPTaMd5mOVXImk\nT1X0\r\n=2q3B\r\n-----END PGP SIGNATURE-----\r\n",
62
+    "shasum": "c37220257d11abe0b9a86bc18785bbaa21e27d69",
63
+    "tarball": "https://registry.npmjs.org/cordova-plugin-contacts-phonenumbers/-/cordova-plugin-contacts-phonenumbers-0.0.12.tgz",
64
+    "unpackedSize": 32642
65
+  },
66
+  "gitHead": "989abe18852bcf5854d4fe05ae77b0e8b902aaac",
67
+  "homepage": "https://github.com/dbaq/cordova-plugin-contacts-phone-numbers#readme",
68
+  "keywords": [
69
+    "contacts",
70
+    "cordova",
71
+    "cordova-android",
72
+    "cordova-ios",
73
+    "ecosystem:cordova",
74
+    "list",
75
+    "numbers",
76
+    "phone"
77
+  ],
78
+  "license": "Apache 2.0",
79
+  "maintainers": [
80
+    {
81
+      "name": "dbaq",
82
+      "email": "didier.baquier@gmail.com"
83
+    }
84
+  ],
85
+  "name": "cordova-plugin-contacts-phonenumbers",
86
+  "optionalDependencies": {},
87
+  "readme": "ERROR: No README data found!",
88
+  "repository": {
89
+    "type": "git",
90
+    "url": "git+https://github.com/dbaq/cordova-plugin-contacts-phone-numbers.git"
91
+  },
92
+  "version": "0.0.12"
93
+}

+ 53
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/plugin.xml Parādīt failu

@@ -0,0 +1,53 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+
3
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
+    xmlns:android="http://schemas.android.com/apk/res/android"
5
+    id="cordova-plugin-contacts-phonenumbers"
6
+    version="0.0.12">
7
+
8
+    <name>Contacts Phone Numbers</name>
9
+    <description>Cordova Plugin to List Contacts Phone Numbers </description>
10
+    <license>Apache 2.0</license>
11
+    <keywords>cordova,contacts,list,phone,numbers</keywords>
12
+    <issue>https://github.com/dbaq/cordova-plugin-contacts-phone-numbers/issues</issue>
13
+
14
+    <js-module src="www/contactsPhoneNumbers.js" name="contactsPhoneNumbers">
15
+        <clobbers target="navigator.contactsPhoneNumbers" />
16
+    </js-module>
17
+
18
+    <!-- android -->
19
+    <platform name="android">
20
+        <config-file target="res/xml/config.xml" parent="/*">
21
+            <feature name="ContactsPhoneNumbers">
22
+                <param name="android-package" value="com.dbaq.cordova.contactsPhoneNumbers.ContactsManager"/>
23
+            </feature>
24
+        </config-file>
25
+
26
+        <config-file target="AndroidManifest.xml" parent="/*">
27
+            <uses-permission android:name="android.permission.READ_CONTACTS" />
28
+        </config-file>
29
+
30
+        <source-file src="src/android/ContactsManager.java" target-dir="src/com/dbaq/cordova/contactsPhoneNumbers" />
31
+    </platform>
32
+
33
+    <!-- ios -->
34
+    <platform name="ios">
35
+        <config-file target="config.xml" parent="/*">
36
+            <feature name="ContactsPhoneNumbers">
37
+                <param name="ios-package" value="CDVContactsPhoneNumbers"/>
38
+            </feature>
39
+        </config-file>
40
+
41
+        <header-file src="src/ios/CDVContactsPhoneNumbers.h" />
42
+        <source-file src="src/ios/CDVContactsPhoneNumbers.m" />
43
+
44
+        <framework src="AddressBook.framework" weak="true" />
45
+        <framework src="AddressBookUI.framework" weak="true" />
46
+        <framework src="CoreGraphics.framework" />
47
+
48
+        <preference name="CONTACTS_USAGE_DESCRIPTION" default="This app needs contacts access"/>
49
+        <config-file target="*-Info.plist" parent="NSContactsUsageDescription">
50
+            <string>$CONTACTS_USAGE_DESCRIPTION</string>
51
+        </config-file>
52
+    </platform>
53
+</plugin>

+ 213
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/src/android/ContactsManager.java Parādīt failu

@@ -0,0 +1,213 @@
1
+package com.dbaq.cordova.contactsPhoneNumbers;
2
+
3
+import org.apache.cordova.CallbackContext;
4
+import org.apache.cordova.CordovaPlugin;
5
+import org.apache.cordova.PluginResult;
6
+import org.json.JSONArray;
7
+import org.json.JSONException;
8
+import org.json.JSONObject;
9
+
10
+import android.app.Activity;
11
+import android.content.pm.PackageManager;
12
+import android.content.ContentResolver;
13
+import android.content.Intent;
14
+import android.database.Cursor;
15
+import android.provider.ContactsContract;
16
+import android.provider.ContactsContract.CommonDataKinds.Phone;
17
+import android.provider.ContactsContract.CommonDataKinds.StructuredName;
18
+import android.provider.ContactsContract.Contacts;
19
+import android.provider.ContactsContract.Contacts.Data;
20
+import android.util.Log;
21
+import static android.Manifest.permission.READ_CONTACTS;
22
+
23
+public class ContactsManager extends CordovaPlugin {
24
+
25
+    private CallbackContext callbackContext;
26
+
27
+    private JSONArray executeArgs;
28
+
29
+    private static final int READ_CONTACTS_REQ_CODE = 0;
30
+
31
+    public static final String ACTION_LIST_CONTACTS = "list";
32
+
33
+    private static final String LOG_TAG = "Contact Phone Numbers";
34
+
35
+    public ContactsManager() {}
36
+
37
+    /**
38
+     * Executes the request and returns PluginResult.
39
+     *
40
+     * @param action            The action to execute.
41
+     * @param args              JSONArray of arguments for the plugin.
42
+     * @param callbackContext   The callback context used when calling back into JavaScript.
43
+     * @return                  True if the action was valid, false otherwise.
44
+     */
45
+    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
46
+
47
+        this.callbackContext = callbackContext;
48
+        this.executeArgs = args;
49
+
50
+        if (ACTION_LIST_CONTACTS.equals(action)) {
51
+            if (cordova.hasPermission(android.Manifest.permission.READ_CONTACTS)) {
52
+                execHelper();
53
+            } else {
54
+                cordova.requestPermission(this, READ_CONTACTS_REQ_CODE, android.Manifest.permission.READ_CONTACTS);
55
+            }
56
+            return true;
57
+        }
58
+        return false;
59
+    }
60
+
61
+    public void onRequestPermissionResult(int requestCode, String[] permissions, int[] grantResults) throws JSONException {
62
+        for (int r : grantResults) {
63
+            if (r == PackageManager.PERMISSION_DENIED) {
64
+                Log.d(LOG_TAG, "Permission denied");
65
+                callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR,
66
+                                                 "User has denied permission"));
67
+                return;
68
+            }
69
+        }
70
+        execHelper();
71
+    }
72
+
73
+    private void execHelper() {
74
+        this.cordova.getThreadPool().execute(new Runnable() {
75
+            public void run() {
76
+                callbackContext.success(list());
77
+            }
78
+        });
79
+    }
80
+
81
+    private JSONArray list() {
82
+        JSONArray contacts = new JSONArray();
83
+        ContentResolver cr = this.cordova.getActivity().getContentResolver();
84
+        String[] projection = new String[] {
85
+            ContactsContract.Contacts.DISPLAY_NAME,
86
+            ContactsContract.Contacts.PHOTO_THUMBNAIL_URI,
87
+            ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,
88
+            ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME,
89
+            ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME,
90
+            ContactsContract.Contacts.HAS_PHONE_NUMBER,
91
+            ContactsContract.CommonDataKinds.Phone.NUMBER,
92
+            ContactsContract.CommonDataKinds.Phone.NORMALIZED_NUMBER,
93
+            ContactsContract.CommonDataKinds.Phone.TYPE,
94
+            ContactsContract.Data.CONTACT_ID,
95
+            ContactsContract.Data.MIMETYPE
96
+        };
97
+        // Retrieve only the contacts with a phone number at least
98
+        Cursor cursor = cr.query(ContactsContract.Data.CONTENT_URI,
99
+                projection,
100
+                ContactsContract.Contacts.HAS_PHONE_NUMBER + " = 1",
101
+                null,
102
+                ContactsContract.Data.CONTACT_ID + " ASC");
103
+
104
+        contacts = populateContactArray(cursor);
105
+        return contacts;
106
+    }
107
+
108
+
109
+    /**
110
+     * Creates an array of contacts from the cursor you pass in
111
+     *
112
+     * @param c            the cursor
113
+     * @return             a JSONArray of contacts
114
+     */
115
+    private JSONArray populateContactArray(Cursor c) {
116
+
117
+        JSONArray contacts = new JSONArray();
118
+
119
+        String contactId = null;
120
+        String oldContactId = null;
121
+        boolean newContact = true;
122
+        String mimetype = null;
123
+
124
+        JSONObject contact = new JSONObject();
125
+        JSONArray phones = new JSONArray();
126
+
127
+        try {
128
+            if (c.getCount() > 0) {
129
+                while (c.moveToNext()) {
130
+                    contactId = c.getString(c.getColumnIndex(ContactsContract.Data.CONTACT_ID));
131
+
132
+                    if (c.getPosition() == 0) // If we are in the first row set the oldContactId
133
+                        oldContactId = contactId;
134
+
135
+                    // When the contact ID changes we need to push the Contact object to the array of contacts and create new objects.
136
+                    if (!oldContactId.equals(contactId)) {
137
+                        // Populate the Contact object with it's arrays and push the contact into the contacts array
138
+                        contact.put("phoneNumbers", phones);
139
+                        contacts.put(contact);
140
+                        // Clean up the objects
141
+                        contact = new JSONObject();
142
+                        phones = new JSONArray();
143
+
144
+                        // Set newContact to true as we are starting to populate a new contact
145
+                        newContact = true;
146
+                    }
147
+
148
+                    // When we detect a new contact set the ID. These fields are available in every row in the result set returned.
149
+                    if (newContact) {
150
+                        newContact = false;
151
+                        contact.put("id", contactId);
152
+                    }
153
+
154
+                    mimetype = c.getString(c.getColumnIndex(ContactsContract.Data.MIMETYPE)); // Grab the mimetype of the current row as it will be used in a lot of comparisons
155
+
156
+                    if (mimetype.equals(ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)) {
157
+                        contact.put("firstName", c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME)));
158
+                        contact.put("lastName", c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME)));
159
+                        contact.put("middleName", c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME)));
160
+                        contact.put("displayName", c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
161
+                        contact.put("thumbnail", c.getString(c.getColumnIndex(ContactsContract.Contacts.PHOTO_THUMBNAIL_URI)));
162
+                    }
163
+                    else if (mimetype.equals(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
164
+                        phones.put(getPhoneNumber(c));
165
+                    }
166
+
167
+                    // Set the old contact ID
168
+                    oldContactId = contactId;
169
+                }
170
+                // Push the last contact into the contacts array
171
+                contact.put("phoneNumbers", phones);
172
+                contacts.put(contact);
173
+            }
174
+        } catch (JSONException e) {
175
+            Log.e(LOG_TAG, e.getMessage(), e);
176
+        }
177
+        c.close();
178
+        return contacts;
179
+    }
180
+
181
+    /**
182
+     * Create a phone number JSONObject
183
+     * @param cursor the current database row
184
+     * @return a JSONObject representing a phone number
185
+     */
186
+    private JSONObject getPhoneNumber(Cursor cursor) throws JSONException {
187
+        JSONObject phoneNumber = new JSONObject();
188
+        String number = cursor.getString(cursor.getColumnIndex(Phone.NUMBER));
189
+        String normalizedNumber = cursor.getString(cursor.getColumnIndex(Phone.NORMALIZED_NUMBER));
190
+        phoneNumber.put("number", number);
191
+        phoneNumber.put("normalizedNumber", (normalizedNumber == null) ? number : normalizedNumber);
192
+        phoneNumber.put("type", getPhoneTypeLabel(cursor.getInt(cursor.getColumnIndex(Phone.TYPE))));
193
+        return phoneNumber;
194
+    }
195
+
196
+
197
+    /**
198
+     * Retrieve the type of the phone number based on the type code
199
+     * @param type the code of the type
200
+     * @return a string in caps representing the type of phone number
201
+     */
202
+    private String getPhoneTypeLabel(int type) {
203
+        String label = "OTHER";
204
+        if (type == Phone.TYPE_HOME)
205
+            label = "HOME";
206
+        else if (type == Phone.TYPE_MOBILE)
207
+            label = "MOBILE";
208
+        else if (type == Phone.TYPE_WORK)
209
+            label = "WORK";
210
+
211
+        return label;
212
+    }
213
+}

+ 48
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/src/ios/CDVContactsPhoneNumbers.h Parādīt failu

@@ -0,0 +1,48 @@
1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <Foundation/Foundation.h>
21
+#import <AddressBook/ABAddressBook.h>
22
+#import <AddressBookUI/AddressBookUI.h>
23
+#import <Cordova/CDVPlugin.h>
24
+
25
+@interface CDVContactsPhoneNumbers : CDVPlugin
26
+{
27
+    ABAddressBookRef addressBook;
28
+}
29
+
30
+/*
31
+ * list
32
+ *
33
+ * arguments:
34
+ *  1: successcallback - this is the javascript function that will be called with the array of found contacts
35
+ *  2:  errorCallback - optional javascript function to be called in the event of an error
36
+ */
37
+- (void)list:(CDVInvokedUrlCommand*)command;
38
+
39
+@end
40
+
41
+typedef void (^ CDVAddressBookWorkerBlock)(
42
+    ABAddressBookRef         addrBook
43
+    );
44
+@interface CDVAddressBookPhoneNumberHelper : NSObject
45
+{}
46
+
47
+- (void)createAddressBook:(CDVAddressBookWorkerBlock)workerBlock;
48
+@end

+ 172
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/src/ios/CDVContactsPhoneNumbers.m Parādīt failu

@@ -0,0 +1,172 @@
1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import "CDVContactsPhoneNumbers.h"
21
+#import <UIKit/UIKit.h>
22
+
23
+@implementation CDVContactsPhoneNumbers
24
+
25
+- (void)list:(CDVInvokedUrlCommand*)command
26
+{
27
+    NSString* callbackId = command.callbackId;
28
+
29
+    [self.commandDelegate runInBackground:^{
30
+
31
+        CDVAddressBookPhoneNumberHelper* abHelper = [[CDVAddressBookPhoneNumberHelper alloc] init];
32
+        CDVContactsPhoneNumbers* __weak weakSelf = self;
33
+
34
+        [abHelper createAddressBook: ^(ABAddressBookRef addrBook) {
35
+            if (addrBook == NULL) { // permission was denied or other error - return error
36
+                CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"unauthorized"];
37
+                [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
38
+                return;
39
+            }
40
+
41
+            NSMutableArray* contactsWithPhoneNumbers = [[NSMutableArray alloc] init];
42
+
43
+            CFArrayRef records = ABAddressBookCopyArrayOfAllPeople(addrBook);
44
+            NSArray *phoneContacts = (__bridge NSArray*)records;
45
+            CFRelease(records);
46
+
47
+            for(int i = 0; i < phoneContacts.count; i++) {
48
+                ABRecordRef ref = (__bridge ABRecordRef)[phoneContacts objectAtIndex:i];
49
+
50
+                ABMultiValueRef phones = ABRecordCopyValue(ref, kABPersonPhoneProperty);
51
+                int countPhones = ABMultiValueGetCount(phones);
52
+                //we skip users with no phone numbers
53
+                if (countPhones > 0) {
54
+                    NSMutableArray* phoneNumbersArray = [[NSMutableArray alloc] init];
55
+
56
+                    for(CFIndex j = 0; j < countPhones; j++) {
57
+                        CFStringRef phoneNumberRef = ABMultiValueCopyValueAtIndex(phones, j);
58
+                        CFStringRef phoneTypeLabelRef = ABMultiValueCopyLabelAtIndex(phones, j);
59
+                        NSString *number = (__bridge NSString *) phoneNumberRef;
60
+                        NSString *phoneLabel = @"OTHER";
61
+                        if (phoneTypeLabelRef) {
62
+                            if (CFEqual(phoneTypeLabelRef, kABWorkLabel)) {
63
+                                phoneLabel = @"WORK";
64
+                            } else if (CFEqual(phoneTypeLabelRef, kABHomeLabel)) {
65
+                                phoneLabel = @"HOME";
66
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhoneMobileLabel)) {
67
+                                phoneLabel = @"MOBILE";
68
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhoneIPhoneLabel)) {
69
+                                phoneLabel = @"IPHONE";
70
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhoneMainLabel)) {
71
+                                phoneLabel = @"MAIN";
72
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhoneHomeFAXLabel)) {
73
+                                phoneLabel = @"HOMEFAX";
74
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhoneWorkFAXLabel)) {
75
+                                phoneLabel = @"WORKFAX";
76
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhoneOtherFAXLabel)) {
77
+                                phoneLabel = @"OTHERFAX";
78
+                            } else if (CFEqual(phoneTypeLabelRef, kABPersonPhonePagerLabel)) {
79
+                                phoneLabel = @"PAGER";
80
+                            }
81
+                        }
82
+
83
+                        // creating the nested element with the phone number details
84
+                        NSMutableDictionary* phoneNumberDictionary = [NSMutableDictionary dictionaryWithCapacity:1];
85
+                        [phoneNumberDictionary setObject: number forKey:@"number"];
86
+                        [phoneNumberDictionary setObject: number forKey:@"normalizedNumber"];
87
+                        [phoneNumberDictionary setObject: phoneLabel forKey:@"type"];
88
+                        // adding this phone number to the list of phone numbers for this user
89
+                        [phoneNumbersArray addObject:phoneNumberDictionary];
90
+
91
+                        if (phoneNumberRef) CFRelease(phoneNumberRef);
92
+                        if (phoneTypeLabelRef) CFRelease(phoneTypeLabelRef);
93
+                    }
94
+
95
+                    // creating the contact object
96
+                    NSString *displayName;
97
+
98
+                    NSString *firstName = (__bridge_transfer NSString*)ABRecordCopyValue(ref, kABPersonFirstNameProperty);
99
+                    if (!firstName)
100
+                        firstName = @"";
101
+                    displayName = firstName;
102
+
103
+                    NSString *middleName = (__bridge_transfer NSString*)ABRecordCopyValue(ref, kABPersonMiddleNameProperty);
104
+                    if (!middleName) {
105
+                        middleName = @"";
106
+                    }
107
+                    else {
108
+                        if (displayName.length)
109
+                            displayName = [displayName stringByAppendingString:@" "];
110
+                        displayName = [displayName stringByAppendingString:middleName];
111
+                    }
112
+
113
+                    NSString *lastName = (__bridge_transfer NSString*)ABRecordCopyValue(ref, kABPersonLastNameProperty);
114
+                    if (!lastName) {
115
+                        lastName = @"";
116
+                    }
117
+                    else {
118
+                        if (displayName.length)
119
+                            displayName = [displayName stringByAppendingString:@" "];
120
+                        displayName = [displayName stringByAppendingString:lastName];
121
+                    }
122
+
123
+                    NSString *contactId = [NSString stringWithFormat:@"%d", ABRecordGetRecordID(ref)];
124
+
125
+                    //NSLog(@"Name %@ - %@", displayName, contactId);
126
+
127
+                    NSMutableDictionary* contactDictionary = [NSMutableDictionary dictionaryWithCapacity:1];
128
+                    [contactDictionary setObject: contactId forKey:@"id"];
129
+                    [contactDictionary setObject: displayName forKey:@"displayName"];
130
+                    [contactDictionary setObject: firstName forKey:@"firstName"];
131
+                    [contactDictionary setObject: lastName forKey:@"lastName"];
132
+                    [contactDictionary setObject: middleName forKey:@"middleName"];
133
+                    [contactDictionary setObject: phoneNumbersArray forKey:@"phoneNumbers"];
134
+
135
+                    //add the contact to the list to return
136
+                    [contactsWithPhoneNumbers addObject:contactDictionary];
137
+                }
138
+                CFRelease(phones);
139
+            }
140
+
141
+            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:contactsWithPhoneNumbers];
142
+            [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
143
+
144
+            if (addrBook) {
145
+                CFRelease(addrBook);
146
+            }
147
+        }];
148
+    }];
149
+
150
+    return;
151
+}
152
+@end
153
+
154
+
155
+
156
+@implementation CDVAddressBookPhoneNumberHelper
157
+
158
+/**
159
+ * NOTE: workerBlock is responsible for releasing the addressBook that is passed to it
160
+ */
161
+- (void)createAddressBook:(CDVAddressBookWorkerBlock)workerBlock
162
+{
163
+    ABAddressBookRef addrBook = ABAddressBookCreateWithOptions(NULL, nil);
164
+    ABAddressBookRequestAccessWithCompletion(addrBook, ^(bool granted, CFErrorRef error) {
165
+        // callback can occur in background, address book must be accessed on thread it was created on
166
+        dispatch_sync(dispatch_get_main_queue(), ^{
167
+            workerBlock(error || !granted ? NULL : addrBook);
168
+        });
169
+    });
170
+}
171
+
172
+@end

+ 55
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/www/ContactsPhoneNumbers.d.ts Parādīt failu

@@ -0,0 +1,55 @@
1
+interface Navigator {
2
+    /** Provides access to the device contacts database. */
3
+    contactsPhoneNumbers: ContactsPhoneNumbers;
4
+}
5
+
6
+interface ContactsPhoneNumbers {
7
+    /**
8
+     * The navigator.contactsPhoneNumbers.list method executes asynchronously, querying the device contacts database
9
+     * and returning an array of Contact objects. The resulting objects are passed to the onSuccess
10
+     * callback function specified by the onSuccess parameter.
11
+     * @param onSuccess Success callback function invoked with the array of Contact objects returned from the database
12
+     * @param onError Error callback function, invoked when an error occurs.
13
+     */
14
+    list(onSuccess: (contacts: Contact[]) => void,
15
+        onError?: (error: string) => void): void;
16
+}
17
+
18
+interface Contact {
19
+    /** A globally unique identifier. */
20
+    id?: string;
21
+    /** The first name of this Contact. */
22
+    firstName?: string;
23
+    /** The last name of this Contact. */
24
+    lastName?: string;
25
+    /** The name of this Contact, suitable for display to end users. */
26
+    displayName?: string;
27
+    /** An array of all the contact's phone numbers. */
28
+    phoneNumbers?: ContactPhoneNumber[];
29
+}
30
+
31
+declare var Contact: {
32
+    /** Constructor of Contact object */
33
+    new(id?: string,
34
+        firstName?: string,
35
+        LastName?: string,
36
+        displayName?: string,
37
+        phoneNumbers?: ContactPhoneNumber[]): Contact
38
+};
39
+
40
+/** Contains different kinds of information about a Contact object's phone number. */
41
+interface ContactPhoneNumber {
42
+    /** The contact phone number's number. */
43
+    number?: string;
44
+    /** The contact phone number's normalized number. */
45
+    normalizedNumber?: string;
46
+    /** The contact phone number's type (WORK, MOBILE, HOME or OTHER). */
47
+    type?: string;
48
+}
49
+
50
+declare var ContactPhoneNumber: {
51
+    /** Constructor for ContactPhoneNumber object */
52
+    new (number?: string,
53
+        normalizedNumber?: string,
54
+        type?: string): ContactPhoneNumber
55
+};

+ 42
- 0
km0App/node_modules/cordova-plugin-contacts-phonenumbers/www/contactsPhoneNumbers.js Parādīt failu

@@ -0,0 +1,42 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+var argscheck = require('cordova/argscheck'),
23
+    exec = require('cordova/exec');
24
+    
25
+/**
26
+* Represents a group of Contacts.
27
+* @constructor
28
+*/
29
+var contactsList = {
30
+    /**
31
+     * Returns an array of Contacts
32
+     * @param successCB success callback
33
+     * @param errorCB error callback
34
+     * @return array of Contacts 
35
+     */
36
+    list:function(successCB, errorCB) {
37
+        argscheck.checkArgs('fF', 'contactsPhoneNumbers.list', arguments);
38
+        exec(successCB, errorCB, "ContactsPhoneNumbers", "list", []);
39
+    }
40
+};
41
+
42
+module.exports = contactsList;

+ 28
- 0
km0App/node_modules/cordova-plugin-contacts/.appveyor.yml Parādīt failu

@@ -0,0 +1,28 @@
1
+# appveyor file
2
+# http://www.appveyor.com/docs/appveyor-yml
3
+
4
+max_jobs: 1
5
+
6
+shallow_clone: true
7
+
8
+init:
9
+  - git config --global core.autocrlf true
10
+
11
+image:
12
+  - Visual Studio 2017
13
+
14
+environment:
15
+  nodejs_version: "4"
16
+  matrix:
17
+    - PLATFORM: windows-10-store
18
+
19
+install:
20
+  - npm cache clean -f
21
+  - node --version
22
+  - npm install -g cordova-paramedic@https://github.com/apache/cordova-paramedic.git
23
+  - npm install -g cordova
24
+
25
+build: off
26
+
27
+test_script:
28
+  - cordova-paramedic --config pr\%PLATFORM% --plugin . --justBuild

+ 22
- 0
km0App/node_modules/cordova-plugin-contacts/.github/PULL_REQUEST_TEMPLATE.md Parādīt failu

@@ -0,0 +1,22 @@
1
+<!--
2
+Please make sure the checklist boxes are all checked before submitting the PR. The checklist
3
+is intended as a quick reference, for complete details please see our Contributor Guidelines:
4
+
5
+http://cordova.apache.org/contribute/contribute_guidelines.html
6
+
7
+Thanks!
8
+-->
9
+
10
+### Platforms affected
11
+
12
+
13
+### What does this PR do?
14
+
15
+
16
+### What testing has been done on this change?
17
+
18
+
19
+### Checklist
20
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
21
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
22
+- [ ] Added automated test coverage as appropriate for this change.

+ 24
- 0
km0App/node_modules/cordova-plugin-contacts/.jshintrc Parādīt failu

@@ -0,0 +1,24 @@
1
+{
2
+    "browser": true
3
+  , "devel": true
4
+  , "bitwise": true
5
+  , "undef": true
6
+  , "trailing": true
7
+  , "quotmark": false
8
+  , "indent": 4
9
+  , "unused": "vars"
10
+  , "latedef": "nofunc"
11
+  , "globals": {
12
+        "module": false,
13
+        "exports": false,
14
+        "require": false,
15
+        "cordova": true,
16
+        "ContactFindOptions": true,
17
+        "ContactError": true,
18
+        "Contact": true,
19
+        "ContactName": true,
20
+        "ContactField": true,
21
+        "ContactAddress": true,
22
+        "ContactOrganization": true
23
+    }
24
+}

+ 67
- 0
km0App/node_modules/cordova-plugin-contacts/.travis.yml Parādīt failu

@@ -0,0 +1,67 @@
1
+sudo: false
2
+addons:
3
+  jwt:
4
+    secure: JMPPMkxcqYQQJTmXXj6VHAdNny+95vTWFzY6tV4wFMydTurAX5Rw4H2qotEQjcPHml/8ifB/x/9wjLYEuZ+ZTD13LFXeu3AEJJUyzwJ7nTd0/WXIEgnSp+jorWkuhgd9Wn9+cW+XC5HsWUtib23/FQOOm6rEWNv9tHsJTJDkBOI=
5
+env:
6
+  global:
7
+  - SAUCE_USERNAME=snay
8
+  - TRAVIS_NODE_VERSION="4.2"
9
+matrix:
10
+  include:
11
+  - env: PLATFORM=ios-9.3
12
+    os: osx
13
+    osx_image: xcode7.3
14
+    language: node_js
15
+    node_js: '4.2'
16
+  - env: PLATFORM=ios-10.0
17
+    os: osx
18
+    osx_image: xcode7.3
19
+    language: node_js
20
+    node_js: '4.2'
21
+  - env: PLATFORM=android-4.4
22
+    os: linux
23
+    language: android
24
+    jdk: oraclejdk8
25
+    android:
26
+      components:
27
+      - tools
28
+  - env: PLATFORM=android-5.1
29
+    os: linux
30
+    language: android
31
+    jdk: oraclejdk8
32
+    android:
33
+      components:
34
+      - tools
35
+  - env: PLATFORM=android-6.0
36
+    os: linux
37
+    language: android
38
+    jdk: oraclejdk8
39
+    android:
40
+      components:
41
+      - tools
42
+  - env: PLATFORM=android-7.0
43
+    os: linux
44
+    language: android
45
+    jdk: oraclejdk8
46
+    android:
47
+      components:
48
+      - tools
49
+before_install:
50
+- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
51
+  && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
52
+  install $TRAVIS_NODE_VERSION
53
+- node --version
54
+- if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
55
+- if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
56
+- if [[ "$PLATFORM" =~ android ]]; then echo y | android update sdk -u --filter android-22,android-23,android-24,android-25,android-26;
57
+  fi
58
+- git clone https://github.com/apache/cordova-paramedic /tmp/paramedic && pushd /tmp/paramedic
59
+  && npm install && popd
60
+- npm install -g cordova
61
+install:
62
+- npm install
63
+script:
64
+- npm test
65
+- node /tmp/paramedic/main.js --config pr/$PLATFORM --plugin $(pwd) --shouldUseSauce
66
+  --buildName travis-plugin-contacts-$TRAVIS_JOB_NUMBER
67
+

+ 37
- 0
km0App/node_modules/cordova-plugin-contacts/CONTRIBUTING.md Parādīt failu

@@ -0,0 +1,37 @@
1
+<!--
2
+#
3
+# Licensed to the Apache Software Foundation (ASF) under one
4
+# or more contributor license agreements.  See the NOTICE file
5
+# distributed with this work for additional information
6
+# regarding copyright ownership.  The ASF licenses this file
7
+# to you under the Apache License, Version 2.0 (the
8
+# "License"); you may not use this file except in compliance
9
+# with the License.  You may obtain a copy of the License at
10
+#
11
+# http://www.apache.org/licenses/LICENSE-2.0
12
+#
13
+# Unless required by applicable law or agreed to in writing,
14
+# software distributed under the License is distributed on an
15
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+#  KIND, either express or implied.  See the License for the
17
+# specific language governing permissions and limitations
18
+# under the License.
19
+#
20
+-->
21
+
22
+# Contributing to Apache Cordova
23
+
24
+Anyone can contribute to Cordova. And we need your contributions.
25
+
26
+There are multiple ways to contribute: report bugs, improve the docs, and
27
+contribute code.
28
+
29
+For instructions on this, start with the 
30
+[contribution overview](http://cordova.apache.org/contribute/).
31
+
32
+The details are explained there, but the important items are:
33
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
34
+ - Have a Jira issue open that corresponds to your contribution.
35
+ - Run the tests so your patch doesn't break existing functionality.
36
+
37
+We look forward to your contributions!

+ 202
- 0
km0App/node_modules/cordova-plugin-contacts/LICENSE Parādīt failu

@@ -0,0 +1,202 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+
177
+   END OF TERMS AND CONDITIONS
178
+
179
+   APPENDIX: How to apply the Apache License to your work.
180
+
181
+      To apply the Apache License to your work, attach the following
182
+      boilerplate notice, with the fields enclosed by brackets "[]"
183
+      replaced with your own identifying information. (Don't include
184
+      the brackets!)  The text should be enclosed in the appropriate
185
+      comment syntax for the file format. We also recommend that a
186
+      file or class name and description of purpose be included on the
187
+      same "printed page" as the copyright notice for easier
188
+      identification within third-party archives.
189
+
190
+   Copyright [yyyy] [name of copyright owner]
191
+
192
+   Licensed under the Apache License, Version 2.0 (the "License");
193
+   you may not use this file except in compliance with the License.
194
+   You may obtain a copy of the License at
195
+
196
+       http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+   Unless required by applicable law or agreed to in writing, software
199
+   distributed under the License is distributed on an "AS IS" BASIS,
200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+   See the License for the specific language governing permissions and
202
+   limitations under the License.

+ 6
- 0
km0App/node_modules/cordova-plugin-contacts/NOTICE Parādīt failu

@@ -0,0 +1,6 @@
1
+Apache Cordova
2
+Copyright 2012 The Apache Software Foundation
3
+
4
+This product includes software developed at
5
+The Apache Software Foundation (http://www.apache.org/).
6
+Microsoft Open Technologies, Inc. (http://msopentech.com/).

+ 907
- 0
km0App/node_modules/cordova-plugin-contacts/README.md Parādīt failu

@@ -0,0 +1,907 @@
1
+---
2
+title: Contacts
3
+description: Manage the contacts on the device.
4
+---
5
+<!---
6
+# license: Licensed to the Apache Software Foundation (ASF) under one
7
+#         or more contributor license agreements.  See the NOTICE file
8
+#         distributed with this work for additional information
9
+#         regarding copyright ownership.  The ASF licenses this file
10
+#         to you under the Apache License, Version 2.0 (the
11
+#         "License"); you may not use this file except in compliance
12
+#         with the License.  You may obtain a copy of the License at
13
+#
14
+#           http://www.apache.org/licenses/LICENSE-2.0
15
+#
16
+#         Unless required by applicable law or agreed to in writing,
17
+#         software distributed under the License is distributed on an
18
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
+#         KIND, either express or implied.  See the License for the
20
+#         specific language governing permissions and limitations
21
+#         under the License.
22
+-->
23
+
24
+|AppVeyor|Travis CI|
25
+|:-:|:-:|
26
+|[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-plugin-contacts?branch=master)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-contacts)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-contacts)|
27
+
28
+# cordova-plugin-contacts
29
+
30
+This plugin defines a global `navigator.contacts` object, which provides access to the device contacts database.
31
+
32
+Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
33
+```js
34
+document.addEventListener("deviceready", onDeviceReady, false);
35
+function onDeviceReady() {
36
+console.log(navigator.contacts);
37
+}
38
+```
39
+
40
+__WARNING__: Collection and use of contact data raises
41
+important privacy issues.  Your app's privacy policy should discuss
42
+how the app uses contact data and whether it is shared with any other
43
+parties.  Contact information is considered sensitive because it
44
+reveals the people with whom a person communicates.  Therefore, in
45
+addition to the app's privacy policy, you should strongly consider
46
+providing a just-in-time notice before the app accesses or uses
47
+contact data, if the device operating system doesn't do so
48
+already. That notice should provide the same information noted above,
49
+as well as obtaining the user's permission (e.g., by presenting
50
+choices for __OK__ and __No Thanks__).  Note that some app
51
+marketplaces may require the app to provide a just-in-time notice and
52
+obtain the user's permission before accessing contact data.  A
53
+clear and easy-to-understand user experience surrounding the use of
54
+contact data helps avoid user confusion and perceived misuse of
55
+contact data.  For more information, please see the [Privacy Guide](http://cordova.apache.org/docs/en/latest/guide/appdev/privacy/index.html).
56
+
57
+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%20Contacts%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
58
+
59
+## Deprecation Notice
60
+
61
+This plugin is being deprecated. No more work will be done on this plugin by the Cordova development community. You can continue to use this plugin and it should work as-is in the future but any more arising issues will not be fixed by the Cordova community.
62
+
63
+## Installation
64
+
65
+This requires cordova 5.0+ ( current stable v1.0.0 )
66
+
67
+    cordova plugin add cordova-plugin-contacts
68
+Older versions of cordova can still install via the __deprecated__ id ( stale v0.2.16 )
69
+
70
+    cordova plugin add org.apache.cordova.contacts
71
+It is also possible to install via repo url directly ( unstable )
72
+
73
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
74
+
75
+
76
+### iOS Quirks
77
+
78
+Since iOS 10 it's mandatory to provide an usage description in the `info.plist` if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn't provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don't provide an usage description.
79
+
80
+ This plugins requires the following usage description:
81
+
82
+ * `NSContactsUsageDescription` describes the reason that the app accesses the user's contacts.
83
+
84
+ To add this entry into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this:
85
+
86
+```
87
+<edit-config target="NSContactsUsageDescription" file="*-Info.plist" mode="merge">
88
+    <string>need contacts access to search friends</string>
89
+</edit-config>
90
+```
91
+
92
+### Firefox OS Quirks
93
+
94
+Create __www/manifest.webapp__ as described in
95
+[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest).
96
+Add relevant permisions.
97
+There is also a need to change the webapp type to "privileged"  - [Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type).
98
+__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.
99
+
100
+```json
101
+"type": "privileged",
102
+"permissions": {
103
+	"contacts": {
104
+		"access": "readwrite",
105
+		"description": "Describe why there is a need for such permission"
106
+	}
107
+}
108
+```
109
+### Windows Quirks
110
+
111
+**Prior to Windows 10:** Any contacts returned from `find` and `pickContact` methods are readonly, so your application cannot modify them.
112
+`find` method available only on Windows Phone 8.1 devices.
113
+
114
+**Windows 10 and above:** Contacts may be saved and will be saved to app-local contacts storage.  Contacts may also be deleted.
115
+
116
+### Windows 8 Quirks
117
+
118
+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.
119
+Any contacts returned are readonly, so your application cannot modify them.
120
+
121
+## navigator.contacts
122
+
123
+### Methods
124
+
125
+- navigator.contacts.create
126
+- navigator.contacts.find
127
+- navigator.contacts.pickContact
128
+
129
+### Objects
130
+
131
+- Contact
132
+- ContactName
133
+- ContactField
134
+- ContactAddress
135
+- ContactOrganization
136
+- ContactFindOptions
137
+- ContactError
138
+- ContactFieldType
139
+
140
+## navigator.contacts.create
141
+
142
+The `navigator.contacts.create` method is synchronous, and returns a new `Contact` object.
143
+
144
+This method does not retain the Contact object in the device contacts
145
+database, for which you need to invoke the `Contact.save` method.
146
+
147
+### Supported Platforms
148
+
149
+- Android
150
+- BlackBerry 10
151
+- Firefox OS
152
+- iOS
153
+- Windows Phone 8
154
+
155
+### Example
156
+
157
+```js
158
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
159
+```
160
+
161
+## navigator.contacts.find
162
+
163
+The `navigator.contacts.find` method executes asynchronously, querying the
164
+device contacts database and returning an array of `Contact` objects.
165
+The resulting objects are passed to the `contactSuccess` callback
166
+function specified by the __contactSuccess__ parameter.
167
+
168
+The __contactFields__ parameter specifies the fields to be used as a
169
+search qualifier.  A zero-length __contactFields__ parameter is invalid and results in
170
+`ContactError.INVALID_ARGUMENT_ERROR`. A __contactFields__ value of
171
+`"*"` searches all contact fields.
172
+
173
+The __contactFindOptions.filter__ string can be used as a search
174
+filter when querying the contacts database.  If provided, a
175
+case-insensitive, partial value match is applied to each field
176
+specified in the __contactFields__ parameter.  If there's a match for
177
+_any_ of the specified fields, the contact is returned. Use __contactFindOptions.desiredFields__
178
+parameter to control which contact properties must be returned back.
179
+
180
+Supported values for both __contactFields__ and __contactFindOptions.desiredFields__ parameters are enumerated in [`ContactFieldType`](#contactfieldtype) object.
181
+
182
+### Parameters
183
+
184
+- __contactFields__: Contact fields to use as a search qualifier. _(DOMString[])_ [Required]
185
+
186
+- __contactSuccess__: Success callback function invoked with the array of Contact objects returned from the database. [Required]
187
+
188
+- __contactError__: Error callback function, invoked when an error occurs. [Optional]
189
+
190
+- __contactFindOptions__: Search options to filter navigator.contacts. [Optional]
191
+
192
+	Keys include:
193
+
194
+	- __filter__: The search string used to find navigator.contacts. _(DOMString)_ (Default: `""`)
195
+
196
+	- __multiple__: Determines if the find operation returns multiple navigator.contacts. _(Boolean)_ (Default: `false`)
197
+
198
+    - __desiredFields__: Contact fields to be returned back. If specified, the resulting `Contact` object only features values for these fields. _(DOMString[])_ [Optional]
199
+
200
+    - __hasPhoneNumber__(Android only): Filters the search to only return contacts with a phone number informed. _(Boolean)_ (Default: `false`)
201
+
202
+### Supported Platforms
203
+
204
+- Android
205
+- BlackBerry 10
206
+- Firefox OS
207
+- iOS
208
+- Windows Phone 8
209
+- Windows (Windows Phone 8.1 and Windows 10)
210
+
211
+### Example
212
+
213
+```js
214
+function onSuccess(contacts) {
215
+	alert('Found ' + contacts.length + ' contacts.');
216
+};
217
+
218
+function onError(contactError) {
219
+	alert('onError!');
220
+};
221
+
222
+// find all contacts with 'Bob' in any name field
223
+var options      = new ContactFindOptions();
224
+options.filter   = "Bob";
225
+options.multiple = true;
226
+options.desiredFields = [navigator.contacts.fieldType.id];
227
+options.hasPhoneNumber = true;
228
+var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
229
+navigator.contacts.find(fields, onSuccess, onError, options);
230
+```
231
+
232
+### Windows Quirks
233
+
234
+- `__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.
235
+
236
+## navigator.contacts.pickContact
237
+
238
+The `navigator.contacts.pickContact` method launches the Contact Picker to select a single contact.
239
+The resulting object is passed to the `contactSuccess` callback
240
+function specified by the __contactSuccess__ parameter.
241
+
242
+### Parameters
243
+
244
+- __contactSuccess__: Success callback function invoked with the single Contact object. [Required]
245
+
246
+- __contactError__: Error callback function, invoked when an error occurs. [Optional]
247
+
248
+### Supported Platforms
249
+
250
+- Android
251
+- iOS
252
+- Windows Phone 8
253
+- Windows
254
+
255
+### Example
256
+
257
+```js
258
+navigator.contacts.pickContact(function(contact){
259
+        console.log('The following contact has been selected:' + JSON.stringify(contact));
260
+    },function(err){
261
+        console.log('Error: ' + err);
262
+    });
263
+```
264
+
265
+### Android Quirks
266
+
267
+This plugin launches an external Activity for picking contacts. See the
268
+[Android Lifecycle Guide](http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#lifecycle-guide)
269
+for an explanation of how this affects your application. If the plugin returns
270
+its result in the `resume` event, then you must first wrap the returned object
271
+in a `Contact` object before using it. Here is an example:
272
+
273
+```javascript
274
+function onResume(resumeEvent) {
275
+    if(resumeEvent.pendingResult) {
276
+        if(resumeEvent.pendingResult.pluginStatus === "OK") {
277
+            var contact = navigator.contacts.create(resumeEvent.pendingResult.result);
278
+            successCallback(contact);
279
+        } else {
280
+            failCallback(resumeEvent.pendingResult.result);
281
+        }
282
+    }
283
+}
284
+```
285
+
286
+## Contact
287
+
288
+The `Contact` object represents a user's contact.  Contacts can be
289
+created, stored, or removed from the device contacts database.
290
+Contacts can also be retrieved (individually or in bulk) from the
291
+database by invoking the `navigator.contacts.find` method.
292
+
293
+__NOTE__: Not all of the contact fields listed above are supported on
294
+every device platform.  Please check each platform's _Quirks_ section
295
+for details.
296
+
297
+
298
+### Properties
299
+
300
+- __id__: A globally unique identifier. _(DOMString)_
301
+
302
+- __displayName__: The name of this Contact, suitable for display to end users. _(DOMString)_
303
+
304
+- __name__: An object containing all components of a persons name. _(ContactName)_
305
+
306
+- __nickname__: A casual name by which to address the contact. _(DOMString)_
307
+
308
+- __phoneNumbers__: An array of all the contact's phone numbers. _(ContactField[])_
309
+
310
+- __emails__: An array of all the contact's email addresses. _(ContactField[])_
311
+
312
+- __addresses__: An array of all the contact's addresses. _(ContactAddress[])_
313
+
314
+- __ims__: An array of all the contact's IM addresses. _(ContactField[])_
315
+
316
+- __organizations__: An array of all the contact's organizations. _(ContactOrganization[])_
317
+
318
+- __birthday__: The birthday of the contact. _(Date)_
319
+
320
+- __note__: A note about the contact. _(DOMString)_
321
+
322
+- __photos__: An array of the contact's photos. _(ContactField[])_
323
+
324
+- __categories__:  An array of all the user-defined categories associated with the contact. _(ContactField[])_
325
+
326
+- __urls__:  An array of web pages associated with the contact. _(ContactField[])_
327
+
328
+### Methods
329
+
330
+- __clone__: Returns a new `Contact` object that is a deep copy of the calling object, with the `id` property set to `null`.
331
+
332
+- __remove__: Removes the contact from the device contacts database, otherwise executes an error callback with a `ContactError` object.
333
+
334
+- __save__: Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same __id__ already exists.
335
+
336
+### Supported Platforms
337
+
338
+- Amazon Fire OS
339
+- Android
340
+- BlackBerry 10
341
+- Firefox OS
342
+- iOS
343
+- Windows Phone 8
344
+- Windows
345
+
346
+### Save Example
347
+
348
+```js
349
+function onSuccess(contact) {
350
+    alert("Save Success");
351
+};
352
+
353
+function onError(contactError) {
354
+    alert("Error = " + contactError.code);
355
+};
356
+
357
+// create a new contact object
358
+var contact = navigator.contacts.create();
359
+contact.displayName = "Plumber";
360
+contact.nickname = "Plumber";            // specify both to support all devices
361
+
362
+// populate some fields
363
+var name = new ContactName();
364
+name.givenName = "Jane";
365
+name.familyName = "Doe";
366
+contact.name = name;
367
+
368
+// save to device
369
+contact.save(onSuccess,onError);
370
+```
371
+
372
+### Clone Example
373
+
374
+```js
375
+// clone the contact object
376
+var clone = contact.clone();
377
+clone.name.givenName = "John";
378
+console.log("Original contact name = " + contact.name.givenName);
379
+console.log("Cloned contact name = " + clone.name.givenName);
380
+```
381
+
382
+### Remove Example
383
+
384
+```js
385
+function onSuccess() {
386
+    alert("Removal Success");
387
+};
388
+
389
+function onError(contactError) {
390
+    alert("Error = " + contactError.code);
391
+};
392
+
393
+// remove the contact from the device
394
+contact.remove(onSuccess,onError);
395
+```
396
+### Removing phone number(s) from a saved contact
397
+
398
+```js
399
+// Example to create a contact with 3 phone numbers and then remove
400
+// 2 phone numbers. This example is for illustrative purpose only
401
+var myContact = navigator.contacts.create({"displayName": "Test User"});
402
+var phoneNumbers = [];
403
+
404
+phoneNumbers[0] = new ContactField('work', '768-555-1234', false);
405
+phoneNumbers[1] = new ContactField('mobile', '999-555-5432', true); // preferred number
406
+phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
407
+
408
+myContact.phoneNumbers = phoneNumbers;
409
+myContact.save(function (contact_obj) {
410
+    var contactObjToModify = contact_obj.clone();
411
+    contact_obj.remove(function(){
412
+        var phoneNumbers = [contactObjToModify.phoneNumbers[0]];
413
+        contactObjToModify.phoneNumbers = phoneNumbers;
414
+        contactObjToModify.save(function(c_obj){
415
+            console.log("All Done");
416
+        }, function(error){
417
+            console.log("Not able to save the cloned object: " + error);
418
+        });
419
+    }, function(contactError) {
420
+        console.log("Contact Remove Operation failed: " + contactError);
421
+    });
422
+});
423
+```
424
+
425
+### Android 2.X Quirks
426
+
427
+- __categories__:  Not supported on Android 2.X devices, returning `null`.
428
+
429
+### BlackBerry 10 Quirks
430
+
431
+- __id__: Assigned by the device when saving the contact.
432
+
433
+### FirefoxOS Quirks
434
+
435
+- __categories__: Partially supported. Fields __pref__ and __type__ are returning `null`
436
+
437
+- __ims__: Not supported
438
+
439
+- __photos__: Not supported
440
+
441
+
442
+### iOS Quirks
443
+
444
+- __displayName__: Not supported on iOS, returning `null` unless there is no `ContactName` specified, in which case it returns the composite name, __nickname__ or `""`, respectively.
445
+
446
+- __birthday__: Must be input as a JavaScript `Date` object, the same way it is returned.
447
+
448
+- __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.
449
+
450
+- __categories__:  This property is currently not supported, returning `null`.
451
+
452
+### Windows Phone 8 Quirks
453
+
454
+- __displayName__: When creating a contact, the value provided for the display name parameter differs from the display name retrieved when finding the contact.
455
+
456
+- __urls__: When creating a contact, users can input and save more than one web address, but only one is available when searching the contact.
457
+
458
+- __phoneNumbers__: The _pref_ option is not supported. The _type_ is not supported in a _find_ operation. Only one `phoneNumber` is allowed for each _type_.
459
+
460
+- __emails__: The _pref_ option is not supported. Home and personal references same email entry. Only one entry is allowed for each _type_.
461
+
462
+- __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_.
463
+
464
+- __organizations__: Only one is allowed, and does not support the _pref_, _type_, and _department_ attributes.
465
+
466
+- __note__: Not supported, returning `null`.
467
+
468
+- __ims__: Not supported, returning `null`.
469
+
470
+- __birthdays__: Not supported, returning `null`.
471
+
472
+- __categories__: Not supported, returning `null`.
473
+
474
+- __remove__: Method is not supported
475
+
476
+### Windows Quirks
477
+
478
+- __photos__: Returns a File URL to the image, which is stored in the application's temporary directory.
479
+
480
+- __birthdays__: Not supported, returning `null`.
481
+
482
+- __categories__: Not supported, returning `null`.
483
+
484
+- __remove__: Method is only supported in Windows 10 or above.
485
+
486
+## ContactAddress
487
+
488
+The `ContactAddress` object stores the properties of a single address
489
+of a contact.  A `Contact` object may include more than one address in
490
+a `ContactAddress[]` array.
491
+
492
+
493
+### Properties
494
+
495
+- __pref__: Set to `true` if this `ContactAddress` contains the user's preferred value. _(boolean)_
496
+
497
+- __type__: A string indicating what type of field this is, _home_ for example. _(DOMString)_
498
+
499
+- __formatted__: The full address formatted for display. _(DOMString)_
500
+
501
+- __streetAddress__: The full street address. _(DOMString)_
502
+
503
+- __locality__: The city or locality. _(DOMString)_
504
+
505
+- __region__: The state or region. _(DOMString)_
506
+
507
+- __postalCode__: The zip code or postal code. _(DOMString)_
508
+
509
+- __country__: The country name. _(DOMString)_
510
+
511
+### Supported Platforms
512
+
513
+- Amazon Fire OS
514
+- Android
515
+- BlackBerry 10
516
+- Firefox OS
517
+- iOS
518
+- Windows Phone 8
519
+- Windows
520
+
521
+### Example
522
+
523
+```js
524
+// display the address information for all contacts
525
+
526
+function onSuccess(contacts) {
527
+    for (var i = 0; i < contacts.length; i++) {
528
+        for (var j = 0; j < contacts[i].addresses.length; j++) {
529
+            alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
530
+                "Type: "           + contacts[i].addresses[j].type          + "\n" +
531
+                "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
532
+                "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
533
+                "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
534
+                "Region: "         + contacts[i].addresses[j].region        + "\n" +
535
+                "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
536
+                "Country: "        + contacts[i].addresses[j].country);
537
+        }
538
+    }
539
+};
540
+
541
+function onError(contactError) {
542
+    alert('onError!');
543
+};
544
+
545
+// find all contacts
546
+var options = new ContactFindOptions();
547
+options.filter = "";
548
+options.multiple = true;
549
+var filter = ["displayName", "addresses"];
550
+navigator.contacts.find(filter, onSuccess, onError, options);
551
+```
552
+
553
+### Android 2.X Quirks
554
+
555
+- __pref__: Not supported, returning `false` on Android 2.X devices.
556
+
557
+### BlackBerry 10 Quirks
558
+
559
+- __pref__: Not supported on BlackBerry devices, returning `false`.
560
+
561
+- __type__: Partially supported.  Only one each of _Work_ and _Home_ type addresses can be stored per contact.
562
+
563
+- __formatted__: Partially supported.  Returns a concatenation of all BlackBerry address fields.
564
+
565
+- __streetAddress__: Supported.  Returns a concatenation of BlackBerry __address1__ and __address2__ address fields.
566
+
567
+- __locality__: Supported.  Stored in BlackBerry __city__ address field.
568
+
569
+- __region__: Supported.  Stored in BlackBerry __stateProvince__ address field.
570
+
571
+- __postalCode__: Supported.  Stored in BlackBerry __zipPostal__ address field.
572
+
573
+- __country__: Supported.
574
+
575
+### FirefoxOS Quirks
576
+
577
+- __formatted__: Currently not supported
578
+
579
+### iOS Quirks
580
+
581
+- __pref__: Not supported on iOS devices, returning `false`.
582
+
583
+- __formatted__: Currently not supported.
584
+
585
+### Windows Quirks
586
+
587
+- __pref__: Not supported
588
+
589
+
590
+## ContactError
591
+
592
+The `ContactError` object is returned to the user through the
593
+`contactError` callback function when an error occurs.
594
+
595
+### Properties
596
+
597
+- __code__: One of the predefined error codes listed below.
598
+
599
+### Constants
600
+
601
+- `ContactError.UNKNOWN_ERROR` (code 0)
602
+- `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
603
+- `ContactError.TIMEOUT_ERROR` (code 2)
604
+- `ContactError.PENDING_OPERATION_ERROR` (code 3)
605
+- `ContactError.IO_ERROR` (code 4)
606
+- `ContactError.NOT_SUPPORTED_ERROR` (code 5)
607
+- `ContactError.OPERATION_CANCELLED_ERROR` (code 6)
608
+- `ContactError.PERMISSION_DENIED_ERROR` (code 20)
609
+
610
+
611
+## ContactField
612
+
613
+The `ContactField` object is a reusable component that represents
614
+contact fields generically.  Each `ContactField` object contains a
615
+`value`, `type`, and `pref` property.  A `Contact` object stores
616
+several properties in `ContactField[]` arrays, such as phone numbers
617
+and email addresses.
618
+
619
+In most instances, there are no pre-determined values for a
620
+`ContactField` object's __type__ attribute.  For example, a phone
621
+number can specify __type__ values of _home_, _work_, _mobile_,
622
+_iPhone_, or any other value that is supported by a particular device
623
+platform's contact database.  However, for the `Contact` __photos__
624
+field, the __type__ field indicates the format of the returned image:
625
+__url__ when the __value__ attribute contains a URL to the photo
626
+image, or _base64_ when the __value__ contains a base64-encoded image
627
+string.
628
+
629
+### Properties
630
+
631
+- __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString)_
632
+
633
+- __value__: The value of the field, such as a phone number or email address. _(DOMString)_
634
+
635
+- __pref__: Set to `true` if this `ContactField` contains the user's preferred value. _(boolean)_
636
+
637
+### Supported Platforms
638
+
639
+- Amazon Fire OS
640
+- Android
641
+- BlackBerry 10
642
+- Firefox OS
643
+- iOS
644
+- Windows Phone 8
645
+- Windows
646
+
647
+### Example
648
+
649
+```js
650
+// create a new contact
651
+var contact = navigator.contacts.create();
652
+
653
+// store contact phone numbers in ContactField[]
654
+var phoneNumbers = [];
655
+phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
656
+phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
657
+phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
658
+contact.phoneNumbers = phoneNumbers;
659
+
660
+// save the contact
661
+contact.save();
662
+```
663
+
664
+### Android Quirks
665
+
666
+- __pref__: Not supported, returning `false`.
667
+
668
+### BlackBerry 10 Quirks
669
+
670
+- __type__: Partially supported.  Used for phone numbers.
671
+
672
+- __value__: Supported.
673
+
674
+- __pref__: Not supported, returning `false`.
675
+
676
+### iOS Quirks
677
+
678
+- __pref__: Not supported, returning `false`.
679
+
680
+### Windows Quirks
681
+
682
+- __pref__: Not supported, returning `false`.
683
+
684
+
685
+## ContactName
686
+
687
+Contains different kinds of information about a `Contact` object's name.
688
+
689
+### Properties
690
+
691
+- __formatted__: The complete name of the contact. _(DOMString)_
692
+
693
+- __familyName__: The contact's family name. _(DOMString)_
694
+
695
+- __givenName__: The contact's given name. _(DOMString)_
696
+
697
+- __middleName__: The contact's middle name. _(DOMString)_
698
+
699
+- __honorificPrefix__: The contact's prefix (example _Mr._ or _Dr._) _(DOMString)_
700
+
701
+- __honorificSuffix__: The contact's suffix (example _Esq._). _(DOMString)_
702
+
703
+### Supported Platforms
704
+
705
+- Amazon Fire OS
706
+- Android
707
+- BlackBerry 10
708
+- Firefox OS
709
+- iOS
710
+- Windows Phone 8
711
+- Windows
712
+
713
+### Example
714
+
715
+```js
716
+function onSuccess(contacts) {
717
+    for (var i = 0; i < contacts.length; i++) {
718
+        alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
719
+            "Family Name: "  + contacts[i].name.familyName      + "\n" +
720
+            "Given Name: "   + contacts[i].name.givenName       + "\n" +
721
+            "Middle Name: "  + contacts[i].name.middleName      + "\n" +
722
+            "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
723
+            "Prefix: "       + contacts[i].name.honorificSuffix);
724
+    }
725
+};
726
+
727
+function onError(contactError) {
728
+    alert('onError!');
729
+};
730
+
731
+var options = new ContactFindOptions();
732
+options.filter = "";
733
+options.multiple = true;
734
+filter = ["displayName", "name"];
735
+navigator.contacts.find(filter, onSuccess, onError, options);
736
+```
737
+
738
+### Android Quirks
739
+
740
+- __formatted__: Partially supported, and read-only.  Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`.
741
+
742
+### BlackBerry 10 Quirks
743
+
744
+- __formatted__: Partially supported.  Returns a concatenation of BlackBerry __firstName__ and __lastName__ fields.
745
+
746
+- __familyName__: Supported.  Stored in BlackBerry __lastName__ field.
747
+
748
+- __givenName__: Supported.  Stored in BlackBerry __firstName__ field.
749
+
750
+- __middleName__: Not supported, returning `null`.
751
+
752
+- __honorificPrefix__: Not supported, returning `null`.
753
+
754
+- __honorificSuffix__: Not supported, returning `null`.
755
+
756
+### FirefoxOS Quirks
757
+
758
+- __formatted__: Partially supported, and read-only.  Returns a concatenation of `honorificPrefix`, `givenName`, `middleName`, `familyName`, and `honorificSuffix`.
759
+
760
+
761
+### iOS Quirks
762
+
763
+- __formatted__: Partially supported.  Returns iOS Composite Name, but is read-only.
764
+
765
+### Windows Quirks
766
+
767
+- __formatted__: This is the only name property, and is identical to `displayName`, and `nickname`
768
+
769
+- __familyName__: not supported
770
+
771
+- __givenName__: not supported
772
+
773
+- __middleName__: not supported
774
+
775
+- __honorificPrefix__: not supported
776
+
777
+- __honorificSuffix__: not supported
778
+
779
+
780
+## ContactOrganization
781
+
782
+The `ContactOrganization` object stores a contact's organization
783
+properties.  A `Contact` object stores one or more
784
+`ContactOrganization` objects in an array.
785
+
786
+### Properties
787
+
788
+- __pref__: Set to `true` if this `ContactOrganization` contains the user's preferred value. _(boolean)_
789
+
790
+- __type__: A string that indicates what type of field this is, _home_ for example. _(DOMString)
791
+
792
+- __name__: The name of the organization. _(DOMString)_
793
+
794
+- __department__: The department the contract works for. _(DOMString)_
795
+
796
+- __title__: The contact's title at the organization. _(DOMString)_
797
+
798
+
799
+### Supported Platforms
800
+
801
+- Android
802
+- BlackBerry 10
803
+- Firefox OS
804
+- iOS
805
+- Windows Phone 8
806
+- Windows (Windows 8.1 and Windows Phone 8.1 devices only)
807
+
808
+### Example
809
+
810
+```js
811
+function onSuccess(contacts) {
812
+    for (var i = 0; i < contacts.length; i++) {
813
+        for (var j = 0; j < contacts[i].organizations.length; j++) {
814
+            alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
815
+                "Type: "        + contacts[i].organizations[j].type       + "\n" +
816
+                "Name: "        + contacts[i].organizations[j].name       + "\n" +
817
+                "Department: "  + contacts[i].organizations[j].department + "\n" +
818
+                "Title: "       + contacts[i].organizations[j].title);
819
+        }
820
+    }
821
+};
822
+
823
+function onError(contactError) {
824
+    alert('onError!');
825
+};
826
+
827
+var options = new ContactFindOptions();
828
+options.filter = "";
829
+options.multiple = true;
830
+filter = ["displayName", "organizations"];
831
+navigator.contacts.find(filter, onSuccess, onError, options);
832
+```
833
+
834
+### Android 2.X Quirks
835
+
836
+- __pref__: Not supported by Android 2.X devices, returning `false`.
837
+
838
+### BlackBerry 10 Quirks
839
+
840
+- __pref__: Not supported by BlackBerry devices, returning `false`.
841
+
842
+- __type__: Not supported by BlackBerry devices, returning `null`.
843
+
844
+- __name__: Partially supported.  The first organization name is stored in the BlackBerry __company__ field.
845
+
846
+- __department__: Not supported, returning `null`.
847
+
848
+- __title__: Partially supported.  The first organization title is stored in the BlackBerry __jobTitle__ field.
849
+
850
+### Firefox OS Quirks
851
+
852
+- __pref__: Not supported
853
+
854
+- __type__: Not supported
855
+
856
+- __department__: Not supported
857
+
858
+- Fields __name__ and __title__ stored in __org__ and __jobTitle__.
859
+
860
+### iOS Quirks
861
+
862
+- __pref__: Not supported on iOS devices, returning `false`.
863
+
864
+- __type__: Not supported on iOS devices, returning `null`.
865
+
866
+- __name__: Partially supported.  The first organization name is stored in the iOS __kABPersonOrganizationProperty__ field.
867
+
868
+- __department__: Partially supported.  The first department name is stored in the iOS __kABPersonDepartmentProperty__ field.
869
+
870
+- __title__: Partially supported.  The first title is stored in the iOS __kABPersonJobTitleProperty__ field.
871
+
872
+### Windows Quirks
873
+
874
+- __pref__: Not supported, returning `false`.
875
+
876
+- __type__: Not supported, returning `null`.
877
+
878
+## ContactFieldType
879
+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:
880
+
881
+- `navigator.contacts.fieldType.addresses`
882
+- `navigator.contacts.fieldType.birthday`
883
+- `navigator.contacts.fieldType.categories`
884
+- `navigator.contacts.fieldType.country`
885
+- `navigator.contacts.fieldType.department`
886
+- `navigator.contacts.fieldType.displayName`
887
+- `navigator.contacts.fieldType.emails`
888
+- `navigator.contacts.fieldType.familyName`
889
+- `navigator.contacts.fieldType.formatted`
890
+- `navigator.contacts.fieldType.givenName`
891
+- `navigator.contacts.fieldType.honorificPrefix`
892
+- `navigator.contacts.fieldType.honorificSuffix`
893
+- `navigator.contacts.fieldType.id`
894
+- `navigator.contacts.fieldType.ims`
895
+- `navigator.contacts.fieldType.locality`
896
+- `navigator.contacts.fieldType.middleName`
897
+- `navigator.contacts.fieldType.name`
898
+- `navigator.contacts.fieldType.nickname`
899
+- `navigator.contacts.fieldType.note`
900
+- `navigator.contacts.fieldType.organizations`
901
+- `navigator.contacts.fieldType.phoneNumbers`
902
+- `navigator.contacts.fieldType.photos`
903
+- `navigator.contacts.fieldType.postalCode`
904
+- `navigator.contacts.fieldType.region`
905
+- `navigator.contacts.fieldType.streetAddress`
906
+- `navigator.contacts.fieldType.title`
907
+- `navigator.contacts.fieldType.urls`

+ 283
- 0
km0App/node_modules/cordova-plugin-contacts/RELEASENOTES.md Parādīt failu

@@ -0,0 +1,283 @@
1
+<!--
2
+#
3
+# Licensed to the Apache Software Foundation (ASF) under one
4
+# or more contributor license agreements.  See the NOTICE file
5
+# distributed with this work for additional information
6
+# regarding copyright ownership.  The ASF licenses this file
7
+# to you under the Apache License, Version 2.0 (the
8
+# "License"); you may not use this file except in compliance
9
+# with the License.  You may obtain a copy of the License at
10
+# 
11
+# http://www.apache.org/licenses/LICENSE-2.0
12
+# 
13
+# Unless required by applicable law or agreed to in writing,
14
+# software distributed under the License is distributed on an
15
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+#  KIND, either express or implied.  See the License for the
17
+# specific language governing permissions and limitations
18
+# under the License.
19
+#
20
+-->
21
+# Release Notes
22
+
23
+### 3.0.1 (Dec 15, 2017)
24
+* [CB-13062](https://issues.apache.org/jira/browse/CB-13062): Deprecated this plugin. Added notice to README.md
25
+
26
+### 3.0.0 (Nov 06, 2017)
27
+* [CB-13522](https://issues.apache.org/jira/browse/CB-13522) (iOS): Remove usage description
28
+* [CB-13521](https://issues.apache.org/jira/browse/CB-13521) (all): Add 'protective' entry to `cordovaDependencies`
29
+* [CB-13472](https://issues.apache.org/jira/browse/CB-13472) (CI) Fixed Travis **Android** builds again
30
+* [CB-13294](https://issues.apache.org/jira/browse/CB-13294) Remove `cordova-plugin-compat`
31
+* [CB-13299](https://issues.apache.org/jira/browse/CB-13299) (CI) Fix **Android** builds
32
+* [CB-12991](https://issues.apache.org/jira/browse/CB-12991) (CI) Updated CI badges
33
+* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
34
+
35
+### 2.3.1 (Apr 27, 2017)
36
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
37
+* [CB-10496](https://issues.apache.org/jira/browse/CB-10496) (android) now support data: URIs to save photo for contact by image data base64 encoded
38
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
39
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) (android) Adapt Appium tests for **Android** 6 and 7
40
+* [CB-10784](https://issues.apache.org/jira/browse/CB-10784) CDVContactsPicker finish animating before callback
41
+
42
+### 2.3.0 (Feb 28, 2017)
43
+* [CB-12326](https://issues.apache.org/jira/browse/CB-12326) **Android:** `CommonDataKinds.*.LABEL`
44
+* [CB-8076](https://issues.apache.org/jira/browse/CB-8076) Provide error support for **browser** platform
45
+* [CB-12445](https://issues.apache.org/jira/browse/CB-12445) (Appium) Removed double check for contact's name
46
+* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
47
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
48
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and ** iOS 10.0**
49
+* [CB-12357](https://issues.apache.org/jira/browse/CB-12357) Tests give user some time to accept the permission alert
50
+* [CB-12300](https://issues.apache.org/jira/browse/CB-12300) fix tests failure when running it using `jasmine-node`
51
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
52
+
53
+### 2.2.1 (Dec 07, 2016)
54
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 2.2.1
55
+* [CB-11541](https://issues.apache.org/jira/browse/CB-11541) Pended one unsupported test on Windows
56
+* [CB-11541](https://issues.apache.org/jira/browse/CB-11541) iOS: Add extra labels for phone, ims
57
+* [CB-11028](https://issues.apache.org/jira/browse/CB-11028) android: Allow to set custom labels for contacts' fields
58
+* [CB-11975](https://issues.apache.org/jira/browse/CB-11975) iOS: Allow to use numeric values in search filter
59
+* [CB-11206](https://issues.apache.org/jira/browse/CB-11206) (android) Fixed custom IM protocol parsing close #128
60
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been signed and submitted to secretary@apache.org."
61
+* [CB-11350](https://issues.apache.org/jira/browse/CB-11350) android: retrieve displayName for contact when specified in desiredFields
62
+* [CB-11864](https://issues.apache.org/jira/browse/CB-11864) Fixed tests for the new Jasmine version
63
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
64
+
65
+### 2.2.0 (Sep 08, 2016)
66
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
67
+* Added variable to set the usage
68
+* Plugin uses `Android Log class` and not `Cordova LOG class`
69
+* [CB-11695](https://issues.apache.org/jira/browse/CB-11695) Increased session creation timeout for Appium tests
70
+* [CB-11667](https://issues.apache.org/jira/browse/CB-11667) Memory leak in `CDVContact` for `CoreFoundation` `ABRecordRef`
71
+* [CB-11574](https://issues.apache.org/jira/browse/CB-11574) Appium tests now use new injected promise chain methods
72
+* Add badges for paramedic builds on Jenkins
73
+* [CB-11296](https://issues.apache.org/jira/browse/CB-11296) Appium: Better element clicking and session error handling
74
+* Add pull request template.
75
+* Add fenced code blocks - with language hints
76
+* handle `Invalid Date` error
77
+* [CB-11166](https://issues.apache.org/jira/browse/CB-11166) Appium tests: Added a check for contact's birthday
78
+* [CB-11033](https://issues.apache.org/jira/browse/CB-11033) Appium tests: more timeout tweaks
79
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md`
80
+* [CB-11128](https://issues.apache.org/jira/browse/CB-11128) Appium tests: Increased session destruction timeout
81
+
82
+### 2.1.0 (Apr 15, 2016)
83
+* [CB-11043](https://issues.apache.org/jira/browse/CB-11043) **Android** app crashes while trying to save contact with phone numbers array with deleted values
84
+* [CB-10985](https://issues.apache.org/jira/browse/CB-10985) Android sets type to `-1` for ims Added a corresponding test
85
+* [CB-11048](https://issues.apache.org/jira/browse/CB-11048) Fix spec27's inadvertant breakage that happened during logging rollback
86
+* [CB-11041](https://issues.apache.org/jira/browse/CB-11041) `cordova-plugin-contacts` readme must be updated to include instructions on removing phone number from a contact
87
+* [CB-11033](https://issues.apache.org/jira/browse/CB-11033) Appium tests: Increased the timeout for updating the contact
88
+* [CB-10399](https://issues.apache.org/jira/browse/CB-10399) Added Appium tests
89
+* Replace `PermissionHelper.java` with `cordova-plugin-compat`
90
+* [CB-8115](https://issues.apache.org/jira/browse/CB-8115) incorrect birthday saved to phonebook using Contacts Plugin
91
+* Changes to stop using global object - remove all created contacts from the emulator
92
+* [CB-10881](https://issues.apache.org/jira/browse/CB-10881) Increase timeout for Spec22
93
+* Fix for the specs 26&27 to use the newly created contacts for removal test
94
+* [CB-10881](https://issues.apache.org/jira/browse/CB-10881) Remove test dependency on global object
95
+* [CB-10632](https://issues.apache.org/jira/browse/CB-10632) Fixing jasmine test contact removal
96
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
97
+
98
+### 2.0.1 (Jan 15, 2016)
99
+* [CB-10159](https://issues.apache.org/jira/browse/CB-10159) **Android** Adding restore callback to handle Activity destruction
100
+* [CB-10319](https://issues.apache.org/jira/browse/CB-10319) **Android** Adding reflective helper methods for permission requests
101
+* [CB-10117](https://issues.apache.org/jira/browse/CB-10117) Added new tests
102
+* [CB-10131](https://issues.apache.org/jira/browse/CB-10131) Fixed null contact creation.
103
+* [CB-10053](https://issues.apache.org/jira/browse/CB-10053) Documents `ContactFieldType` enumeration. 
104
+* [CB-10148](https://issues.apache.org/jira/browse/CB-10148) **Android** Added `READ_CONTACTS` permission request when picking a contact
105
+* [CB-10053](https://issues.apache.org/jira/browse/CB-10053) Accept assets `URIs` for contact photos
106
+* [CB-8115](https://issues.apache.org/jira/browse/CB-8115) Save contact birthday properly
107
+* [CB-6979](https://issues.apache.org/jira/browse/CB-6979) Don't create duplicates for extracted contacts photos
108
+* [CB-5308](https://issues.apache.org/jira/browse/CB-5308) Makes contacts save specs passing
109
+* [CB-5308](https://issues.apache.org/jira/browse/CB-5308) Return `rawId` instead of id when modifying existing contact
110
+* [CB-4921](https://issues.apache.org/jira/browse/CB-4921) Corrects examples by adding missing `multiple` option where multiple contacts are expected
111
+* [CB-10094](https://issues.apache.org/jira/browse/CB-10094) **Android** Fixed empty string comparison
112
+* [CB-3950](https://issues.apache.org/jira/browse/CB-3950) Adds support for custom labels
113
+* [CB-9770](https://issues.apache.org/jira/browse/CB-9770) Request user permissions before picking a contact
114
+* [CB-8156](https://issues.apache.org/jira/browse/CB-8156) Call error callback on `pickContact` cancellation
115
+* [CB-7906](https://issues.apache.org/jira/browse/CB-7906) Prevent app crash when `desiredFields` option has undefined items
116
+* [CB-7021](https://issues.apache.org/jira/browse/CB-7021) Adds manual test for `pickContact`
117
+
118
+### 2.0.0 (Nov 18, 2015)
119
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
120
+* [CB-9728](https://issues.apache.org/jira/browse/CB-9728) Solving memory leak issues due to opened cursor objects
121
+* [CB-9940](https://issues.apache.org/jira/browse/CB-9940) Adding namespace declarations for `m3` and uap to `plugin.xml`. 
122
+* [CB-9905](https://issues.apache.org/jira/browse/CB-9905) mark tests as pending if **iOS** permission is blocked.
123
+* Refactored `ContactManager` after feedback
124
+* Commit of Contacts Plugin with new `API` for new **MarshMallow** permissions for **Android 6.0**
125
+* Fixing contribute link.
126
+* [CB-9823](https://issues.apache.org/jira/browse/CB-9823) Making sure the `photoCursor` is always closed.
127
+* Shortened multiple references to use `CommonDataKinds` directly
128
+* removed mulitple calls `toLowerCase(Locale.getDefault())` for the same string, use type Phone `enum` directly.
129
+* [CB-8537](https://issues.apache.org/jira/browse/CB-8537) Updated source to pass `Fortify` scan.
130
+* Update `ContactProxy.js`
131
+* Do not return absolute path for contact images.
132
+* [CB-9579](https://issues.apache.org/jira/browse/CB-9579) Fixed failed tests when `DeleteMe` contact already exists
133
+* [CB-9054](https://issues.apache.org/jira/browse/CB-9054): Can't fully reproduce, but we should probably wrap this in an exception anyway.
134
+
135
+### 1.1.0 (Jun 17, 2015)
136
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-contacts documentation translation: cordova-plugin-contacts
137
+* fix npm md issue
138
+* Add more install text for legacy versions of cordova tools. This closes #60
139
+* [CB-9056](https://issues.apache.org/jira/browse/CB-9056) Increased timeout of failing tests
140
+* [CB-8987](https://issues.apache.org/jira/browse/CB-8987): Support for save and remove for Windows 10
141
+* [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.
142
+
143
+### 1.0.0 (Apr 15, 2015)
144
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
145
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) updated wp specific references of old id to new id
146
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
147
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
148
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
149
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
150
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
151
+* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of initWebView method
152
+* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of deprecated headers
153
+* [CB-8604](https://issues.apache.org/jira/browse/CB-8604) Pended unsupported test for wp8, updated documentation
154
+* [CB-8561](https://issues.apache.org/jira/browse/CB-8561) Integrate TravisCI
155
+* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-contacts documentation translation: cordova-plugin-contacts
156
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
157
+* windows: pended .remove test as it is not supported on windows
158
+* [CB-8395](https://issues.apache.org/jira/browse/CB-8395) marked unsupported tests pending on wp8
159
+
160
+### 0.2.16 (Feb 04, 2015)
161
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using (newly) deprecated CordovaLib functions
162
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
163
+* android: Update ContactName support
164
+* Updated the comments for ContactOrganization constructor.
165
+
166
+### 0.2.15 (Dec 02, 2014)
167
+* [CB-7131](https://issues.apache.org/jira/browse/CB-7131) Check for profile photo existance
168
+* [CB-7896](https://issues.apache.org/jira/browse/CB-7896) Better way to detect **Windows** and **WindowsPhone8.1**
169
+* [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
170
+* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
171
+* [CB-7772](https://issues.apache.org/jira/browse/CB-7772) - [Contacts] Cancelling `pickContact` should call the error callback, not the success callback
172
+* [CB-7761](https://issues.apache.org/jira/browse/CB-7761) - Misleading text in documentation
173
+* [CB-7762](https://issues.apache.org/jira/browse/CB-7762) - Parameter list is incorrect for `contacts.find`
174
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-contacts documentation translation: cordova-plugin-contacts
175
+
176
+### 0.2.14 (Oct 03, 2014)
177
+* [CB-7373](https://issues.apache.org/jira/browse/CB-7373) Removes unnecessary Error object creation
178
+* [CB-7373](https://issues.apache.org/jira/browse/CB-7373) Adds additional output if method is not supported.
179
+* [CB-7357](https://issues.apache.org/jira/browse/CB-7357) Adds missing 'capability' element to phone's appxmanifest.
180
+
181
+### 0.2.13 (Sep 17, 2014)
182
+* [CB-7546](https://issues.apache.org/jira/browse/CB-7546) [Contacts][iOS] pickContact shows exception in the console log
183
+* [CB-6374](https://issues.apache.org/jira/browse/CB-6374) Fix iOS 6 deprecation warnings in Contacts
184
+* [CB-7544](https://issues.apache.org/jira/browse/CB-7544) [Contacts][iOS 8] Contact picker is read-only in iOS 8
185
+* [CB-7523](https://issues.apache.org/jira/browse/CB-7523) Fixing "ContactFieldType" error in the config.xml
186
+* [CB-6724](https://issues.apache.org/jira/browse/CB-6724) Empty may be expected.
187
+* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-contacts documentation translation
188
+* Add missing test, skip some specs on wp
189
+* rm old test folder and merged with renamed tests folder
190
+* [CB-7290](https://issues.apache.org/jira/browse/CB-7290) Adds support for universal Windows platform.
191
+* Renamed test dir, added nested plugin.xml
192
+* [CB-7148](https://issues.apache.org/jira/browse/CB-7148) Added manual tests
193
+* Removed js-module for tests from plugin.xml
194
+* Changing cdvtest format to use module exports
195
+* register tests using new style
196
+* convert test to new style
197
+* added documentation for manual tests
198
+* merged changes for test framework plugin
199
+
200
+### 0.2.12 (Aug 06, 2014)
201
+* fixes .find method when 'options' param is not passed. Will return all contacts on missing 'options' param
202
+* [FFOS] update ContactsProxy.js
203
+* Removing a stray unicode character
204
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
205
+* [CB-5698](https://issues.apache.org/jira/browse/CB-5698) ios: Check to see if photoData exists before using
206
+
207
+### 0.2.11 (Jul 2, 2014)
208
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #25
209
+* Remove deprecated symbols for iOS < 6
210
+* [CB-6797](https://issues.apache.org/jira/browse/CB-6797) Add license
211
+* [wp8] now pupulates contact photos
212
+* Update license headers format
213
+* Add pickContact functionality to cordova contacts plugin
214
+* [CB-5416](https://issues.apache.org/jira/browse/CB-5416) - Adding support for auto-managing permissions
215
+* [CB-6682](https://issues.apache.org/jira/browse/CB-6682) move windows8 command proxy into it's missing platform tag. This closes #30
216
+* Add ContactError codes to index.md doc (closes #28)
217
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
218
+* Docs typo: navigator.contacts.length -> contacts.length
219
+* [CB-5698](https://issues.apache.org/jira/browse/CB-5698) ios: Check to see if photoData exists before using
220
+* [CB-7003](https://issues.apache.org/jira/browse/CB-7003) android: Make pickContact pick correct contact on Android 4.3 and 4.4.3
221
+
222
+### 0.2.10 (Apr 17, 2014)
223
+* [CB-6126](https://issues.apache.org/jira/browse/CB-6126): [BlackBerry10] Update docs quirks section for fields which are supported
224
+* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
225
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
226
+* Add NOTICE file
227
+
228
+### 0.2.9 (Feb 26, 2014)
229
+* [CB-6086](https://issues.apache.org/jira/browse/CB-6086) Fix typo in ffos part of plugin.xml: Camera -> Contacts
230
+* [CB-5994](https://issues.apache.org/jira/browse/CB-5994) Switch Contact ID lookup to use Raw contact id.
231
+
232
+### 0.2.8 (Feb 05, 2014)
233
+* [CB-3208](https://issues.apache.org/jira/browse/CB-3208) FFOS docs updated
234
+* [CB-4590](https://issues.apache.org/jira/browse/CB-4590) - chooseContact in CDVContacts crashes app
235
+
236
+### 0.2.7 (Jan 02, 2014)
237
+* B-5658 Add doc/index.md for Contacts plugin
238
+
239
+### 0.2.6 (Dec 4, 2013)
240
+* Fix bad commit/merge
241
+* [CB-3035](https://issues.apache.org/jira/browse/CB-3035) Fix issue with windows new line char \n\r
242
+* wrong example given
243
+* docs added
244
+* FxOS name fields are arrays hackedSearch refactored search based on find commented out
245
+* search hacked via getAll
246
+* search added - no idea if this is working
247
+* createMozillaFromCordova and vice versa are used to translate contact objects from one API to another.
248
+* add/remove working
249
+* save is working
250
+* attempt to save is failing trying to limit the translated contact fields to name and familyName, but still failing
251
+* save is linked with the proxy contact.name doesn't exist www/Contact.js#Contact.prototype.save check on which side is the error
252
+* [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
253
+* [CB-5525](https://issues.apache.org/jira/browse/CB-5525) WP8. Contacts Api fails in case of there is special character in contact field
254
+* fixed ubuntu policy error
255
+* [ubuntu] specify policy_group
256
+* add ubuntu platform
257
+* [CB-3035](https://issues.apache.org/jira/browse/CB-3035) Fix issue with windows new line char \n\r
258
+* 1. Added amazon-fireos platform. 2. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'.
259
+* [CB-5198](https://issues.apache.org/jira/browse/CB-5198) [BlackBerry10] Update dependencies to point to registry
260
+* handle null filter when fields are specified. ( long standing pull-req from @kevfromireland )
261
+
262
+### 0.2.5 (Oct 28, 2013)
263
+* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tags for contacts
264
+* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
265
+
266
+### 0.2.4 (Oct 9, 2013)
267
+* [CB-4950](https://issues.apache.org/jira/browse/CB-4950) Remove the dependence on concrete component android.webkit.WebView.
268
+* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
269
+
270
+### 0.2.3 (Sept 25, 2013)
271
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
272
+* [BlackBerry10] removed uneeded permission tags in plugin.xml
273
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming blackberry10 reference in plugin.xml
274
+* [CB-4888](https://issues.apache.org/jira/browse/CB-4888) renaming org.apache.cordova.core.contacts to org.apache.cordova.contacts
275
+* added contacts api for firefoxos
276
+* Rename CHANGELOG.md -> RELEASENOTES.md
277
+* [CB-4824](https://issues.apache.org/jira/browse/CB-4824) Fix XCode 5 contacts plugin warnings
278
+* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
279
+
280
+### 0.2.1 (Sept 5, 2013)
281
+* [CB-4580](https://issues.apache.org/jira/browse/CB-4580) Fixed up duplicate definitions of module id
282
+* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) Copyright notice change
283
+

+ 422
- 0
km0App/node_modules/cordova-plugin-contacts/appium-tests/common/common.spec.js Parādīt failu

@@ -0,0 +1,422 @@
1
+/*jshint node: true, jasmine: true, browser: true */
2
+/*global ContactFindOptions, ContactName, Q*/
3
+
4
+/*
5
+ *
6
+ * Licensed to the Apache Software Foundation (ASF) under one
7
+ * or more contributor license agreements.  See the NOTICE file
8
+ * distributed with this work for additional information
9
+ * regarding copyright ownership.  The ASF licenses this file
10
+ * to you under the Apache License, Version 2.0 (the
11
+ * "License"); you may not use this file except in compliance
12
+ * with the License.  You may obtain a copy of the License at
13
+ *
14
+ *   http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing,
17
+ * software distributed under the License is distributed on an
18
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
+ * KIND, either express or implied.  See the License for the
20
+ * specific language governing permissions and limitations
21
+ * under the License.
22
+ *
23
+*/
24
+
25
+// these tests are meant to be executed by Cordova Medic Appium runner
26
+// you can find it here: https://github.com/apache/cordova-medic/
27
+// it is not necessary to do a full CI setup to run these tests, just run:
28
+// node cordova-medic/medic/medic.js appium --platform android --plugins cordova-plugin-contacts
29
+
30
+'use strict';
31
+
32
+var wdHelper = global.WD_HELPER;
33
+var screenshotHelper = global.SCREENSHOT_HELPER;
34
+var contactsHelper = require('../helpers/contactsHelper');
35
+
36
+var MINUTE = 60 * 1000;
37
+var PLATFORM = global.PLATFORM;
38
+var UNORM = global.UNORM;
39
+
40
+describe('Contacts UI Automation Tests', function () {
41
+    var driver;
42
+    var webviewContext;
43
+    var promiseCount = 0;
44
+    // going to set this to false if session is created successfully
45
+    var failedToStart = true;
46
+
47
+    function getNextPromiseId() {
48
+        return 'appium_promise_' + promiseCount++;
49
+    }
50
+
51
+    function saveScreenshotAndFail(error) {
52
+        fail(error);
53
+        return screenshotHelper
54
+            .saveScreenshot(driver)
55
+            .quit()
56
+            .then(function () {
57
+                return getDriver();
58
+            });
59
+    }
60
+
61
+    function getDriver() {
62
+        driver = wdHelper.getDriver(PLATFORM);
63
+        return wdHelper.getWebviewContext(driver, 2)
64
+            .then(function (context) {
65
+                webviewContext = context;
66
+                return driver.context(webviewContext);
67
+            })
68
+            .then(function () {
69
+                return wdHelper.waitForDeviceReady(driver);
70
+            })
71
+            .then(function () {
72
+                return wdHelper.injectLibraries(driver);
73
+            });
74
+    }
75
+
76
+    function addContact(firstName, lastName, bday) {
77
+        var bdayString = bday ? bday.toDateString() : undefined;
78
+        var contactName = contactsHelper.getContactName(firstName, lastName);
79
+        return driver
80
+            .context(webviewContext)
81
+            .setAsyncScriptTimeout(MINUTE)
82
+            .executeAsync(function (contactname, bday, callback) {
83
+                navigator.contacts.create({
84
+                    'displayName': contactname.formatted,
85
+                    'name': contactname,
86
+                    'note': 'DeleteMe',
87
+                    'birthday': new Date(bday)
88
+                }).save(function (successResult) {
89
+                    callback(successResult);
90
+                }, function (failureResult) {
91
+                    callback(failureResult);
92
+                });
93
+            }, [contactName, bdayString])
94
+            .then(function (result) {
95
+                if (result && result.hasOwnProperty('code')) {
96
+                    throw result;
97
+                }
98
+                return result;
99
+            });
100
+    }
101
+
102
+    function pickContact(name) {
103
+        var promiseId = getNextPromiseId();
104
+        return driver
105
+            .context(webviewContext)
106
+            .execute(function (pID) {
107
+                navigator._appiumPromises[pID] = Q.defer();
108
+                navigator.contacts.pickContact(function (contact) {
109
+                    navigator._appiumPromises[pID].resolve(contact);
110
+                }, function (err) {
111
+                    navigator._appiumPromises[pID].reject(err);
112
+                });
113
+            }, [promiseId])
114
+            .context('NATIVE_APP')
115
+            .then(function () {
116
+                switch (PLATFORM) {
117
+                    case 'ios':
118
+                        return driver
119
+                            .waitForElementByAccessibilityId(name, 20000)
120
+                            .elementByAccessibilityId(name);
121
+                    case 'android':
122
+                        return driver
123
+                            .waitForElementByXPath('//android.widget.TextView[@text="' + name + '"]', MINUTE);
124
+                }
125
+            })
126
+            .click()
127
+            .context(webviewContext)
128
+            .executeAsync(function (pID, cb) {
129
+                navigator._appiumPromises[pID].promise
130
+                .then(function (contact) {
131
+                    // for some reason Appium cannot get Date object
132
+                    // let's make birthday a string then
133
+                    contact.birthday = contact.birthday.toDateString();
134
+                    cb(contact);
135
+                }, function (err) {
136
+                    cb('ERROR: ' + err);
137
+                });
138
+            }, [promiseId])
139
+            .then(function (result) {
140
+                if (typeof result === 'string' && result.indexOf('ERROR:') === 0) {
141
+                    throw result;
142
+                }
143
+                return result;
144
+            });
145
+    }
146
+
147
+    function renameContact(oldName, newGivenName, newFamilyName) {
148
+        return driver
149
+            .context(webviewContext)
150
+            .setAsyncScriptTimeout(7 * MINUTE)
151
+            .executeAsync(function (oldname, newgivenname, newfamilyname, callback) {
152
+                var obj = new ContactFindOptions();
153
+                obj.filter = oldname;
154
+                obj.multiple = false;
155
+
156
+                navigator.contacts.find(['displayName', 'name'], function (contacts) {
157
+                    if (contacts.length === 0) {
158
+                        callback({ 'code': -35142 });
159
+                        return;
160
+                    }
161
+                    var contact = contacts[0];
162
+                    contact.displayName = newgivenname + ' ' + newfamilyname;
163
+                    var name = new ContactName();
164
+                    name.givenName = newgivenname;
165
+                    name.familyName = newfamilyname;
166
+                    contact.name = name;
167
+                    contact.save(callback, callback);
168
+                }, function (result) {
169
+                    callback(result);
170
+                }, obj);
171
+            }, [oldName, newGivenName, newFamilyName])
172
+            .then(function (result) {
173
+                if (result && result.hasOwnProperty('code')) {
174
+                    if (result.code === -35142) {
175
+                        throw 'Couldn\'t find the contact "' + oldName + '"';
176
+                    }
177
+                    throw result;
178
+                }
179
+                return result;
180
+            });
181
+    }
182
+
183
+    function removeTestContacts() {
184
+        return driver
185
+            .context(webviewContext)
186
+            .setAsyncScriptTimeout(MINUTE)
187
+            .executeAsync(function (callback) {
188
+                var obj = new ContactFindOptions();
189
+                obj.filter = 'DeleteMe';
190
+                obj.multiple = true;
191
+                navigator.contacts.find(['note'], function (contacts) {
192
+                    var removes = [];
193
+                    contacts.forEach(function (contact) {
194
+                        removes.push(contact);
195
+                    });
196
+                    if (removes.length === 0) {
197
+                        return;
198
+                    }
199
+
200
+                   var nextToRemove;
201
+                   if (removes.length > 0) {
202
+                        nextToRemove = removes.shift();
203
+                    }
204
+
205
+                    function removeNext(item) {
206
+                        if (typeof item === 'undefined') {
207
+                            callback();
208
+                            return;
209
+                        }
210
+
211
+                        if (removes.length > 0) {
212
+                            nextToRemove = removes.shift();
213
+                        } else {
214
+                            nextToRemove = undefined;
215
+                        }
216
+
217
+                        item.remove(function removeSucceeded() {
218
+                            removeNext(nextToRemove);
219
+                        }, function removeFailed() {
220
+                            removeNext(nextToRemove);
221
+                        });
222
+                    }
223
+                    removeNext(nextToRemove);
224
+                }, function (failureResult) {
225
+                    callback(failureResult);
226
+                }, obj);
227
+            }, [])
228
+            .then(function (result) {
229
+                if (typeof result !== 'undefined') {
230
+                    throw result;
231
+                }
232
+            });
233
+    }
234
+
235
+    function checkSession(done) {
236
+        if (failedToStart) {
237
+            fail('Failed to start a session');
238
+            done();
239
+        }
240
+    }
241
+
242
+    afterAll(function (done) {
243
+        checkSession(done);
244
+        driver
245
+            .quit()
246
+            .done(done);
247
+    }, MINUTE);
248
+
249
+    it('should connect to an appium endpoint properly', function (done) {
250
+        // retry up to 3 times
251
+        getDriver()
252
+            .fail(function () {
253
+                return getDriver()
254
+                    .fail(function () {
255
+                        return getDriver()
256
+                            .fail(fail);
257
+                    });
258
+            })
259
+            .then(function () {
260
+                failedToStart = false;
261
+            }, fail)
262
+            .then(function () {
263
+                // on iOS and Android >= 6, first interaction with contacts API will trigger the permission dialog.
264
+                // We will attempt to bust it manually here, by triggering the contacts API
265
+                // and waiting for the native dialog to show up, then dismissing the alert.
266
+                // This only needs to be done once.
267
+                // NOTE: in earlier versions of iOS (9.3 and below), using the older UI testing library
268
+                // (UIAutomation), Appium's autoAcceptAlerts capability handles this for us. This logic
269
+                // is here as a transition between UIAutomation and XCUITest and is compatible with both.
270
+                // More details in the comment below.
271
+                var promiseId = getNextPromiseId();
272
+                var contactName = contactsHelper.getContactName('Permission', 'Buster');
273
+                return driver
274
+                    .context(webviewContext)
275
+                    .execute(function (pID, contactname) {
276
+                        navigator._appiumPromises[pID] = Q.defer();
277
+                        navigator.contacts.create({
278
+                            'displayName': contactname.formatted,
279
+                            'name': contactname,
280
+                            'note': 'DeleteMe'
281
+                        }).save(function (contact) {
282
+                            navigator._appiumPromises[pID].resolve(contact);
283
+                        }, function (err) {
284
+                            navigator._appiumPromises[pID].reject(err);
285
+                        });
286
+                    }, [promiseId, contactName])
287
+                    .context('NATIVE_APP')
288
+                    .then(function () {
289
+                        // iOS
290
+                        if (PLATFORM === 'ios') {
291
+                            return driver.acceptAlert()
292
+                                .then(function alertDismissed() {
293
+                                    // TODO: once we move to only XCUITest-based (which is force on you in either iOS 10+ or Xcode 8+)
294
+                                    // UI tests, we will have to:
295
+                                    // a) remove use of autoAcceptAlerts appium capability since it no longer functions in XCUITest
296
+                                    // b) can remove this entire then() clause, as we do not need to explicitly handle the acceptAlert
297
+                                    //    failure callback, since we will be guaranteed to hit the permission dialog on startup.
298
+                                 }, function noAlert() {
299
+                                     // in case the contacts permission alert never showed up: no problem, don't freak out.
300
+                                     // This can happen if:
301
+                                     // a) The application-under-test already had contacts permissions granted to it
302
+                                     // b) Appium's autoAcceptAlerts capability is provided (and functioning)
303
+                                 });
304
+                        }
305
+
306
+                        // Android
307
+                        return driver
308
+                            .elementByXPath('//android.widget.Button[translate(@text, "alow", "ALOW")="ALLOW"]')
309
+                            .click()
310
+                            .fail(function noAlert() { });
311
+                    })
312
+                    .context(webviewContext)
313
+                    .executeAsync(function (pID, cb) {
314
+                        navigator._appiumPromises[pID].promise
315
+                            .then(function (result) {
316
+                                cb(result);
317
+                            }, function (err) {
318
+                                cb('ERROR: ' + err);
319
+                            });
320
+                    }, [promiseId])
321
+                    .then(function (result) {
322
+                        if (typeof result === 'string' && result.indexOf('ERROR:') === 0) {
323
+                            throw result;
324
+                        }
325
+                        return result;
326
+                    });
327
+            })
328
+            .done(done);
329
+    }, 30 * MINUTE);
330
+
331
+    describe('Picking contacts', function () {
332
+        afterEach(function (done) {
333
+            checkSession(done);
334
+            removeTestContacts()
335
+                .finally(done);
336
+        }, MINUTE);
337
+
338
+        it('contacts.ui.spec.1 Pick a contact', function (done) {
339
+            checkSession(done);
340
+            var bday = new Date(1991, 1, 1);
341
+            driver
342
+                .then(function () {
343
+                    return addContact('Test', 'Contact', bday);
344
+                })
345
+                .then(function () {
346
+                    return pickContact('Test Contact');
347
+                })
348
+                .then(function (contact) {
349
+                    expect(contact.name.givenName).toBe('Test');
350
+                    expect(contact.name.familyName).toBe('Contact');
351
+                    expect(contact.birthday).toBe(bday.toDateString());
352
+                })
353
+                .fail(saveScreenshotAndFail)
354
+                .done(done);
355
+        }, 5 * MINUTE);
356
+
357
+        it('contacts.ui.spec.2 Update an existing contact', function (done) {
358
+            checkSession(done);
359
+            driver
360
+                .then(function () {
361
+                    return addContact('Dooney', 'Evans');
362
+                })
363
+                .then(function () {
364
+                    return renameContact('Dooney Evans', 'Urist', 'McContact');
365
+                })
366
+                .then(function () {
367
+                    return pickContact('Urist McContact');
368
+                })
369
+                .then(function (contact) {
370
+                    expect(contact.name.givenName).toBe('Urist');
371
+                    expect(contact.name.familyName).toBe('McContact');
372
+                })
373
+                .fail(saveScreenshotAndFail)
374
+                .done(done);
375
+        }, 10 * MINUTE);
376
+
377
+        it('contacts.ui.spec.3 Create a contact with no name', function (done) {
378
+            checkSession(done);
379
+            driver
380
+                .then(function () {
381
+                    return addContact();
382
+                })
383
+                .then(function () {
384
+                    switch (PLATFORM) {
385
+                        case 'android':
386
+                            return pickContact('(No name)');
387
+                        case 'ios':
388
+                            return pickContact('No Name');
389
+                    }
390
+                })
391
+                .then(function (contact) {
392
+                    if (contact.name) {
393
+                        expect(contact.name.givenName).toBeFalsy();
394
+                        expect(contact.name.middleName).toBeFalsy();
395
+                        expect(contact.name.familyName).toBeFalsy();
396
+                        expect(contact.name.formatted).toBeFalsy();
397
+                    } else {
398
+                        expect(contact.name).toBeFalsy();
399
+                    }
400
+                })
401
+                .fail(saveScreenshotAndFail)
402
+                .done(done);
403
+        }, 5 * MINUTE);
404
+
405
+        it('contacts.ui.spec.4 Create a contact with Unicode characters in name', function (done) {
406
+            checkSession(done);
407
+            driver
408
+                .then(function () {
409
+                    return addContact('Н€йромонах', 'ФеофаЊ');
410
+                })
411
+                .then(function () {
412
+                    return pickContact('Н€йромонах ФеофаЊ');
413
+                })
414
+                .then(function (contact) {
415
+                    expect(contact.name.givenName).toBe('Н€йромонах');
416
+                    expect(contact.name.familyName).toBe('ФеофаЊ');
417
+                })
418
+                .fail(saveScreenshotAndFail)
419
+                .done(done);
420
+        }, 5 * MINUTE);
421
+    });
422
+});

+ 41
- 0
km0App/node_modules/cordova-plugin-contacts/appium-tests/helpers/contactsHelper.js Parādīt failu

@@ -0,0 +1,41 @@
1
+/* jshint node: true */
2
+/*
3
+ *
4
+ * Licensed to the Apache Software Foundation (ASF) under one
5
+ * or more contributor license agreements.  See the NOTICE file
6
+ * distributed with this work for additional information
7
+ * regarding copyright ownership.  The ASF licenses this file
8
+ * to you under the Apache License, Version 2.0 (the
9
+ * "License"); you may not use this file except in compliance
10
+ * with the License.  You may obtain a copy of the License at
11
+ *
12
+ *   http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing,
15
+ * software distributed under the License is distributed on an
16
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
+ * KIND, either express or implied.  See the License for the
18
+ * specific language governing permissions and limitations
19
+ * under the License.
20
+ *
21
+*/
22
+
23
+'use strict';
24
+
25
+module.exports.getContactName = function (firstName, lastName) {
26
+    var formattedName;
27
+    if (typeof firstName !== 'undefined' || typeof lastName !== 'undefined') {
28
+        var delimiter = '';
29
+        if (firstName) {
30
+            delimiter = ' ';
31
+        }
32
+        formattedName = firstName + delimiter + lastName;
33
+    }
34
+
35
+    var contactName = {
36
+        formatted: formattedName,
37
+        familyName: lastName,
38
+        givenName: firstName
39
+    };
40
+    return contactName;
41
+};

+ 735
- 0
km0App/node_modules/cordova-plugin-contacts/doc/de/README.md Parādīt failu

@@ -0,0 +1,735 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+Dieses Plugin definiert eine globale `navigator.contacts`-Objekt bietet Zugriff auf die Geräte-Kontakte-Datenbank.
25
+
26
+Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**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.
35
+
36
+## Installation
37
+
38
+Dies erfordert Cordova 5.0 + (aktuelle stabile v1)
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+Ältere Versionen von Cordova können noch über die Id **veraltet** (veraltet v0.2.16) installieren.
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+Es ist auch möglich, über Repo Url direkt zu installieren (unstable)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### Firefox OS Macken
54
+
55
+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.
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### Windows-Eigenheiten
67
+
68
+**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.
69
+
70
+**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.
71
+
72
+### Windows 8 Macken
73
+
74
+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.
75
+
76
+## Navigator.Contacts
77
+
78
+### Methoden
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### Objekte
85
+
86
+  * Kontakt
87
+  * ContactName
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+Die `navigator.contacts.create`-Methode ist synchron und gibt ein neues `Contact` objekt.
98
+
99
+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.
100
+
101
+### Unterstützte Plattformen
102
+
103
+  * Android
104
+  * BlackBerry 10
105
+  * Firefox OS
106
+  * iOS
107
+  * Windows Phone 7 und 8
108
+
109
+### Beispiel
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+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.
117
+
118
+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.
119
+
120
+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.
121
+
122
+### Parameter
123
+
124
+  * **contactFields**: Kontaktfelder als Qualifizierer Suche verwenden. *(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: Erfolg-Callback-Funktion aufgerufen, die mit dem Array von Contact-Objekte aus der Datenbank zurückgegeben. [Required]
127
+
128
+  * **ContactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt. [Optional]
129
+
130
+  * **contactFindOptions**: Optionen zum Filtern von navigator.contacts zu suchen. [Optional]
131
+    
132
+    Schlüssel enthalten:
133
+    
134
+      * **filter**: die zu suchende Zeichenfolge verwendet, um navigator.contacts zu finden. *(DOM-String und enthält)* (Standard: `""`)
135
+    
136
+      * **multiple**: bestimmt, ob der Suchvorgang mehrere navigator.contacts gibt. *(Boolesch)* (Standard: `false`)
137
+        
138
+          * **desiredFields**: Kontaktfelder wieder zurückgegeben werden. Wenn angegeben, Objekt der daraus resultierenden `Contact` nur Funktionen Werte für diese Felder. *(DOMString[])* [Optional]
139
+
140
+### Unterstützte Plattformen
141
+
142
+  * Android
143
+  * BlackBerry 10
144
+  * Firefox OS
145
+  * iOS
146
+  * Windows Phone 7 und 8
147
+  * Windows (Windows Phone 8.1 und Windows 10)
148
+
149
+### Beispiel
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### Windows-Eigenheiten
169
+
170
+  * `__contactFields__`wird nicht unterstützt und wird ignoriert. `find`Methode wird immer versucht, die Namen, e-Mail-Adresse oder Telefonnummer eines Kontakts übereinstimmen.
171
+
172
+## navigator.contacts.pickContact
173
+
174
+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.
175
+
176
+### Parameter
177
+
178
+  * **ContactSuccess**: Erfolg-Callback-Funktion, die mit den einzelnen Kontakt-Objekt aufgerufen. [Erforderlich]
179
+
180
+  * **ContactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt. [Optional]
181
+
182
+### Unterstützte Plattformen
183
+
184
+  * Android
185
+  * iOS
186
+  * Windows Phone 8
187
+  * Windows 8
188
+  * Windows
189
+
190
+### Beispiel
191
+
192
+    navigator.contacts.pickContact(function(contact){
193
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
194
+        },function(err){
195
+            console.log('Error: ' + err);
196
+        });
197
+    
198
+
199
+## Kontakt
200
+
201
+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.
202
+
203
+**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.
204
+
205
+### Eigenschaften
206
+
207
+  * **ID**: einen globally unique Identifier. *(DOM-String und enthält)*
208
+
209
+  * **DisplayName**: der Name dieses Kontakts, geeignet für die Anzeige für Endbenutzer. *(DOM-String und enthält)*
210
+
211
+  * **Name**: ein Objekt, das alle Komponenten eines Personen-Namen enthält. *(Kontaktperson)*
212
+
213
+  * **Nickname**: einen lässig ein, um den Kontakt zu adressieren. *(DOM-String und enthält)*
214
+
215
+  * **Telefonnummern**: ein Array von der Kontakt-Telefonnummern. *(ContactField[])*
216
+
217
+  * **Email**: ein Array von e-Mail-Adressen des Kontakts. *(ContactField[])*
218
+
219
+  * **Adressen**: ein Array von allen Kontaktadressen. *(ContactAddress[])*
220
+
221
+  * **IMS**: ein Array von IM-Adressen des Kontakts. *(ContactField[])*
222
+
223
+  * **Organisationen**: ein Array von Organisationen des Kontakts. *(ContactOrganization[])*
224
+
225
+  * **Geburtstag**: der Geburtstag des Kontakts. *(Datum)*
226
+
227
+  * **Anmerkung**: eine Anmerkung über den Kontakt. *(DOM-String und enthält)*
228
+
229
+  * **Fotos**: ein Array mit den Kontakt-Fotos. *(ContactField[])*
230
+
231
+  * **Kategorien**: ein Array mit allen benutzerdefinierten Kategorien zugeordnet den Kontakt. *(ContactField[])*
232
+
233
+  * **URLs**: ein Array von Web-Seiten, die den Kontakt zugeordnet. *(ContactField[])*
234
+
235
+### Methoden
236
+
237
+  * **clone**: gibt eine neue `Contact` Objekt, das eine tiefe Kopie des aufrufenden Objekts, mit der `id` -Eigenschaft festgelegt`null`.
238
+
239
+  * **remove**: entfernt den Kontakt aus der Gerät-Kontakte-Datenbank, ansonsten führt eine Fehler-Callback mit einem `ContactError` Objekt.
240
+
241
+  * **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.
242
+
243
+### Unterstützte Plattformen
244
+
245
+  * Amazon Fire OS
246
+  * Android
247
+  * BlackBerry 10
248
+  * Firefox OS
249
+  * iOS
250
+  * Windows Phone 7 und 8
251
+  * Windows 8
252
+  * Windows
253
+
254
+### Speichern Sie Beispiel
255
+
256
+    function onSuccess(contact) {
257
+        alert("Save Success");
258
+    };
259
+    
260
+    function onError(contactError) {
261
+        alert("Error = " + contactError.code);
262
+    };
263
+    
264
+    // create a new contact object
265
+    var contact = navigator.contacts.create();
266
+    contact.displayName = "Plumber";
267
+    contact.nickname = "Plumber";            // specify both to support all devices
268
+    
269
+    // populate some fields
270
+    var name = new ContactName();
271
+    name.givenName = "Jane";
272
+    name.familyName = "Doe";
273
+    contact.name = name;
274
+    
275
+    // save to device
276
+    contact.save(onSuccess,onError);
277
+    
278
+
279
+### Clone-Beispiel
280
+
281
+        // clone the contact object
282
+        var clone = contact.clone();
283
+        clone.name.givenName = "John";
284
+        console.log("Original contact name = " + contact.name.givenName);
285
+        console.log("Cloned contact name = " + clone.name.givenName);
286
+    
287
+
288
+### Beispiel zu entfernen
289
+
290
+    function onSuccess() {
291
+        alert("Removal Success");
292
+    };
293
+    
294
+    function onError(contactError) {
295
+        alert("Error = " + contactError.code);
296
+    };
297
+    
298
+    // remove the contact from the device
299
+    contact.remove(onSuccess,onError);
300
+    
301
+
302
+### Android 2.X Macken
303
+
304
+  * **Kategorien**: Android 2.X Geräten, Rückgabe nicht unterstützt`null`.
305
+
306
+### BlackBerry 10 Macken
307
+
308
+  * **ID**: vom Gerät zugewiesen werden, wenn den Kontakt zu speichern.
309
+
310
+### FirefoxOS Macken
311
+
312
+  * **Kategorien**: teilweise unterstützt. Felder **Pref** und **Typ** kehren zurück`null`
313
+
314
+  * **IMS**: nicht unterstützt
315
+
316
+  * **Fotos**: nicht unterstützt
317
+
318
+### iOS Macken
319
+
320
+  * **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..
321
+
322
+  * **Geburtstag**: muss eingegeben werden, als JavaScript `Date` Objekt, die gleiche Weise zurückgegeben wird.
323
+
324
+  * **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.
325
+
326
+  * **Kategorien**: Diese Eigenschaft wird derzeit nicht unterstützt, Rückgabe`null`.
327
+
328
+### Windows Phone 7 und 8 Eigenarten
329
+
330
+  * **DisplayName**: Wenn Sie einen Kontakt erstellen, der Nutzen für den Anzeigenamen der Display-Name-Parameter unterscheidet abgerufen, wenn den Kontakt zu finden.
331
+
332
+  * **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.
333
+
334
+  * **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*.
335
+
336
+  * **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..
337
+
338
+  * **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..
339
+
340
+  * **Organisationen**: nur zulässig ist, und unterstützt nicht die Attribute *Pref*, *Typ*und *Abteilung* .
341
+
342
+  * **Hinweis**: nicht unterstützt, Rückgabe`null`.
343
+
344
+  * **IMS**: nicht unterstützt, Rückgabe`null`.
345
+
346
+  * **Geburtstage**: nicht unterstützt, Rückgabe`null`.
347
+
348
+  * **Kategorien**: nicht unterstützt, Rückgabe`null`.
349
+
350
+  * **remove**: Methode wird nicht unterstützt
351
+
352
+### Windows-Eigenheiten
353
+
354
+  * **Fotos**: gibt einen Datei-URL auf das Bild, das im temporären Verzeichnis der Anwendung gespeichert ist.
355
+
356
+  * **Geburtstage**: nicht unterstützt, Rückgabe`null`.
357
+
358
+  * **Kategorien**: nicht unterstützt, Rückgabe`null`.
359
+
360
+  * **remove**: Methode ist nur in Windows 10 oder höher unterstützt.
361
+
362
+## ContactAddress
363
+
364
+Das `ContactAddress`-Objekt speichert die Eigenschaften einer einzelnen Adresse eines Kontakts. Ein `Contact` objekt kann mehr als eine Adresse in einem `ContactAddress []`-Array enthalten.
365
+
366
+### Eigenschaften
367
+
368
+  * **Pref**: Legen Sie auf `true` Wenn dieses `ContactAddress` des Benutzers bevorzugten Wert enthält. *(boolesch)*
369
+
370
+  * **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
371
+
372
+  * **formatiert**: die vollständige Adresse, die für die Anzeige formatiert. *(DOM-String und enthält)*
373
+
374
+  * **StreetAddress**: die vollständige Postanschrift. *(DOM-String und enthält)*
375
+
376
+  * **Ort**: die Stadt oder Gemeinde. *(DOM-String und enthält)*
377
+
378
+  * **Region**: dem Staat oder der Region. *(DOM-String und enthält)*
379
+
380
+  * **Postleitzahl**: die Postleitzahl oder Postleitzahl. *(DOM-String und enthält)*
381
+
382
+  * **Land**: den Ländernamen. *(DOM-String und enthält)*
383
+
384
+### Unterstützte Plattformen
385
+
386
+  * Amazon Fire OS
387
+  * Android
388
+  * BlackBerry 10
389
+  * Firefox OS
390
+  * iOS
391
+  * Windows Phone 7 und 8
392
+  * Windows 8
393
+  * Windows
394
+
395
+### Beispiel
396
+
397
+    // display the address information for all contacts
398
+    
399
+    function onSuccess(contacts) {
400
+        for (var i = 0; i < contacts.length; i++) {
401
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
402
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
403
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
404
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
405
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
406
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
407
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
408
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
409
+                    "Country: "        + contacts[i].addresses[j].country);
410
+            }
411
+        }
412
+    };
413
+    
414
+    function onError(contactError) {
415
+        alert('onError!');
416
+    };
417
+    
418
+    // find all contacts
419
+    var options = new ContactFindOptions();
420
+    options.filter = "";
421
+    var filter = ["displayName", "addresses"];
422
+    navigator.contacts.find(filter, onSuccess, onError, options);
423
+    
424
+
425
+### Android 2.X Macken
426
+
427
+  * **Pref**: nicht unterstützt, Rückkehr `false` auf Android 2.X Geräten.
428
+
429
+### BlackBerry 10 Macken
430
+
431
+  * **Pref**: BlackBerry-Geräten, Rückgabe nicht unterstützt`false`.
432
+
433
+  * **Typ**: teilweise unterstützt. Nur eine *Arbeit* und *Home* Typ Adressen kann pro Kontakt gespeichert werden.
434
+
435
+  * **formatiert**: teilweise unterstützt. Gibt eine Verkettung von allen BlackBerry-Adressfelder.
436
+
437
+  * **StreetAddress**: unterstützt. Gibt eine Verkettung von BlackBerry **Adresse1** und **Adresse2** Adressfelder.
438
+
439
+  * **Ort**: unterstützt. Gespeichert in BlackBerry **Stadt** Adressfeld.
440
+
441
+  * **Region**: unterstützt. Gespeichert in BlackBerry **StateProvince** Adressfeld.
442
+
443
+  * **Postleitzahl**: unterstützt. Im Feld für die Adresse des BlackBerry- **ZipPostal** gespeichert.
444
+
445
+  * **Land**: unterstützt.
446
+
447
+### FirefoxOS Macken
448
+
449
+  * **formatiert**: derzeit nicht unterstützt
450
+
451
+### iOS Macken
452
+
453
+  * **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
454
+
455
+  * **formatiert**: derzeit nicht unterstützt.
456
+
457
+### Windows 8 Macken
458
+
459
+  * **Pref**: nicht unterstützt
460
+
461
+### Windows-Eigenheiten
462
+
463
+  * **Pref**: nicht unterstützt
464
+
465
+## ContactError
466
+
467
+Das `ContactError`-Objekt wird dem Benutzer über die `contactError`-Callback-Funktion zurückgegeben, wenn ein Fehler auftritt.
468
+
469
+### Eigenschaften
470
+
471
+  * **Code**: einer der vordefinierten Fehlercodes aufgeführt.
472
+
473
+### Konstanten
474
+
475
+  * `ContactError.UNKNOWN_ERROR` (code 0)
476
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
477
+  * `ContactError.TIMEOUT_ERROR` (code 2)
478
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
479
+  * `ContactError.IO_ERROR` (code 4)
480
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
481
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
482
+
483
+## ContactField
484
+
485
+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.
486
+
487
+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.
488
+
489
+### Eigenschaften
490
+
491
+  * **type**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
492
+
493
+  * **value**: der Wert des Feldes, wie z. B. eine Telefonnummer oder e-Mail-Adresse. *(DOM-String und enthält)*
494
+
495
+  * **pref**: Legen Sie auf `true` Wenn dieses `ContactField` des Benutzers bevorzugten Wert enthält. *(boolesch)*
496
+
497
+### Unterstützte Plattformen
498
+
499
+  * Amazon Fire OS
500
+  * Android
501
+  * BlackBerry 10
502
+  * Firefox OS
503
+  * iOS
504
+  * Windows Phone 7 und 8
505
+  * Windows 8
506
+  * Windows
507
+
508
+### Beispiel
509
+
510
+        // create a new contact
511
+        var contact = navigator.contacts.create();
512
+    
513
+        // store contact phone numbers in ContactField[]
514
+        var phoneNumbers = [];
515
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
516
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
517
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
518
+        contact.phoneNumbers = phoneNumbers;
519
+    
520
+        // save the contact
521
+        contact.save();
522
+    
523
+
524
+### Android Eigenarten
525
+
526
+  * **Pref**: nicht unterstützt, Rückgabe`false`.
527
+
528
+### BlackBerry 10 Macken
529
+
530
+  * **Typ**: teilweise unterstützt. Für Telefonnummern verwendet.
531
+
532
+  * **Wert**: unterstützt.
533
+
534
+  * **Pref**: nicht unterstützt, Rückgabe`false`.
535
+
536
+### iOS Macken
537
+
538
+  * **Pref**: nicht unterstützt, Rückgabe`false`.
539
+
540
+### Windows8 Macken
541
+
542
+  * **Pref**: nicht unterstützt, Rückgabe`false`.
543
+
544
+### Windows-Eigenheiten
545
+
546
+  * **Pref**: nicht unterstützt, Rückgabe`false`.
547
+
548
+## ContactName
549
+
550
+Enthält verschiedene Arten von Informationen über `ein Kontaktobjekt` Namen.
551
+
552
+### Eigenschaften
553
+
554
+  * **formatiert**: den vollständigen Namen des Kontakts. *(DOM-String und enthält)*
555
+
556
+  * **Nachname**: Familienname des Kontakts. *(DOM-String und enthält)*
557
+
558
+  * **GivenName**: Given Name des Kontaktes. *(DOM-String und enthält)*
559
+
560
+  * **MiddleName**: Middle Name des Kontaktes. *(DOM-String und enthält)*
561
+
562
+  * **HonorificPrefix**: der Kontakt-Präfix (z.B. *Mr.* oder *Dr.*) *(DOM-String und enthält)*
563
+
564
+  * **HonorificSuffix**: der Kontakt-Suffix (Beispiel *Esq.*). *(DOM-String und enthält)*
565
+
566
+### Unterstützte Plattformen
567
+
568
+  * Amazon Fire OS
569
+  * Android
570
+  * BlackBerry 10
571
+  * Firefox OS
572
+  * iOS
573
+  * Windows Phone 7 und 8
574
+  * Windows 8
575
+  * Windows
576
+
577
+### Beispiel
578
+
579
+    function onSuccess(contacts) {
580
+        for (var i = 0; i < contacts.length; i++) {
581
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
582
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
583
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
584
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
585
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
586
+                "Prefix: "       + contacts[i].name.honorificSuffix);
587
+        }
588
+    };
589
+    
590
+    function onError(contactError) {
591
+        alert('onError!');
592
+    };
593
+    
594
+    var options = new ContactFindOptions();
595
+    options.filter = "";
596
+    filter = ["displayName", "name"];
597
+    navigator.contacts.find(filter, onSuccess, onError, options);
598
+    
599
+
600
+### Android Eigenarten
601
+
602
+  * **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
603
+
604
+### BlackBerry 10 Macken
605
+
606
+  * **formatiert**: teilweise unterstützt. Gibt eine Verkettung von BlackBerry- **FirstName** und **LastName** -Feldern.
607
+
608
+  * **Nachname**: unterstützt. Im Feld der BlackBerry- **Nachname** gespeichert.
609
+
610
+  * **GivenName**: unterstützt. Im BlackBerry **FirstName** -Feld gespeichert.
611
+
612
+  * **MiddleName**: nicht unterstützt, Rückgabe`null`.
613
+
614
+  * **HonorificPrefix**: nicht unterstützte, Rückgabe`null`.
615
+
616
+  * **HonorificSuffix**: nicht unterstützte, Rückgabe`null`.
617
+
618
+### FirefoxOS Macken
619
+
620
+  * **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
621
+
622
+### iOS Macken
623
+
624
+  * **formatiert**: teilweise unterstützt. IOS zusammengesetzten Namen gibt, aber ist schreibgeschützt.
625
+
626
+### Windows 8 Macken
627
+
628
+  * **formatiert**: Dies ist die einzige Eigenschaft, und ist identisch mit `displayName` , und`nickname`
629
+
630
+  * **Nachname**: nicht unterstützt
631
+
632
+  * **GivenName**: nicht unterstützt
633
+
634
+  * **MiddleName**: nicht unterstützt
635
+
636
+  * **HonorificPrefix**: nicht unterstützt
637
+
638
+  * **HonorificSuffix**: nicht unterstützt
639
+
640
+### Windows-Eigenheiten
641
+
642
+  * **formatiert**: Er ist identisch mit`displayName`
643
+
644
+## ContactOrganization
645
+
646
+Das `ContactOrganization`-Objekt speichert Organisationseigenschaften eines Kontakts. Ein `Contact` objekt werden ein oder mehrere `ContactOrganization`-Objekte in einem Array gespeichert.
647
+
648
+### Eigenschaften
649
+
650
+  * **Pref**: Legen Sie auf `true` Wenn dieses `ContactOrganization` des Benutzers bevorzugten Wert enthält. *(boolesch)*
651
+
652
+  * **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. _(DOMString)
653
+
654
+  * **Name**: der Name der Organisation. *(DOM-String und enthält)*
655
+
656
+  * **Abteilung**: die Abteilung, die der Vertrag für arbeitet. *(DOM-String und enthält)*
657
+
658
+  * **Titel**: Titel des Kontakts in der Organisation. *(DOM-String und enthält)*
659
+
660
+### Unterstützte Plattformen
661
+
662
+  * Android
663
+  * BlackBerry 10
664
+  * Firefox OS
665
+  * iOS
666
+  * Windows Phone 7 und 8
667
+  * Windows (nur Windows-8.1 und Windows Phone 8.1-Geräte)
668
+
669
+### Beispiel
670
+
671
+    function onSuccess(contacts) {
672
+        for (var i = 0; i < contacts.length; i++) {
673
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
674
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
675
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
676
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
677
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
678
+                    "Title: "       + contacts[i].organizations[j].title);
679
+            }
680
+        }
681
+    };
682
+    
683
+    function onError(contactError) {
684
+        alert('onError!');
685
+    };
686
+    
687
+    var options = new ContactFindOptions();
688
+    options.filter = "";
689
+    filter = ["displayName", "organizations"];
690
+    navigator.contacts.find(filter, onSuccess, onError, options);
691
+    
692
+
693
+### Android 2.X Macken
694
+
695
+  * **Pref**: von Android 2.X-Geräte, Rückgabe nicht unterstützt`false`.
696
+
697
+### BlackBerry 10 Macken
698
+
699
+  * **Pref**: von BlackBerry-Geräten zurückgeben nicht unterstützt`false`.
700
+
701
+  * **Typ**: von BlackBerry-Geräten zurückgeben nicht unterstützt`null`.
702
+
703
+  * **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **Firma** BlackBerry gespeichert.
704
+
705
+  * **Abteilung**: nicht unterstützt, Rückgabe`null`.
706
+
707
+  * **Titel**: teilweise unterstützt. Der erste Titel der Organisation wird im Feld **JobTitle** BlackBerry gespeichert.
708
+
709
+### Firefox OS Macken
710
+
711
+  * **Pref**: nicht unterstützt
712
+
713
+  * **Typ**: nicht unterstützt
714
+
715
+  * **Abteilung**: nicht unterstützt
716
+
717
+  * Felder **Name** und **Titel** in **Org** und **JobTitle** gespeichert.
718
+
719
+### iOS Macken
720
+
721
+  * **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
722
+
723
+  * **Typ**: iOS-Geräten, Rückgabe nicht unterstützt`null`.
724
+
725
+  * **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **kABPersonOrganizationProperty** iOS gespeichert.
726
+
727
+  * **Abteilung**: teilweise unterstützt. Die Abteilungsnamen der erste ist im Feld **kABPersonDepartmentProperty** iOS gespeichert.
728
+
729
+  * **Titel**: teilweise unterstützt. Der erste Titel wird im Feld **kABPersonJobTitleProperty** iOS gespeichert.
730
+
731
+### Windows-Eigenheiten
732
+
733
+  * **Pref**: nicht unterstützt, Rückgabe`false`.
734
+
735
+  * **Typ**: nicht unterstützt, Rückgabe`null`.

+ 719
- 0
km0App/node_modules/cordova-plugin-contacts/doc/de/index.md Parādīt failu

@@ -0,0 +1,719 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+Dieses Plugin definiert eine globale `navigator.contacts`-Objekt bietet Zugriff auf die Geräte-Kontakte-Datenbank.
23
+
24
+Obwohl das Objekt mit der globalen Gültigkeitsbereich `navigator` verbunden ist, steht es nicht bis nach dem `Deviceready`-Ereignis.
25
+
26
+    document.addEventListener("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {
28
+        console.log(navigator.contacts);
29
+    }
30
+    
31
+
32
+**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.
33
+
34
+## Installation
35
+
36
+    cordova plugin add cordova-plugin-contacts
37
+    
38
+
39
+### Firefox OS Macken
40
+
41
+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.
42
+
43
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
44
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
45
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
46
+
47
+    "type": "privileged",
48
+    "permissions": {
49
+        "contacts": {
50
+            "access": "readwrite",
51
+            "description": "Describe why there is a need for such permission"
52
+        }
53
+    }
54
+    
55
+
56
+### Windows-Eigenheiten
57
+
58
+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.
59
+
60
+### Windows 8 Macken
61
+
62
+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.
63
+
64
+## Navigator.Contacts
65
+
66
+### Methoden
67
+
68
+*   navigator.contacts.create
69
+*   navigator.contacts.find
70
+*   navigator.contacts.pickContact
71
+
72
+### Objekte
73
+
74
+*   Kontakt
75
+*   ContactName
76
+*   ContactField
77
+*   ContactAddress
78
+*   ContactOrganization
79
+*   ContactFindOptions
80
+*   ContactError
81
+*   ContactFieldType
82
+
83
+## Navigator.Contacts.Create
84
+
85
+Die `navigator.contacts.create`-Methode ist synchron und gibt ein neues `Contact` objekt.
86
+
87
+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.
88
+
89
+### Unterstützte Plattformen
90
+
91
+*   Android
92
+*   BlackBerry 10
93
+*   Firefox OS
94
+*   iOS
95
+*   Windows Phone 7 und 8
96
+
97
+### Beispiel
98
+
99
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
100
+    
101
+
102
+## navigator.contacts.find
103
+
104
+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.
105
+
106
+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.
107
+
108
+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.
109
+
110
+### Parameter
111
+
112
+*   **contactFields**: Kontaktfelder als Qualifizierer Suche verwenden. *(DOMString[])* [Required]
113
+
114
+*   **contactSuccess**: Erfolg-Callback-Funktion aufgerufen, die mit dem Array von Contact-Objekte aus der Datenbank zurückgegeben. [Required]
115
+
116
+*   **contactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt.[Optional]
117
+
118
+*   **contactFindOptions**: Optionen zum Filtern von navigator.contacts zu suchen. [Optional]
119
+    
120
+    Schlüssel enthalten:
121
+    
122
+    *   **filter**: die zu suchende Zeichenfolge verwendet, um navigator.contacts zu finden. *(DOM-String und enthält)* (Standard: `""`)
123
+    
124
+    *   **multiple**: bestimmt, ob der Suchvorgang mehrere navigator.contacts gibt. *(Boolesch)* (Standard: `false`)
125
+        
126
+        *   **desiredFields**: Kontaktfelder wieder zurückgegeben werden. Wenn angegeben, Objekt der daraus resultierenden `Contact` nur Funktionen Werte für diese Felder. *(DOMString[])* [Optional]
127
+
128
+### Unterstützte Plattformen
129
+
130
+*   Android
131
+*   BlackBerry 10
132
+*   Firefox OS
133
+*   iOS
134
+*   Windows Phone 7 und 8
135
+*   Windows (nur Windows Phone 8.1-Geräte)
136
+
137
+### Beispiel
138
+
139
+    function onSuccess(contacts) {
140
+        alert('Found ' + contacts.length + ' contacts.');
141
+    };
142
+    
143
+    function onError(contactError) {
144
+        alert('onError!');
145
+    };
146
+    
147
+    // find all contacts with 'Bob' in any name field
148
+    var options      = new ContactFindOptions();
149
+    options.filter   = "Bob";
150
+    options.multiple = true;
151
+    options.desiredFields = [navigator.contacts.fieldType.id];
152
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
153
+    navigator.contacts.find(fields, onSuccess, onError, options);
154
+    
155
+
156
+### Windows-Eigenheiten
157
+
158
+*   `__contactFields__`wird nicht unterstützt und wird ignoriert. `find`Methode wird immer versucht, die Namen, e-Mail-Adresse oder Telefonnummer eines Kontakts übereinstimmen.
159
+
160
+## navigator.contacts.pickContact
161
+
162
+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.
163
+
164
+### Parameter
165
+
166
+*   **ContactSuccess**: Erfolg-Callback-Funktion, die mit den einzelnen Kontakt-Objekt aufgerufen. [Erforderlich]
167
+
168
+*   **ContactError**: Fehler-Callback-Funktion wird aufgerufen, wenn ein Fehler auftritt. [Optional]
169
+
170
+### Unterstützte Plattformen
171
+
172
+*   Android
173
+*   iOS
174
+*   Windows Phone 8
175
+*   Windows 8
176
+*   Windows
177
+
178
+### Beispiel
179
+
180
+    navigator.contacts.pickContact(function(contact){
181
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
182
+        },function(err){
183
+            console.log('Error: ' + err);
184
+        });
185
+    
186
+
187
+## Kontakt
188
+
189
+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.
190
+
191
+**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.
192
+
193
+### Eigenschaften
194
+
195
+*   **ID**: einen globally unique Identifier. *(DOM-String und enthält)*
196
+
197
+*   **DisplayName**: der Name dieses Kontakts, geeignet für die Anzeige für Endbenutzer. *(DOM-String und enthält)*
198
+
199
+*   **Name**: ein Objekt, das alle Komponenten eines Personen-Namen enthält. *(Kontaktperson)*
200
+
201
+*   **Nickname**: einen lässig ein, um den Kontakt zu adressieren. *(DOM-String und enthält)*
202
+
203
+*   **Telefonnummern**: ein Array von der Kontakt-Telefonnummern. *(ContactField[])*
204
+
205
+*   **Email**: ein Array von e-Mail-Adressen des Kontakts. *(ContactField[])*
206
+
207
+*   **Adressen**: ein Array von allen Kontaktadressen. *(ContactAddress[])*
208
+
209
+*   **IMS**: ein Array von IM-Adressen des Kontakts. *(ContactField[])*
210
+
211
+*   **Organisationen**: ein Array von Organisationen des Kontakts. *(ContactOrganization[])*
212
+
213
+*   **Geburtstag**: der Geburtstag des Kontakts. *(Datum)*
214
+
215
+*   **Anmerkung**: eine Anmerkung über den Kontakt. *(DOM-String und enthält)*
216
+
217
+*   **Fotos**: ein Array mit den Kontakt-Fotos. *(ContactField[])*
218
+
219
+*   **Kategorien**: ein Array mit allen benutzerdefinierten Kategorien zugeordnet den Kontakt. *(ContactField[])*
220
+
221
+*   **URLs**: ein Array von Web-Seiten, die den Kontakt zugeordnet. *(ContactField[])*
222
+
223
+### Methoden
224
+
225
+*   **clone**: gibt eine neue `Contact` Objekt, das eine tiefe Kopie des aufrufenden Objekts, mit der `id` -Eigenschaft festgelegt`null`.
226
+
227
+*   **remove**: entfernt den Kontakt aus der Gerät-Kontakte-Datenbank, ansonsten führt eine Fehler-Callback mit einem `ContactError` Objekt.
228
+
229
+*   **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.
230
+
231
+### Unterstützte Plattformen
232
+
233
+*   Amazon Fire OS
234
+*   Android
235
+*   BlackBerry 10
236
+*   Firefox OS
237
+*   iOS
238
+*   Windows Phone 7 und 8
239
+*   Windows 8
240
+*   Windows
241
+
242
+### Speichern Sie Beispiel
243
+
244
+    function onSuccess(contact) {
245
+        alert("Save Success");
246
+    };
247
+    
248
+    function onError(contactError) {
249
+        alert("Error = " + contactError.code);
250
+    };
251
+    
252
+    // create a new contact object
253
+    var contact = navigator.contacts.create();
254
+    contact.displayName = "Plumber";
255
+    contact.nickname = "Plumber";            // specify both to support all devices
256
+    
257
+    // populate some fields
258
+    var name = new ContactName();
259
+    name.givenName = "Jane";
260
+    name.familyName = "Doe";
261
+    contact.name = name;
262
+    
263
+    // save to device
264
+    contact.save(onSuccess,onError);
265
+    
266
+
267
+### Clone-Beispiel
268
+
269
+        // clone the contact object
270
+        var clone = contact.clone();
271
+        clone.name.givenName = "John";
272
+        console.log("Original contact name = " + contact.name.givenName);
273
+        console.log("Cloned contact name = " + clone.name.givenName);
274
+    
275
+
276
+### Beispiel zu entfernen
277
+
278
+    function onSuccess() {
279
+        alert("Removal Success");
280
+    };
281
+    
282
+    function onError(contactError) {
283
+        alert("Error = " + contactError.code);
284
+    };
285
+    
286
+    // remove the contact from the device
287
+    contact.remove(onSuccess,onError);
288
+    
289
+
290
+### Android 2.X Macken
291
+
292
+*   **Kategorien**: Android 2.X Geräten, Rückgabe nicht unterstützt`null`.
293
+
294
+### BlackBerry 10 Macken
295
+
296
+*   **ID**: vom Gerät zugewiesen werden, wenn den Kontakt zu speichern.
297
+
298
+### FirefoxOS Macken
299
+
300
+*   **Kategorien**: teilweise unterstützt. Felder **Pref** und **Typ** kehren zurück`null`
301
+
302
+*   **IMS**: nicht unterstützt
303
+
304
+*   **Fotos**: nicht unterstützt
305
+
306
+### iOS Macken
307
+
308
+*   **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..
309
+
310
+*   **Geburtstag**: muss eingegeben werden, als JavaScript `Date` Objekt, die gleiche Weise zurückgegeben wird.
311
+
312
+*   **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.
313
+
314
+*   **Kategorien**: Diese Eigenschaft wird derzeit nicht unterstützt, Rückgabe`null`.
315
+
316
+### Windows Phone 7 und 8 Eigenarten
317
+
318
+*   **DisplayName**: Wenn Sie einen Kontakt erstellen, der Nutzen für den Anzeigenamen der Display-Name-Parameter unterscheidet abgerufen, wenn den Kontakt zu finden.
319
+
320
+*   **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.
321
+
322
+*   **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*.
323
+
324
+*   **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..
325
+
326
+*   **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..
327
+
328
+*   **Organisationen**: nur zulässig ist, und unterstützt nicht die Attribute *Pref*, *Typ*und *Abteilung* .
329
+
330
+*   **Hinweis**: nicht unterstützt, Rückgabe`null`.
331
+
332
+*   **IMS**: nicht unterstützt, Rückgabe`null`.
333
+
334
+*   **Geburtstage**: nicht unterstützt, Rückgabe`null`.
335
+
336
+*   **Kategorien**: nicht unterstützt, Rückgabe`null`.
337
+
338
+### Windows-Eigenheiten
339
+
340
+*   **Fotos**: gibt einen Datei-URL auf das Bild, das im temporären Verzeichnis der Anwendung gespeichert ist.
341
+
342
+*   **Geburtstage**: nicht unterstützt, Rückgabe`null`.
343
+
344
+*   **Kategorien**: nicht unterstützt, Rückgabe`null`.
345
+
346
+## ContactAddress
347
+
348
+Das `ContactAddress`-Objekt speichert die Eigenschaften einer einzelnen Adresse eines Kontakts. Ein `Contact` objekt kann mehr als eine Adresse in einem `ContactAddress []`-Array enthalten.
349
+
350
+### Eigenschaften
351
+
352
+*   **Pref**: Legen Sie auf `true` Wenn dieses `ContactAddress` des Benutzers bevorzugten Wert enthält. *(boolesch)*
353
+
354
+*   **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
355
+
356
+*   **formatiert**: die vollständige Adresse, die für die Anzeige formatiert. *(DOM-String und enthält)*
357
+
358
+*   **StreetAddress**: die vollständige Postanschrift. *(DOM-String und enthält)*
359
+
360
+*   **Ort**: die Stadt oder Gemeinde. *(DOM-String und enthält)*
361
+
362
+*   **Region**: dem Staat oder der Region. *(DOM-String und enthält)*
363
+
364
+*   **Postleitzahl**: die Postleitzahl oder Postleitzahl. *(DOM-String und enthält)*
365
+
366
+*   **Land**: den Ländernamen. *(DOM-String und enthält)*
367
+
368
+### Unterstützte Plattformen
369
+
370
+*   Amazon Fire OS
371
+*   Android
372
+*   BlackBerry 10
373
+*   Firefox OS
374
+*   iOS
375
+*   Windows Phone 7 und 8
376
+*   Windows 8
377
+*   Windows
378
+
379
+### Beispiel
380
+
381
+    // display the address information for all contacts
382
+    
383
+    function onSuccess(contacts) {
384
+        for (var i = 0; i < contacts.length; i++) {
385
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
386
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
387
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
388
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
389
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
390
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
391
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
392
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
393
+                    "Country: "        + contacts[i].addresses[j].country);
394
+            }
395
+        }
396
+    };
397
+    
398
+    function onError(contactError) {
399
+        alert('onError!');
400
+    };
401
+    
402
+    // find all contacts
403
+    var options = new ContactFindOptions();
404
+    options.filter = "";
405
+    var filter = ["displayName", "addresses"];
406
+    navigator.contacts.find(filter, onSuccess, onError, options);
407
+    
408
+
409
+### Android 2.X Macken
410
+
411
+*   **Pref**: nicht unterstützt, Rückkehr `false` auf Android 2.X Geräten.
412
+
413
+### BlackBerry 10 Macken
414
+
415
+*   **Pref**: BlackBerry-Geräten, Rückgabe nicht unterstützt`false`.
416
+
417
+*   **Typ**: teilweise unterstützt. Nur eine *Arbeit* und *Home* Typ Adressen kann pro Kontakt gespeichert werden.
418
+
419
+*   **formatiert**: teilweise unterstützt. Gibt eine Verkettung von allen BlackBerry-Adressfelder.
420
+
421
+*   **StreetAddress**: unterstützt. Gibt eine Verkettung von BlackBerry **Adresse1** und **Adresse2** Adressfelder.
422
+
423
+*   **Ort**: unterstützt. Gespeichert in BlackBerry **Stadt** Adressfeld.
424
+
425
+*   **Region**: unterstützt. Gespeichert in BlackBerry **StateProvince** Adressfeld.
426
+
427
+*   **Postleitzahl**: unterstützt. Im Feld für die Adresse des BlackBerry- **ZipPostal** gespeichert.
428
+
429
+*   **Land**: unterstützt.
430
+
431
+### FirefoxOS Macken
432
+
433
+*   **formatiert**: derzeit nicht unterstützt
434
+
435
+### iOS Macken
436
+
437
+*   **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
438
+
439
+*   **formatiert**: derzeit nicht unterstützt.
440
+
441
+### Windows 8 Macken
442
+
443
+*   **Pref**: nicht unterstützt
444
+
445
+### Windows-Eigenheiten
446
+
447
+*   **Pref**: nicht unterstützt
448
+
449
+## ContactError
450
+
451
+Das `ContactError`-Objekt wird dem Benutzer über die `contactError`-Callback-Funktion zurückgegeben, wenn ein Fehler auftritt.
452
+
453
+### Eigenschaften
454
+
455
+*   **Code**: einer der vordefinierten Fehlercodes aufgeführt.
456
+
457
+### Konstanten
458
+
459
+*   `ContactError.UNKNOWN_ERROR` (code 0)
460
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
461
+*   `ContactError.TIMEOUT_ERROR` (code 2)
462
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
463
+*   `ContactError.IO_ERROR` (code 4)
464
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
465
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
466
+
467
+## ContactField
468
+
469
+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.
470
+
471
+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.
472
+
473
+### Eigenschaften
474
+
475
+*   **type**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. *(DOM-String und enthält)*
476
+
477
+*   **value**: der Wert des Feldes, wie z. B. eine Telefonnummer oder e-Mail-Adresse. *(DOM-String und enthält)*
478
+
479
+*   **pref**: Legen Sie auf `true` Wenn dieses `ContactField` des Benutzers bevorzugten Wert enthält. *(boolesch)*
480
+
481
+### Unterstützte Plattformen
482
+
483
+*   Amazon Fire OS
484
+*   Android
485
+*   BlackBerry 10
486
+*   Firefox OS
487
+*   iOS
488
+*   Windows Phone 7 und 8
489
+*   Windows 8
490
+*   Windows
491
+
492
+### Beispiel
493
+
494
+        // create a new contact
495
+        var contact = navigator.contacts.create();
496
+    
497
+        // store contact phone numbers in ContactField[]
498
+        var phoneNumbers = [];
499
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
500
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
501
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
502
+        contact.phoneNumbers = phoneNumbers;
503
+    
504
+        // save the contact
505
+        contact.save();
506
+    
507
+
508
+### Android Eigenarten
509
+
510
+*   **Pref**: nicht unterstützt, Rückgabe`false`.
511
+
512
+### BlackBerry 10 Macken
513
+
514
+*   **Typ**: teilweise unterstützt. Für Telefonnummern verwendet.
515
+
516
+*   **Wert**: unterstützt.
517
+
518
+*   **Pref**: nicht unterstützt, Rückgabe`false`.
519
+
520
+### iOS Macken
521
+
522
+*   **Pref**: nicht unterstützt, Rückgabe`false`.
523
+
524
+### Windows8 Macken
525
+
526
+*   **Pref**: nicht unterstützt, Rückgabe`false`.
527
+
528
+### Windows-Eigenheiten
529
+
530
+*   **Pref**: nicht unterstützt, Rückgabe`false`.
531
+
532
+## ContactName
533
+
534
+Enthält verschiedene Arten von Informationen über `ein Kontaktobjekt` Namen.
535
+
536
+### Eigenschaften
537
+
538
+*   **formatiert**: den vollständigen Namen des Kontakts. *(DOM-String und enthält)*
539
+
540
+*   **Nachname**: Familienname des Kontakts. *(DOM-String und enthält)*
541
+
542
+*   **GivenName**: Given Name des Kontaktes. *(DOM-String und enthält)*
543
+
544
+*   **MiddleName**: Middle Name des Kontaktes. *(DOM-String und enthält)*
545
+
546
+*   **HonorificPrefix**: der Kontakt-Präfix (z.B. *Mr.* oder *Dr.*) *(DOM-String und enthält)*
547
+
548
+*   **HonorificSuffix**: der Kontakt-Suffix (Beispiel *Esq.*). *(DOM-String und enthält)*
549
+
550
+### Unterstützte Plattformen
551
+
552
+*   Amazon Fire OS
553
+*   Android
554
+*   BlackBerry 10
555
+*   Firefox OS
556
+*   iOS
557
+*   Windows Phone 7 und 8
558
+*   Windows 8
559
+*   Windows
560
+
561
+### Beispiel
562
+
563
+    function onSuccess(contacts) {
564
+        for (var i = 0; i < contacts.length; i++) {
565
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
566
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
567
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
568
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
569
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
570
+                "Prefix: "       + contacts[i].name.honorificSuffix);
571
+        }
572
+    };
573
+    
574
+    function onError(contactError) {
575
+        alert('onError!');
576
+    };
577
+    
578
+    var options = new ContactFindOptions();
579
+    options.filter = "";
580
+    filter = ["displayName", "name"];
581
+    navigator.contacts.find(filter, onSuccess, onError, options);
582
+    
583
+
584
+### Android Eigenarten
585
+
586
+*   **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
587
+
588
+### BlackBerry 10 Macken
589
+
590
+*   **formatiert**: teilweise unterstützt. Gibt eine Verkettung von BlackBerry- **FirstName** und **LastName** -Feldern.
591
+
592
+*   **Nachname**: unterstützt. Im Feld der BlackBerry- **Nachname** gespeichert.
593
+
594
+*   **GivenName**: unterstützt. Im BlackBerry **FirstName** -Feld gespeichert.
595
+
596
+*   **MiddleName**: nicht unterstützt, Rückgabe`null`.
597
+
598
+*   **HonorificPrefix**: nicht unterstützte, Rückgabe`null`.
599
+
600
+*   **HonorificSuffix**: nicht unterstützte, Rückgabe`null`.
601
+
602
+### FirefoxOS Macken
603
+
604
+*   **formatiert**: teilweise unterstützte "und" Read-only. Gibt eine Verkettung von `honorificPrefix` , `givenName` , `middleName` , `familyName` , und`honorificSuffix`.
605
+
606
+### iOS Macken
607
+
608
+*   **formatiert**: teilweise unterstützt. IOS zusammengesetzten Namen gibt, aber ist schreibgeschützt.
609
+
610
+### Windows 8 Macken
611
+
612
+*   **formatiert**: Dies ist die einzige Eigenschaft, und ist identisch mit `displayName` , und`nickname`
613
+
614
+*   **Nachname**: nicht unterstützt
615
+
616
+*   **GivenName**: nicht unterstützt
617
+
618
+*   **MiddleName**: nicht unterstützt
619
+
620
+*   **HonorificPrefix**: nicht unterstützt
621
+
622
+*   **HonorificSuffix**: nicht unterstützt
623
+
624
+### Windows-Eigenheiten
625
+
626
+*   **formatiert**: Er ist identisch mit`displayName`
627
+
628
+## ContactOrganization
629
+
630
+Das `ContactOrganization`-Objekt speichert Organisationseigenschaften eines Kontakts. Ein `Contact` objekt werden ein oder mehrere `ContactOrganization`-Objekte in einem Array gespeichert.
631
+
632
+### Eigenschaften
633
+
634
+*   **Pref**: Legen Sie auf `true` Wenn dieses `ContactOrganization` des Benutzers bevorzugten Wert enthält. *(boolesch)*
635
+
636
+*   **Typ**: eine Zeichenfolge, die angibt, welche Art von Feld in diesem *Hause* zum Beispiel. _(DOMString)
637
+
638
+*   **Name**: der Name der Organisation. *(DOM-String und enthält)*
639
+
640
+*   **Abteilung**: die Abteilung, die der Vertrag für arbeitet. *(DOM-String und enthält)*
641
+
642
+*   **Titel**: Titel des Kontakts in der Organisation. *(DOM-String und enthält)*
643
+
644
+### Unterstützte Plattformen
645
+
646
+*   Android
647
+*   BlackBerry 10
648
+*   Firefox OS
649
+*   iOS
650
+*   Windows Phone 7 und 8
651
+*   Windows (nur Windows-8.1 und Windows Phone 8.1-Geräte)
652
+
653
+### Beispiel
654
+
655
+    function onSuccess(contacts) {
656
+        for (var i = 0; i < contacts.length; i++) {
657
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
658
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
659
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
660
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
661
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
662
+                    "Title: "       + contacts[i].organizations[j].title);
663
+            }
664
+        }
665
+    };
666
+    
667
+    function onError(contactError) {
668
+        alert('onError!');
669
+    };
670
+    
671
+    var options = new ContactFindOptions();
672
+    options.filter = "";
673
+    filter = ["displayName", "organizations"];
674
+    navigator.contacts.find(filter, onSuccess, onError, options);
675
+    
676
+
677
+### Android 2.X Macken
678
+
679
+*   **Pref**: von Android 2.X-Geräte, Rückgabe nicht unterstützt`false`.
680
+
681
+### BlackBerry 10 Macken
682
+
683
+*   **Pref**: von BlackBerry-Geräten zurückgeben nicht unterstützt`false`.
684
+
685
+*   **Typ**: von BlackBerry-Geräten zurückgeben nicht unterstützt`null`.
686
+
687
+*   **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **Firma** BlackBerry gespeichert.
688
+
689
+*   **Abteilung**: nicht unterstützt, Rückgabe`null`.
690
+
691
+*   **Titel**: teilweise unterstützt. Der erste Titel der Organisation wird im Feld **JobTitle** BlackBerry gespeichert.
692
+
693
+### Firefox OS Macken
694
+
695
+*   **Pref**: nicht unterstützt
696
+
697
+*   **Typ**: nicht unterstützt
698
+
699
+*   **Abteilung**: nicht unterstützt
700
+
701
+*   Felder **Name** und **Titel** in **Org** und **JobTitle** gespeichert.
702
+
703
+### iOS Macken
704
+
705
+*   **Pref**: iOS-Geräten, Rückgabe nicht unterstützt`false`.
706
+
707
+*   **Typ**: iOS-Geräten, Rückgabe nicht unterstützt`null`.
708
+
709
+*   **Name**: teilweise unterstützt. Der Name der ersten Organisation wird im Feld **kABPersonOrganizationProperty** iOS gespeichert.
710
+
711
+*   **Abteilung**: teilweise unterstützt. Die Abteilungsnamen der erste ist im Feld **kABPersonDepartmentProperty** iOS gespeichert.
712
+
713
+*   **Titel**: teilweise unterstützt. Der erste Titel wird im Feld **kABPersonJobTitleProperty** iOS gespeichert.
714
+
715
+### Windows-Eigenheiten
716
+
717
+*   **Pref**: nicht unterstützt, Rückgabe`false`.
718
+
719
+*   **Typ**: nicht unterstützt, Rückgabe`null`.

+ 732
- 0
km0App/node_modules/cordova-plugin-contacts/doc/es/README.md Parādīt failu

@@ -0,0 +1,732 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+Este plugin define un global `navigator.contacts` objeto que proporciona acceso a la base de datos de contactos de dispositivo.
25
+
26
+Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**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.
35
+
36
+## Instalación
37
+
38
+Esto requiere cordova 5.0 + (v1.0.0 estable actual)
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+Las versiones más antiguas de Córdoba todavía pueden instalar mediante el id de **obsoleto** (viejo v0.2.16)
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+También es posible instalar directamente vía url repo (inestable)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### Firefox OS rarezas
54
+
55
+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.
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### Windows rarezas
67
+
68
+**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.
69
+
70
+**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.
71
+
72
+### Rarezas de Windows 8
73
+
74
+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.
75
+
76
+## Navigator.Contacts
77
+
78
+### Métodos
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### Objetos
85
+
86
+  * Contact
87
+  * ContactName
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+El `navigator.contacts.create` método es sincrónico y devuelve una nueva `Contact` objeto.
98
+
99
+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.
100
+
101
+### Plataformas soportadas
102
+
103
+  * Android
104
+  * BlackBerry 10
105
+  * Firefox OS
106
+  * iOS
107
+  * Windows Phone 7 y 8
108
+
109
+### Ejemplo
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+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** .
117
+
118
+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.
119
+
120
+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.
121
+
122
+### Parámetros
123
+
124
+  * **contactFields**: póngase en contacto con campos para usar como un calificador de búsqueda. *(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: función de callback de éxito se invoca con la matriz de objetos contacto devueltos desde la base de datos. [Required]
127
+
128
+  * **contactError**: función de callback de Error, se invoca cuando se produce un error. [Opcional]
129
+
130
+  * **contactFindOptions**: buscar opciones para filtrar navigator.contacts. [Optional]
131
+    
132
+    Claves incluyen:
133
+    
134
+      * **filtro**: la cadena de búsqueda utilizada para encontrar navigator.contacts. *(DOMString)* (Por defecto:`""`)
135
+    
136
+      * **múltiples**: determina si la operación de búsqueda devuelve múltiples navigator.contacts. *(Booleano)* (Por defecto:`false`)
137
+        
138
+          * **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]
139
+
140
+### Plataformas soportadas
141
+
142
+  * Android
143
+  * BlackBerry 10
144
+  * Firefox OS
145
+  * iOS
146
+  * Windows Phone 7 y 8
147
+  * Windows (Windows Phone 8.1 y Windows 10)
148
+
149
+### Ejemplo
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### Windows rarezas
169
+
170
+  * `__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.
171
+
172
+## navigator.contacts.pickContact
173
+
174
+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** .
175
+
176
+### Parámetros
177
+
178
+  * **contactSuccess**: función de callback de éxito se invoca con el único objeto de contacto. [Obligatorio]
179
+
180
+  * **contactError**: función de callback de Error, se invoca cuando se produce un error. [Opcional]
181
+
182
+### Plataformas soportadas
183
+
184
+  * Android
185
+  * iOS
186
+  * Windows Phone 8
187
+  * Windows 8
188
+  * Windows
189
+
190
+### Ejemplo
191
+
192
+    navigator.contacts.pickContact(function(contact) {console.log (' se ha seleccionado el siguiente contacto: "+ JSON.stringify(contact));
193
+        }, function(err) {console.log ('Error: ' + err);
194
+        });
195
+    
196
+
197
+## Contact
198
+
199
+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.
200
+
201
+**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.
202
+
203
+### Propiedades
204
+
205
+  * **ID**: un identificador único global. *(DOMString)*
206
+
207
+  * **displayName**: el nombre de este contacto, conveniente para la exhibición a los usuarios finales. *(DOMString)*
208
+
209
+  * **nombre**: un objeto que contiene todos los componentes de un nombre de las personas. *(ContactName)*
210
+
211
+  * **apodo**: un nombre para abordar el contacto casual. *(DOMString)*
212
+
213
+  * **números**: una matriz de números de teléfono de contacto. *(ContactField[])*
214
+
215
+  * **correos electrónicos**: un conjunto de direcciones de correo electrónico del contacto. *(ContactField[])*
216
+
217
+  * **direcciones**: un conjunto de direcciones de todos los contactos. *(ContactAddress[])*
218
+
219
+  * **IMS**: un conjunto de direcciones de todos los contactos IM. *(ContactField[])*
220
+
221
+  * **organizaciones**: un conjunto de organizaciones de todos los contactos. *(ContactOrganization[])*
222
+
223
+  * **cumpleaños**: el cumpleaños del contacto. *(Fecha)*
224
+
225
+  * **Nota**: una nota sobre el contacto. *(DOMString)*
226
+
227
+  * **fotos**: una serie de fotos de los contactos. *(ContactField[])*
228
+
229
+  * **categorías**: una matriz de todas las categorías definidas por el usuario asociado con el contacto. *(ContactField[])*
230
+
231
+  * **URL**: un conjunto de páginas web asociadas con el contacto. *(ContactField[])*
232
+
233
+### Métodos
234
+
235
+  * **clon**: devuelve un nuevo `Contact` objeto que es una copia en profundidad del objeto de llamadas con el `id` propiedad establecida en`null`.
236
+
237
+  * **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.
238
+
239
+  * **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** .
240
+
241
+### Plataformas soportadas
242
+
243
+  * Amazon fire OS
244
+  * Android
245
+  * BlackBerry 10
246
+  * Firefox OS
247
+  * iOS
248
+  * Windows Phone 7 y 8
249
+  * Windows 8
250
+  * Windows
251
+
252
+### Salvar ejemplo
253
+
254
+    function onSuccess(contact) {
255
+        alert("Save Success");
256
+    };
257
+    
258
+    function onError(contactError) {
259
+        alert("Error = " + contactError.code);
260
+    };
261
+    
262
+    // create a new contact object
263
+    var contact = navigator.contacts.create();
264
+    contact.displayName = "Plumber";
265
+    contact.nickname = "Plumber";            // specify both to support all devices
266
+    
267
+    // populate some fields
268
+    var name = new ContactName();
269
+    name.givenName = "Jane";
270
+    name.familyName = "Doe";
271
+    contact.name = name;
272
+    
273
+    // save to device
274
+    contact.save(onSuccess,onError);
275
+    
276
+
277
+### Ejemplo de clon
278
+
279
+        clon del clon de contacto objeto var = contact.clone();
280
+        clone.name.givenName = "John";
281
+        Console.log ("contacto Original nombre =" + contact.name.givenName);
282
+        Console.log ("Cloned contacto nombre =" + clone.name.givenName);
283
+    
284
+
285
+### Quitar ejemplo
286
+
287
+    function onSuccess() {
288
+        alert("Removal Success");
289
+    };
290
+    
291
+    function onError(contactError) {
292
+        alert("Error = " + contactError.code);
293
+    };
294
+    
295
+    // remove the contact from the device
296
+    contact.remove(onSuccess,onError);
297
+    
298
+
299
+### Rarezas Android 2.X
300
+
301
+  * **categories**: no compatible con dispositivos Android 2.X, devolver `null`.
302
+
303
+### BlackBerry 10 rarezas
304
+
305
+  * **ID**: asignado por el dispositivo cuando se guarda el contacto.
306
+
307
+### FirefoxOS rarezas
308
+
309
+  * **categorías**: parcialmente soportado. Campos **pref** y **tipo** regresan`null`
310
+
311
+  * **IMS**: no se admite
312
+
313
+  * **fotos**: no se admite
314
+
315
+### iOS rarezas
316
+
317
+  * **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.
318
+
319
+  * **cumpleaños**: debe ser de entrada como un JavaScript `Date` objeto, del mismo modo que se la devuelvan.
320
+
321
+  * **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.
322
+
323
+  * **categorías**: esta propiedad actualmente no es compatible, regresando`null`.
324
+
325
+### Windows Phone 7 y 8 rarezas
326
+
327
+  * **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.
328
+
329
+  * **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.
330
+
331
+  * **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*.
332
+
333
+  * **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*.
334
+
335
+  * **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*.
336
+
337
+  * **organizaciones**: sólo está permitido y no es compatible con los atributos *pref*, *tipo*y *Departamento* .
338
+
339
+  * **Nota**: no compatible, regresando`null`.
340
+
341
+  * **ims**: no soportado, devolver `null`.
342
+
343
+  * **cumpleaños**: no soportado, regresando`null`.
344
+
345
+  * **categorías**: no soportado, regresando`null`.
346
+
347
+  * **remove**: no se admite el método
348
+
349
+### Windows rarezas
350
+
351
+  * **fotos**: devuelve una dirección URL del archivo de la imagen, que se almacena en el directorio temporal de la aplicación.
352
+
353
+  * **cumpleaños**: no soportado, regresando`null`.
354
+
355
+  * **categorías**: no soportado, regresando`null`.
356
+
357
+  * **remove**: el método sólo es soportado en Windows 10 o superior.
358
+
359
+## ContactAddress
360
+
361
+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.
362
+
363
+### Propiedades
364
+
365
+  * **pref**: establecido en `true` si esta `ContactAddress` contiene el usuario preferido de valor. *(boolean)*
366
+
367
+  * **type**: una cadena que indica qué tipo de campo es, *home* por ejemplo. *(DOMString)*
368
+
369
+  * **formatted**: la dirección completa con formato de visualización. *(DOMString)*
370
+
371
+  * **streetAddress**: la dirección completa. *(DOMString)*
372
+
373
+  * **locality**: la ciudad o localidad. *(DOMString)*
374
+
375
+  * **region**: el estado o la región. *(DOMString)*
376
+
377
+  * **postalCode**: el código postal o código postal. *(DOMString)*
378
+
379
+  * **country**: el nombre del país. *(DOMString)*
380
+
381
+### Plataformas soportadas
382
+
383
+  * Amazon fire OS
384
+  * Android
385
+  * BlackBerry 10
386
+  * Firefox OS
387
+  * iOS
388
+  * Windows Phone 7 y 8
389
+  * Windows 8
390
+  * Windows
391
+
392
+### Ejemplo
393
+
394
+    // display the address information for all contacts
395
+    
396
+    function onSuccess(contacts) {
397
+        for (var i = 0; i < contacts.length; i++) {
398
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
399
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
400
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
401
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
402
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
403
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
404
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
405
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
406
+                    "Country: "        + contacts[i].addresses[j].country);
407
+            }
408
+        }
409
+    };
410
+    
411
+    function onError(contactError) {
412
+        alert('onError!');
413
+    };
414
+    
415
+    // find all contacts
416
+    var options = new ContactFindOptions();
417
+    options.filter = "";
418
+    var filter = ["displayName", "addresses"];
419
+    navigator.contacts.find(filter, onSuccess, onError, options);
420
+    
421
+
422
+### Rarezas Android 2.X
423
+
424
+  * **pref**: no soportado, devolviendo `false` en dispositivos Android 2.X.
425
+
426
+### BlackBerry 10 rarezas
427
+
428
+  * **pref**: no compatible con dispositivos BlackBerry, devolviendo `false`.
429
+
430
+  * **type**: parcialmente soportado. Sólo uno de cada *Work* y *Home* tipo direcciones puede ser almacenado por contacto.
431
+
432
+  * **formatted**: parcialmente soportado. Devuelve una concatenación de todos los campos de dirección de BlackBerry.
433
+
434
+  * **streetAddress**: soportado. Devuelve una concatenación de BlackBerry **address1** y **2** campos de dirección.
435
+
436
+  * **locality**: apoyado. Almacenada en el campo de dirección de la **city** de BlackBerry.
437
+
438
+  * **region**: apoyado. Almacenada en el campo de dirección de BlackBerry **stateProvince**.
439
+
440
+  * **postalCode**: apoyado. Almacenada en el campo de dirección de BlackBerry **zipPostal**.
441
+
442
+  * **country**: apoyado.
443
+
444
+### FirefoxOS rarezas
445
+
446
+  * **formato**: actualmente no se admite
447
+
448
+### iOS rarezas
449
+
450
+  * **pref**: no se admite en dispositivos iOS, devolviendo `false`.
451
+
452
+  * **formatted**: actualmente no se admite.
453
+
454
+### Rarezas de Windows 8
455
+
456
+  * **Pref**: no se admite
457
+
458
+### Windows rarezas
459
+
460
+  * **Pref**: no se admite
461
+
462
+## ContactError
463
+
464
+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.
465
+
466
+### Propiedades
467
+
468
+  * **code**: uno de los códigos de error predefinido enumerados a continuación.
469
+
470
+### Constantes
471
+
472
+  * `ContactError.UNKNOWN_ERROR` (code 0)
473
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
474
+  * `ContactError.TIMEOUT_ERROR` (code 2)
475
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
476
+  * `ContactError.IO_ERROR` (code 4)
477
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
478
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
479
+
480
+## ContactField
481
+
482
+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.
483
+
484
+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.
485
+
486
+### Propiedades
487
+
488
+  * **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. *(DOMString)*
489
+
490
+  * **valor**: el valor del campo, como un teléfono número o dirección de email. *(DOMString)*
491
+
492
+  * **Pref**: A `true` si este `ContactField` contiene el valor del usuario preferido. *(booleano)*
493
+
494
+### Plataformas soportadas
495
+
496
+  * Amazon fire OS
497
+  * Android
498
+  * BlackBerry 10
499
+  * Firefox OS
500
+  * iOS
501
+  * Windows Phone 7 y 8
502
+  * Windows 8
503
+  * Windows
504
+
505
+### Ejemplo
506
+
507
+        // create a new contact
508
+        var contact = navigator.contacts.create();
509
+    
510
+        // store contact phone numbers in ContactField[]
511
+        var phoneNumbers = [];
512
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
513
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
514
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
515
+        contact.phoneNumbers = phoneNumbers;
516
+    
517
+        // save the contact
518
+        contact.save();
519
+    
520
+
521
+### Rarezas Android
522
+
523
+  * **Pref**: no soportado, regresando`false`.
524
+
525
+### BlackBerry 10 rarezas
526
+
527
+  * **tipo**: parcialmente soportado. Utilizado para los números de teléfono.
528
+
529
+  * **valor**: apoyado.
530
+
531
+  * **Pref**: no soportado, regresando`false`.
532
+
533
+### iOS rarezas
534
+
535
+  * **Pref**: no soportado, regresando`false`.
536
+
537
+### Windows8 rarezas
538
+
539
+  * **Pref**: no soportado, regresando`false`.
540
+
541
+### Windows rarezas
542
+
543
+  * **Pref**: no soportado, regresando`false`.
544
+
545
+## ContactName
546
+
547
+Contiene diferentes tipos de información sobre un `Contact` nombre del objeto.
548
+
549
+### Propiedades
550
+
551
+  * **formato**: el nombre completo del contacto. *(DOMString)*
552
+
553
+  * **familia**: el nombre del contacto familiar. *(DOMString)*
554
+
555
+  * **givenName**: nombre del contacto. *(DOMString)*
556
+
557
+  * **middleName**: el nombre del contacto media. *(DOMString)*
558
+
559
+  * **honorificPrefix**: prefijo del contacto (ejemplo *señor* o *doctor*) *(DOMString)*
560
+
561
+  * **honorificSuffix**: sufijo de contacto (ejemplo *Esq.*). *(DOMString)*
562
+
563
+### Plataformas soportadas
564
+
565
+  * Amazon fire OS
566
+  * Android
567
+  * BlackBerry 10
568
+  * Firefox OS
569
+  * iOS
570
+  * Windows Phone 7 y 8
571
+  * Windows 8
572
+  * Windows
573
+
574
+### Ejemplo
575
+
576
+    function onSuccess(contacts) {
577
+        for (var i = 0; i < contacts.length; i++) {
578
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
579
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
580
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
581
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
582
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
583
+                "Prefix: "       + contacts[i].name.honorificSuffix);
584
+        }
585
+    };
586
+    
587
+    function onError(contactError) {
588
+        alert('onError!');
589
+    };
590
+    
591
+    var options = new ContactFindOptions();
592
+    options.filter = "";
593
+    filter = ["displayName", "name"];
594
+    navigator.contacts.find(filter, onSuccess, onError, options);
595
+    
596
+
597
+### Rarezas Android
598
+
599
+  * **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
600
+
601
+### BlackBerry 10 rarezas
602
+
603
+  * **formato**: parcialmente soportado. Devuelve una concatenación de campos **firstName** y **lastName** de BlackBerry.
604
+
605
+  * **familia**: apoyo. Almacenada en el campo **lastName** BlackBerry.
606
+
607
+  * **givenName**: apoyado. Almacenados en campo **firstName** BlackBerry.
608
+
609
+  * **middleName**: no soportado, regresando`null`.
610
+
611
+  * **honorificPrefix**: no soportado, regresando`null`.
612
+
613
+  * **honorificSuffix**: no soportado, regresando`null`.
614
+
615
+### FirefoxOS rarezas
616
+
617
+  * **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
618
+
619
+### iOS rarezas
620
+
621
+  * **formato**: parcialmente soportado. Devuelve iOS nombre compuesto, pero es de sólo lectura.
622
+
623
+### Rarezas de Windows 8
624
+
625
+  * **formato**: este es el único nombre de propiedad y es idéntico al `displayName` , y`nickname`
626
+
627
+  * **familia**: no se admite
628
+
629
+  * **givenName**: no se admite
630
+
631
+  * **middleName**: no se admite
632
+
633
+  * **honorificPrefix**: no se admite
634
+
635
+  * **honorificSuffix**: no se admite
636
+
637
+### Windows rarezas
638
+
639
+  * **formato**: es idéntica a`displayName`
640
+
641
+## ContactOrganization
642
+
643
+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.
644
+
645
+### Propiedades
646
+
647
+  * **Pref**: A `true` si este `ContactOrganization` contiene el valor del usuario preferido. *(booleano)*
648
+
649
+  * **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. _(DOMString)
650
+
651
+  * **nombre**: el nombre de la organización. *(DOMString)*
652
+
653
+  * **Departamento**: el contrato de obras para el departamento. *(DOMString)*
654
+
655
+  * **título**: título del contacto de la organización. *(DOMString)*
656
+
657
+### Plataformas soportadas
658
+
659
+  * Android
660
+  * BlackBerry 10
661
+  * Firefox OS
662
+  * iOS
663
+  * Windows Phone 7 y 8
664
+  * Windows (sólo dispositivos Windows 8.1 y 8.1 de Windows Phone)
665
+
666
+### Ejemplo
667
+
668
+    function onSuccess(contacts) {
669
+        for (var i = 0; i < contacts.length; i++) {
670
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
671
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
672
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
673
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
674
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
675
+                    "Title: "       + contacts[i].organizations[j].title);
676
+            }
677
+        }
678
+    };
679
+    
680
+    function onError(contactError) {
681
+        alert('onError!');
682
+    };
683
+    
684
+    var options = new ContactFindOptions();
685
+    options.filter = "";
686
+    filter = ["displayName", "organizations"];
687
+    navigator.contacts.find(filter, onSuccess, onError, options);
688
+    
689
+
690
+### Rarezas Android 2.X
691
+
692
+  * **Pref**: no compatible con dispositivos Android 2.X, regresando`false`.
693
+
694
+### BlackBerry 10 rarezas
695
+
696
+  * **Pref**: no compatible con dispositivos BlackBerry, regresando`false`.
697
+
698
+  * **tipo**: no compatible con dispositivos BlackBerry, regresando`null`.
699
+
700
+  * **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de la **empresa** BlackBerry.
701
+
702
+  * **Departamento**: no soportado, regresando`null`.
703
+
704
+  * **título**: parcialmente soportado. El primer título de la organización se almacena en el campo de **jobTitle** BlackBerry.
705
+
706
+### Firefox OS rarezas
707
+
708
+  * **Pref**: no se admite
709
+
710
+  * **tipo**: no se admite
711
+
712
+  * **Departamento**: no se admite
713
+
714
+  * Los campos **nombre** y **título** almacenado en **org** y **jobTitle**.
715
+
716
+### iOS rarezas
717
+
718
+  * **pref**: no se admite en dispositivos iOS, devolviendo `false`.
719
+
720
+  * **tipo**: no se admite en dispositivos iOS, regresando`null`.
721
+
722
+  * **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de **kABPersonOrganizationProperty** de iOS.
723
+
724
+  * **Departamento**: parcialmente soportado. El primer nombre de departamento se almacena en el campo de **kABPersonDepartmentProperty** de iOS.
725
+
726
+  * **título**: parcialmente soportado. El primer título se almacena en el campo de **kABPersonJobTitleProperty** de iOS.
727
+
728
+### Windows rarezas
729
+
730
+  * **Pref**: no soportado, regresando`false`.
731
+
732
+  * **tipo**: no soportado, regresando`null`.

+ 652
- 0
km0App/node_modules/cordova-plugin-contacts/doc/es/index.md Parādīt failu

@@ -0,0 +1,652 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+Este plugin define un global `navigator.contacts` objeto que proporciona acceso a la base de datos de contactos de dispositivo.
23
+
24
+Aunque el objeto está unido al ámbito global `navigator` , no estará disponible hasta después de la `deviceready` evento.
25
+
26
+    document.addEventListener ("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {console.log(navigator.contacts)};
28
+    
29
+
30
+**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.
31
+
32
+## Instalación
33
+
34
+    Cordova plugin agregar cordova-plugin-contacts
35
+    
36
+
37
+### Firefox OS rarezas
38
+
39
+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.
40
+
41
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
42
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
43
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
44
+
45
+    "tipo": "el privilegio", "permisos": {"contactos": {"acceso": "readwrite", "Descripción": "describir por qué hay una necesidad de tal autorización"}}
46
+    
47
+
48
+### Windows rarezas
49
+
50
+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.
51
+
52
+### Rarezas de Windows 8
53
+
54
+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.
55
+
56
+## Navigator.Contacts
57
+
58
+### Métodos
59
+
60
+*   navigator.contacts.create
61
+*   navigator.contacts.find
62
+*   navigator.contacts.pickContact
63
+
64
+### Objetos
65
+
66
+*   Contact
67
+*   ContactName
68
+*   ContactField
69
+*   ContactAddress
70
+*   ContactOrganization
71
+*   ContactFindOptions
72
+*   ContactError
73
+*   ContactFieldType
74
+
75
+## Navigator.contacts.Create
76
+
77
+El `navigator.contacts.create` método es sincrónico y devuelve una nueva `Contact` objeto.
78
+
79
+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.
80
+
81
+### Plataformas soportadas
82
+
83
+*   Android
84
+*   BlackBerry 10
85
+*   Firefox OS
86
+*   iOS
87
+*   Windows Phone 7 y 8
88
+
89
+### Ejemplo
90
+
91
+    var myContact = navigator.contacts.create ({"displayName": "Test User"});
92
+    
93
+
94
+## navigator.contacts.find
95
+
96
+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** .
97
+
98
+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.
99
+
100
+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.
101
+
102
+### Parámetros
103
+
104
+*   **contactFields**: póngase en contacto con campos para usar como un calificador de búsqueda. *(DOMString[])* [Required]
105
+
106
+*   **contactSuccess**: función de callback de éxito se invoca con la matriz de objetos contacto devueltos desde la base de datos. [Required]
107
+
108
+*   **contactError**: función de callback de Error, se invoca cuando se produce un error. [Optional]
109
+
110
+*   **contactFindOptions**: buscar opciones para filtrar navigator.contacts. [Optional]
111
+    
112
+    Claves incluyen:
113
+    
114
+    *   **filtro**: la cadena de búsqueda utilizada para encontrar navigator.contacts. *(DOMString)* (Por defecto:`""`)
115
+    
116
+    *   **múltiples**: determina si la operación de búsqueda devuelve múltiples navigator.contacts. *(Booleano)* (Por defecto:`false`)
117
+        
118
+        *   **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]
119
+
120
+### Plataformas soportadas
121
+
122
+*   Android
123
+*   BlackBerry 10
124
+*   Firefox OS
125
+*   iOS
126
+*   Windows Phone 7 y 8
127
+*   Windows (sólo dispositivos Windows Phone 8.1)
128
+
129
+### Ejemplo
130
+
131
+    function onSuccess(contacts) {alert ('Encontrados' + contacts.length + 'contactos de.');};
132
+    
133
+    function onError(contactError) {alert('onError!');};
134
+    
135
+    encuentra todos los contactos con 'Bob' en cualquier nombre campo var opciones = new ContactFindOptions();
136
+    options.Filter = "Bob";
137
+    options.Multiple = true;
138
+    options.desiredFields = [navigator.contacts.fieldType.id];
139
+    campos var = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
140
+    Navigator.contacts.Find (campos, onSuccess, onError, opciones);
141
+    
142
+
143
+### Windows rarezas
144
+
145
+*   `__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.
146
+
147
+## navigator.contacts.pickContact
148
+
149
+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** .
150
+
151
+### Parámetros
152
+
153
+*   **contactSuccess**: función de callback de éxito se invoca con el único objeto de contacto. [Obligatorio]
154
+
155
+*   **contactError**: función de callback de Error, se invoca cuando se produce un error. [Opcional]
156
+
157
+### Plataformas soportadas
158
+
159
+*   Android
160
+*   iOS
161
+*   Windows Phone 8
162
+*   Windows 8
163
+*   Windows
164
+
165
+### Ejemplo
166
+
167
+    navigator.contacts.pickContact(function(contact) {console.log (' se ha seleccionado el siguiente contacto: "+ JSON.stringify(contact));
168
+        }, function(err) {console.log ('Error: ' + err);
169
+        });
170
+    
171
+
172
+## Contact
173
+
174
+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.
175
+
176
+**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.
177
+
178
+### Propiedades
179
+
180
+*   **ID**: un identificador único global. *(DOMString)*
181
+
182
+*   **displayName**: el nombre de este contacto, conveniente para la exhibición a los usuarios finales. *(DOMString)*
183
+
184
+*   **nombre**: un objeto que contiene todos los componentes de un nombre de las personas. *(ContactName)*
185
+
186
+*   **apodo**: un nombre para abordar el contacto casual. *(DOMString)*
187
+
188
+*   **números**: una matriz de números de teléfono de contacto. *(ContactField[])*
189
+
190
+*   **correos electrónicos**: un conjunto de direcciones de correo electrónico del contacto. *(ContactField[])*
191
+
192
+*   **direcciones**: un conjunto de direcciones de todos los contactos. *(ContactAddress[])*
193
+
194
+*   **IMS**: un conjunto de direcciones de todos los contactos IM. *(ContactField[])*
195
+
196
+*   **organizaciones**: un conjunto de organizaciones de todos los contactos. *(ContactOrganization[])*
197
+
198
+*   **cumpleaños**: el cumpleaños del contacto. *(Fecha)*
199
+
200
+*   **Nota**: una nota sobre el contacto. *(DOMString)*
201
+
202
+*   **fotos**: una serie de fotos de los contactos. *(ContactField[])*
203
+
204
+*   **categorías**: una matriz de todas las categorías definidas por el usuario asociado con el contacto. *(ContactField[])*
205
+
206
+*   **URL**: un conjunto de páginas web asociadas con el contacto. *(ContactField[])*
207
+
208
+### Métodos
209
+
210
+*   **clon**: devuelve un nuevo `Contact` objeto que es una copia en profundidad del objeto de llamadas con el `id` propiedad establecida en`null`.
211
+
212
+*   **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.
213
+
214
+*   **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** .
215
+
216
+### Plataformas soportadas
217
+
218
+*   Amazon fire OS
219
+*   Android
220
+*   BlackBerry 10
221
+*   Firefox OS
222
+*   iOS
223
+*   Windows Phone 7 y 8
224
+*   Windows 8
225
+*   Windows
226
+
227
+### Salvar ejemplo
228
+
229
+    function onSuccess(contact) {alert ("salvar con éxito");};
230
+    
231
+    function onError(contactError) {alert ("Error =" + contactError.code);};
232
+    
233
+    crear un nuevo objeto contacto var contacto = navigator.contacts.create();
234
+    contact.displayName = "Plomero";
235
+    Contact.nickname = "Plomero";            especificar tanto para todos los dispositivos de apoyo / / rellenar algún nombre var campos = new ContactName();
236
+    name.givenName = "Jane";
237
+    name.familyName = "Doe";
238
+    Contact.name = nombre;
239
+    
240
+    guardar en el dispositivo contact.save(onSuccess,onError);
241
+    
242
+
243
+### Ejemplo de clon
244
+
245
+        clon del clon de contacto objeto var = contact.clone();
246
+        clone.name.givenName = "John";
247
+        Console.log ("contacto Original nombre =" + contact.name.givenName);
248
+        Console.log ("Cloned contacto nombre =" + clone.name.givenName);
249
+    
250
+
251
+### Quitar ejemplo
252
+
253
+    function onSuccess() {alert ("retiro el éxito");};
254
+    
255
+    function onError(contactError) {alert ("Error =" + contactError.code);};
256
+    
257
+    quitar el contacto de la contact.remove(onSuccess,onError) del dispositivo;
258
+    
259
+
260
+### Rarezas Android 2.X
261
+
262
+*   **categories**: no compatible con dispositivos Android 2.X, devolver `null`.
263
+
264
+### BlackBerry 10 rarezas
265
+
266
+*   **ID**: asignado por el dispositivo cuando se guarda el contacto.
267
+
268
+### FirefoxOS rarezas
269
+
270
+*   **categorías**: parcialmente soportado. Campos **pref** y **tipo** regresan`null`
271
+
272
+*   **IMS**: no se admite
273
+
274
+*   **fotos**: no se admite
275
+
276
+### iOS rarezas
277
+
278
+*   **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.
279
+
280
+*   **cumpleaños**: debe ser de entrada como un JavaScript `Date` objeto, del mismo modo que se la devuelvan.
281
+
282
+*   **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.
283
+
284
+*   **categorías**: esta propiedad actualmente no es compatible, regresando`null`.
285
+
286
+### Windows Phone 7 y 8 rarezas
287
+
288
+*   **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.
289
+
290
+*   **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.
291
+
292
+*   **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*.
293
+
294
+*   **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*.
295
+
296
+*   **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*.
297
+
298
+*   **organizaciones**: sólo está permitido y no es compatible con los atributos *pref*, *tipo*y *Departamento* .
299
+
300
+*   **Nota**: no compatible, regresando`null`.
301
+
302
+*   **ims**: no soportado, devolver `null`.
303
+
304
+*   **cumpleaños**: no soportado, regresando`null`.
305
+
306
+*   **categorías**: no soportado, regresando`null`.
307
+
308
+### Windows rarezas
309
+
310
+*   **fotos**: devuelve una dirección URL del archivo de la imagen, que se almacena en el directorio temporal de la aplicación.
311
+
312
+*   **cumpleaños**: no soportado, regresando`null`.
313
+
314
+*   **categorías**: no soportado, regresando`null`.
315
+
316
+## ContactAddress
317
+
318
+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.
319
+
320
+### Propiedades
321
+
322
+*   **pref**: establecido en `true` si esta `ContactAddress` contiene el usuario preferido de valor. *(boolean)*
323
+
324
+*   **type**: una cadena que indica qué tipo de campo es, *home* por ejemplo. *(DOMString)*
325
+
326
+*   **formatted**: la dirección completa con formato de visualización. *(DOMString)*
327
+
328
+*   **streetAddress**: la dirección completa. *(DOMString)*
329
+
330
+*   **locality**: la ciudad o localidad. *(DOMString)*
331
+
332
+*   **region**: el estado o la región. *(DOMString)*
333
+
334
+*   **postalCode**: el código postal o código postal. *(DOMString)*
335
+
336
+*   **country**: el nombre del país. *(DOMString)*
337
+
338
+### Plataformas soportadas
339
+
340
+*   Amazon fire OS
341
+*   Android
342
+*   BlackBerry 10
343
+*   Firefox OS
344
+*   iOS
345
+*   Windows Phone 7 y 8
346
+*   Windows 8
347
+*   Windows
348
+
349
+### Ejemplo
350
+
351
+    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);
352
+            }
353
+        }
354
+    };
355
+    
356
+    function onError(contactError) {alert('onError!');};
357
+    
358
+    encontrar todos los contactos var opciones = new ContactFindOptions();
359
+    options.Filter = "";
360
+    filtro var = ["displayName", "direcciones"];
361
+    Navigator.contacts.Find (filtro, onSuccess, onError, opciones);
362
+    
363
+
364
+### Rarezas Android 2.X
365
+
366
+*   **pref**: no soportado, devolviendo `false` en dispositivos Android 2.X.
367
+
368
+### BlackBerry 10 rarezas
369
+
370
+*   **pref**: no compatible con dispositivos BlackBerry, devolviendo `false`.
371
+
372
+*   **type**: parcialmente soportado. Sólo uno de cada *Work* y *Home* tipo direcciones puede ser almacenado por contacto.
373
+
374
+*   **formatted**: parcialmente soportado. Devuelve una concatenación de todos los campos de dirección de BlackBerry.
375
+
376
+*   **streetAddress**: soportado. Devuelve una concatenación de BlackBerry **address1** y **2** campos de dirección.
377
+
378
+*   **locality**: apoyado. Almacenada en el campo de dirección de la **city** de BlackBerry.
379
+
380
+*   **region**: apoyado. Almacenada en el campo de dirección de BlackBerry **stateProvince**.
381
+
382
+*   **postalCode**: apoyado. Almacenada en el campo de dirección de BlackBerry **zipPostal**.
383
+
384
+*   **country**: apoyado.
385
+
386
+### FirefoxOS rarezas
387
+
388
+*   **formato**: actualmente no se admite
389
+
390
+### iOS rarezas
391
+
392
+*   **pref**: no se admite en dispositivos iOS, devolviendo `false`.
393
+
394
+*   **formatted**: actualmente no se admite.
395
+
396
+### Rarezas de Windows 8
397
+
398
+*   **Pref**: no se admite
399
+
400
+### Windows rarezas
401
+
402
+*   **Pref**: no se admite
403
+
404
+## ContactError
405
+
406
+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.
407
+
408
+### Propiedades
409
+
410
+*   **code**: uno de los códigos de error predefinido enumerados a continuación.
411
+
412
+### Constantes
413
+
414
+*   `ContactError.UNKNOWN_ERROR` (code 0)
415
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
416
+*   `ContactError.TIMEOUT_ERROR` (code 2)
417
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
418
+*   `ContactError.IO_ERROR` (code 4)
419
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
420
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
421
+
422
+## ContactField
423
+
424
+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.
425
+
426
+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.
427
+
428
+### Propiedades
429
+
430
+*   **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. *(DOMString)*
431
+
432
+*   **valor**: el valor del campo, como un teléfono número o dirección de email. *(DOMString)*
433
+
434
+*   **Pref**: A `true` si este `ContactField` contiene el valor del usuario preferido. *(booleano)*
435
+
436
+### Plataformas soportadas
437
+
438
+*   Amazon fire OS
439
+*   Android
440
+*   BlackBerry 10
441
+*   Firefox OS
442
+*   iOS
443
+*   Windows Phone 7 y 8
444
+*   Windows 8
445
+*   Windows
446
+
447
+### Ejemplo
448
+
449
+        crear un nuevo contacto contacto var = navigator.contacts.create();
450
+    
451
+        almacenar números de teléfono de contacto en números de var ContactField [] = [];
452
+        phoneNumbers[0] = new ContactField ('trabajo', ' 212-555-1234', false);
453
+        phoneNumbers[1] = new ContactField ('móviles', ' 917-555-5432', true); recomendado: número phoneNumbers[2] = new ContactField ('home', ' 203-555-7890', false);
454
+        contact.phoneNumbers = números;
455
+    
456
+        guardar el contacto contact.save();
457
+    
458
+
459
+### Rarezas Android
460
+
461
+*   **Pref**: no soportado, regresando`false`.
462
+
463
+### BlackBerry 10 rarezas
464
+
465
+*   **tipo**: parcialmente soportado. Utilizado para los números de teléfono.
466
+
467
+*   **valor**: apoyado.
468
+
469
+*   **Pref**: no soportado, regresando`false`.
470
+
471
+### iOS rarezas
472
+
473
+*   **Pref**: no soportado, regresando`false`.
474
+
475
+### Windows8 rarezas
476
+
477
+*   **Pref**: no soportado, regresando`false`.
478
+
479
+### Windows rarezas
480
+
481
+*   **Pref**: no soportado, regresando`false`.
482
+
483
+## ContactName
484
+
485
+Contiene diferentes tipos de información sobre un `Contact` nombre del objeto.
486
+
487
+### Propiedades
488
+
489
+*   **formato**: el nombre completo del contacto. *(DOMString)*
490
+
491
+*   **familia**: el nombre del contacto familiar. *(DOMString)*
492
+
493
+*   **givenName**: nombre del contacto. *(DOMString)*
494
+
495
+*   **middleName**: el nombre del contacto media. *(DOMString)*
496
+
497
+*   **honorificPrefix**: prefijo del contacto (ejemplo *señor* o *doctor*) *(DOMString)*
498
+
499
+*   **honorificSuffix**: sufijo de contacto (ejemplo *Esq.*). *(DOMString)*
500
+
501
+### Plataformas soportadas
502
+
503
+*   Amazon fire OS
504
+*   Android
505
+*   BlackBerry 10
506
+*   Firefox OS
507
+*   iOS
508
+*   Windows Phone 7 y 8
509
+*   Windows 8
510
+*   Windows
511
+
512
+### Ejemplo
513
+
514
+    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);
515
+        }
516
+    };
517
+    
518
+    function onError(contactError) {alert('onError!');};
519
+    
520
+    var opciones = new ContactFindOptions();
521
+    options.Filter = "";
522
+    filtro = ["displayName", "nombre"];
523
+    Navigator.contacts.Find (filtro, onSuccess, onError, opciones);
524
+    
525
+
526
+### Rarezas Android
527
+
528
+*   **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
529
+
530
+### BlackBerry 10 rarezas
531
+
532
+*   **formato**: parcialmente soportado. Devuelve una concatenación de campos **firstName** y **lastName** de BlackBerry.
533
+
534
+*   **familia**: apoyo. Almacenada en el campo **lastName** BlackBerry.
535
+
536
+*   **givenName**: apoyado. Almacenados en campo **firstName** BlackBerry.
537
+
538
+*   **middleName**: no soportado, regresando`null`.
539
+
540
+*   **honorificPrefix**: no soportado, regresando`null`.
541
+
542
+*   **honorificSuffix**: no soportado, regresando`null`.
543
+
544
+### FirefoxOS rarezas
545
+
546
+*   **formato**: parcialmente compatibles y de sólo lectura. Devuelve una concatenación de `honorificPrefix` , `givenName` , `middleName` , `familyName` , y`honorificSuffix`.
547
+
548
+### iOS rarezas
549
+
550
+*   **formato**: parcialmente soportado. Devuelve iOS nombre compuesto, pero es de sólo lectura.
551
+
552
+### Rarezas de Windows 8
553
+
554
+*   **formato**: este es el único nombre de propiedad y es idéntico al `displayName` , y`nickname`
555
+
556
+*   **familia**: no se admite
557
+
558
+*   **givenName**: no se admite
559
+
560
+*   **middleName**: no se admite
561
+
562
+*   **honorificPrefix**: no se admite
563
+
564
+*   **honorificSuffix**: no se admite
565
+
566
+### Windows rarezas
567
+
568
+*   **formato**: es idéntica a`displayName`
569
+
570
+## ContactOrganization
571
+
572
+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.
573
+
574
+### Propiedades
575
+
576
+*   **Pref**: A `true` si este `ContactOrganization` contiene el valor del usuario preferido. *(booleano)*
577
+
578
+*   **tipo**: una cadena que indica qué tipo de campo es, *casa* por ejemplo. _(DOMString)
579
+
580
+*   **nombre**: el nombre de la organización. *(DOMString)*
581
+
582
+*   **Departamento**: el contrato de obras para el departamento. *(DOMString)*
583
+
584
+*   **título**: título del contacto de la organización. *(DOMString)*
585
+
586
+### Plataformas soportadas
587
+
588
+*   Android
589
+*   BlackBerry 10
590
+*   Firefox OS
591
+*   iOS
592
+*   Windows Phone 7 y 8
593
+*   Windows (sólo dispositivos Windows 8.1 y 8.1 de Windows Phone)
594
+
595
+### Ejemplo
596
+
597
+    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);
598
+            }
599
+        }
600
+    };
601
+    
602
+    function onError(contactError) {alert('onError!');};
603
+    
604
+    var opciones = new ContactFindOptions();
605
+    options.Filter = "";
606
+    filtro = ["displayName", "organizaciones"];
607
+    Navigator.contacts.Find (filtro, onSuccess, onError, opciones);
608
+    
609
+
610
+### Rarezas Android 2.X
611
+
612
+*   **Pref**: no compatible con dispositivos Android 2.X, regresando`false`.
613
+
614
+### BlackBerry 10 rarezas
615
+
616
+*   **Pref**: no compatible con dispositivos BlackBerry, regresando`false`.
617
+
618
+*   **tipo**: no compatible con dispositivos BlackBerry, regresando`null`.
619
+
620
+*   **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de la **empresa** BlackBerry.
621
+
622
+*   **Departamento**: no soportado, regresando`null`.
623
+
624
+*   **título**: parcialmente soportado. El primer título de la organización se almacena en el campo de **jobTitle** BlackBerry.
625
+
626
+### Firefox OS rarezas
627
+
628
+*   **Pref**: no se admite
629
+
630
+*   **tipo**: no se admite
631
+
632
+*   **Departamento**: no se admite
633
+
634
+*   Los campos **nombre** y **título** almacenado en **org** y **jobTitle**.
635
+
636
+### iOS rarezas
637
+
638
+*   **pref**: no se admite en dispositivos iOS, devolviendo `false`.
639
+
640
+*   **tipo**: no se admite en dispositivos iOS, regresando`null`.
641
+
642
+*   **nombre**: parcialmente soportado. El primer nombre de la organización se almacena en el campo de **kABPersonOrganizationProperty** de iOS.
643
+
644
+*   **Departamento**: parcialmente soportado. El primer nombre de departamento se almacena en el campo de **kABPersonDepartmentProperty** de iOS.
645
+
646
+*   **título**: parcialmente soportado. El primer título se almacena en el campo de **kABPersonJobTitleProperty** de iOS.
647
+
648
+### Windows rarezas
649
+
650
+*   **Pref**: no soportado, regresando`false`.
651
+
652
+*   **tipo**: no soportado, regresando`null`.

+ 668
- 0
km0App/node_modules/cordova-plugin-contacts/doc/fr/README.md Parādīt failu

@@ -0,0 +1,668 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+Ce plugin définit un global `navigator.contacts` objet, ce qui permet d'accéder à la base de données de contacts de dispositif.
25
+
26
+Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
27
+
28
+    document.addEventListener (« deviceready », onDeviceReady, false) ;
29
+    function onDeviceReady() {console.log(navigator.contacts);}
30
+    
31
+
32
+**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.
33
+
34
+## Installation
35
+
36
+Pour cela, cordova 5.0 + (v1.0.0 stable actuelle)
37
+
38
+    cordova plugin add cordova-plugin-contacts
39
+    
40
+
41
+Anciennes versions de cordova peuvent toujours installer via l'id **déconseillée** (v0.2.16 rassis)
42
+
43
+    cordova plugin add org.apache.cordova.contacts
44
+    
45
+
46
+Il est également possible d'installer directement via l'url de repo (instable)
47
+
48
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
49
+    
50
+
51
+### Firefox OS Quirks
52
+
53
+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.
54
+
55
+    « type »: "le privilège", "autorisations": {« contacts »: {« accès »: "readwrite", "description": "décrire pourquoi il est nécessaire pour obtenir cette permission"}}
56
+    
57
+
58
+### Bizarreries de Windows
59
+
60
+**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.
61
+
62
+**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.
63
+
64
+### Bizarreries de Windows 8
65
+
66
+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.
67
+
68
+## Navigator.contacts
69
+
70
+### Méthodes
71
+
72
+  * navigator.contacts.create
73
+  * navigator.contacts.find
74
+  * navigator.contacts.pickContact
75
+
76
+### Objets
77
+
78
+  * Contact
79
+  * ContactName
80
+  * ContactField
81
+  * ContactAddress
82
+  * ContactOrganization
83
+  * ContactFindOptions
84
+  * ContactError
85
+  * ContactFieldType
86
+
87
+## navigator.contacts.create
88
+
89
+La `navigator.contacts.create` méthode est synchrone et retourne un nouveau `Contact` objet.
90
+
91
+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.
92
+
93
+### Plates-formes supportées
94
+
95
+  * Android
96
+  * BlackBerry 10
97
+  * Firefox OS
98
+  * iOS
99
+  * Windows Phone 7 et 8
100
+
101
+### Exemple
102
+
103
+    myContact var = navigator.contacts.create ({« displayName »: « Test User »}) ;
104
+    
105
+
106
+## navigator.contacts.find
107
+
108
+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** .
109
+
110
+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.
111
+
112
+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.
113
+
114
+### Paramètres
115
+
116
+  * **contactFields**: communiquer avec les champs à utiliser comme un qualificateur de recherche. *(DOMString[])* [Required]
117
+
118
+  * **contactSuccess**: fonction de rappel de succès avec le tableau d'objets Contact appelée retournée par la base de données. [Required]
119
+
120
+  * **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Facultatif]
121
+
122
+  * **contactFindOptions**: recherche d'options pour filtrer navigator.contacts. [Optional]
123
+    
124
+    Clés incluent :
125
+    
126
+      * **filtre**: la chaîne de recherche utilisée pour trouver navigator.contacts. *(DOMString)* (Par défaut :`""`)
127
+    
128
+      * **multiples**: détermine si l'opération find retourne plusieurs navigator.contacts. *(Booléen)* (Par défaut :`false`)
129
+        
130
+          * **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]
131
+
132
+### Plates-formes supportées
133
+
134
+  * Android
135
+  * BlackBerry 10
136
+  * Firefox OS
137
+  * iOS
138
+  * Windows Phone 7 et 8
139
+  * Windows (Windows Phone, 8.1 et Windows 10)
140
+
141
+### Exemple
142
+
143
+    function onSuccess(contacts) {alert (« Found » + contacts.length + « contacts. »);} ;
144
+    
145
+    function onError(contactError) {alert('onError!');} ;
146
+    
147
+    trouver tous les contacts avec « Bob » dans toute option de var de champ nom = new ContactFindOptions() ;
148
+    options.Filter = « Bob » ;
149
+    options.multiple = true ;
150
+    options.desiredFields = [navigator.contacts.fieldType.id] ;
151
+    champs var = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name] ;
152
+    Navigator.contacts.Find (champs, onSuccess, onError, options) ;
153
+    
154
+
155
+### Bizarreries de Windows
156
+
157
+  * `__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.
158
+
159
+## navigator.contacts.pickContact
160
+
161
+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** .
162
+
163
+### Paramètres
164
+
165
+  * **contactSuccess**: fonction de rappel de succès appelée avec l'objet de Contact unique. [Obligatoire]
166
+
167
+  * **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Facultatif]
168
+
169
+### Plates-formes supportées
170
+
171
+  * Android
172
+  * iOS
173
+  * Windows Phone 8
174
+  * Windows 8
175
+  * Windows
176
+
177
+### Exemple
178
+
179
+    navigator.contacts.pickContact(function(contact) {console.log ("le contact suivant a été retenu:" + JSON.stringify(contact)) ;
180
+        }, function(err) {console.log ("Error:" + err) ;
181
+        });
182
+    
183
+
184
+## Contact
185
+
186
+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.
187
+
188
+**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.
189
+
190
+### Propriétés
191
+
192
+  * **ID**: un identificateur global unique. *(DOMString)*
193
+
194
+  * **displayName**: le nom de ce Contact, approprié pour l'affichage à l'utilisateur final. *(DOMString)*
195
+
196
+  * **nom**: un objet contenant tous les composants d'un nom de personnes. *(ContactName)*
197
+
198
+  * **Pseudo**: un nom occasionnel permettant de régler le contact. *(DOMString)*
199
+
200
+  * **phoneNumbers**: un tableau des numéros de téléphone du contact. *(ContactField[])*
201
+
202
+  * **courriels**: un tableau d'adresses de courriel du contact. *(ContactField[])*
203
+
204
+  * **adresses**: un tableau d'adresses tous les contacts. *(ContactAddress[])*
205
+
206
+  * **IMS**: un tableau d'adresses IM tout le contact. *(ContactField[])*
207
+
208
+  * **organisations**: un tableau des organisations de tout le contact. *(ContactOrganization[])*
209
+
210
+  * **anniversaire**: l'anniversaire du contact. *(Date)*
211
+
212
+  * **Remarque**: une remarque sur le contact. *(DOMString)*
213
+
214
+  * **photos**: un tableau de photos du contact. *(ContactField[])*
215
+
216
+  * **catégories**: un tableau de toutes les catégories définies par l'utilisateur attribuée au contact. *(ContactField[])*
217
+
218
+  * **URL**: un tableau des pages web attribuée au contact. *(ContactField[])*
219
+
220
+### Méthodes
221
+
222
+  * **Clone**: retourne un nouveau `Contact` objet qui est une copie complète de l'objet appelant, avec le `id` propriété la valeur`null`.
223
+
224
+  * **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.
225
+
226
+  * **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à.
227
+
228
+### Plates-formes supportées
229
+
230
+  * Amazon Fire OS
231
+  * Android
232
+  * BlackBerry 10
233
+  * Firefox OS
234
+  * iOS
235
+  * Windows Phone 7 et 8
236
+  * Windows 8
237
+  * Windows
238
+
239
+### Enregistrez l'exemple
240
+
241
+    function onSuccess(contact) {alert ("sauver succès");} ;
242
+    
243
+    function onError(contactError) {alert ("erreur =" + contactError.code);} ;
244
+    
245
+    créer un objet contact contact var = navigator.contacts.create() ;
246
+    contact.displayName = « Plombier » ;
247
+    contact.Nickname = « Plombier » ;            spécifier à la fois pour prendre en charge tous les périphériques / / renseigner certains champs var nom = new ContactName() ;
248
+    name.givenName = « Jane » ;
249
+    name.familyName = « Doe » ;
250
+    contact.name = nom ;
251
+    
252
+    enregistrer dans contact.save(onSuccess,onError) de l'appareil ;
253
+    
254
+
255
+### Exemple de clone
256
+
257
+        Clone clone objet contact var = contact.clone() ;
258
+        clone.name.givenName = « John » ;
259
+        Console.log ("contact Original nom =" + contact.name.givenName) ;
260
+        Console.log ("nom de contact clonés =" + clone.name.givenName) ;
261
+    
262
+
263
+### Supprimer l'exemple
264
+
265
+    fonction onSuccess() {alert ("succès");} ;
266
+    
267
+    function onError(contactError) {alert ("erreur =" + contactError.code);} ;
268
+    
269
+    supprimer le contact de l'appareil contact.remove(onSuccess,onError) ;
270
+    
271
+
272
+### Android 2.X Quirks
273
+
274
+  * **catégories**: non pris en charge sur les périphériques Android 2.X, retour`null`.
275
+
276
+### BlackBerry 10 Quirks
277
+
278
+  * **ID**: assignés par l'appareil lors de l'enregistrement du contact.
279
+
280
+### Bizarreries de FirefoxOS
281
+
282
+  * **catégories**: partiellement pris en charge. Champs **pref** et **type** sont de retour`null`
283
+
284
+  * **IMS**: non pris en charge
285
+
286
+  * **photos**: ne pas pris en charge
287
+
288
+### Notes au sujet d'iOS
289
+
290
+  * **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.
291
+
292
+  * **anniversaire**: doit être entré comme un JavaScript `Date` objet, de la même façon qu'il soit retourné.
293
+
294
+  * **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.
295
+
296
+  * **catégories**: cette propriété n'est actuellement pas supportée, retour`null`.
297
+
298
+### Notes au sujet de Windows Phone 7 et 8
299
+
300
+  * **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.
301
+
302
+  * **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.
303
+
304
+  * **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*.
305
+
306
+  * **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*.
307
+
308
+  * **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*.
309
+
310
+  * **organisations**: seul est autorisé et ne supporte pas les attributs *pref*, *type*et *Département* .
311
+
312
+  * **Remarque**: ne pas pris en charge, retour`null`.
313
+
314
+  * **IMS**: ne pas pris en charge, retour`null`.
315
+
316
+  * **anniversaires**: ne pas pris en charge, retour`null`.
317
+
318
+  * **catégories**: ne pas pris en charge, retour`null`.
319
+
320
+  * **remove**: méthode n'est pas prise en charge
321
+
322
+### Bizarreries de Windows
323
+
324
+  * **photos**: retourne une URL de fichier de l'image, qui est stocké dans le répertoire temporaire de l'application.
325
+
326
+  * **anniversaires**: ne pas pris en charge, retour`null`.
327
+
328
+  * **catégories**: ne pas pris en charge, retour`null`.
329
+
330
+  * **remove**: méthode est uniquement pris en charge dans Windows 10 ou supérieur.
331
+
332
+## ContactAddress
333
+
334
+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.
335
+
336
+### Propriétés
337
+
338
+  * **pref**: la valeur `true` si ce `ContactAddress` contient la valeur de préférence de l'utilisateur. *(booléen)*
339
+
340
+  * **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
341
+
342
+  * **mise en forme**: l'adresse complète au format pour l'affichage. *(DOMString)*
343
+
344
+  * **adresse**: l'adresse complète. *(DOMString)*
345
+
346
+  * **localité**: la ville ou la localité. *(DOMString)*
347
+
348
+  * **région**: l'État ou la région. *(DOMString)*
349
+
350
+  * **Code postal**: le code zip ou code postal. *(DOMString)*
351
+
352
+  * **pays**: le nom du pays. *(DOMString)*
353
+
354
+### Plates-formes supportées
355
+
356
+  * Amazon Fire OS
357
+  * Android
358
+  * BlackBerry 10
359
+  * Firefox OS
360
+  * iOS
361
+  * Windows Phone 7 et 8
362
+  * Windows 8
363
+  * Windows
364
+
365
+### Exemple
366
+
367
+    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) ;
368
+            }
369
+        }
370
+    };
371
+    
372
+    function onError(contactError) {alert('onError!');} ;
373
+    
374
+    trouver tous les contacts options var = new ContactFindOptions() ;
375
+    options.Filter = "" ;
376
+    filtre var = ["name", « adresses »] ;
377
+    Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
378
+    
379
+
380
+### Android 2.X Quirks
381
+
382
+  * **pref**: ne pas pris en charge, retour `false` sur les appareils Android 2.X.
383
+
384
+### BlackBerry 10 Quirks
385
+
386
+  * **pref**: non pris en charge sur les appareils BlackBerry, retour`false`.
387
+
388
+  * **type**: partiellement pris en charge. Seule chaque de *travail* et tapez les adresses de *la maison* peut être stockée par contact.
389
+
390
+  * **au format**: partiellement pris en charge. Retourne la concaténation de tous les champs d'adresse BlackBerry.
391
+
392
+  * **streetAddress**: prise en charge. Retourne la concaténation de BlackBerry **address1** et **address2** champs d'adresse.
393
+
394
+  * **localité**: prise en charge. Stockée dans le champ d'adresse BlackBerry **ville** .
395
+
396
+  * **région**: pris en charge. Stockée dans le champ d'adresse BlackBerry **stateProvince** .
397
+
398
+  * **Code postal**: prise en charge. Stockée dans le champ d'adresse BlackBerry **zipPostal** .
399
+
400
+  * **pays**: prise en charge.
401
+
402
+### Bizarreries de FirefoxOS
403
+
404
+  * **au format**: actuellement ne pas pris en charge
405
+
406
+### Notes au sujet d'iOS
407
+
408
+  * **pref**: non pris en charge sur les appareils iOS, retour`false`.
409
+
410
+  * **au format**: actuellement ne pas pris en charge.
411
+
412
+### Bizarreries de Windows 8
413
+
414
+  * **pref**: non pris en charge
415
+
416
+### Bizarreries de Windows
417
+
418
+  * **pref**: non pris en charge
419
+
420
+## ContactError
421
+
422
+Le `ContactError` objet est retourné à l'utilisateur via le `contactError` fonction de rappel lorsqu'une erreur survient.
423
+
424
+### Propriétés
425
+
426
+  * **code**: l'un des codes d'erreur prédéfinis énumérés ci-dessous.
427
+
428
+### Constantes
429
+
430
+  * `ContactError.UNKNOWN_ERROR` (code 0)
431
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
432
+  * `ContactError.TIMEOUT_ERROR` (code 2)
433
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
434
+  * `ContactError.IO_ERROR` (code 4)
435
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
436
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
437
+
438
+## ContactField
439
+
440
+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.
441
+
442
+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.
443
+
444
+### Propriétés
445
+
446
+  * **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
447
+
448
+  * **valeur**: la valeur du champ, comme un téléphone numéro ou adresse e-mail. *(DOMString)*
449
+
450
+  * **pref**: la valeur `true` si ce `ContactField` contient la valeur de préférence de l'utilisateur. *(booléen)*
451
+
452
+### Plates-formes supportées
453
+
454
+  * Amazon Fire OS
455
+  * Android
456
+  * BlackBerry 10
457
+  * Firefox OS
458
+  * iOS
459
+  * Windows Phone 7 et 8
460
+  * Windows 8
461
+  * Windows
462
+
463
+### Exemple
464
+
465
+        créer un nouveau contact contact var = navigator.contacts.create() ;
466
+    
467
+        stocker des numéros de téléphone de contact en ContactField [] var phoneNumbers = [] ;
468
+        phoneNumbers[0] = new ContactField (« travail », ' 212-555-1234', false) ;
469
+        phoneNumbers[1] = new ContactField (« mobile », ' 917-555-5432', true) ; phoneNumbers[2] numéro préféré = new ContactField (« home », ' 203-555-7890', false) ;
470
+        contact.phoneNumbers = phoneNumbers ;
471
+    
472
+        enregistrer le contact contact.save() ;
473
+    
474
+
475
+### Quirks Android
476
+
477
+  * **pref**: ne pas pris en charge, retour`false`.
478
+
479
+### BlackBerry 10 Quirks
480
+
481
+  * **type**: partiellement pris en charge. Utilisé pour les numéros de téléphone.
482
+
483
+  * **valeur**: prise en charge.
484
+
485
+  * **pref**: ne pas pris en charge, retour`false`.
486
+
487
+### Notes au sujet d'iOS
488
+
489
+  * **pref**: ne pas pris en charge, retour`false`.
490
+
491
+### Quirks Windows8
492
+
493
+  * **pref**: ne pas pris en charge, retour`false`.
494
+
495
+### Bizarreries de Windows
496
+
497
+  * **pref**: ne pas pris en charge, retour`false`.
498
+
499
+## ContactName
500
+
501
+Contient différents types d'informations sur un `Contact` nom de l'objet.
502
+
503
+### Propriétés
504
+
505
+  * **mise en forme**: le nom complet du contact. *(DOMString)*
506
+
507
+  * **familyName**: nom de famille du contact. *(DOMString)*
508
+
509
+  * **givenName**: prénom du contact. *(DOMString)*
510
+
511
+  * **middleName**: deuxième prénom du contact. *(DOMString)*
512
+
513
+  * **honorificPrefix**: préfixe du contact (exemple *M.* ou *Mme*) *(DOMString)*
514
+
515
+  * **honorificSuffix**: suffixe du contact (exemple *Esq.*). *(DOMString)*
516
+
517
+### Plates-formes supportées
518
+
519
+  * Amazon Fire OS
520
+  * Android
521
+  * BlackBerry 10
522
+  * Firefox OS
523
+  * iOS
524
+  * Windows Phone 7 et 8
525
+  * Windows 8
526
+  * Windows
527
+
528
+### Exemple
529
+
530
+    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) ;
531
+        }
532
+    };
533
+    
534
+    function onError(contactError) {alert('onError!');} ;
535
+    
536
+    options de var = new ContactFindOptions() ;
537
+    options.Filter = "" ;
538
+    filtre = ["name", « nom »] ;
539
+    Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
540
+    
541
+
542
+### Quirks Android
543
+
544
+  * **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
545
+
546
+### BlackBerry 10 Quirks
547
+
548
+  * **au format**: partiellement pris en charge. Retourne la concaténation de champs **firstName** et **lastName** de BlackBerry.
549
+
550
+  * **familyName**: prise en charge. Stockée dans le champ **lastName** BlackBerry.
551
+
552
+  * **givenName**: prise en charge. Stockée dans le champ **firstName** BlackBerry.
553
+
554
+  * **middleName**: ne pas pris en charge, retour`null`.
555
+
556
+  * **honorificPrefix**: ne pas pris en charge, retour`null`.
557
+
558
+  * **honorificSuffix**: ne pas pris en charge, retour`null`.
559
+
560
+### Bizarreries de FirefoxOS
561
+
562
+  * **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
563
+
564
+### Notes au sujet d'iOS
565
+
566
+  * **au format**: partiellement pris en charge. Retourne la dénomination composée d'iOS, mais est en lecture seule.
567
+
568
+### Bizarreries de Windows 8
569
+
570
+  * **au format**: c'est le seul nom de propriété et est identique à `displayName` , et`nickname`
571
+
572
+  * **familyName**: non pris en charge
573
+
574
+  * **givenName**: non pris en charge
575
+
576
+  * **middleName**: non pris en charge
577
+
578
+  * **honorificPrefix**: non pris en charge
579
+
580
+  * **honorificSuffix**: non pris en charge
581
+
582
+### Bizarreries de Windows
583
+
584
+  * **mise en forme**: il est identique à`displayName`
585
+
586
+## ContactOrganization
587
+
588
+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.
589
+
590
+### Propriétés
591
+
592
+  * **pref**: la valeur `true` si ce `ContactOrganization` contient la valeur de préférence de l'utilisateur. *(booléen)*
593
+
594
+  * **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. _(DOMString)
595
+
596
+  * **nom**: le nom de l'organisation. *(DOMString)*
597
+
598
+  * **Département**: le département et le contrat de travaille pour. *(DOMString)*
599
+
600
+  * **titre**: titre du contact auprès de l'organisation. *(DOMString)*
601
+
602
+### Plates-formes supportées
603
+
604
+  * Android
605
+  * BlackBerry 10
606
+  * Firefox OS
607
+  * iOS
608
+  * Windows Phone 7 et 8
609
+  * Windows (Windows 8.1 et Windows Phone 8.1 dispositifs seulement)
610
+
611
+### Exemple
612
+
613
+    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) ;
614
+            }
615
+        }
616
+    };
617
+    
618
+    function onError(contactError) {alert('onError!');} ;
619
+    
620
+    options de var = new ContactFindOptions() ;
621
+    options.Filter = "" ;
622
+    filtre = ["displayName", « organisations »] ;
623
+    Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
624
+    
625
+
626
+### Android 2.X Quirks
627
+
628
+  * **pref**: ne pas pris en charge par des dispositifs Android 2.X, retour`false`.
629
+
630
+### BlackBerry 10 Quirks
631
+
632
+  * **pref**: ne pas pris en charge par les appareils BlackBerry, retour`false`.
633
+
634
+  * **type**: ne pas pris en charge par les appareils BlackBerry, retour`null`.
635
+
636
+  * **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ **company** de BlackBerry.
637
+
638
+  * **Département**: ne pas pris en charge, retour`null`.
639
+
640
+  * **titre**: partiellement pris en charge. Le premier titre de l'organisation est stocké dans le champ de **jobTitle** BlackBerry.
641
+
642
+### Firefox OS Quirks
643
+
644
+  * **pref**: non pris en charge
645
+
646
+  * **type**: non pris en charge
647
+
648
+  * **Département**: non pris en charge
649
+
650
+  * Les champs **nom** et **titre** stocké dans **org** et **jobTitle**.
651
+
652
+### Notes au sujet d'iOS
653
+
654
+  * **pref**: non pris en charge sur les appareils iOS, retour`false`.
655
+
656
+  * **type**: non pris en charge sur les appareils iOS, retour`null`.
657
+
658
+  * **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ de **kABPersonOrganizationProperty** iOS.
659
+
660
+  * **Département**: partiellement pris en charge. Le premier nom de département est stocké dans le champ de **kABPersonDepartmentProperty** iOS.
661
+
662
+  * **titre**: partiellement pris en charge. Le premier titre est stocké dans le champ de **kABPersonJobTitleProperty** iOS.
663
+
664
+### Bizarreries de Windows
665
+
666
+  * **pref**: ne pas pris en charge, retour`false`.
667
+
668
+  * **type**: ne pas pris en charge, retour`null`.

+ 652
- 0
km0App/node_modules/cordova-plugin-contacts/doc/fr/index.md Parādīt failu

@@ -0,0 +1,652 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+Ce plugin définit un global `navigator.contacts` objet, ce qui permet d'accéder à la base de données de contacts de dispositif.
23
+
24
+Bien que l'objet est attaché à la portée globale `navigator` , il n'est pas disponible jusqu'après la `deviceready` événement.
25
+
26
+    document.addEventListener (« deviceready », onDeviceReady, false) ;
27
+    function onDeviceReady() {console.log(navigator.contacts);}
28
+    
29
+
30
+**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.
31
+
32
+## Installation
33
+
34
+    Cordova plugin ajouter cordova-plugin-contacts
35
+    
36
+
37
+### Firefox OS Quirks
38
+
39
+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.
40
+
41
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
42
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
43
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
44
+
45
+    « type »: "le privilège", "autorisations": {« contacts »: {« accès »: "readwrite", "description": "décrire pourquoi il est nécessaire pour obtenir cette permission"}}
46
+    
47
+
48
+### Bizarreries de Windows
49
+
50
+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.
51
+
52
+### Bizarreries de Windows 8
53
+
54
+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.
55
+
56
+## Navigator.contacts
57
+
58
+### Méthodes
59
+
60
+*   navigator.contacts.create
61
+*   navigator.contacts.find
62
+*   navigator.contacts.pickContact
63
+
64
+### Objets
65
+
66
+*   Contact
67
+*   ContactName
68
+*   ContactField
69
+*   ContactAddress
70
+*   ContactOrganization
71
+*   ContactFindOptions
72
+*   ContactError
73
+*   ContactFieldType
74
+
75
+## Navigator.contacts.Create
76
+
77
+La `navigator.contacts.create` méthode est synchrone et retourne un nouveau `Contact` objet.
78
+
79
+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.
80
+
81
+### Plates-formes prises en charge
82
+
83
+*   Android
84
+*   BlackBerry 10
85
+*   Firefox OS
86
+*   iOS
87
+*   Windows Phone 7 et 8
88
+
89
+### Exemple
90
+
91
+    myContact var = navigator.contacts.create ({« displayName »: « Test User »}) ;
92
+    
93
+
94
+## navigator.contacts.find
95
+
96
+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** .
97
+
98
+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.
99
+
100
+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.
101
+
102
+### Paramètres
103
+
104
+*   **contactFields**: communiquer avec les champs à utiliser comme un qualificateur de recherche. *(DOMString[])* [Required]
105
+
106
+*   **contactSuccess**: fonction de rappel de succès avec le tableau d'objets Contact appelée retournée par la base de données. [Required]
107
+
108
+*   **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Optional]
109
+
110
+*   **contactFindOptions**: recherche d'options pour filtrer navigator.contacts. [Optional]
111
+    
112
+    Clés incluent :
113
+    
114
+    *   **filtre**: la chaîne de recherche utilisée pour trouver navigator.contacts. *(DOMString)* (Par défaut :`""`)
115
+    
116
+    *   **multiples**: détermine si l'opération find retourne plusieurs navigator.contacts. *(Booléen)* (Par défaut :`false`)
117
+        
118
+        *   **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]
119
+
120
+### Plates-formes prises en charge
121
+
122
+*   Android
123
+*   BlackBerry 10
124
+*   Firefox OS
125
+*   iOS
126
+*   Windows Phone 7 et 8
127
+*   Windows (Windows Phone 8.1 dispositifs seulement)
128
+
129
+### Exemple
130
+
131
+    function onSuccess(contacts) {alert (« Found » + contacts.length + « contacts. »);} ;
132
+    
133
+    function onError(contactError) {alert('onError!');} ;
134
+    
135
+    trouver tous les contacts avec « Bob » dans toute option de var de champ nom = new ContactFindOptions() ;
136
+    options.Filter = « Bob » ;
137
+    options.multiple = true ;
138
+    options.desiredFields = [navigator.contacts.fieldType.id] ;
139
+    champs var = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name] ;
140
+    Navigator.contacts.Find (champs, onSuccess, onError, options) ;
141
+    
142
+
143
+### Bizarreries de Windows
144
+
145
+*   `__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.
146
+
147
+## navigator.contacts.pickContact
148
+
149
+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** .
150
+
151
+### Paramètres
152
+
153
+*   **contactSuccess**: fonction de rappel de succès appelée avec l'objet de Contact unique. [Obligatoire]
154
+
155
+*   **contactError**: fonction de rappel d'erreur, appelée lorsqu'une erreur se produit. [Facultatif]
156
+
157
+### Plates-formes prises en charge
158
+
159
+*   Android
160
+*   iOS
161
+*   Windows Phone 8
162
+*   Windows 8
163
+*   Windows
164
+
165
+### Exemple
166
+
167
+    navigator.contacts.pickContact(function(contact) {console.log ("le contact suivant a été retenu:" + JSON.stringify(contact)) ;
168
+        }, function(err) {console.log ("Error:" + err) ;
169
+        });
170
+    
171
+
172
+## Contact
173
+
174
+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.
175
+
176
+**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.
177
+
178
+### Propriétés
179
+
180
+*   **ID**: un identificateur global unique. *(DOMString)*
181
+
182
+*   **displayName**: le nom de ce Contact, approprié pour l'affichage à l'utilisateur final. *(DOMString)*
183
+
184
+*   **nom**: un objet contenant tous les composants d'un nom de personnes. *(ContactName)*
185
+
186
+*   **Pseudo**: un nom occasionnel permettant de régler le contact. *(DOMString)*
187
+
188
+*   **phoneNumbers**: un tableau des numéros de téléphone du contact. *(ContactField[])*
189
+
190
+*   **courriels**: un tableau d'adresses de courriel du contact. *(ContactField[])*
191
+
192
+*   **adresses**: un tableau d'adresses tous les contacts. *(ContactAddress[])*
193
+
194
+*   **IMS**: un tableau d'adresses IM tout le contact. *(ContactField[])*
195
+
196
+*   **organisations**: un tableau des organisations de tout le contact. *(ContactOrganization[])*
197
+
198
+*   **anniversaire**: l'anniversaire du contact. *(Date)*
199
+
200
+*   **Remarque**: une remarque sur le contact. *(DOMString)*
201
+
202
+*   **photos**: un tableau de photos du contact. *(ContactField[])*
203
+
204
+*   **catégories**: un tableau de toutes les catégories définies par l'utilisateur attribuée au contact. *(ContactField[])*
205
+
206
+*   **URL**: un tableau des pages web attribuée au contact. *(ContactField[])*
207
+
208
+### Méthodes
209
+
210
+*   **Clone**: retourne un nouveau `Contact` objet qui est une copie complète de l'objet appelant, avec le `id` propriété la valeur`null`.
211
+
212
+*   **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.
213
+
214
+*   **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à.
215
+
216
+### Plates-formes prises en charge
217
+
218
+*   Amazon Fire OS
219
+*   Android
220
+*   BlackBerry 10
221
+*   Firefox OS
222
+*   iOS
223
+*   Windows Phone 7 et 8
224
+*   Windows 8
225
+*   Windows
226
+
227
+### Enregistrez l'exemple
228
+
229
+    function onSuccess(contact) {alert ("sauver succès");} ;
230
+    
231
+    function onError(contactError) {alert ("erreur =" + contactError.code);} ;
232
+    
233
+    créer un objet contact contact var = navigator.contacts.create() ;
234
+    contact.displayName = « Plombier » ;
235
+    contact.Nickname = « Plombier » ;            spécifier à la fois pour prendre en charge tous les périphériques / / renseigner certains champs var nom = new ContactName() ;
236
+    name.givenName = « Jane » ;
237
+    name.familyName = « Doe » ;
238
+    contact.name = nom ;
239
+    
240
+    enregistrer dans contact.save(onSuccess,onError) de l'appareil ;
241
+    
242
+
243
+### Exemple de clone
244
+
245
+        Clone clone objet contact var = contact.clone() ;
246
+        clone.name.givenName = « John » ;
247
+        Console.log ("contact Original nom =" + contact.name.givenName) ;
248
+        Console.log ("nom de contact clonés =" + clone.name.givenName) ;
249
+    
250
+
251
+### Supprimer l'exemple
252
+
253
+    fonction onSuccess() {alert ("succès");} ;
254
+    
255
+    function onError(contactError) {alert ("erreur =" + contactError.code);} ;
256
+    
257
+    supprimer le contact de l'appareil contact.remove(onSuccess,onError) ;
258
+    
259
+
260
+### Android 2.X Quirks
261
+
262
+*   **catégories**: non pris en charge sur les périphériques Android 2.X, retour`null`.
263
+
264
+### BlackBerry 10 Quirks
265
+
266
+*   **ID**: assignés par l'appareil lors de l'enregistrement du contact.
267
+
268
+### Bizarreries de FirefoxOS
269
+
270
+*   **catégories**: partiellement pris en charge. Champs **pref** et **type** sont de retour`null`
271
+
272
+*   **IMS**: non pris en charge
273
+
274
+*   **photos**: ne pas pris en charge
275
+
276
+### iOS Quirks
277
+
278
+*   **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.
279
+
280
+*   **anniversaire**: doit être entré comme un JavaScript `Date` objet, de la même façon qu'il soit retourné.
281
+
282
+*   **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.
283
+
284
+*   **catégories**: cette propriété n'est actuellement pas supportée, retour`null`.
285
+
286
+### Windows Phone 7 et 8 Quirks
287
+
288
+*   **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.
289
+
290
+*   **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.
291
+
292
+*   **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*.
293
+
294
+*   **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*.
295
+
296
+*   **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*.
297
+
298
+*   **organisations**: seul est autorisé et ne supporte pas les attributs *pref*, *type*et *Département* .
299
+
300
+*   **Remarque**: ne pas pris en charge, retour`null`.
301
+
302
+*   **IMS**: ne pas pris en charge, retour`null`.
303
+
304
+*   **anniversaires**: ne pas pris en charge, retour`null`.
305
+
306
+*   **catégories**: ne pas pris en charge, retour`null`.
307
+
308
+### Bizarreries de Windows
309
+
310
+*   **photos**: retourne une URL de fichier de l'image, qui est stocké dans le répertoire temporaire de l'application.
311
+
312
+*   **anniversaires**: ne pas pris en charge, retour`null`.
313
+
314
+*   **catégories**: ne pas pris en charge, retour`null`.
315
+
316
+## ContactAddress
317
+
318
+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.
319
+
320
+### Propriétés
321
+
322
+*   **pref**: la valeur `true` si ce `ContactAddress` contient la valeur de préférence de l'utilisateur. *(booléen)*
323
+
324
+*   **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
325
+
326
+*   **mise en forme**: l'adresse complète au format pour l'affichage. *(DOMString)*
327
+
328
+*   **adresse**: l'adresse complète. *(DOMString)*
329
+
330
+*   **localité**: la ville ou la localité. *(DOMString)*
331
+
332
+*   **région**: l'État ou la région. *(DOMString)*
333
+
334
+*   **Code postal**: le code zip ou code postal. *(DOMString)*
335
+
336
+*   **pays**: le nom du pays. *(DOMString)*
337
+
338
+### Plates-formes prises en charge
339
+
340
+*   Amazon Fire OS
341
+*   Android
342
+*   BlackBerry 10
343
+*   Firefox OS
344
+*   iOS
345
+*   Windows Phone 7 et 8
346
+*   Windows 8
347
+*   Windows
348
+
349
+### Exemple
350
+
351
+    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) ;
352
+            }
353
+        }
354
+    };
355
+    
356
+    function onError(contactError) {alert('onError!');} ;
357
+    
358
+    trouver tous les contacts options var = new ContactFindOptions() ;
359
+    options.Filter = "" ;
360
+    filtre var = ["name", « adresses »] ;
361
+    Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
362
+    
363
+
364
+### Android 2.X Quirks
365
+
366
+*   **pref**: ne pas pris en charge, retour `false` sur les appareils Android 2.X.
367
+
368
+### BlackBerry 10 Quirks
369
+
370
+*   **pref**: non pris en charge sur les appareils BlackBerry, retour`false`.
371
+
372
+*   **type**: partiellement pris en charge. Seule chaque de *travail* et tapez les adresses de *la maison* peut être stockée par contact.
373
+
374
+*   **au format**: partiellement pris en charge. Retourne la concaténation de tous les champs d'adresse BlackBerry.
375
+
376
+*   **streetAddress**: prise en charge. Retourne la concaténation de BlackBerry **address1** et **address2** champs d'adresse.
377
+
378
+*   **localité**: prise en charge. Stockée dans le champ d'adresse BlackBerry **ville** .
379
+
380
+*   **région**: pris en charge. Stockée dans le champ d'adresse BlackBerry **stateProvince** .
381
+
382
+*   **Code postal**: prise en charge. Stockée dans le champ d'adresse BlackBerry **zipPostal** .
383
+
384
+*   **pays**: prise en charge.
385
+
386
+### Bizarreries de FirefoxOS
387
+
388
+*   **au format**: actuellement ne pas pris en charge
389
+
390
+### iOS Quirks
391
+
392
+*   **pref**: non pris en charge sur les appareils iOS, retour`false`.
393
+
394
+*   **au format**: actuellement ne pas pris en charge.
395
+
396
+### Bizarreries de Windows 8
397
+
398
+*   **pref**: non pris en charge
399
+
400
+### Bizarreries de Windows
401
+
402
+*   **pref**: non pris en charge
403
+
404
+## ContactError
405
+
406
+Le `ContactError` objet est retourné à l'utilisateur via le `contactError` fonction de rappel lorsqu'une erreur survient.
407
+
408
+### Propriétés
409
+
410
+*   **code**: l'un des codes d'erreur prédéfinis énumérés ci-dessous.
411
+
412
+### Constantes
413
+
414
+*   `ContactError.UNKNOWN_ERROR` (code 0)
415
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
416
+*   `ContactError.TIMEOUT_ERROR` (code 2)
417
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
418
+*   `ContactError.IO_ERROR` (code 4)
419
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
420
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
421
+
422
+## ContactField
423
+
424
+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.
425
+
426
+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.
427
+
428
+### Propriétés
429
+
430
+*   **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. *(DOMString)*
431
+
432
+*   **valeur**: la valeur du champ, comme un téléphone numéro ou adresse e-mail. *(DOMString)*
433
+
434
+*   **pref**: la valeur `true` si ce `ContactField` contient la valeur de préférence de l'utilisateur. *(booléen)*
435
+
436
+### Plates-formes prises en charge
437
+
438
+*   Amazon Fire OS
439
+*   Android
440
+*   BlackBerry 10
441
+*   Firefox OS
442
+*   iOS
443
+*   Windows Phone 7 et 8
444
+*   Windows 8
445
+*   Windows
446
+
447
+### Exemple
448
+
449
+        créer un nouveau contact contact var = navigator.contacts.create() ;
450
+    
451
+        stocker des numéros de téléphone de contact en ContactField [] var phoneNumbers = [] ;
452
+        phoneNumbers[0] = new ContactField (« travail », ' 212-555-1234', false) ;
453
+        phoneNumbers[1] = new ContactField (« mobile », ' 917-555-5432', true) ; phoneNumbers[2] numéro préféré = new ContactField (« home », ' 203-555-7890', false) ;
454
+        contact.phoneNumbers = phoneNumbers ;
455
+    
456
+        enregistrer le contact contact.save() ;
457
+    
458
+
459
+### Quirks Android
460
+
461
+*   **pref**: ne pas pris en charge, retour`false`.
462
+
463
+### BlackBerry 10 Quirks
464
+
465
+*   **type**: partiellement pris en charge. Utilisé pour les numéros de téléphone.
466
+
467
+*   **valeur**: prise en charge.
468
+
469
+*   **pref**: ne pas pris en charge, retour`false`.
470
+
471
+### iOS Quirks
472
+
473
+*   **pref**: ne pas pris en charge, retour`false`.
474
+
475
+### Quirks Windows8
476
+
477
+*   **pref**: ne pas pris en charge, retour`false`.
478
+
479
+### Bizarreries de Windows
480
+
481
+*   **pref**: ne pas pris en charge, retour`false`.
482
+
483
+## ContactName
484
+
485
+Contient différents types d'informations sur un `Contact` nom de l'objet.
486
+
487
+### Propriétés
488
+
489
+*   **mise en forme**: le nom complet du contact. *(DOMString)*
490
+
491
+*   **familyName**: nom de famille du contact. *(DOMString)*
492
+
493
+*   **givenName**: prénom du contact. *(DOMString)*
494
+
495
+*   **middleName**: deuxième prénom du contact. *(DOMString)*
496
+
497
+*   **honorificPrefix**: préfixe du contact (exemple *M.* ou *Mme*) *(DOMString)*
498
+
499
+*   **honorificSuffix**: suffixe du contact (exemple *Esq.*). *(DOMString)*
500
+
501
+### Plates-formes prises en charge
502
+
503
+*   Amazon Fire OS
504
+*   Android
505
+*   BlackBerry 10
506
+*   Firefox OS
507
+*   iOS
508
+*   Windows Phone 7 et 8
509
+*   Windows 8
510
+*   Windows
511
+
512
+### Exemple
513
+
514
+    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) ;
515
+        }
516
+    };
517
+    
518
+    function onError(contactError) {alert('onError!');} ;
519
+    
520
+    options de var = new ContactFindOptions() ;
521
+    options.Filter = "" ;
522
+    filtre = ["name", « nom »] ;
523
+    Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
524
+    
525
+
526
+### Quirks Android
527
+
528
+*   **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
529
+
530
+### BlackBerry 10 Quirks
531
+
532
+*   **au format**: partiellement pris en charge. Retourne la concaténation de champs **firstName** et **lastName** de BlackBerry.
533
+
534
+*   **familyName**: prise en charge. Stockée dans le champ **lastName** BlackBerry.
535
+
536
+*   **givenName**: prise en charge. Stockée dans le champ **firstName** BlackBerry.
537
+
538
+*   **middleName**: ne pas pris en charge, retour`null`.
539
+
540
+*   **honorificPrefix**: ne pas pris en charge, retour`null`.
541
+
542
+*   **honorificSuffix**: ne pas pris en charge, retour`null`.
543
+
544
+### Bizarreries de FirefoxOS
545
+
546
+*   **au format**: partiellement pris en charge et en lecture seule. Retourne la concaténation de `honorificPrefix` , `givenName` , `middleName` , `familyName` , et`honorificSuffix`.
547
+
548
+### iOS Quirks
549
+
550
+*   **au format**: partiellement pris en charge. Retourne la dénomination composée d'iOS, mais est en lecture seule.
551
+
552
+### Bizarreries de Windows 8
553
+
554
+*   **au format**: c'est le seul nom de propriété et est identique à `displayName` , et`nickname`
555
+
556
+*   **familyName**: non pris en charge
557
+
558
+*   **givenName**: non pris en charge
559
+
560
+*   **middleName**: non pris en charge
561
+
562
+*   **honorificPrefix**: non pris en charge
563
+
564
+*   **honorificSuffix**: non pris en charge
565
+
566
+### Bizarreries de Windows
567
+
568
+*   **mise en forme**: il est identique à`displayName`
569
+
570
+## ContactOrganization
571
+
572
+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.
573
+
574
+### Propriétés
575
+
576
+*   **pref**: la valeur `true` si ce `ContactOrganization` contient la valeur de préférence de l'utilisateur. *(booléen)*
577
+
578
+*   **type**: une chaîne qui indique quel type de terrain c'est le cas, *maison* par exemple. _(DOMString)
579
+
580
+*   **nom**: le nom de l'organisation. *(DOMString)*
581
+
582
+*   **Département**: le département et le contrat de travaille pour. *(DOMString)*
583
+
584
+*   **titre**: titre du contact auprès de l'organisation. *(DOMString)*
585
+
586
+### Plates-formes prises en charge
587
+
588
+*   Android
589
+*   BlackBerry 10
590
+*   Firefox OS
591
+*   iOS
592
+*   Windows Phone 7 et 8
593
+*   Windows (Windows 8.1 et Windows Phone 8.1 dispositifs seulement)
594
+
595
+### Exemple
596
+
597
+    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) ;
598
+            }
599
+        }
600
+    };
601
+    
602
+    function onError(contactError) {alert('onError!');} ;
603
+    
604
+    options de var = new ContactFindOptions() ;
605
+    options.Filter = "" ;
606
+    filtre = ["displayName", « organisations »] ;
607
+    Navigator.contacts.Find (filtre, onSuccess, onError, options) ;
608
+    
609
+
610
+### Android 2.X Quirks
611
+
612
+*   **pref**: ne pas pris en charge par des dispositifs Android 2.X, retour`false`.
613
+
614
+### BlackBerry 10 Quirks
615
+
616
+*   **pref**: ne pas pris en charge par les appareils BlackBerry, retour`false`.
617
+
618
+*   **type**: ne pas pris en charge par les appareils BlackBerry, retour`null`.
619
+
620
+*   **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ **company** de BlackBerry.
621
+
622
+*   **Département**: ne pas pris en charge, retour`null`.
623
+
624
+*   **titre**: partiellement pris en charge. Le premier titre de l'organisation est stocké dans le champ de **jobTitle** BlackBerry.
625
+
626
+### Firefox OS Quirks
627
+
628
+*   **pref**: non pris en charge
629
+
630
+*   **type**: non pris en charge
631
+
632
+*   **Département**: non pris en charge
633
+
634
+*   Les champs **nom** et **titre** stocké dans **org** et **jobTitle**.
635
+
636
+### iOS Quirks
637
+
638
+*   **pref**: non pris en charge sur les appareils iOS, retour`false`.
639
+
640
+*   **type**: non pris en charge sur les appareils iOS, retour`null`.
641
+
642
+*   **nom**: partiellement pris en charge. Le premier nom de l'organisme est stocké dans le champ de **kABPersonOrganizationProperty** iOS.
643
+
644
+*   **Département**: partiellement pris en charge. Le premier nom de département est stocké dans le champ de **kABPersonDepartmentProperty** iOS.
645
+
646
+*   **titre**: partiellement pris en charge. Le premier titre est stocké dans le champ de **kABPersonJobTitleProperty** iOS.
647
+
648
+### Bizarreries de Windows
649
+
650
+*   **pref**: ne pas pris en charge, retour`false`.
651
+
652
+*   **type**: ne pas pris en charge, retour`null`.

+ 735
- 0
km0App/node_modules/cordova-plugin-contacts/doc/it/README.md Parādīt failu

@@ -0,0 +1,735 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+Questo plugin definisce un oggetto globale `navigator.contacts`, che fornisce l'accesso al database di contatti del dispositivo.
25
+
26
+Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**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.
35
+
36
+## Installazione
37
+
38
+Ciò richiede cordova 5.0 + (v 1.0.0 stabile corrente)
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+Versioni precedenti di cordova comunque possono installare tramite l'id **deprecato** (stantio v0.2.16)
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+È anche possibile installare direttamente tramite url di repo (instabile)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### Firefox OS stranezze
54
+
55
+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.
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### Stranezze di Windows
67
+
68
+**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.
69
+
70
+**Windows 10 e sopra:** Contatti possono essere salvati e deposito di app locale contatti verranno salvate. Contatti possono anche essere eliminati.
71
+
72
+### Stranezze di Windows 8
73
+
74
+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.
75
+
76
+## Navigator.contacts
77
+
78
+### Metodi
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### Oggetti
85
+
86
+  * Contact
87
+  * ContactName
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+Il metodo `navigator.contacts.create` è sincrono e restituisce un nuovo oggetto di `Contact`.
98
+
99
+Questo metodo non mantiene l'oggetto contatto nel database contatti dispositivo, per cui è necessario richiamare il metodo `Contact.save`.
100
+
101
+### Piattaforme supportate
102
+
103
+  * Android
104
+  * BlackBerry 10
105
+  * Firefox OS
106
+  * iOS
107
+  * Windows Phone 7 e 8
108
+
109
+### Esempio
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+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**.
117
+
118
+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.
119
+
120
+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.
121
+
122
+### Parametri
123
+
124
+  * **contactFields**: contattare campi da utilizzare come un qualificatore di ricerca. *(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: funzione di callback successo richiamato con la matrice di oggetti contatto restituiti dal database. [Required]
127
+
128
+  * **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
129
+
130
+  * **contactFindOptions**: opzioni per filtrare navigator.contacts di ricerca. [Optional]
131
+    
132
+    I tasti sono:
133
+    
134
+      * **filter**: la stringa di ricerca utilizzata per trovare navigator.contacts. *(DOMString)* (Default: `""`)
135
+    
136
+      * **multiple**: determina se l'operazione di ricerca restituisce più navigator.contacts. *(Boolean)* (Default: `false`)
137
+        
138
+          * **desiredFields**: contattare i campi per essere tornato indietro. Se specificato, il risultante `contatto` oggetto solo caratteristiche valori per questi campi. *(DOMString[])* [Optional]
139
+
140
+### Piattaforme supportate
141
+
142
+  * Android
143
+  * BlackBerry 10
144
+  * Firefox OS
145
+  * iOS
146
+  * Windows Phone 7 e 8
147
+  * Windows (Windows Phone 8.1 e Windows 10)
148
+
149
+### Esempio
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### Stranezze di Windows
169
+
170
+  * `__contactFields__`non è supportato, verrà ignorato. `find`metodo cercherà sempre di abbinare il nome, indirizzo email o numero di telefono di un contatto.
171
+
172
+## navigator.contacts.pickContact
173
+
174
+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**.
175
+
176
+### Parametri
177
+
178
+  * **contactSuccess**: funzione di callback di successo viene richiamato con il singolo oggetto di contatto. [Richiesto]
179
+
180
+  * **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
181
+
182
+### Piattaforme supportate
183
+
184
+  * Android
185
+  * iOS
186
+  * Windows Phone 8
187
+  * Windows 8
188
+  * Windows
189
+
190
+### Esempio
191
+
192
+    navigator.contacts.pickContact(function(contact){
193
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
194
+        },function(err){
195
+            console.log('Error: ' + err);
196
+        });
197
+    
198
+
199
+## Contact
200
+
201
+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`.
202
+
203
+**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.
204
+
205
+### Proprietà
206
+
207
+  * **ID**: un identificatore univoco globale. *(DOMString)*
208
+
209
+  * **displayName**: il nome di questo contatto, adatto per la visualizzazione a utenti finali. *(DOMString)*
210
+
211
+  * **nome**: un oggetto che contiene tutti i componenti di un nome di persone. *(ContactName)*
212
+
213
+  * **Nickname**: un nome informale con cui affrontare il contatto. *(DOMString)*
214
+
215
+  * **phoneNumbers**: una matrice di numeri di telefono del contatto. *(ContactField[])*
216
+
217
+  * **email**: una matrice di indirizzi di posta elettronica del contatto. *(ContactField[])*
218
+
219
+  * **indirizzi**: una matrice di indirizzi di contatto. *(ContactAddress[])*
220
+
221
+  * **IMS**: una matrice di indirizzi IM tutto il contatto. *(ContactField[])*
222
+
223
+  * **organizzazioni**: una matrice di organizzazioni di tutto il contatto. *(ContactOrganization[])*
224
+
225
+  * **compleanno**: il compleanno del contatto. *(Data)*
226
+
227
+  * **Nota**: una nota sul contatto. *(DOMString)*
228
+
229
+  * **foto**: una matrice di foto del contatto. *(ContactField[])*
230
+
231
+  * **categorie**: matrice di tutte le categorie definite dall'utente connesso con il contatto. *(ContactField[])*
232
+
233
+  * **URL**: matrice di pagine web connesso con il contatto. *(ContactField[])*
234
+
235
+### Metodi
236
+
237
+  * **clone**: restituisce una nuova `Contact` oggetto che è una copia completa dell'oggetto chiamante, con la `id` proprietà impostata`null`.
238
+
239
+  * **rimuovere**: rimuove il contatto dal database contatti dispositivo, altrimenti esegue un callback di errore con un `ContactError` oggetto.
240
+
241
+  * **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** .
242
+
243
+### Piattaforme supportate
244
+
245
+  * Amazon fuoco OS
246
+  * Android
247
+  * BlackBerry 10
248
+  * Firefox OS
249
+  * iOS
250
+  * Windows Phone 7 e 8
251
+  * Windows 8
252
+  * Windows
253
+
254
+### Esempio di salvare
255
+
256
+    function onSuccess(contact) {
257
+        alert("Save Success");
258
+    };
259
+    
260
+    function onError(contactError) {
261
+        alert("Error = " + contactError.code);
262
+    };
263
+    
264
+    // create a new contact object
265
+    var contact = navigator.contacts.create();
266
+    contact.displayName = "Plumber";
267
+    contact.nickname = "Plumber";            // specify both to support all devices
268
+    
269
+    // populate some fields
270
+    var name = new ContactName();
271
+    name.givenName = "Jane";
272
+    name.familyName = "Doe";
273
+    contact.name = name;
274
+    
275
+    // save to device
276
+    contact.save(onSuccess,onError);
277
+    
278
+
279
+### Esempio di clone
280
+
281
+        // clone the contact object
282
+        var clone = contact.clone();
283
+        clone.name.givenName = "John";
284
+        console.log("Original contact name = " + contact.name.givenName);
285
+        console.log("Cloned contact name = " + clone.name.givenName);
286
+    
287
+
288
+### Rimuovere esempio
289
+
290
+    function onSuccess() {
291
+        alert("Removal Success");
292
+    };
293
+    
294
+    function onError(contactError) {
295
+        alert("Error = " + contactError.code);
296
+    };
297
+    
298
+    // remove the contact from the device
299
+    contact.remove(onSuccess,onError);
300
+    
301
+
302
+### Stranezze di Android 2. x
303
+
304
+  * **categorie**: non è supportato sui dispositivi Android 2. x, restituendo`null`.
305
+
306
+### BlackBerry 10 capricci
307
+
308
+  * **ID**: assegnate dal dispositivo quando si salva il contatto.
309
+
310
+### Capricci di FirefoxOS
311
+
312
+  * **categorie**: parzialmente supportati. Campi **pref** e **tipo** stanno tornando`null`
313
+
314
+  * **IMS**: non supportato
315
+
316
+  * **foto**: non supportato
317
+
318
+### iOS stranezze
319
+
320
+  * **displayName**: non supportata su iOS, tornando `null` se non c'è nessun `ContactName` specificato, nel qual caso restituisce il nome composito, **soprannome** o `""` , rispettivamente.
321
+
322
+  * **compleanno**: deve essere inserito come un JavaScript `Date` oggetto, allo stesso modo viene restituito.
323
+
324
+  * **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.
325
+
326
+  * **categorie**: questa proprietà non è attualmente supportata, restituendo`null`.
327
+
328
+### Windows Phone 7 e 8 stranezze
329
+
330
+  * **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.
331
+
332
+  * **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.
333
+
334
+  * **phoneNumbers**: non è supportata l'opzione *pref* . Il *tipo* non è supportato in un'operazione di *trovare* . Un solo `phoneNumber` è consentita per ogni *tipo*.
335
+
336
+  * **email**: non è supportata l'opzione *pref* . Home e personal fa riferimento la stessa voce di posta elettronica. È consentito un solo ingresso per ogni *tipo*.
337
+
338
+  * **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*.
339
+
340
+  * **organizzazioni**: solo uno è consentito e non supporta gli attributi *pref*, *tipo*e *dipartimento* .
341
+
342
+  * **Nota**: non supportato, restituendo`null`.
343
+
344
+  * **IMS**: non supportato, restituendo`null`.
345
+
346
+  * **compleanni**: non supportato, restituendo`null`.
347
+
348
+  * **categorie**: non supportato, restituendo`null`.
349
+
350
+  * **remove**: metodo non è supportato
351
+
352
+### Stranezze di Windows
353
+
354
+  * **foto**: restituisce un URL del File dell'immagine, che viene memorizzato nella directory temporanea dell'applicazione.
355
+
356
+  * **compleanni**: non supportato, restituendo`null`.
357
+
358
+  * **categorie**: non supportato, restituendo`null`.
359
+
360
+  * **remove**: metodo è supportato solo in Windows 10 o superiore.
361
+
362
+## ContactAddress
363
+
364
+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`.
365
+
366
+### Proprietà
367
+
368
+  * **pref**: impostare su `true` se questo `ContactAddress` contiene il valore dell'utente preferito. *(booleano)*
369
+
370
+  * **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
371
+
372
+  * **formattato**: indirizzo completo formattato per la visualizzazione. *(DOMString)*
373
+
374
+  * **streetAddress**: l'indirizzo completo. *(DOMString)*
375
+
376
+  * **località**: la città o località. *(DOMString)*
377
+
378
+  * **regione**: lo stato o la regione. *(DOMString)*
379
+
380
+  * **postalCode**: il codice postale o il codice postale. *(DOMString)*
381
+
382
+  * **paese**: il nome del paese. *(DOMString)*
383
+
384
+### Piattaforme supportate
385
+
386
+  * Amazon fuoco OS
387
+  * Android
388
+  * BlackBerry 10
389
+  * Firefox OS
390
+  * iOS
391
+  * Windows Phone 7 e 8
392
+  * Windows 8
393
+  * Windows
394
+
395
+### Esempio
396
+
397
+    // display the address information for all contacts
398
+    
399
+    function onSuccess(contacts) {
400
+        for (var i = 0; i < contacts.length; i++) {
401
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
402
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
403
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
404
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
405
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
406
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
407
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
408
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
409
+                    "Country: "        + contacts[i].addresses[j].country);
410
+            }
411
+        }
412
+    };
413
+    
414
+    function onError(contactError) {
415
+        alert('onError!');
416
+    };
417
+    
418
+    // find all contacts
419
+    var options = new ContactFindOptions();
420
+    options.filter = "";
421
+    var filter = ["displayName", "addresses"];
422
+    navigator.contacts.find(filter, onSuccess, onError, options);
423
+    
424
+
425
+### Stranezze di Android 2. x
426
+
427
+  * **pref**: non supportato, tornando `false` su dispositivi Android 2. x.
428
+
429
+### BlackBerry 10 capricci
430
+
431
+  * **pref**: non è supportato sui dispositivi BlackBerry, restituendo`false`.
432
+
433
+  * **tipo**: parzialmente supportati. Solo uno di *lavoro* e *casa* tipo indirizzi può essere memorizzato per ciascun contatto.
434
+
435
+  * **formattato**: parzialmente supportati. Restituisce una concatenazione di tutti i campi Indirizzo BlackBerry.
436
+
437
+  * **streetAddress**: supportato. Restituisce una concatenazione di BlackBerry **Indirizzo1** e **Indirizzo2** campi indirizzo.
438
+
439
+  * **località**: supportato. Memorizzato nel campo indirizzo **città** di BlackBerry.
440
+
441
+  * **regione**: supportato. Memorizzato nel campo indirizzo di **stateProvince** BlackBerry.
442
+
443
+  * **postalCode**: supportato. Memorizzato nel campo dell'indirizzo **zipPostal** BlackBerry.
444
+
445
+  * **paese**: supportato.
446
+
447
+### Capricci di FirefoxOS
448
+
449
+  * **formattato**: attualmente non supportato
450
+
451
+### iOS stranezze
452
+
453
+  * **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
454
+
455
+  * **formattato**: attualmente non supportati.
456
+
457
+### Stranezze di Windows 8
458
+
459
+  * **pref**: non supportato
460
+
461
+### Stranezze di Windows
462
+
463
+  * **pref**: non supportato
464
+
465
+## ContactError
466
+
467
+L'oggetto `ContactError` viene restituito all'utente tramite la funzione di callback `contactError` quando si verifica un errore.
468
+
469
+### Proprietà
470
+
471
+  * **codice**: uno dei codici di errore predefiniti elencati di seguito.
472
+
473
+### Costanti
474
+
475
+  * `ContactError.UNKNOWN_ERROR` (code 0)
476
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
477
+  * `ContactError.TIMEOUT_ERROR` (code 2)
478
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
479
+  * `ContactError.IO_ERROR` (code 4)
480
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
481
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
482
+
483
+## ContactField
484
+
485
+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.
486
+
487
+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.
488
+
489
+### Proprietà
490
+
491
+  * **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
492
+
493
+  * **valore**: il valore del campo, ad esempio un telefono numero o indirizzo e-mail. *(DOMString)*
494
+
495
+  * **pref**: impostare su `true` se questo `ContactField` contiene il valore dell'utente preferito. *(booleano)*
496
+
497
+### Piattaforme supportate
498
+
499
+  * Amazon fuoco OS
500
+  * Android
501
+  * BlackBerry 10
502
+  * Firefox OS
503
+  * iOS
504
+  * Windows Phone 7 e 8
505
+  * Windows 8
506
+  * Windows
507
+
508
+### Esempio
509
+
510
+        // create a new contact
511
+        var contact = navigator.contacts.create();
512
+    
513
+        // store contact phone numbers in ContactField[]
514
+        var phoneNumbers = [];
515
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
516
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
517
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
518
+        contact.phoneNumbers = phoneNumbers;
519
+    
520
+        // save the contact
521
+        contact.save();
522
+    
523
+
524
+### Stranezze Android
525
+
526
+  * **pref**: non supportato, restituendo`false`.
527
+
528
+### BlackBerry 10 capricci
529
+
530
+  * **tipo**: parzialmente supportati. Usato per i numeri di telefono.
531
+
532
+  * **valore**: supportato.
533
+
534
+  * **pref**: non supportato, restituendo`false`.
535
+
536
+### iOS stranezze
537
+
538
+  * **pref**: non supportato, restituendo`false`.
539
+
540
+### Stranezze di Windows8
541
+
542
+  * **pref**: non supportato, restituendo`false`.
543
+
544
+### Stranezze di Windows
545
+
546
+  * **pref**: non supportato, restituendo`false`.
547
+
548
+## ContactName
549
+
550
+Contiene diversi tipi di informazioni sul nome di un oggetto `Contact`.
551
+
552
+### Proprietà
553
+
554
+  * **formattato**: il nome completo del contatto. *(DOMString)*
555
+
556
+  * **familyName**: cognome del contatto. *(DOMString)*
557
+
558
+  * **givenName**: nome del contatto. *(DOMString)*
559
+
560
+  * **middleName**: il nome del contatto medio. *(DOMString)*
561
+
562
+  * **honorificPrefix**: prefisso del contatto (esempio *Mr* o *Dr*) *(DOMString)*
563
+
564
+  * **honorificSuffix**: suffisso del contatto (esempio *Esq.*). *(DOMString)*
565
+
566
+### Piattaforme supportate
567
+
568
+  * Amazon fuoco OS
569
+  * Android
570
+  * BlackBerry 10
571
+  * Firefox OS
572
+  * iOS
573
+  * Windows Phone 7 e 8
574
+  * Windows 8
575
+  * Windows
576
+
577
+### Esempio
578
+
579
+    function onSuccess(contacts) {
580
+        for (var i = 0; i < contacts.length; i++) {
581
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
582
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
583
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
584
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
585
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
586
+                "Prefix: "       + contacts[i].name.honorificSuffix);
587
+        }
588
+    };
589
+    
590
+    function onError(contactError) {
591
+        alert('onError!');
592
+    };
593
+    
594
+    var options = new ContactFindOptions();
595
+    options.filter = "";
596
+    filter = ["displayName", "name"];
597
+    navigator.contacts.find(filter, onSuccess, onError, options);
598
+    
599
+
600
+### Stranezze Android
601
+
602
+  * **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
603
+
604
+### BlackBerry 10 capricci
605
+
606
+  * **formattato**: parzialmente supportati. Restituisce una concatenazione di campi **firstName** e **lastName** BlackBerry.
607
+
608
+  * **familyName**: supportato. Archiviato in campo **lastName** BlackBerry.
609
+
610
+  * **givenName**: supportato. Archiviato in campo **firstName** BlackBerry.
611
+
612
+  * **middleName**: non supportato, restituendo`null`.
613
+
614
+  * **honorificPrefix**: non supportato, restituendo`null`.
615
+
616
+  * **honorificSuffix**: non supportato, restituendo`null`.
617
+
618
+### Capricci di FirefoxOS
619
+
620
+  * **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
621
+
622
+### iOS stranezze
623
+
624
+  * **formattato**: parzialmente supportati. Restituisce il nome composito di iOS, ma è di sola lettura.
625
+
626
+### Stranezze di Windows 8
627
+
628
+  * **formattato**: questo è l'unico nome proprietà ed è identico a `displayName` , e`nickname`
629
+
630
+  * **familyName**: non supportato
631
+
632
+  * **givenName**: non supportato
633
+
634
+  * **middleName**: non supportato
635
+
636
+  * **honorificPrefix**: non supportato
637
+
638
+  * **honorificSuffix**: non supportato
639
+
640
+### Stranezze di Windows
641
+
642
+  * **formattato**: esso è identico al`displayName`
643
+
644
+## ContactOrganization
645
+
646
+L'oggetto `ContactOrganization` memorizza la proprietà di organizzazione di un contatto. Un oggetto `Contact` memorizza uno o più oggetti `ContactOrganization` in una matrice.
647
+
648
+### Proprietà
649
+
650
+  * **pref**: impostare su `true` se questo `ContactOrganization` contiene il valore dell'utente preferito. *(booleano)*
651
+
652
+  * **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. _(DOMString)
653
+
654
+  * **nome**: il nome dell'organizzazione. *(DOMString)*
655
+
656
+  * **dipartimento**: contratto lavora per il dipartimento. *(DOMString)*
657
+
658
+  * **titolo**: titolo del contatto presso l'organizzazione. *(DOMString)*
659
+
660
+### Piattaforme supportate
661
+
662
+  * Android
663
+  * BlackBerry 10
664
+  * Firefox OS
665
+  * iOS
666
+  * Windows Phone 7 e 8
667
+  * Windows (solo dispositivi Windows 8.1 e 8.1 di Windows Phone)
668
+
669
+### Esempio
670
+
671
+    function onSuccess(contacts) {
672
+        for (var i = 0; i < contacts.length; i++) {
673
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
674
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
675
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
676
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
677
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
678
+                    "Title: "       + contacts[i].organizations[j].title);
679
+            }
680
+        }
681
+    };
682
+    
683
+    function onError(contactError) {
684
+        alert('onError!');
685
+    };
686
+    
687
+    var options = new ContactFindOptions();
688
+    options.filter = "";
689
+    filter = ["displayName", "organizations"];
690
+    navigator.contacts.find(filter, onSuccess, onError, options);
691
+    
692
+
693
+### Stranezze di Android 2. x
694
+
695
+  * **pref**: non supportato dai dispositivi Android 2. x, restituendo`false`.
696
+
697
+### BlackBerry 10 capricci
698
+
699
+  * **pref**: non supportato dai dispositivi BlackBerry, restituendo`false`.
700
+
701
+  * **tipo**: non supportato dai dispositivi BlackBerry, restituendo`null`.
702
+
703
+  * **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **azienda** BlackBerry.
704
+
705
+  * **dipartimento**: non supportato, restituendo`null`.
706
+
707
+  * **titolo**: parzialmente supportati. Il primo titolo di organizzazione è memorizzato nel campo **jobTitle** BlackBerry.
708
+
709
+### Firefox OS stranezze
710
+
711
+  * **pref**: non supportato
712
+
713
+  * **tipo**: non supportato
714
+
715
+  * **dipartimento**: non supportato
716
+
717
+  * Campi **nome** e **titolo** memorizzato in **org** e **jobTitle**.
718
+
719
+### iOS stranezze
720
+
721
+  * **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
722
+
723
+  * **tipo**: non è supportato sui dispositivi iOS, restituendo`null`.
724
+
725
+  * **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **kABPersonOrganizationProperty** iOS.
726
+
727
+  * **dipartimento**: parzialmente supportati. Il primo nome del dipartimento è memorizzato nel campo **kABPersonDepartmentProperty** iOS.
728
+
729
+  * **titolo**: parzialmente supportati. Il primo titolo è memorizzato nel campo **kABPersonJobTitleProperty** iOS.
730
+
731
+### Stranezze di Windows
732
+
733
+  * **pref**: non supportato, restituendo`false`.
734
+
735
+  * **tipo**: non supportato, restituendo`null`.

+ 719
- 0
km0App/node_modules/cordova-plugin-contacts/doc/it/index.md Parādīt failu

@@ -0,0 +1,719 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+Questo plugin definisce un oggetto globale `navigator.contacts`, che fornisce l'accesso al database di contatti del dispositivo.
23
+
24
+Anche se l'oggetto è associato con ambito globale del `navigator`, non è disponibile fino a dopo l'evento `deviceready`.
25
+
26
+    document.addEventListener("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {
28
+        console.log(navigator.contacts);
29
+    }
30
+    
31
+
32
+**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.
33
+
34
+## Installazione
35
+
36
+    cordova plugin add cordova-plugin-contacts
37
+    
38
+
39
+### Firefox OS stranezze
40
+
41
+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.
42
+
43
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
44
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
45
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
46
+
47
+    "type": "privileged",
48
+    "permissions": {
49
+        "contacts": {
50
+            "access": "readwrite",
51
+            "description": "Describe why there is a need for such permission"
52
+        }
53
+    }
54
+    
55
+
56
+### Stranezze di Windows
57
+
58
+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.
59
+
60
+### Stranezze di Windows 8
61
+
62
+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.
63
+
64
+## Navigator.contacts
65
+
66
+### Metodi
67
+
68
+*   navigator.contacts.create
69
+*   navigator.contacts.find
70
+*   navigator.contacts.pickContact
71
+
72
+### Oggetti
73
+
74
+*   Contact
75
+*   ContactName
76
+*   ContactField
77
+*   ContactAddress
78
+*   ContactOrganization
79
+*   ContactFindOptions
80
+*   ContactError
81
+*   ContactFieldType
82
+
83
+## navigator.contacts.create
84
+
85
+Il metodo `navigator.contacts.create` è sincrono e restituisce un nuovo oggetto di `Contact`.
86
+
87
+Questo metodo non mantiene l'oggetto contatto nel database contatti dispositivo, per cui è necessario richiamare il metodo `Contact.save`.
88
+
89
+### Piattaforme supportate
90
+
91
+*   Android
92
+*   BlackBerry 10
93
+*   Firefox OS
94
+*   iOS
95
+*   Windows Phone 7 e 8
96
+
97
+### Esempio
98
+
99
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
100
+    
101
+
102
+## navigator.contacts.find
103
+
104
+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**.
105
+
106
+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.
107
+
108
+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.
109
+
110
+### Parametri
111
+
112
+*   **contactFields**: contattare campi da utilizzare come un qualificatore di ricerca. *(DOMString[])* [Required]
113
+
114
+*   **contactSuccess**: funzione di callback successo richiamato con la matrice di oggetti contatto restituiti dal database. [Required]
115
+
116
+*   **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
117
+
118
+*   **contactFindOptions**: opzioni per filtrare navigator.contacts di ricerca. [Optional]
119
+    
120
+    I tasti sono:
121
+    
122
+    *   **filter**: la stringa di ricerca utilizzata per trovare navigator.contacts. *(DOMString)* (Default: `""`)
123
+    
124
+    *   **multiple**: determina se l'operazione di ricerca restituisce più navigator.contacts. *(Boolean)* (Default: `false`)
125
+        
126
+        *   **desiredFields**: contattare i campi per essere tornato indietro. Se specificato, il risultante `contatto` oggetto solo caratteristiche valori per questi campi. *(DOMString[])* [Optional]
127
+
128
+### Piattaforme supportate
129
+
130
+*   Android
131
+*   BlackBerry 10
132
+*   Firefox OS
133
+*   iOS
134
+*   Windows Phone 7 e 8
135
+*   Windows (solo per dispositivi Windows Phone 8.1)
136
+
137
+### Esempio
138
+
139
+    function onSuccess(contacts) {
140
+        alert('Found ' + contacts.length + ' contacts.');
141
+    };
142
+    
143
+    function onError(contactError) {
144
+        alert('onError!');
145
+    };
146
+    
147
+    // find all contacts with 'Bob' in any name field
148
+    var options      = new ContactFindOptions();
149
+    options.filter   = "Bob";
150
+    options.multiple = true;
151
+    options.desiredFields = [navigator.contacts.fieldType.id];
152
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
153
+    navigator.contacts.find(fields, onSuccess, onError, options);
154
+    
155
+
156
+### Stranezze di Windows
157
+
158
+*   `__contactFields__`non è supportato, verrà ignorato. `find`metodo cercherà sempre di abbinare il nome, indirizzo email o numero di telefono di un contatto.
159
+
160
+## navigator.contacts.pickContact
161
+
162
+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**.
163
+
164
+### Parametri
165
+
166
+*   **contactSuccess**: funzione di callback di successo viene richiamato con il singolo oggetto di contatto. [Richiesto]
167
+
168
+*   **contactError**: funzione di callback di errore, viene richiamato quando si verifica un errore. [Facoltativo]
169
+
170
+### Piattaforme supportate
171
+
172
+*   Android
173
+*   iOS
174
+*   Windows Phone 8
175
+*   Windows 8
176
+*   Windows
177
+
178
+### Esempio
179
+
180
+    navigator.contacts.pickContact(function(contact){
181
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
182
+        },function(err){
183
+            console.log('Error: ' + err);
184
+        });
185
+    
186
+
187
+## Contact
188
+
189
+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`.
190
+
191
+**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.
192
+
193
+### Proprietà
194
+
195
+*   **ID**: un identificatore univoco globale. *(DOMString)*
196
+
197
+*   **displayName**: il nome di questo contatto, adatto per la visualizzazione a utenti finali. *(DOMString)*
198
+
199
+*   **nome**: un oggetto che contiene tutti i componenti di un nome di persone. *(ContactName)*
200
+
201
+*   **Nickname**: un nome informale con cui affrontare il contatto. *(DOMString)*
202
+
203
+*   **phoneNumbers**: una matrice di numeri di telefono del contatto. *(ContactField[])*
204
+
205
+*   **email**: una matrice di indirizzi di posta elettronica del contatto. *(ContactField[])*
206
+
207
+*   **indirizzi**: una matrice di indirizzi di contatto. *(ContactAddress[])*
208
+
209
+*   **IMS**: una matrice di indirizzi IM tutto il contatto. *(ContactField[])*
210
+
211
+*   **organizzazioni**: una matrice di organizzazioni di tutto il contatto. *(ContactOrganization[])*
212
+
213
+*   **compleanno**: il compleanno del contatto. *(Data)*
214
+
215
+*   **Nota**: una nota sul contatto. *(DOMString)*
216
+
217
+*   **foto**: una matrice di foto del contatto. *(ContactField[])*
218
+
219
+*   **categorie**: matrice di tutte le categorie definite dall'utente connesso con il contatto. *(ContactField[])*
220
+
221
+*   **URL**: matrice di pagine web connesso con il contatto. *(ContactField[])*
222
+
223
+### Metodi
224
+
225
+*   **clone**: restituisce una nuova `Contact` oggetto che è una copia completa dell'oggetto chiamante, con la `id` proprietà impostata`null`.
226
+
227
+*   **rimuovere**: rimuove il contatto dal database contatti dispositivo, altrimenti esegue un callback di errore con un `ContactError` oggetto.
228
+
229
+*   **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** .
230
+
231
+### Piattaforme supportate
232
+
233
+*   Amazon fuoco OS
234
+*   Android
235
+*   BlackBerry 10
236
+*   Firefox OS
237
+*   iOS
238
+*   Windows Phone 7 e 8
239
+*   Windows 8
240
+*   Windows
241
+
242
+### Esempio di salvare
243
+
244
+    function onSuccess(contact) {
245
+        alert("Save Success");
246
+    };
247
+    
248
+    function onError(contactError) {
249
+        alert("Error = " + contactError.code);
250
+    };
251
+    
252
+    // create a new contact object
253
+    var contact = navigator.contacts.create();
254
+    contact.displayName = "Plumber";
255
+    contact.nickname = "Plumber";            // specify both to support all devices
256
+    
257
+    // populate some fields
258
+    var name = new ContactName();
259
+    name.givenName = "Jane";
260
+    name.familyName = "Doe";
261
+    contact.name = name;
262
+    
263
+    // save to device
264
+    contact.save(onSuccess,onError);
265
+    
266
+
267
+### Esempio di clone
268
+
269
+        // clone the contact object
270
+        var clone = contact.clone();
271
+        clone.name.givenName = "John";
272
+        console.log("Original contact name = " + contact.name.givenName);
273
+        console.log("Cloned contact name = " + clone.name.givenName);
274
+    
275
+
276
+### Rimuovere esempio
277
+
278
+    function onSuccess() {
279
+        alert("Removal Success");
280
+    };
281
+    
282
+    function onError(contactError) {
283
+        alert("Error = " + contactError.code);
284
+    };
285
+    
286
+    // remove the contact from the device
287
+    contact.remove(onSuccess,onError);
288
+    
289
+
290
+### Stranezze di Android 2. x
291
+
292
+*   **categorie**: non è supportato sui dispositivi Android 2. x, restituendo`null`.
293
+
294
+### BlackBerry 10 capricci
295
+
296
+*   **ID**: assegnate dal dispositivo quando si salva il contatto.
297
+
298
+### Capricci di FirefoxOS
299
+
300
+*   **categorie**: parzialmente supportati. Campi **pref** e **tipo** stanno tornando`null`
301
+
302
+*   **IMS**: non supportato
303
+
304
+*   **foto**: non supportato
305
+
306
+### iOS stranezze
307
+
308
+*   **displayName**: non supportata su iOS, tornando `null` se non c'è nessun `ContactName` specificato, nel qual caso restituisce il nome composito, **soprannome** o `""` , rispettivamente.
309
+
310
+*   **compleanno**: deve essere inserito come un JavaScript `Date` oggetto, allo stesso modo viene restituito.
311
+
312
+*   **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.
313
+
314
+*   **categorie**: questa proprietà non è attualmente supportata, restituendo`null`.
315
+
316
+### Windows Phone 7 e 8 stranezze
317
+
318
+*   **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.
319
+
320
+*   **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.
321
+
322
+*   **phoneNumbers**: non è supportata l'opzione *pref* . Il *tipo* non è supportato in un'operazione di *trovare* . Un solo `phoneNumber` è consentita per ogni *tipo*.
323
+
324
+*   **email**: non è supportata l'opzione *pref* . Home e personal fa riferimento la stessa voce di posta elettronica. È consentito un solo ingresso per ogni *tipo*.
325
+
326
+*   **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*.
327
+
328
+*   **organizzazioni**: solo uno è consentito e non supporta gli attributi *pref*, *tipo*e *dipartimento* .
329
+
330
+*   **Nota**: non supportato, restituendo`null`.
331
+
332
+*   **IMS**: non supportato, restituendo`null`.
333
+
334
+*   **compleanni**: non supportato, restituendo`null`.
335
+
336
+*   **categorie**: non supportato, restituendo`null`.
337
+
338
+### Stranezze di Windows
339
+
340
+*   **foto**: restituisce un URL del File dell'immagine, che viene memorizzato nella directory temporanea dell'applicazione.
341
+
342
+*   **compleanni**: non supportato, restituendo`null`.
343
+
344
+*   **categorie**: non supportato, restituendo`null`.
345
+
346
+## ContactAddress
347
+
348
+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`.
349
+
350
+### Proprietà
351
+
352
+*   **pref**: impostare su `true` se questo `ContactAddress` contiene il valore dell'utente preferito. *(booleano)*
353
+
354
+*   **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
355
+
356
+*   **formattato**: indirizzo completo formattato per la visualizzazione. *(DOMString)*
357
+
358
+*   **streetAddress**: l'indirizzo completo. *(DOMString)*
359
+
360
+*   **località**: la città o località. *(DOMString)*
361
+
362
+*   **regione**: lo stato o la regione. *(DOMString)*
363
+
364
+*   **postalCode**: il codice postale o il codice postale. *(DOMString)*
365
+
366
+*   **paese**: il nome del paese. *(DOMString)*
367
+
368
+### Piattaforme supportate
369
+
370
+*   Amazon fuoco OS
371
+*   Android
372
+*   BlackBerry 10
373
+*   Firefox OS
374
+*   iOS
375
+*   Windows Phone 7 e 8
376
+*   Windows 8
377
+*   Windows
378
+
379
+### Esempio
380
+
381
+    // display the address information for all contacts
382
+    
383
+    function onSuccess(contacts) {
384
+        for (var i = 0; i < contacts.length; i++) {
385
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
386
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
387
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
388
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
389
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
390
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
391
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
392
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
393
+                    "Country: "        + contacts[i].addresses[j].country);
394
+            }
395
+        }
396
+    };
397
+    
398
+    function onError(contactError) {
399
+        alert('onError!');
400
+    };
401
+    
402
+    // find all contacts
403
+    var options = new ContactFindOptions();
404
+    options.filter = "";
405
+    var filter = ["displayName", "addresses"];
406
+    navigator.contacts.find(filter, onSuccess, onError, options);
407
+    
408
+
409
+### Stranezze di Android 2. x
410
+
411
+*   **pref**: non supportato, tornando `false` su dispositivi Android 2. x.
412
+
413
+### BlackBerry 10 capricci
414
+
415
+*   **pref**: non è supportato sui dispositivi BlackBerry, restituendo`false`.
416
+
417
+*   **tipo**: parzialmente supportati. Solo uno di *lavoro* e *casa* tipo indirizzi può essere memorizzato per ciascun contatto.
418
+
419
+*   **formattato**: parzialmente supportati. Restituisce una concatenazione di tutti i campi Indirizzo BlackBerry.
420
+
421
+*   **streetAddress**: supportato. Restituisce una concatenazione di BlackBerry **Indirizzo1** e **Indirizzo2** campi indirizzo.
422
+
423
+*   **località**: supportato. Memorizzato nel campo indirizzo **città** di BlackBerry.
424
+
425
+*   **regione**: supportato. Memorizzato nel campo indirizzo di **stateProvince** BlackBerry.
426
+
427
+*   **postalCode**: supportato. Memorizzato nel campo dell'indirizzo **zipPostal** BlackBerry.
428
+
429
+*   **paese**: supportato.
430
+
431
+### Capricci di FirefoxOS
432
+
433
+*   **formattato**: attualmente non supportato
434
+
435
+### iOS stranezze
436
+
437
+*   **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
438
+
439
+*   **formattato**: attualmente non supportati.
440
+
441
+### Stranezze di Windows 8
442
+
443
+*   **pref**: non supportato
444
+
445
+### Stranezze di Windows
446
+
447
+*   **pref**: non supportato
448
+
449
+## ContactError
450
+
451
+L'oggetto `ContactError` viene restituito all'utente tramite la funzione di callback `contactError` quando si verifica un errore.
452
+
453
+### Proprietà
454
+
455
+*   **codice**: uno dei codici di errore predefiniti elencati di seguito.
456
+
457
+### Costanti
458
+
459
+*   `ContactError.UNKNOWN_ERROR` (code 0)
460
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
461
+*   `ContactError.TIMEOUT_ERROR` (code 2)
462
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
463
+*   `ContactError.IO_ERROR` (code 4)
464
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
465
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
466
+
467
+## ContactField
468
+
469
+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.
470
+
471
+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.
472
+
473
+### Proprietà
474
+
475
+*   **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. *(DOMString)*
476
+
477
+*   **valore**: il valore del campo, ad esempio un telefono numero o indirizzo e-mail. *(DOMString)*
478
+
479
+*   **pref**: impostare su `true` se questo `ContactField` contiene il valore dell'utente preferito. *(booleano)*
480
+
481
+### Piattaforme supportate
482
+
483
+*   Amazon fuoco OS
484
+*   Android
485
+*   BlackBerry 10
486
+*   Firefox OS
487
+*   iOS
488
+*   Windows Phone 7 e 8
489
+*   Windows 8
490
+*   Windows
491
+
492
+### Esempio
493
+
494
+        // create a new contact
495
+        var contact = navigator.contacts.create();
496
+    
497
+        // store contact phone numbers in ContactField[]
498
+        var phoneNumbers = [];
499
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
500
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
501
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
502
+        contact.phoneNumbers = phoneNumbers;
503
+    
504
+        // save the contact
505
+        contact.save();
506
+    
507
+
508
+### Stranezze Android
509
+
510
+*   **pref**: non supportato, restituendo`false`.
511
+
512
+### BlackBerry 10 capricci
513
+
514
+*   **tipo**: parzialmente supportati. Usato per i numeri di telefono.
515
+
516
+*   **valore**: supportato.
517
+
518
+*   **pref**: non supportato, restituendo`false`.
519
+
520
+### iOS stranezze
521
+
522
+*   **pref**: non supportato, restituendo`false`.
523
+
524
+### Stranezze di Windows8
525
+
526
+*   **pref**: non supportato, restituendo`false`.
527
+
528
+### Stranezze di Windows
529
+
530
+*   **pref**: non supportato, restituendo`false`.
531
+
532
+## ContactName
533
+
534
+Contiene diversi tipi di informazioni sul nome di un oggetto `Contact`.
535
+
536
+### Proprietà
537
+
538
+*   **formattato**: il nome completo del contatto. *(DOMString)*
539
+
540
+*   **familyName**: cognome del contatto. *(DOMString)*
541
+
542
+*   **givenName**: nome del contatto. *(DOMString)*
543
+
544
+*   **middleName**: il nome del contatto medio. *(DOMString)*
545
+
546
+*   **honorificPrefix**: prefisso del contatto (esempio *Mr* o *Dr*) *(DOMString)*
547
+
548
+*   **honorificSuffix**: suffisso del contatto (esempio *Esq.*). *(DOMString)*
549
+
550
+### Piattaforme supportate
551
+
552
+*   Amazon fuoco OS
553
+*   Android
554
+*   BlackBerry 10
555
+*   Firefox OS
556
+*   iOS
557
+*   Windows Phone 7 e 8
558
+*   Windows 8
559
+*   Windows
560
+
561
+### Esempio
562
+
563
+    function onSuccess(contacts) {
564
+        for (var i = 0; i < contacts.length; i++) {
565
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
566
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
567
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
568
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
569
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
570
+                "Prefix: "       + contacts[i].name.honorificSuffix);
571
+        }
572
+    };
573
+    
574
+    function onError(contactError) {
575
+        alert('onError!');
576
+    };
577
+    
578
+    var options = new ContactFindOptions();
579
+    options.filter = "";
580
+    filter = ["displayName", "name"];
581
+    navigator.contacts.find(filter, onSuccess, onError, options);
582
+    
583
+
584
+### Stranezze Android
585
+
586
+*   **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
587
+
588
+### BlackBerry 10 capricci
589
+
590
+*   **formattato**: parzialmente supportati. Restituisce una concatenazione di campi **firstName** e **lastName** BlackBerry.
591
+
592
+*   **familyName**: supportato. Archiviato in campo **lastName** BlackBerry.
593
+
594
+*   **givenName**: supportato. Archiviato in campo **firstName** BlackBerry.
595
+
596
+*   **middleName**: non supportato, restituendo`null`.
597
+
598
+*   **honorificPrefix**: non supportato, restituendo`null`.
599
+
600
+*   **honorificSuffix**: non supportato, restituendo`null`.
601
+
602
+### Capricci di FirefoxOS
603
+
604
+*   **formattato**: parzialmente supportati e di sola lettura. Restituisce una concatenazione di `honorificPrefix` , `givenName` , `middleName` , `familyName` , e`honorificSuffix`.
605
+
606
+### iOS stranezze
607
+
608
+*   **formattato**: parzialmente supportati. Restituisce il nome composito di iOS, ma è di sola lettura.
609
+
610
+### Stranezze di Windows 8
611
+
612
+*   **formattato**: questo è l'unico nome proprietà ed è identico a `displayName` , e`nickname`
613
+
614
+*   **familyName**: non supportato
615
+
616
+*   **givenName**: non supportato
617
+
618
+*   **middleName**: non supportato
619
+
620
+*   **honorificPrefix**: non supportato
621
+
622
+*   **honorificSuffix**: non supportato
623
+
624
+### Stranezze di Windows
625
+
626
+*   **formattato**: esso è identico al`displayName`
627
+
628
+## ContactOrganization
629
+
630
+L'oggetto `ContactOrganization` memorizza la proprietà di organizzazione di un contatto. Un oggetto `Contact` memorizza uno o più oggetti `ContactOrganization` in una matrice.
631
+
632
+### Proprietà
633
+
634
+*   **pref**: impostare su `true` se questo `ContactOrganization` contiene il valore dell'utente preferito. *(booleano)*
635
+
636
+*   **tipo**: una stringa che indica il tipo di campo è, *casa* ad esempio. _(DOMString)
637
+
638
+*   **nome**: il nome dell'organizzazione. *(DOMString)*
639
+
640
+*   **dipartimento**: contratto lavora per il dipartimento. *(DOMString)*
641
+
642
+*   **titolo**: titolo del contatto presso l'organizzazione. *(DOMString)*
643
+
644
+### Piattaforme supportate
645
+
646
+*   Android
647
+*   BlackBerry 10
648
+*   Firefox OS
649
+*   iOS
650
+*   Windows Phone 7 e 8
651
+*   Windows (solo dispositivi Windows 8.1 e 8.1 di Windows Phone)
652
+
653
+### Esempio
654
+
655
+    function onSuccess(contacts) {
656
+        for (var i = 0; i < contacts.length; i++) {
657
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
658
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
659
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
660
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
661
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
662
+                    "Title: "       + contacts[i].organizations[j].title);
663
+            }
664
+        }
665
+    };
666
+    
667
+    function onError(contactError) {
668
+        alert('onError!');
669
+    };
670
+    
671
+    var options = new ContactFindOptions();
672
+    options.filter = "";
673
+    filter = ["displayName", "organizations"];
674
+    navigator.contacts.find(filter, onSuccess, onError, options);
675
+    
676
+
677
+### Stranezze di Android 2. x
678
+
679
+*   **pref**: non supportato dai dispositivi Android 2. x, restituendo`false`.
680
+
681
+### BlackBerry 10 capricci
682
+
683
+*   **pref**: non supportato dai dispositivi BlackBerry, restituendo`false`.
684
+
685
+*   **tipo**: non supportato dai dispositivi BlackBerry, restituendo`null`.
686
+
687
+*   **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **azienda** BlackBerry.
688
+
689
+*   **dipartimento**: non supportato, restituendo`null`.
690
+
691
+*   **titolo**: parzialmente supportati. Il primo titolo di organizzazione è memorizzato nel campo **jobTitle** BlackBerry.
692
+
693
+### Firefox OS stranezze
694
+
695
+*   **pref**: non supportato
696
+
697
+*   **tipo**: non supportato
698
+
699
+*   **dipartimento**: non supportato
700
+
701
+*   Campi **nome** e **titolo** memorizzato in **org** e **jobTitle**.
702
+
703
+### iOS stranezze
704
+
705
+*   **pref**: non è supportato sui dispositivi iOS, restituendo`false`.
706
+
707
+*   **tipo**: non è supportato sui dispositivi iOS, restituendo`null`.
708
+
709
+*   **nome**: parzialmente supportati. Il primo nome dell'organizzazione è memorizzato nel campo **kABPersonOrganizationProperty** iOS.
710
+
711
+*   **dipartimento**: parzialmente supportati. Il primo nome del dipartimento è memorizzato nel campo **kABPersonDepartmentProperty** iOS.
712
+
713
+*   **titolo**: parzialmente supportati. Il primo titolo è memorizzato nel campo **kABPersonJobTitleProperty** iOS.
714
+
715
+### Stranezze di Windows
716
+
717
+*   **pref**: non supportato, restituendo`false`.
718
+
719
+*   **tipo**: non supportato, restituendo`null`.

+ 735
- 0
km0App/node_modules/cordova-plugin-contacts/doc/ja/README.md Parādīt failu

@@ -0,0 +1,735 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+このプラグインは、デバイスの連絡先データベースへのアクセスを提供するグローバル `navigator.contacts` オブジェクトを定義します。
25
+
26
+オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**警告**: 連絡先データの収集と利用を重要なプライバシーの問題を発生させます。 アプリのプライバシー ポリシー アプリが連絡先データを使用する方法と、他の当事者では共有されているかどうかを話し合う必要があります。 人誰と通信する人々 を明らかにするために、連絡先情報が機密と見なされます。 したがって、アプリのプライバシー ポリシーに加えて、強くお勧めデバイスのオペレーティング システムが既にしない場合アプリにアクセスまたは連絡先のデータを使用する前に - 時間のお知らせを提供します。 その通知は、上記の (例えば、**[ok]** を **おかげで** 選択肢を提示する) によってユーザーのアクセス許可を取得するだけでなく、同じ情報を提供する必要があります。 いくつかのアプリのマーケットプ レース - 時間の通知を提供して、連絡先データにアクセスする前にユーザーの許可を取得するアプリをする必要がありますに注意してください。 連絡先データは、ユーザーの混乱を避けるのに役立ちますの使用および連絡先データの知覚の誤用を囲む明確でわかりやすいユーザー エクスペリエンス。 詳細については、プライバシーに関するガイドを参照してください。
35
+
36
+## インストール
37
+
38
+これはコルドバ 5.0 + (現在安定 v1.0.0) を必要とします。
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+コルドバの古いバージョンでも**非推奨**id (古い v0.2.16) 経由でインストールできます。
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+また、レポの url 経由で直接インストールすることが可能だ (不安定)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### Firefox OS 癖
54
+
55
+[マニフェストのドキュメント](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) を適用します。 別の方法で、アプリケーションを初期化します。
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### Windows の癖
67
+
68
+**Windows 10 前に:**すべての連絡先を`検索`し、 `pickContact`メソッドから返されるアプリケーションが変更できないように読み取り専用であります。 `find` メソッド 8.1 の Windows Phone デバイスでのみ使用できます。
69
+
70
+**Windows 10 以上:**連絡先は、保存可能性があります、連絡先アプリ ローカル記憶域に保存されます。 連絡先も削除されます。
71
+
72
+### Windows 8 の癖
73
+
74
+Windows 8 の連絡先は、読み取り専用です。 コルドバ API コンタクトを介してされませんクエリ/検索可能で、ユーザーに通知する必要があります連絡先を選択 '人' アプリを開くことが contacts.pickContact への呼び出しとして、ユーザーが連絡先を選択する必要があります。 戻される連絡先は読み取り専用、アプリケーションを変更することはできません。
75
+
76
+## navigator.contacts
77
+
78
+### メソッド
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### オブジェクト
85
+
86
+  * お問い合わせ
87
+  * ContactName
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+`navigator.contacts.create` メソッドは同期的に、新しい `連絡先` オブジェクトを返します。
98
+
99
+このメソッドは、`Contact.save` メソッドを呼び出す必要があるデバイスの連絡先データベースに連絡先オブジェクトを保持しません。
100
+
101
+### サポートされているプラットフォーム
102
+
103
+  * アンドロイド
104
+  * ブラックベリー 10
105
+  * Firefox の OS
106
+  * iOS
107
+  * Windows Phone 7 と 8
108
+
109
+### 例
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+デバイスの連絡先データベースを照会して、`Contact` オブジェクトの配列を返す `navigator.contacts.find` メソッドを非同期的に実行します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
117
+
118
+**contactFields** パラメーター検索の修飾子として使用するフィールドを指定します。 ゼロ長さ **contactFields** パラメーターは有効で、`ContactError.INVALID_ARGUMENT_ERROR` の結果します。 **contactFields** 値 `"*"` すべての連絡先フィールドが検索されます。
119
+
120
+**contactFindOptions.filter** 文字列の連絡先データベースを照会するときに検索フィルターとして使用できます。 指定した場合、大文字と小文字、部分的な値の一致する **contactFields** パラメーターで指定されたフィールドごとに適用されます。 一致する *任意* 指定のフィールドがある場合は、連絡先が返されます。 バック連絡先プロパティを制御する **contactFindOptions.desiredFields** パラメーターを使用しますが返される必要があります。
121
+
122
+### パラメーター
123
+
124
+  * **contactFields**: 連絡先検索修飾子として使用するフィールド。*(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: Contact オブジェクトの配列に呼び出される成功コールバック関数は、データベースから返されます。[Required]
127
+
128
+  * **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
129
+
130
+  * **contactFindOptions**: navigator.contacts をフィルターするオプションを検索します。[Optional]
131
+    
132
+    キーは次のとおりです。
133
+    
134
+      * **filter**: navigator.contacts の検索に使用する検索文字列。*(,)*(デフォルト: `""`)
135
+    
136
+      * **multiple**: 複数 navigator.contacts かどうかは、検索操作に返すを決定します。*(ブール値)*(デフォルト: `false`)
137
+        
138
+          * **desiredFields**: 戻って返されるフィールドに問い合わせてください。指定した場合、結果 `Contact` オブジェクトこれらのフィールドの値でのみ機能します。*(DOMString[])* [Optional]
139
+
140
+### サポートされているプラットフォーム
141
+
142
+  * アンドロイド
143
+  * ブラックベリー 10
144
+  * Firefox の OS
145
+  * iOS
146
+  * Windows Phone 7 と 8
147
+  * Windows (Windows Phone 8.1 および Windows 10)
148
+
149
+### 例
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### Windows の癖
169
+
170
+  * `__contactFields__`サポートされていないと無視されます。`find`メソッドは、常に名前、電子メール アドレス、または連絡先の電話番号に一致ましょう。
171
+
172
+## navigator.contacts.pickContact
173
+
174
+`navigator.contacts.pickContact` メソッドは単一の連絡先を選択する連絡先ピッカーを起動します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
175
+
176
+### パラメーター
177
+
178
+  * **contactSuccess**: 1 つの連絡先オブジェクトに呼び出される成功コールバック関数。[必須]
179
+
180
+  * **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
181
+
182
+### サポートされているプラットフォーム
183
+
184
+  * アンドロイド
185
+  * iOS
186
+  * Windows Phone 8
187
+  * Windows 8
188
+  * Windows
189
+
190
+### 例
191
+
192
+    navigator.contacts.pickContact(function(contact){
193
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
194
+        },function(err){
195
+            console.log('Error: ' + err);
196
+        });
197
+    
198
+
199
+## お問い合わせ
200
+
201
+`Contact` オブジェクトは、ユーザーの連絡先を表します。 連絡先の作成、格納、またはデバイスの連絡先データベースから削除することができます。 連絡先も取得できます (個別にまたは一括で) データベースから `navigator.contacts.find` メソッドを呼び出すことによって。
202
+
203
+**注**: すべて上記の連絡先フィールドのすべてのデバイス プラットフォームでサポートされます。詳細については各プラットフォームの *互換* セクションを確認してください。
204
+
205
+### プロパティ
206
+
207
+  * **id**: グローバルに一意の識別子。*(,)*
208
+
209
+  * **displayName**: エンド ・ ユーザーへの表示に適した、この連絡先の名前。*(,)*
210
+
211
+  * **名前**: 人の名前のすべてのコンポーネントを格納するオブジェクト。*(ContactName)*
212
+
213
+  * **ニックネーム**: 連絡先のアドレスに使用するカジュアルな名前。*(,)*
214
+
215
+  * **電話番号**: 連絡先の電話番号の配列。*(ContactField[])*
216
+
217
+  * **メール**: 連絡先の電子メール アドレスの配列。*(ContactField[])*
218
+
219
+  * **アドレス**: 連絡先のアドレスの配列。*(ContactAddress[])*
220
+
221
+  * **ims**: 連絡先の IM アドレスの配列。*(ContactField[])*
222
+
223
+  * **組織**: 連絡先の組織の配列。*(ContactOrganization[])*
224
+
225
+  * **誕生日**: 連絡先の誕生日。*(日)*
226
+
227
+  * **注**: 連絡先についてのメモ。*(,)*
228
+
229
+  * **写真**: 連絡先の写真の配列。*(ContactField[])*
230
+
231
+  * **カテゴリ**: 取引先担当者に関連付けられているすべてのユーザー定義カテゴリの配列。*(ContactField[])*
232
+
233
+  * **url**: 取引先担当者に関連付けられている web ページの配列。*(ContactField[])*
234
+
235
+### メソッド
236
+
237
+  * **クローン**: 新しいを返します `Contact` と呼び出し元のオブジェクトのディープ コピーであるオブジェクトの `id` プロパティに設定`null`.
238
+
239
+  * **削除**: デバイスの連絡先データベースから連絡先を削除します、それ以外の場合のためのエラー コールバックを実行する、 `ContactError` オブジェクト。
240
+
241
+  * **保存**: デバイスの連絡先データベースに新しい連絡先を保存または同じ**id**を持つ連絡先が既に存在する場合、既存の連絡先を更新します。
242
+
243
+### サポートされているプラットフォーム
244
+
245
+  * アマゾン火 OS
246
+  * アンドロイド
247
+  * ブラックベリー 10
248
+  * Firefox の OS
249
+  * iOS
250
+  * Windows Phone 7 と 8
251
+  * Windows 8
252
+  * Windows
253
+
254
+### 保存の例
255
+
256
+    function onSuccess(contact) {
257
+        alert("Save Success");
258
+    };
259
+    
260
+    function onError(contactError) {
261
+        alert("Error = " + contactError.code);
262
+    };
263
+    
264
+    // create a new contact object
265
+    var contact = navigator.contacts.create();
266
+    contact.displayName = "Plumber";
267
+    contact.nickname = "Plumber";            // specify both to support all devices
268
+    
269
+    // populate some fields
270
+    var name = new ContactName();
271
+    name.givenName = "Jane";
272
+    name.familyName = "Doe";
273
+    contact.name = name;
274
+    
275
+    // save to device
276
+    contact.save(onSuccess,onError);
277
+    
278
+
279
+### クローンの例
280
+
281
+        // clone the contact object
282
+        var clone = contact.clone();
283
+        clone.name.givenName = "John";
284
+        console.log("Original contact name = " + contact.name.givenName);
285
+        console.log("Cloned contact name = " + clone.name.givenName);
286
+    
287
+
288
+### 削除の例
289
+
290
+    function onSuccess() {
291
+        alert("Removal Success");
292
+    };
293
+    
294
+    function onError(contactError) {
295
+        alert("Error = " + contactError.code);
296
+    };
297
+    
298
+    // remove the contact from the device
299
+    contact.remove(onSuccess,onError);
300
+    
301
+
302
+### アンドロイド 2.X 癖
303
+
304
+  * **カテゴリ**: 返す 2.X の Android デバイスでサポートされていません`null`.
305
+
306
+### ブラックベリー 10 癖
307
+
308
+  * **id**: 連絡先を保存するときに、デバイスによって割り当てられます。
309
+
310
+### FirefoxOS の癖
311
+
312
+  * **カテゴリ**: 部分的にサポートされます。フィールド**県**・**タイプ**を返す`null`
313
+
314
+  * **ims**: サポートされていません。
315
+
316
+  * **写真**: サポートされていません。
317
+
318
+### iOS の癖
319
+
320
+  * **displayName**: 返す iOS でサポートされていない `null` がない限り、ない `ContactName` 指定すると、その場合は複合名、**ニックネーム**を返しますまたは `""` 、それぞれ。
321
+
322
+  * **誕生日**: JavaScript として入力する必要があります `Date` オブジェクト、同じ方法が返されます。
323
+
324
+  * **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。一時ディレクトリの内容は、アプリケーションの終了時に削除されます。
325
+
326
+  * **カテゴリ**: このプロパティは現在サポートされていません、返す`null`.
327
+
328
+### Windows Phone 7 と 8 癖
329
+
330
+  * **displayName**: 表示名パラメーターの表示名と異なるために提供値を取得、連絡先を検索するとき、連絡先を作成するとき。
331
+
332
+  * **url**: 連絡先を作成するときユーザー入力保存でき、1 つ以上の web アドレスが 1 つだけ、連絡先を検索するとき。
333
+
334
+  * **電話番号**:*県*オプションはサポートされていません。 *型*は、*検索*操作ではサポートされていません。 1 つだけ `phoneNumber` は各*タイプ*の許可.
335
+
336
+  * **メール**:*県*オプションはサポートされていません。家庭や個人的なメールと同じエントリを参照します。各*タイプ*の 1 つだけのエントリが許可されて.
337
+
338
+  * **アドレス**: 仕事とホーム/パーソナル*タイプ*のみをサポートしています。家庭や個人*型*参照して同じアドレス エントリ。各*タイプ*の 1 つだけのエントリが許可されて.
339
+
340
+  * **組織**: 1 つだけが許可され、*県*、*タイプ*、および*部門*の属性をサポートしていません。
341
+
342
+  * **注**: サポートされていないを返す`null`.
343
+
344
+  * **ims**: サポートされていないを返す`null`.
345
+
346
+  * **誕生日**: サポートされていないを返す`null`.
347
+
348
+  * **カテゴリ**: サポートされていないを返す`null`.
349
+
350
+  * **remove**: メソッドはサポートされていません
351
+
352
+### Windows の癖
353
+
354
+  * **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。
355
+
356
+  * **誕生日**: サポートされていないを返す`null`.
357
+
358
+  * **カテゴリ**: サポートされていないを返す`null`.
359
+
360
+  * **remove**: Windows 10 以上メソッドはサポートされてのみ。
361
+
362
+## ContactAddress
363
+
364
+`ContactAddress` オブジェクトは、連絡先の 1 つのアドレスのプロパティを格納します。 `Contact` オブジェクトは、`ContactAddress` 配列の 1 つ以上のアドレスなどがあります。
365
+
366
+### プロパティ
367
+
368
+  * **県**: に設定されている `true` 場合は、この `ContactAddress` ユーザーの推奨値が含まれています。*(ブール値)*
369
+
370
+  * **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
371
+
372
+  * **書式設定**: 表示用にフォーマットの完全なアドレス。*(,)*
373
+
374
+  * **番地**: 完全な住所。*(,)*
375
+
376
+  * **局所性**: 都市または場所。*(,)*
377
+
378
+  * **地域**: 状態または地域。*(,)*
379
+
380
+  * **郵便番号**: 郵便番号または郵便番号。*(,)*
381
+
382
+  * **国**: 国の名前。*(,)*
383
+
384
+### サポートされているプラットフォーム
385
+
386
+  * アマゾン火 OS
387
+  * アンドロイド
388
+  * ブラックベリー 10
389
+  * Firefox の OS
390
+  * iOS
391
+  * Windows Phone 7 と 8
392
+  * Windows 8
393
+  * Windows
394
+
395
+### 例
396
+
397
+    // display the address information for all contacts
398
+    
399
+    function onSuccess(contacts) {
400
+        for (var i = 0; i < contacts.length; i++) {
401
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
402
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
403
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
404
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
405
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
406
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
407
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
408
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
409
+                    "Country: "        + contacts[i].addresses[j].country);
410
+            }
411
+        }
412
+    };
413
+    
414
+    function onError(contactError) {
415
+        alert('onError!');
416
+    };
417
+    
418
+    // find all contacts
419
+    var options = new ContactFindOptions();
420
+    options.filter = "";
421
+    var filter = ["displayName", "addresses"];
422
+    navigator.contacts.find(filter, onSuccess, onError, options);
423
+    
424
+
425
+### アンドロイド 2.X 癖
426
+
427
+  * **県**: サポートされていない返す `false` 2.X の Android デバイスで。
428
+
429
+### ブラックベリー 10 癖
430
+
431
+  * **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
432
+
433
+  * **種類**: 部分的にサポートされます。連絡先ごとの 1 つだけ各*仕事*と*家庭*の種類のアドレスを格納できます。
434
+
435
+  * **フォーマット**: 部分的にサポートされます。すべての BlackBerry アドレス フィールドの連結を返します。
436
+
437
+  * **番地**: サポートされています。ブラックベリーの**住所 1** **住所 2**の連結アドレス フィールドを返します。
438
+
439
+  * **局所性**: サポートされています。ブラックベリー**市**アドレス フィールドに格納されます。
440
+
441
+  * **地域**: サポートされています。ブラックベリー **stateProvince**アドレス フィールドに格納されます。
442
+
443
+  * **郵便番号**: サポートされています。ブラックベリー **zipPostal**アドレス フィールドに格納されます。
444
+
445
+  * **国**: サポートされています。
446
+
447
+### FirefoxOS の癖
448
+
449
+  * **フォーマット**: 現在サポートされていません
450
+
451
+### iOS の癖
452
+
453
+  * **県**: 戻る iOS デバイスでサポートされていません`false`.
454
+
455
+  * **フォーマット**: 現在サポートされていません。
456
+
457
+### Windows 8 の癖
458
+
459
+  * **県**: サポートされていません。
460
+
461
+### Windows の癖
462
+
463
+  * **県**: サポートされていません。
464
+
465
+## ContactError
466
+
467
+`ContactError` オブジェクトにエラーが発生したときに `contactError` コールバック関数を通じてユーザーに返されます。
468
+
469
+### プロパティ
470
+
471
+  * **コード**: 次のいずれかの定義済みのエラー コード。
472
+
473
+### 定数
474
+
475
+  * `ContactError.UNKNOWN_ERROR` (code 0)
476
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
477
+  * `ContactError.TIMEOUT_ERROR` (code 2)
478
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
479
+  * `ContactError.IO_ERROR` (code 4)
480
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
481
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
482
+
483
+## ContactField
484
+
485
+`ContactField` オブジェクトは連絡先フィールドを総称を表す再利用可能なコンポーネントです。 各 `ContactField` オブジェクトには `値` `型`、および `県` プロパティが含まれています。 `連絡先` オブジェクトは、`ContactField` 配列に、電話番号、メール アドレスなどのいくつかのプロパティを格納します。
486
+
487
+ほとんどの場合、`ContactField` オブジェクトの **type** 属性のあらかじめ決められた値はありません。 たとえば、電話番号が *ホーム*、*仕事*、*モバイル*、*iPhone*、または特定のデバイス プラットフォームの連絡先データベースでサポートされている他の値の **型** の値を指定できます。 ただし、`連絡先` **の写真**] のフィールド **の種類**] フィールドを示します返される画像の形式: **url** **値** 属性 **値** を base64 でエンコードされたイメージの文字列が含まれる場合に写真イメージまたは *base64* に URL が含まれる場合。
488
+
489
+### プロパティ
490
+
491
+  * **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
492
+
493
+  * **値**: 電話番号や電子メール アドレスなど、フィールドの値。*(,)*
494
+
495
+  * **県**: に設定されている `true` 場合は、この `ContactField` ユーザーの推奨値が含まれています。*(ブール値)*
496
+
497
+### サポートされているプラットフォーム
498
+
499
+  * アマゾン火 OS
500
+  * アンドロイド
501
+  * ブラックベリー 10
502
+  * Firefox の OS
503
+  * iOS
504
+  * Windows Phone 7 と 8
505
+  * Windows 8
506
+  * Windows
507
+
508
+### 例
509
+
510
+        // create a new contact
511
+        var contact = navigator.contacts.create();
512
+    
513
+        // store contact phone numbers in ContactField[]
514
+        var phoneNumbers = [];
515
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
516
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
517
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
518
+        contact.phoneNumbers = phoneNumbers;
519
+    
520
+        // save the contact
521
+        contact.save();
522
+    
523
+
524
+### Android の癖
525
+
526
+  * **県**: サポートされていないを返す`false`.
527
+
528
+### ブラックベリー 10 癖
529
+
530
+  * **種類**: 部分的にサポートされます。電話番号を使用します。
531
+
532
+  * **値**: サポートされています。
533
+
534
+  * **県**: サポートされていないを返す`false`.
535
+
536
+### iOS の癖
537
+
538
+  * **県**: サポートされていないを返す`false`.
539
+
540
+### Windows8 の癖
541
+
542
+  * **県**: サポートされていないを返す`false`.
543
+
544
+### Windows の癖
545
+
546
+  * **県**: サポートされていないを返す`false`.
547
+
548
+## ContactName
549
+
550
+異なる種類 `Contact` オブジェクトの名前についての情報にはが含まれています。
551
+
552
+### プロパティ
553
+
554
+  * **フォーマット**: 連絡先の完全な名前。*(,)*
555
+
556
+  * **familyName**: 連絡先の姓。*(,)*
557
+
558
+  * **givenName**: 連絡先の名前。*(,)*
559
+
560
+  * **ミドル ネーム**: 連絡先のミドル ネーム。*(,)*
561
+
562
+  * **honorificPrefix**: 連絡先のプレフィックス (例*氏*または*博士*) *(,)*
563
+
564
+  * **honorificSuffix**: 連絡先のサフィックス (*弁護士*の例)。*(,)*
565
+
566
+### サポートされているプラットフォーム
567
+
568
+  * アマゾン火 OS
569
+  * アンドロイド
570
+  * ブラックベリー 10
571
+  * Firefox の OS
572
+  * iOS
573
+  * Windows Phone 7 と 8
574
+  * Windows 8
575
+  * Windows
576
+
577
+### 例
578
+
579
+    function onSuccess(contacts) {
580
+        for (var i = 0; i < contacts.length; i++) {
581
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
582
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
583
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
584
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
585
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
586
+                "Prefix: "       + contacts[i].name.honorificSuffix);
587
+        }
588
+    };
589
+    
590
+    function onError(contactError) {
591
+        alert('onError!');
592
+    };
593
+    
594
+    var options = new ContactFindOptions();
595
+    options.filter = "";
596
+    filter = ["displayName", "name"];
597
+    navigator.contacts.find(filter, onSuccess, onError, options);
598
+    
599
+
600
+### Android の癖
601
+
602
+  * **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
603
+
604
+### ブラックベリー 10 癖
605
+
606
+  * **フォーマット**: 部分的にサポートされます。ブラックベリー **firstName**と**lastName**フィールドの連結を返します。
607
+
608
+  * **familyName**: サポートされています。ブラックベリー **[氏名]**フィールドに格納されます。
609
+
610
+  * **givenName**: サポートされています。ブラックベリーの**firstName**フィールドに格納されます。
611
+
612
+  * **ミドル ネーム**: サポートされていないを返す`null`.
613
+
614
+  * **honorificPrefix**: サポートされていないを返す`null`.
615
+
616
+  * **honorificSuffix**: サポートされていないを返す`null`.
617
+
618
+### FirefoxOS の癖
619
+
620
+  * **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
621
+
622
+### iOS の癖
623
+
624
+  * **フォーマット**: 部分的にサポートされます。IOS 複合名を返しますが、読み取り専用です。
625
+
626
+### Windows 8 の癖
627
+
628
+  * **フォーマット**: これは、プロパティの名前し、同じです `displayName` と`nickname`
629
+
630
+  * **familyName**: サポートされていません。
631
+
632
+  * **givenName**: サポートされていません。
633
+
634
+  * **ミドル ネーム**: サポートされていません。
635
+
636
+  * **honorificPrefix**: サポートされていません。
637
+
638
+  * **honorificSuffix**: サポートされていません。
639
+
640
+### Windows の癖
641
+
642
+  * **フォーマット**: と同じです`displayName`
643
+
644
+## ContactOrganization
645
+
646
+`ContactOrganization` オブジェクトは、連絡先の組織のプロパティを格納します。`連絡先` オブジェクトは、配列の 1 つ以上の `ContactOrganization` オブジェクトを格納します。
647
+
648
+### プロパティ
649
+
650
+  * **県**: に設定されている `true` 場合は、この `ContactOrganization` ユーザーの推奨値が含まれています。*(ブール値)*
651
+
652
+  * **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。_(DOMString)
653
+
654
+  * **名前**: 組織の名前。*(,)*
655
+
656
+  * **部門**: 契約に勤めている部門。*(,)*
657
+
658
+  * **タイトル**: 組織の連絡先のタイトル。*(,)*
659
+
660
+### サポートされているプラットフォーム
661
+
662
+  * アンドロイド
663
+  * ブラックベリー 10
664
+  * Firefox の OS
665
+  * iOS
666
+  * Windows Phone 7 と 8
667
+  * Windows (Windows 8.1 および Windows Phone 8.1 装置のみ)
668
+
669
+### 例
670
+
671
+    function onSuccess(contacts) {
672
+        for (var i = 0; i < contacts.length; i++) {
673
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
674
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
675
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
676
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
677
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
678
+                    "Title: "       + contacts[i].organizations[j].title);
679
+            }
680
+        }
681
+    };
682
+    
683
+    function onError(contactError) {
684
+        alert('onError!');
685
+    };
686
+    
687
+    var options = new ContactFindOptions();
688
+    options.filter = "";
689
+    filter = ["displayName", "organizations"];
690
+    navigator.contacts.find(filter, onSuccess, onError, options);
691
+    
692
+
693
+### アンドロイド 2.X 癖
694
+
695
+  * **県**: 返す 2.X の Android デバイスでサポートされていません`false`.
696
+
697
+### ブラックベリー 10 癖
698
+
699
+  * **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
700
+
701
+  * **タイプ**: 戻る、BlackBerry デバイスでサポートされていません`null`.
702
+
703
+  * **名前**: 部分的にサポートされます。最初の組織名は、**会社**のブラックベリーのフィールドに格納されます。
704
+
705
+  * **部門**: サポートされていないを返す`null`.
706
+
707
+  * **タイトル**: 部分的にサポートされます。組織の最初のタイトルはブラックベリー**氏名**フィールドに格納されます。
708
+
709
+### Firefox OS 癖
710
+
711
+  * **県**: サポートされていません。
712
+
713
+  * **タイプ**: サポートされていません。
714
+
715
+  * **部門**: サポートされていません。
716
+
717
+  * フィールドの**名前**と**組織**、**氏名**に格納された**タイトル**.
718
+
719
+### iOS の癖
720
+
721
+  * **県**: 戻る iOS デバイスでサポートされていません`false`.
722
+
723
+  * **タイプ**: 戻る iOS デバイスでサポートされていません`null`.
724
+
725
+  * **名前**: 部分的にサポートされます。最初の組織名は、iOS **kABPersonOrganizationProperty**フィールドに格納されます。
726
+
727
+  * **部門**: 部分的にサポートされます。最初の部署名は iOS **kABPersonDepartmentProperty**フィールドに格納されます。
728
+
729
+  * **タイトル**: 部分的にサポートされます。最初のタイトルは、iOS **kABPersonJobTitleProperty**フィールドに格納されます。
730
+
731
+### Windows の癖
732
+
733
+  * **県**: サポートされていないを返す`false`.
734
+
735
+  * **タイプ**: サポートされていないを返す`null`.

+ 719
- 0
km0App/node_modules/cordova-plugin-contacts/doc/ja/index.md Parādīt failu

@@ -0,0 +1,719 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+このプラグインは、デバイスの連絡先データベースへのアクセスを提供するグローバル `navigator.contacts` オブジェクトを定義します。
23
+
24
+オブジェクトは、グローバル スコープの `ナビゲーター` に添付、それがないまで `deviceready` イベントの後。
25
+
26
+    document.addEventListener("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {
28
+        console.log(navigator.contacts);
29
+    }
30
+    
31
+
32
+**警告**: 連絡先データの収集と利用を重要なプライバシーの問題を発生させます。 アプリのプライバシー ポリシー アプリが連絡先データを使用する方法と、他の当事者では共有されているかどうかを話し合う必要があります。 人誰と通信する人々 を明らかにするために、連絡先情報が機密と見なされます。 したがって、アプリのプライバシー ポリシーに加えて、強くお勧めデバイスのオペレーティング システムが既にしない場合アプリにアクセスまたは連絡先のデータを使用する前に - 時間のお知らせを提供します。 その通知は、上記の (例えば、**[ok]** を **おかげで** 選択肢を提示する) によってユーザーのアクセス許可を取得するだけでなく、同じ情報を提供する必要があります。 いくつかのアプリのマーケットプ レース - 時間の通知を提供して、連絡先データにアクセスする前にユーザーの許可を取得するアプリをする必要がありますに注意してください。 連絡先データは、ユーザーの混乱を避けるのに役立ちますの使用および連絡先データの知覚の誤用を囲む明確でわかりやすいユーザー エクスペリエンス。 詳細については、プライバシーに関するガイドを参照してください。
33
+
34
+## インストール
35
+
36
+    cordova plugin add cordova-plugin-contacts
37
+    
38
+
39
+### Firefox OS 癖
40
+
41
+[マニフェストのドキュメント][1] で説明されているように、**www/manifest.webapp** を作成します。 関連する権限を追加します。 [マニフェストのドキュメント][2]「特権」- に web アプリケーションの種類を変更する必要も。 **警告**: すべての特権を持つアプリケーション インライン スクリプトを禁止している [コンテンツのセキュリティ ポリシー][3] を適用します。 別の方法で、アプリケーションを初期化します。
42
+
43
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
44
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
45
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
46
+
47
+    "type": "privileged",
48
+    "permissions": {
49
+        "contacts": {
50
+            "access": "readwrite",
51
+            "description": "Describe why there is a need for such permission"
52
+        }
53
+    }
54
+    
55
+
56
+### Windows の癖
57
+
58
+`find` し、`pickContact` メソッドから返されるすべての連絡先は readonly、アプリケーションを変更することはできません。 `find` メソッド 8.1 の Windows Phone デバイスでのみ使用できます。
59
+
60
+### Windows 8 の癖
61
+
62
+Windows 8 の連絡先は、読み取り専用です。 コルドバ API コンタクトを介してされませんクエリ/検索可能で、ユーザーに通知する必要があります連絡先を選択 '人' アプリを開くことが contacts.pickContact への呼び出しとして、ユーザーが連絡先を選択する必要があります。 戻される連絡先は読み取り専用、アプリケーションを変更することはできません。
63
+
64
+## navigator.contacts
65
+
66
+### メソッド
67
+
68
+*   navigator.contacts.create
69
+*   navigator.contacts.find
70
+*   navigator.contacts.pickContact
71
+
72
+### オブジェクト
73
+
74
+*   お問い合わせ
75
+*   得意先コード
76
+*   ContactField
77
+*   ContactAddress
78
+*   ContactOrganization
79
+*   ContactFindOptions
80
+*   ContactError
81
+*   ContactFieldType
82
+
83
+## navigator.contacts.create
84
+
85
+`navigator.contacts.create` メソッドは同期的に、新しい `連絡先` オブジェクトを返します。
86
+
87
+このメソッドは、`Contact.save` メソッドを呼び出す必要があるデバイスの連絡先データベースに連絡先オブジェクトを保持しません。
88
+
89
+### サポートされているプラットフォーム
90
+
91
+*   アンドロイド
92
+*   ブラックベリー 10
93
+*   Firefox の OS
94
+*   iOS
95
+*   Windows Phone 7 と 8
96
+
97
+### 例
98
+
99
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
100
+    
101
+
102
+## navigator.contacts.find
103
+
104
+デバイスの連絡先データベースを照会して、`Contact` オブジェクトの配列を返す `navigator.contacts.find` メソッドを非同期的に実行します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
105
+
106
+**contactFields** パラメーター検索の修飾子として使用するフィールドを指定します。 ゼロ長さ **contactFields** パラメーターは有効で、`ContactError.INVALID_ARGUMENT_ERROR` の結果します。 **contactFields** 値 `"*"` すべての連絡先フィールドが検索されます。
107
+
108
+**contactFindOptions.filter** 文字列の連絡先データベースを照会するときに検索フィルターとして使用できます。 指定した場合、大文字と小文字、部分的な値の一致する **contactFields** パラメーターで指定されたフィールドごとに適用されます。 一致する *任意* 指定のフィールドがある場合は、連絡先が返されます。 バック連絡先プロパティを制御する **contactFindOptions.desiredFields** パラメーターを使用しますが返される必要があります。
109
+
110
+### パラメーター
111
+
112
+*   **contactFields**: 連絡先検索修飾子として使用するフィールド。*(DOMString[])* [Required]
113
+
114
+*   **contactSuccess**: Contact オブジェクトの配列に呼び出される成功コールバック関数は、データベースから返されます。[Required]
115
+
116
+*   **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
117
+
118
+*   **contactFindOptions**: navigator.contacts をフィルターするオプションを検索します。[Optional]
119
+    
120
+    キーは次のとおりです。
121
+    
122
+    *   **filter**: navigator.contacts の検索に使用する検索文字列。*(,)*(デフォルト: `""`)
123
+    
124
+    *   **multiple**: 複数 navigator.contacts かどうかは、検索操作に返すを決定します。*(ブール値)*(デフォルト: `false`)
125
+        
126
+        *   **desiredFields**: 戻って返されるフィールドに問い合わせてください。指定した場合、結果 `Contact` オブジェクトこれらのフィールドの値でのみ機能します。*(DOMString[])* [Optional]
127
+
128
+### サポートされているプラットフォーム
129
+
130
+*   アンドロイド
131
+*   ブラックベリー 10
132
+*   Firefox の OS
133
+*   iOS
134
+*   Windows Phone 7 と 8
135
+*   Windows (Windows Phone 8.1 装置のみ)
136
+
137
+### 例
138
+
139
+    function onSuccess(contacts) {
140
+        alert('Found ' + contacts.length + ' contacts.');
141
+    };
142
+    
143
+    function onError(contactError) {
144
+        alert('onError!');
145
+    };
146
+    
147
+    // find all contacts with 'Bob' in any name field
148
+    var options      = new ContactFindOptions();
149
+    options.filter   = "Bob";
150
+    options.multiple = true;
151
+    options.desiredFields = [navigator.contacts.fieldType.id];
152
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
153
+    navigator.contacts.find(fields, onSuccess, onError, options);
154
+    
155
+
156
+### Windows の癖
157
+
158
+*   `__contactFields__`サポートされていないと無視されます。`find`メソッドは、常に名前、電子メール アドレス、または連絡先の電話番号に一致ましょう。
159
+
160
+## navigator.contacts.pickContact
161
+
162
+`navigator.contacts.pickContact` メソッドは単一の連絡先を選択する連絡先ピッカーを起動します。 結果として得られるオブジェクトは、**contactSuccess** パラメーターで指定された `contactSuccess` コールバック関数に渡されます。
163
+
164
+### パラメーター
165
+
166
+*   **contactSuccess**: 1 つの連絡先オブジェクトに呼び出される成功コールバック関数。[必須]
167
+
168
+*   **contactError**: エラー コールバック関数は、エラーが発生したときに呼び出されます。[オプション]
169
+
170
+### サポートされているプラットフォーム
171
+
172
+*   アンドロイド
173
+*   iOS
174
+*   Windows Phone 8
175
+*   Windows 8
176
+*   Windows
177
+
178
+### 例
179
+
180
+    navigator.contacts.pickContact(function(contact){
181
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
182
+        },function(err){
183
+            console.log('Error: ' + err);
184
+        });
185
+    
186
+
187
+## お問い合わせ
188
+
189
+`Contact` オブジェクトは、ユーザーの連絡先を表します。 連絡先の作成、格納、またはデバイスの連絡先データベースから削除することができます。 連絡先も取得できます (個別にまたは一括で) データベースから `navigator.contacts.find` メソッドを呼び出すことによって。
190
+
191
+**注**: すべて上記の連絡先フィールドのすべてのデバイス プラットフォームでサポートされます。詳細については各プラットフォームの *互換* セクションを確認してください。
192
+
193
+### プロパティ
194
+
195
+*   **id**: グローバルに一意の識別子。*(,)*
196
+
197
+*   **displayName**: エンド ・ ユーザーへの表示に適した、この連絡先の名前。*(,)*
198
+
199
+*   **名前**: 人の名前のすべてのコンポーネントを格納するオブジェクト。*(ContactName)*
200
+
201
+*   **ニックネーム**: 連絡先のアドレスに使用するカジュアルな名前。*(,)*
202
+
203
+*   **電話番号**: 連絡先の電話番号の配列。*(ContactField[])*
204
+
205
+*   **メール**: 連絡先の電子メール アドレスの配列。*(ContactField[])*
206
+
207
+*   **アドレス**: 連絡先のアドレスの配列。*(ContactAddress[])*
208
+
209
+*   **ims**: 連絡先の IM アドレスの配列。*(ContactField[])*
210
+
211
+*   **組織**: 連絡先の組織の配列。*(ContactOrganization[])*
212
+
213
+*   **誕生日**: 連絡先の誕生日。*(日)*
214
+
215
+*   **注**: 連絡先についてのメモ。*(,)*
216
+
217
+*   **写真**: 連絡先の写真の配列。*(ContactField[])*
218
+
219
+*   **カテゴリ**: 取引先担当者に関連付けられているすべてのユーザー定義カテゴリの配列。*(ContactField[])*
220
+
221
+*   **url**: 取引先担当者に関連付けられている web ページの配列。*(ContactField[])*
222
+
223
+### メソッド
224
+
225
+*   **クローン**: 新しいを返します `Contact` と呼び出し元のオブジェクトのディープ コピーであるオブジェクトの `id` プロパティに設定`null`.
226
+
227
+*   **削除**: デバイスの連絡先データベースから連絡先を削除します、それ以外の場合のためのエラー コールバックを実行する、 `ContactError` オブジェクト。
228
+
229
+*   **保存**: デバイスの連絡先データベースに新しい連絡先を保存または同じ**id**を持つ連絡先が既に存在する場合、既存の連絡先を更新します。
230
+
231
+### サポートされているプラットフォーム
232
+
233
+*   アマゾン火 OS
234
+*   アンドロイド
235
+*   ブラックベリー 10
236
+*   Firefox の OS
237
+*   iOS
238
+*   Windows Phone 7 と 8
239
+*   Windows 8
240
+*   Windows
241
+
242
+### 保存の例
243
+
244
+    function onSuccess(contact) {
245
+        alert("Save Success");
246
+    };
247
+    
248
+    function onError(contactError) {
249
+        alert("Error = " + contactError.code);
250
+    };
251
+    
252
+    // create a new contact object
253
+    var contact = navigator.contacts.create();
254
+    contact.displayName = "Plumber";
255
+    contact.nickname = "Plumber";            // specify both to support all devices
256
+    
257
+    // populate some fields
258
+    var name = new ContactName();
259
+    name.givenName = "Jane";
260
+    name.familyName = "Doe";
261
+    contact.name = name;
262
+    
263
+    // save to device
264
+    contact.save(onSuccess,onError);
265
+    
266
+
267
+### クローンの例
268
+
269
+        // clone the contact object
270
+        var clone = contact.clone();
271
+        clone.name.givenName = "John";
272
+        console.log("Original contact name = " + contact.name.givenName);
273
+        console.log("Cloned contact name = " + clone.name.givenName);
274
+    
275
+
276
+### 削除の例
277
+
278
+    function onSuccess() {
279
+        alert("Removal Success");
280
+    };
281
+    
282
+    function onError(contactError) {
283
+        alert("Error = " + contactError.code);
284
+    };
285
+    
286
+    // remove the contact from the device
287
+    contact.remove(onSuccess,onError);
288
+    
289
+
290
+### アンドロイド 2.X 癖
291
+
292
+*   **カテゴリ**: 返す 2.X の Android デバイスでサポートされていません`null`.
293
+
294
+### ブラックベリー 10 癖
295
+
296
+*   **id**: 連絡先を保存するときに、デバイスによって割り当てられます。
297
+
298
+### FirefoxOS の癖
299
+
300
+*   **カテゴリ**: 部分的にサポートされます。フィールド**県**・**タイプ**を返す`null`
301
+
302
+*   **ims**: サポートされていません。
303
+
304
+*   **写真**: サポートされていません。
305
+
306
+### iOS の癖
307
+
308
+*   **displayName**: 返す iOS でサポートされていない `null` がない限り、ない `ContactName` 指定すると、その場合は複合名、**ニックネーム**を返しますまたは `""` 、それぞれ。
309
+
310
+*   **誕生日**: JavaScript として入力する必要があります `Date` オブジェクト、同じ方法が返されます。
311
+
312
+*   **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。一時ディレクトリの内容は、アプリケーションの終了時に削除されます。
313
+
314
+*   **カテゴリ**: このプロパティは現在サポートされていません、返す`null`.
315
+
316
+### Windows Phone 7 と 8 癖
317
+
318
+*   **displayName**: 表示名パラメーターの表示名と異なるために提供値を取得、連絡先を検索するとき、連絡先を作成するとき。
319
+
320
+*   **url**: 連絡先を作成するときユーザー入力保存でき、1 つ以上の web アドレスが 1 つだけ、連絡先を検索するとき。
321
+
322
+*   **電話番号**:*県*オプションはサポートされていません。 *型*は、*検索*操作ではサポートされていません。 1 つだけ `phoneNumber` は各*タイプ*の許可.
323
+
324
+*   **メール**:*県*オプションはサポートされていません。家庭や個人的なメールと同じエントリを参照します。各*タイプ*の 1 つだけのエントリが許可されて.
325
+
326
+*   **アドレス**: 仕事とホーム/パーソナル*タイプ*のみをサポートしています。家庭や個人*型*参照して同じアドレス エントリ。各*タイプ*の 1 つだけのエントリが許可されて.
327
+
328
+*   **組織**: 1 つだけが許可され、*県*、*タイプ*、および*部門*の属性をサポートしていません。
329
+
330
+*   **注**: サポートされていないを返す`null`.
331
+
332
+*   **ims**: サポートされていないを返す`null`.
333
+
334
+*   **誕生日**: サポートされていないを返す`null`.
335
+
336
+*   **カテゴリ**: サポートされていないを返す`null`.
337
+
338
+### Windows の癖
339
+
340
+*   **写真**: アプリケーションの一時ディレクトリに格納されているイメージへのファイルの URL を返します。
341
+
342
+*   **誕生日**: サポートされていないを返す`null`.
343
+
344
+*   **カテゴリ**: サポートされていないを返す`null`.
345
+
346
+## ContactAddress
347
+
348
+`ContactAddress` オブジェクトは、連絡先の 1 つのアドレスのプロパティを格納します。 `Contact` オブジェクトは、`ContactAddress` 配列の 1 つ以上のアドレスなどがあります。
349
+
350
+### プロパティ
351
+
352
+*   **県**: に設定されている `true` 場合は、この `ContactAddress` ユーザーの推奨値が含まれています。*(ブール値)*
353
+
354
+*   **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
355
+
356
+*   **書式設定**: 表示用にフォーマットの完全なアドレス。*(,)*
357
+
358
+*   **番地**: 完全な住所。*(,)*
359
+
360
+*   **局所性**: 都市または場所。*(,)*
361
+
362
+*   **地域**: 状態または地域。*(,)*
363
+
364
+*   **郵便番号**: 郵便番号または郵便番号。*(,)*
365
+
366
+*   **国**: 国の名前。*(,)*
367
+
368
+### サポートされているプラットフォーム
369
+
370
+*   アマゾン火 OS
371
+*   アンドロイド
372
+*   ブラックベリー 10
373
+*   Firefox の OS
374
+*   iOS
375
+*   Windows Phone 7 と 8
376
+*   Windows 8
377
+*   Windows
378
+
379
+### 例
380
+
381
+    // display the address information for all contacts
382
+    
383
+    function onSuccess(contacts) {
384
+        for (var i = 0; i < contacts.length; i++) {
385
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
386
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
387
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
388
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
389
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
390
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
391
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
392
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
393
+                    "Country: "        + contacts[i].addresses[j].country);
394
+            }
395
+        }
396
+    };
397
+    
398
+    function onError(contactError) {
399
+        alert('onError!');
400
+    };
401
+    
402
+    // find all contacts
403
+    var options = new ContactFindOptions();
404
+    options.filter = "";
405
+    var filter = ["displayName", "addresses"];
406
+    navigator.contacts.find(filter, onSuccess, onError, options);
407
+    
408
+
409
+### アンドロイド 2.X 癖
410
+
411
+*   **県**: サポートされていない返す `false` 2.X の Android デバイスで。
412
+
413
+### ブラックベリー 10 癖
414
+
415
+*   **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
416
+
417
+*   **種類**: 部分的にサポートされます。連絡先ごとの 1 つだけ各*仕事*と*家庭*の種類のアドレスを格納できます。
418
+
419
+*   **フォーマット**: 部分的にサポートされます。すべての BlackBerry アドレス フィールドの連結を返します。
420
+
421
+*   **番地**: サポートされています。ブラックベリーの**住所 1** **住所 2**の連結アドレス フィールドを返します。
422
+
423
+*   **局所性**: サポートされています。ブラックベリー**市**アドレス フィールドに格納されます。
424
+
425
+*   **地域**: サポートされています。ブラックベリー **stateProvince**アドレス フィールドに格納されます。
426
+
427
+*   **郵便番号**: サポートされています。ブラックベリー **zipPostal**アドレス フィールドに格納されます。
428
+
429
+*   **国**: サポートされています。
430
+
431
+### FirefoxOS の癖
432
+
433
+*   **フォーマット**: 現在サポートされていません
434
+
435
+### iOS の癖
436
+
437
+*   **県**: 戻る iOS デバイスでサポートされていません`false`.
438
+
439
+*   **フォーマット**: 現在サポートされていません。
440
+
441
+### Windows 8 の癖
442
+
443
+*   **県**: サポートされていません。
444
+
445
+### Windows の癖
446
+
447
+*   **県**: サポートされていません。
448
+
449
+## ContactError
450
+
451
+`ContactError` オブジェクトにエラーが発生したときに `contactError` コールバック関数を通じてユーザーに返されます。
452
+
453
+### プロパティ
454
+
455
+*   **コード**: 次のいずれかの定義済みのエラー コード。
456
+
457
+### 定数
458
+
459
+*   `ContactError.UNKNOWN_ERROR` (code 0)
460
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
461
+*   `ContactError.TIMEOUT_ERROR` (code 2)
462
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
463
+*   `ContactError.IO_ERROR` (code 4)
464
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
465
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
466
+
467
+## ContactField
468
+
469
+`ContactField` オブジェクトは連絡先フィールドを総称を表す再利用可能なコンポーネントです。 各 `ContactField` オブジェクトには `値` `型`、および `県` プロパティが含まれています。 `連絡先` オブジェクトは、`ContactField` 配列に、電話番号、メール アドレスなどのいくつかのプロパティを格納します。
470
+
471
+ほとんどの場合、`ContactField` オブジェクトの **type** 属性のあらかじめ決められた値はありません。 たとえば、電話番号が *ホーム*、*仕事*、*モバイル*、*iPhone*、または特定のデバイス プラットフォームの連絡先データベースでサポートされている他の値の **型** の値を指定できます。 ただし、`連絡先` **の写真**] のフィールド **の種類**] フィールドを示します返される画像の形式: **url** **値** 属性 **値** を base64 でエンコードされたイメージの文字列が含まれる場合に写真イメージまたは *base64* に URL が含まれる場合。
472
+
473
+### プロパティ
474
+
475
+*   **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。*(,)*
476
+
477
+*   **値**: 電話番号や電子メール アドレスなど、フィールドの値。*(,)*
478
+
479
+*   **県**: に設定されている `true` 場合は、この `ContactField` ユーザーの推奨値が含まれています。*(ブール値)*
480
+
481
+### サポートされているプラットフォーム
482
+
483
+*   アマゾン火 OS
484
+*   アンドロイド
485
+*   ブラックベリー 10
486
+*   Firefox の OS
487
+*   iOS
488
+*   Windows Phone 7 と 8
489
+*   Windows 8
490
+*   Windows
491
+
492
+### 例
493
+
494
+        // create a new contact
495
+        var contact = navigator.contacts.create();
496
+    
497
+        // store contact phone numbers in ContactField[]
498
+        var phoneNumbers = [];
499
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
500
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
501
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
502
+        contact.phoneNumbers = phoneNumbers;
503
+    
504
+        // save the contact
505
+        contact.save();
506
+    
507
+
508
+### Android の癖
509
+
510
+*   **県**: サポートされていないを返す`false`.
511
+
512
+### ブラックベリー 10 癖
513
+
514
+*   **種類**: 部分的にサポートされます。電話番号を使用します。
515
+
516
+*   **値**: サポートされています。
517
+
518
+*   **県**: サポートされていないを返す`false`.
519
+
520
+### iOS の癖
521
+
522
+*   **県**: サポートされていないを返す`false`.
523
+
524
+### Windows8 の癖
525
+
526
+*   **県**: サポートされていないを返す`false`.
527
+
528
+### Windows の癖
529
+
530
+*   **県**: サポートされていないを返す`false`.
531
+
532
+## 得意先コード
533
+
534
+異なる種類 `Contact` オブジェクトの名前についての情報にはが含まれています。
535
+
536
+### プロパティ
537
+
538
+*   **フォーマット**: 連絡先の完全な名前。*(,)*
539
+
540
+*   **familyName**: 連絡先の姓。*(,)*
541
+
542
+*   **givenName**: 連絡先の名前。*(,)*
543
+
544
+*   **ミドル ネーム**: 連絡先のミドル ネーム。*(,)*
545
+
546
+*   **honorificPrefix**: 連絡先のプレフィックス (例*氏*または*博士*) *(,)*
547
+
548
+*   **honorificSuffix**: 連絡先のサフィックス (*弁護士*の例)。*(,)*
549
+
550
+### サポートされているプラットフォーム
551
+
552
+*   アマゾン火 OS
553
+*   アンドロイド
554
+*   ブラックベリー 10
555
+*   Firefox の OS
556
+*   iOS
557
+*   Windows Phone 7 と 8
558
+*   Windows 8
559
+*   Windows
560
+
561
+### 例
562
+
563
+    function onSuccess(contacts) {
564
+        for (var i = 0; i < contacts.length; i++) {
565
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
566
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
567
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
568
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
569
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
570
+                "Prefix: "       + contacts[i].name.honorificSuffix);
571
+        }
572
+    };
573
+    
574
+    function onError(contactError) {
575
+        alert('onError!');
576
+    };
577
+    
578
+    var options = new ContactFindOptions();
579
+    options.filter = "";
580
+    filter = ["displayName", "name"];
581
+    navigator.contacts.find(filter, onSuccess, onError, options);
582
+    
583
+
584
+### Android の癖
585
+
586
+*   **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
587
+
588
+### ブラックベリー 10 癖
589
+
590
+*   **フォーマット**: 部分的にサポートされます。ブラックベリー **firstName**と**lastName**フィールドの連結を返します。
591
+
592
+*   **familyName**: サポートされています。ブラックベリー **[氏名]**フィールドに格納されます。
593
+
594
+*   **givenName**: サポートされています。ブラックベリーの**firstName**フィールドに格納されます。
595
+
596
+*   **ミドル ネーム**: サポートされていないを返す`null`.
597
+
598
+*   **honorificPrefix**: サポートされていないを返す`null`.
599
+
600
+*   **honorificSuffix**: サポートされていないを返す`null`.
601
+
602
+### FirefoxOS の癖
603
+
604
+*   **フォーマット**: 部分的にサポートされており、読み取り専用です。 連結を返します `honorificPrefix` 、 `givenName` 、 `middleName` 、 `familyName` と`honorificSuffix`.
605
+
606
+### iOS の癖
607
+
608
+*   **フォーマット**: 部分的にサポートされます。IOS 複合名を返しますが、読み取り専用です。
609
+
610
+### Windows 8 の癖
611
+
612
+*   **フォーマット**: これは、プロパティの名前し、同じです `displayName` と`nickname`
613
+
614
+*   **familyName**: サポートされていません。
615
+
616
+*   **givenName**: サポートされていません。
617
+
618
+*   **ミドル ネーム**: サポートされていません。
619
+
620
+*   **honorificPrefix**: サポートされていません。
621
+
622
+*   **honorificSuffix**: サポートされていません。
623
+
624
+### Windows の癖
625
+
626
+*   **フォーマット**: と同じです`displayName`
627
+
628
+## ContactOrganization
629
+
630
+`ContactOrganization` オブジェクトは、連絡先の組織のプロパティを格納します。`連絡先` オブジェクトは、配列の 1 つ以上の `ContactOrganization` オブジェクトを格納します。
631
+
632
+### プロパティ
633
+
634
+*   **県**: に設定されている `true` 場合は、この `ContactOrganization` ユーザーの推奨値が含まれています。*(ブール値)*
635
+
636
+*   **タイプ**: たとえばフィールドこれは*ホーム*の種類を示す文字列。_(DOMString)
637
+
638
+*   **名前**: 組織の名前。*(,)*
639
+
640
+*   **部門**: 契約に勤めている部門。*(,)*
641
+
642
+*   **タイトル**: 組織の連絡先のタイトル。*(,)*
643
+
644
+### サポートされているプラットフォーム
645
+
646
+*   アンドロイド
647
+*   ブラックベリー 10
648
+*   Firefox の OS
649
+*   iOS
650
+*   Windows Phone 7 と 8
651
+*   Windows (Windows 8.1 および Windows Phone 8.1 装置のみ)
652
+
653
+### 例
654
+
655
+    function onSuccess(contacts) {
656
+        for (var i = 0; i < contacts.length; i++) {
657
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
658
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
659
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
660
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
661
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
662
+                    "Title: "       + contacts[i].organizations[j].title);
663
+            }
664
+        }
665
+    };
666
+    
667
+    function onError(contactError) {
668
+        alert('onError!');
669
+    };
670
+    
671
+    var options = new ContactFindOptions();
672
+    options.filter = "";
673
+    filter = ["displayName", "organizations"];
674
+    navigator.contacts.find(filter, onSuccess, onError, options);
675
+    
676
+
677
+### アンドロイド 2.X 癖
678
+
679
+*   **県**: 返す 2.X の Android デバイスでサポートされていません`false`.
680
+
681
+### ブラックベリー 10 癖
682
+
683
+*   **県**: 戻る、BlackBerry デバイスでサポートされていません`false`.
684
+
685
+*   **タイプ**: 戻る、BlackBerry デバイスでサポートされていません`null`.
686
+
687
+*   **名前**: 部分的にサポートされます。最初の組織名は、**会社**のブラックベリーのフィールドに格納されます。
688
+
689
+*   **部門**: サポートされていないを返す`null`.
690
+
691
+*   **タイトル**: 部分的にサポートされます。組織の最初のタイトルはブラックベリー**氏名**フィールドに格納されます。
692
+
693
+### Firefox OS 癖
694
+
695
+*   **県**: サポートされていません。
696
+
697
+*   **タイプ**: サポートされていません。
698
+
699
+*   **部門**: サポートされていません。
700
+
701
+*   フィールドの**名前**と**組織**、**氏名**に格納された**タイトル**.
702
+
703
+### iOS の癖
704
+
705
+*   **県**: 戻る iOS デバイスでサポートされていません`false`.
706
+
707
+*   **タイプ**: 戻る iOS デバイスでサポートされていません`null`.
708
+
709
+*   **名前**: 部分的にサポートされます。最初の組織名は、iOS **kABPersonOrganizationProperty**フィールドに格納されます。
710
+
711
+*   **部門**: 部分的にサポートされます。最初の部署名は iOS **kABPersonDepartmentProperty**フィールドに格納されます。
712
+
713
+*   **タイトル**: 部分的にサポートされます。最初のタイトルは、iOS **kABPersonJobTitleProperty**フィールドに格納されます。
714
+
715
+### Windows の癖
716
+
717
+*   **県**: サポートされていないを返す`false`.
718
+
719
+*   **タイプ**: サポートされていないを返す`null`.

+ 735
- 0
km0App/node_modules/cordova-plugin-contacts/doc/ko/README.md Parādīt failu

@@ -0,0 +1,735 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+이 플러그인 장치 연락처 데이터베이스에 대 한 액세스를 제공 하는 글로벌 `navigator.contacts` 개체를 정의 합니다.
25
+
26
+개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**경고**: 중요 한 개인 정보 보호 문제를 제기 하는 연락처 데이터의 수집 및 사용 합니다. 응용 프로그램의 개인 정보 보호 정책 응용 프로그램 연락처 데이터를 사용 하는 방법 및 다른 당사자와 함께 공유 하는 여부를 토론 해야 한다. 연락처 정보 누구와 통신 하는 사람이 사람들 보여 때문에 민감한으로 간주 됩니다. 따라서, 애플 리 케이 션의 개인 정보 보호 정책 뿐만 아니라 강력 하 게 고려해 야 장치 운영 체제는 이렇게 이미 하지 않는 경우 응용 프로그램 액세스 또는 연락처 데이터를 사용 하기 전에 그냥--시간 통지를 제공 합니다. 그 통지는 (예를 들어, **확인** 및 **아니오** 선택 제시) 하 여 사용자의 허가 취득 뿐만 아니라, 위에서 언급 된 동일한 정보를 제공 해야 합니다. Note 일부 애플 리 케이 션 장 터 그냥--시간 공지 및 연락처 데이터에 액세스 하기 전에 사용자의 허가 받아야 응용 프로그램에 필요할 수 있습니다. 연락처 데이터는 사용자의 혼동을 방지할 수의 사용 및 연락처 데이터의 인식된 오용 명확 하 고 이해 하기 쉬운 사용자 경험. 자세한 내용은 개인 정보 보호 가이드를 참조 하십시오.
35
+
36
+## 설치
37
+
38
+코르도바 5.0 + (현재 안정적인 v1.0.0) 필요
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+코르도바의 이전 버전 **사용** id (오래 된 v0.2.16)를 통해 설치할 수 있습니다.
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+그것은 또한 배상 계약 url을 통해 직접 설치할 수 (불안정)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### 파이어 폭스 OS 단점
54
+
55
+[참고 문서](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)을 적용 합니다. 다른 방법으로 응용 프로그램을 초기화 합니다.
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### 윈도우 특수
67
+
68
+**이전에 창 10:** `찾기` 및 `pickContact` 메서드에서 반환 하는 모든 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다. `찾을` 방법은 Windows Phone 8.1 장치에만 사용할 수 있습니다.
69
+
70
+**윈도우 10 이상:** 연락처 저장 되 고 응용 프로그램 로컬 연락처 저장소에 저장 됩니다. 연락처도 삭제 될 수 있습니다.
71
+
72
+### 윈도우 8 단점
73
+
74
+윈도우 8 연락처는 읽기 전용입니다. 코르 도우 바 API 연락처를 통해 하지 쿼리/검색할 수 있습니다, 사용자 알려 '사람' 애플 리 케이 션을 열 것 이다 contacts.pickContact에 대 한 호출으로 연락처를 선택 하 여 사용자 연락처를 선택 해야 합니다. 반환 된 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다.
75
+
76
+## navigator.contacts
77
+
78
+### 메서드
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### 개체
85
+
86
+  * 연락처
87
+  * 담당자 이름
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+`navigator.contacts.create` 메서드는 동기적 및 새 `연락처` 개체를 반환 합니다.
98
+
99
+이 메서드는 `Contact.save` 메서드를 호출 해야 장치 연락처 데이터베이스에 연락처 개체를 유지 하지 않습니다.
100
+
101
+### 지원 되는 플랫폼
102
+
103
+  * 안 드 로이드
104
+  * 블랙베리 10
105
+  * Firefox 운영 체제
106
+  * iOS
107
+  * Windows Phone 7과 8
108
+
109
+### 예를 들어
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+장치 연락처 데이터베이스 쿼리 및 `Contact` 개체의 배열을 반환 `navigator.contacts.find` 메서드를 비동기적으로 실행 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
117
+
118
+**contactFields** 매개 변수는 검색 한정자로 사용할 필드를 지정 합니다. 길이가 0 인 **contactFields** 매개 변수가 유효 하 고 `ContactError.INVALID_ARGUMENT_ERROR`에서 결과. **contactFields** 값 `"*"` 모든 연락처 필드를 검색 합니다.
119
+
120
+**contactFindOptions.filter** 문자열 연락처 데이터베이스를 쿼리할 때 검색 필터로 사용할 수 있습니다. 제공 된, 대/소문자, 부분 값 일치 **contactFields** 매개 변수에 지정 된 각 필드에 적용 됩니다. *모든* 지정 된 필드의 일치 하는 경우 연락처 반환 됩니다. 사용 하 여 **contactFindOptions.desiredFields** 매개 변수 속성 문의 제어를 다시 반환 해야 합니다.
121
+
122
+### 매개 변수
123
+
124
+  * **contactFields**: 검색 한정자로 사용 하는 필드에 문의. *(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: 연락처 개체의 배열에 표시 되는 성공 콜백 함수는 데이터베이스에서 반환 된. [Required]
127
+
128
+  * **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
129
+
130
+  * **contactFindOptions**: navigator.contacts 필터링 옵션을 검색 합니다. [Optional]
131
+    
132
+    키 다음과 같습니다.
133
+    
134
+      * **filter**: 검색 문자열 navigator.contacts를 찾는 데 사용 합니다. *(DOMString)* (기본: `""`)
135
+    
136
+      * **multiple**: 여러 navigator.contacts 찾기 작업을 반환 합니다 경우 결정 합니다. *(부울)* (기본값: `false`)
137
+        
138
+          * **desiredFields**: 연락처 필드를 다시 반환 합니다. 지정 된 경우 결과 `Contact` 기능 값만이 필드 개체입니다. *(DOMString[])* [Optional]
139
+
140
+### 지원 되는 플랫폼
141
+
142
+  * 안 드 로이드
143
+  * 블랙베리 10
144
+  * Firefox 운영 체제
145
+  * iOS
146
+  * Windows Phone 7과 8
147
+  * 윈도 (Windows Phone 8.1, 윈도 10)
148
+
149
+### 예를 들어
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### 윈도우 특수
169
+
170
+  * `__contactFields__`지원 되지 않으며 무시 됩니다. `find`메서드가 항상 이름, 이메일 주소 또는 연락처의 전화 번호를 일치 하도록 시도 합니다.
171
+
172
+## navigator.contacts.pickContact
173
+
174
+`navigator.contacts.pickContact` 메서드를 사용 하면 단일 연락처 선택 문의 선택 시작 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
175
+
176
+### 매개 변수
177
+
178
+  * **contactSuccess**: 단일 연락처 개체와 호출 되는 성공 콜백 함수. [필수]
179
+
180
+  * **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
181
+
182
+### 지원 되는 플랫폼
183
+
184
+  * 안 드 로이드
185
+  * iOS
186
+  * Windows Phone 8
187
+  * 윈도우 8
188
+  * 윈도우
189
+
190
+### 예를 들어
191
+
192
+    navigator.contacts.pickContact(function(contact){
193
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
194
+        },function(err){
195
+            console.log('Error: ' + err);
196
+        });
197
+    
198
+
199
+## 연락처
200
+
201
+`Contact` 개체는 사용자의 연락처를 나타냅니다. 연락처 생성 수, 저장 또는 장치 연락처 데이터베이스에서 제거 합니다. 연락처도 검색할 수 있습니다 (개별적으로 또는 일괄적으로) 데이터베이스에서 `navigator.contacts.find` 메서드를 호출 하 여.
202
+
203
+**참고**: 모든 연락처 필드 위에 나열 된 모든 장치 플랫폼에서 지원 됩니다. 자세한 내용은 각 플랫폼의 *단점이* 섹션을 확인 하시기 바랍니다.
204
+
205
+### 속성
206
+
207
+  * **id**: 글로벌 고유 식별자. *(DOMString)*
208
+
209
+  * **displayName**: 최종 사용자에 게 표시에 적합이 연락처의 이름. *(DOMString)*
210
+
211
+  * **이름**: 사람 이름의 모든 구성 요소를 포함 하는 개체. *(담당자 이름)*
212
+
213
+  * **별명**: 캐주얼 이름 연락처 주소입니다. *(DOMString)*
214
+
215
+  * **phoneNumbers**: 모든 연락처의 전화 번호의 배열. *(ContactField[])*
216
+
217
+  * **이메일**: 모든 연락처의 전자 메일 주소의 배열. *(ContactField[])*
218
+
219
+  * **주소**: 모든 연락처의 주소 배열. *(ContactAddress[])*
220
+
221
+  * **ims**: 모든 연락처의 IM 주소 배열. *(ContactField[])*
222
+
223
+  * **조직**: 다양 한 모든 연락처의 조직. *(ContactOrganization[])*
224
+
225
+  * **생일**: 연락처의 생일. *(날짜)*
226
+
227
+  * **참고**: 연락처에 대 한 참고. *(DOMString)*
228
+
229
+  * **사진**: 연락처의 사진을 배열. *(ContactField[])*
230
+
231
+  * **카테고리**: 모든 사용자 정의 범주 연락처에 연결 된 배열. *(ContactField[])*
232
+
233
+  * **url**: 연락처에 연결 된 웹 페이지의 배열. *(ContactField[])*
234
+
235
+### 메서드
236
+
237
+  * **복제**: 새로운 반환 합니다 `Contact` 으로 호출 하는 개체의 전체 복사본은 개체는 `id` 속성으로 설정`null`.
238
+
239
+  * **제거**: 장치 연락처 데이터베이스에서 연락처를 제거 합니다, 그렇지 않으면와 오류 콜백을 실행 한 `ContactError` 개체.
240
+
241
+  * **저장**: 장치 연락처 데이터베이스를 새 연락처를 저장 또는 동일한 **id** 를 가진 연락처가 이미 있는 경우 기존 연락처를 업데이트 합니다.
242
+
243
+### 지원 되는 플랫폼
244
+
245
+  * 아마존 화재 운영 체제
246
+  * 안 드 로이드
247
+  * 블랙베리 10
248
+  * Firefox 운영 체제
249
+  * iOS
250
+  * Windows Phone 7과 8
251
+  * 윈도우 8
252
+  * 윈도우
253
+
254
+### 예를 들어 저장
255
+
256
+    function onSuccess(contact) {
257
+        alert("Save Success");
258
+    };
259
+    
260
+    function onError(contactError) {
261
+        alert("Error = " + contactError.code);
262
+    };
263
+    
264
+    // create a new contact object
265
+    var contact = navigator.contacts.create();
266
+    contact.displayName = "Plumber";
267
+    contact.nickname = "Plumber";            // specify both to support all devices
268
+    
269
+    // populate some fields
270
+    var name = new ContactName();
271
+    name.givenName = "Jane";
272
+    name.familyName = "Doe";
273
+    contact.name = name;
274
+    
275
+    // save to device
276
+    contact.save(onSuccess,onError);
277
+    
278
+
279
+### 복제 예제
280
+
281
+        // clone the contact object
282
+        var clone = contact.clone();
283
+        clone.name.givenName = "John";
284
+        console.log("Original contact name = " + contact.name.givenName);
285
+        console.log("Cloned contact name = " + clone.name.givenName);
286
+    
287
+
288
+### 예제 제거
289
+
290
+    function onSuccess() {
291
+        alert("Removal Success");
292
+    };
293
+    
294
+    function onError(contactError) {
295
+        alert("Error = " + contactError.code);
296
+    };
297
+    
298
+    // remove the contact from the device
299
+    contact.remove(onSuccess,onError);
300
+    
301
+
302
+### 안 드 로이드 2.X 단점
303
+
304
+  * **카테고리**: 안 드 로이드 2.X 장치, 반환에서 지원 되지 않습니다`null`.
305
+
306
+### 블랙베리 10 단점
307
+
308
+  * **id**: 연락처를 저장 하면 장치에 할당 합니다.
309
+
310
+### FirefoxOS 특수
311
+
312
+  * **카테고리**: 부분적으로 지원 합니다. 필드 **pref** 및 **형식** 반환`null`
313
+
314
+  * **ims**: 지원 되지 않음
315
+
316
+  * **사진**: 지원 되지 않음
317
+
318
+### iOS 단점
319
+
320
+  * **displayName**: 반환 iOS에서 지원 되지 않는 `null` 가 아무 `ContactName` 지정 된,이 경우 복합 이름, **닉네임** 을 반환 합니다 또는 `""` , 각각.
321
+
322
+  * **생일**: 자바 스크립트로 입력 해야 합니다 `Date` 개체를 같은 방식으로 반환 됩니다.
323
+
324
+  * **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다. 응용 프로그램이 종료 될 때 임시 디렉터리의 내용은 제거 됩니다.
325
+
326
+  * **카테고리**:이 속성은 현재 지원 되지 않습니다, 반환`null`.
327
+
328
+### Windows Phone 7, 8 특수
329
+
330
+  * **displayName**: 연락처를 만들 때 표시 이름에서 표시 이름 매개 변수 다릅니다 제공 값 검색 연락처를 찾을 때.
331
+
332
+  * **url**: 연락처를 만들 때 사용자가 입력을 하나 이상의 웹 주소를 저장 하지만 하나만 사용할 수 있는 연락처를 검색할 때.
333
+
334
+  * **phoneNumbers**: *pref* 옵션이 지원 되지 않습니다. *형식* *찾기* 작업에서 지원 되지 않습니다. 단 하나 `phoneNumber` 각 *형식* 에 대 한 허용.
335
+
336
+  * **이메일**: *pref* 옵션이 지원 되지 않습니다. 가정 및 개인 동일한 이메일 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
337
+
338
+  * **주소**: 직장, 및 가정/개인 *유형*을 지원 합니다. 가정 및 개인 *유형* 동일한 주소 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
339
+
340
+  * **조직**: 하나만 허용 되 고 *pref*, *유형*및 *부서* 특성을 지원 하지 않습니다.
341
+
342
+  * **참고**: 지원 되지 않는 반환`null`.
343
+
344
+  * **ims**: 지원 되지 않는 반환`null`.
345
+
346
+  * **생일**: 지원 되지 않는 반환`null`.
347
+
348
+  * **카테고리**: 지원 되지 않는 반환`null`.
349
+
350
+  * **제거**: 메서드가 지원 되지 않습니다
351
+
352
+### 윈도우 특수
353
+
354
+  * **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다.
355
+
356
+  * **생일**: 지원 되지 않는 반환`null`.
357
+
358
+  * **카테고리**: 지원 되지 않는 반환`null`.
359
+
360
+  * **제거**: 메서드는 Windows 10 이상 에서만 지원 됩니다.
361
+
362
+## ContactAddress
363
+
364
+`ContactAddress` 개체는 연락처의 단일 주소 속성을 저장합니다. `연락처` 개체는 `ContactAddress` 배열에 있는 하나 이상의 주소를 포함할 수 있습니다.
365
+
366
+### 속성
367
+
368
+  * **pref**: 설정 `true` 이 경우 `ContactAddress` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
369
+
370
+  * **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열. *(DOMString)*
371
+
372
+  * **포맷**: 전체 주소 표시를 위해 서식이 지정 된. *(DOMString)*
373
+
374
+  * **streetAddress**: 전체 주소. *(DOMString)*
375
+
376
+  * **지역**: 구, 군 또는 도시. *(DOMString)*
377
+
378
+  * **지역**: 상태 또는 지역. *(DOMString)*
379
+
380
+  * **postalCode**: 우편 번호 또는 우편 번호. *(DOMString)*
381
+
382
+  * **국가**: 국가 이름. *(DOMString)*
383
+
384
+### 지원 되는 플랫폼
385
+
386
+  * 아마존 화재 운영 체제
387
+  * 안 드 로이드
388
+  * 블랙베리 10
389
+  * Firefox 운영 체제
390
+  * iOS
391
+  * Windows Phone 7과 8
392
+  * 윈도우 8
393
+  * 윈도우
394
+
395
+### 예를 들어
396
+
397
+    // display the address information for all contacts
398
+    
399
+    function onSuccess(contacts) {
400
+        for (var i = 0; i < contacts.length; i++) {
401
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
402
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
403
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
404
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
405
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
406
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
407
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
408
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
409
+                    "Country: "        + contacts[i].addresses[j].country);
410
+            }
411
+        }
412
+    };
413
+    
414
+    function onError(contactError) {
415
+        alert('onError!');
416
+    };
417
+    
418
+    // find all contacts
419
+    var options = new ContactFindOptions();
420
+    options.filter = "";
421
+    var filter = ["displayName", "addresses"];
422
+    navigator.contacts.find(filter, onSuccess, onError, options);
423
+    
424
+
425
+### 안 드 로이드 2.X 단점
426
+
427
+  * **pref**: 지원 되지 않는 반환 `false` 안 드 로이드 2.X 장치에.
428
+
429
+### 블랙베리 10 단점
430
+
431
+  * **pref**: 반환 BlackBerry 장치에서 지원 되지 않습니다`false`.
432
+
433
+  * **유형**: 부분적으로 지원 합니다. *작업* 및 *홈* 형식 주소 각 단 하나 접촉 당 저장할 수 있습니다.
434
+
435
+  * **포맷**: 부분적으로 지원 합니다. 모든 검은 딸기 주소 필드의 연결을 반환합니다.
436
+
437
+  * **streetAddress**: 지원. 블랙베리 **address1** **주소 2** 의 연결 주소 필드를 반환합니다.
438
+
439
+  * **지역**: 지원. 블랙베리 **시** 주소 필드에 저장 합니다.
440
+
441
+  * **지역**: 지원. 블랙베리 **stateProvince** 주소 필드에 저장 합니다.
442
+
443
+  * **postalCode**: 지원. 블랙베리 **zipPostal** 주소 필드에 저장 합니다.
444
+
445
+  * **국가**: 지원.
446
+
447
+### FirefoxOS 특수
448
+
449
+  * **포맷**: 현재 지원 되지 않습니다
450
+
451
+### iOS 단점
452
+
453
+  * **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
454
+
455
+  * **포맷**: 현재 지원 되지 않습니다.
456
+
457
+### 윈도우 8 단점
458
+
459
+  * **pref**: 지원 되지 않음
460
+
461
+### 윈도우 특수
462
+
463
+  * **pref**: 지원 되지 않음
464
+
465
+## ContactError
466
+
467
+`ContactError` 개체는 오류가 발생 하면 `contactError` 콜백 함수를 통해 사용자에 게 반환 됩니다.
468
+
469
+### 속성
470
+
471
+  * **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
472
+
473
+### 상수
474
+
475
+  * `ContactError.UNKNOWN_ERROR` (code 0)
476
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
477
+  * `ContactError.TIMEOUT_ERROR` (code 2)
478
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
479
+  * `ContactError.IO_ERROR` (code 4)
480
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
481
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
482
+
483
+## ContactField
484
+
485
+`ContactField` 개체는 재사용 가능한 구성 요소를 나타내는 필드를 일반적으로 문의입니다. 각 `ContactField` 개체에는 `value`, `type` 및 `pref` 속성을 포함 되어 있습니다. `Contact` 개체는 전화 번호 및 이메일 주소와 같은 `ContactField` 배열에서 몇 가지 속성을 저장합니다.
486
+
487
+대부분의 경우에서는 `ContactField` 개체의 **type** 속성에 대 한 미리 정해진된 값이 없습니다. 예를 들어 전화 번호 *홈*, *작품*, *모바일*, *아이폰* 또는 특정 장치 플랫폼의 연락처 데이터베이스에서 지원 되는 다른 값의 **유형** 값을 지정할 수 있습니다. 그러나, `연락처` **사진** 필드 **유형** 필드 나타냅니다 반환 된 이미지 형식: **url** **값** 특성 **값** 이미지 base64 인코딩된 문자열을 포함 하는 경우 사진 이미지 또는 *base64* URL이 포함 된 경우.
488
+
489
+### 속성
490
+
491
+  * **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. *(DOMString)*
492
+
493
+  * **값**: 전화 번호 또는 이메일 주소와 같은 필드 값. *(DOMString)*
494
+
495
+  * **pref**: 설정 `true` 이 경우 `ContactField` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
496
+
497
+### 지원 되는 플랫폼
498
+
499
+  * 아마존 화재 운영 체제
500
+  * 안 드 로이드
501
+  * 블랙베리 10
502
+  * Firefox 운영 체제
503
+  * iOS
504
+  * Windows Phone 7과 8
505
+  * 윈도우 8
506
+  * 윈도우
507
+
508
+### 예를 들어
509
+
510
+        // create a new contact
511
+        var contact = navigator.contacts.create();
512
+    
513
+        // store contact phone numbers in ContactField[]
514
+        var phoneNumbers = [];
515
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
516
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
517
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
518
+        contact.phoneNumbers = phoneNumbers;
519
+    
520
+        // save the contact
521
+        contact.save();
522
+    
523
+
524
+### 안 드 로이드 단점
525
+
526
+  * **pref**: 지원 되지 않는 반환`false`.
527
+
528
+### 블랙베리 10 단점
529
+
530
+  * **유형**: 부분적으로 지원 합니다. 전화 번호에 대 한 사용.
531
+
532
+  * **값**: 지원.
533
+
534
+  * **pref**: 지원 되지 않는 반환`false`.
535
+
536
+### iOS 단점
537
+
538
+  * **pref**: 지원 되지 않는 반환`false`.
539
+
540
+### Windows8 단점
541
+
542
+  * **pref**: 지원 되지 않는 반환`false`.
543
+
544
+### 윈도우 특수
545
+
546
+  * **pref**: 지원 되지 않는 반환`false`.
547
+
548
+## 담당자 이름
549
+
550
+여러 종류의 `Contact` 개체의 이름에 대 한 정보를 포함합니다.
551
+
552
+### 속성
553
+
554
+  * **포맷**: 연락처의 전체 이름. *(DOMString)*
555
+
556
+  * **familyName**: 연락처의 성. *(DOMString)*
557
+
558
+  * **givenName**: 연락처의 이름. *(DOMString)*
559
+
560
+  * **middleName**: 연락처의 중간 이름을. *(DOMString)*
561
+
562
+  * **honorificPrefix**: 연락처의 접두사 (예: *미스터* 또는 *닥터*) *(DOMString)*
563
+
564
+  * **honorificSuffix**: 연락처의 접미사 ( *esq.*예). *(DOMString)*
565
+
566
+### 지원 되는 플랫폼
567
+
568
+  * 아마존 화재 운영 체제
569
+  * 안 드 로이드
570
+  * 블랙베리 10
571
+  * Firefox 운영 체제
572
+  * iOS
573
+  * Windows Phone 7과 8
574
+  * 윈도우 8
575
+  * 윈도우
576
+
577
+### 예를 들어
578
+
579
+    function onSuccess(contacts) {
580
+        for (var i = 0; i < contacts.length; i++) {
581
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
582
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
583
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
584
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
585
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
586
+                "Prefix: "       + contacts[i].name.honorificSuffix);
587
+        }
588
+    };
589
+    
590
+    function onError(contactError) {
591
+        alert('onError!');
592
+    };
593
+    
594
+    var options = new ContactFindOptions();
595
+    options.filter = "";
596
+    filter = ["displayName", "name"];
597
+    navigator.contacts.find(filter, onSuccess, onError, options);
598
+    
599
+
600
+### 안 드 로이드 단점
601
+
602
+  * **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
603
+
604
+### 블랙베리 10 단점
605
+
606
+  * **포맷**: 부분적으로 지원 합니다. 블랙베리 **firstName** 및 **lastName** 필드의 연결을 반환합니다.
607
+
608
+  * **familyName**: 지원. 블랙베리 **lastName** 필드에 저장 합니다.
609
+
610
+  * **givenName**: 지원. 블랙베리 **firstName** 필드에 저장 합니다.
611
+
612
+  * **middleName**: 지원 되지 않는 반환`null`.
613
+
614
+  * **honorificPrefix**: 지원 되지 않는 반환`null`.
615
+
616
+  * **honorificSuffix**: 지원 되지 않는 반환`null`.
617
+
618
+### FirefoxOS 특수
619
+
620
+  * **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
621
+
622
+### iOS 단점
623
+
624
+  * **포맷**: 부분적으로 지원 합니다. IOS 복합 이름 반환 하지만 읽기 전용입니다.
625
+
626
+### 윈도우 8 단점
627
+
628
+  * **형식**: 이것은 유일한 속성 이름과 동일 하다 `displayName` , 및`nickname`
629
+
630
+  * **familyName**: 지원 되지 않음
631
+
632
+  * **givenName**: 지원 되지 않음
633
+
634
+  * **middleName**: 지원 되지 않음
635
+
636
+  * **honorificPrefix**: 지원 되지 않음
637
+
638
+  * **honorificSuffix**: 지원 되지 않음
639
+
640
+### 윈도우 특수
641
+
642
+  * **형식**: 그것은 동일`displayName`
643
+
644
+## ContactOrganization
645
+
646
+`ContactOrganization` 개체는 연락처의 조직 속성을 저장합니다. `Contact` 개체 배열에 하나 이상의 `ContactOrganization` 개체를 저장합니다.
647
+
648
+### 속성
649
+
650
+  * **pref**: 설정 `true` 이 경우 `ContactOrganization` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
651
+
652
+  * **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. _(DOMString)
653
+
654
+  * **이름**: 조직 이름. *(DOMString)*
655
+
656
+  * **부서**: 계약을 위해 일 하는 부서. *(DOMString)*
657
+
658
+  * **제목**: 조직에서 연락처의 제목. *(DOMString)*
659
+
660
+### 지원 되는 플랫폼
661
+
662
+  * 안 드 로이드
663
+  * 블랙베리 10
664
+  * Firefox 운영 체제
665
+  * iOS
666
+  * Windows Phone 7과 8
667
+  * 윈도우 (Windows 8.1와 Windows Phone 8.1 소자만 해당)
668
+
669
+### 예를 들어
670
+
671
+    function onSuccess(contacts) {
672
+        for (var i = 0; i < contacts.length; i++) {
673
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
674
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
675
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
676
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
677
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
678
+                    "Title: "       + contacts[i].organizations[j].title);
679
+            }
680
+        }
681
+    };
682
+    
683
+    function onError(contactError) {
684
+        alert('onError!');
685
+    };
686
+    
687
+    var options = new ContactFindOptions();
688
+    options.filter = "";
689
+    filter = ["displayName", "organizations"];
690
+    navigator.contacts.find(filter, onSuccess, onError, options);
691
+    
692
+
693
+### 안 드 로이드 2.X 단점
694
+
695
+  * **pref**: 반환 안 드 로이드 2.X 장치에 의해 지원 되지 않습니다`false`.
696
+
697
+### 블랙베리 10 단점
698
+
699
+  * **pref**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`false`.
700
+
701
+  * **유형**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`null`.
702
+
703
+  * **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름 블랙베리 **회사** 필드에 저장 됩니다.
704
+
705
+  * **부서**: 지원 되지 않는 반환`null`.
706
+
707
+  * **제목**: 부분적으로 지원 합니다. 첫 번째 조직 제목 블랙베리 **jobTitle** 필드에 저장 됩니다.
708
+
709
+### 파이어 폭스 OS 단점
710
+
711
+  * **pref**: 지원 되지 않음
712
+
713
+  * **형식**: 지원 되지 않음
714
+
715
+  * **부서**: 지원 되지 않음
716
+
717
+  * 필드 **이름** 및 **제목** **org** 및 **jobTitle** 에 저장.
718
+
719
+### iOS 단점
720
+
721
+  * **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
722
+
723
+  * **유형**: 반환 하는 iOS 장치에서 지원 되지 않습니다`null`.
724
+
725
+  * **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름은 iOS **kABPersonOrganizationProperty** 필드에 저장 됩니다.
726
+
727
+  * **부서**: 부분적으로 지원 합니다. 첫 번째 부서 이름은 iOS **kABPersonDepartmentProperty** 필드에 저장 됩니다.
728
+
729
+  * **제목**: 부분적으로 지원 합니다. 첫 번째 타이틀 iOS **kABPersonJobTitleProperty** 필드에 저장 됩니다.
730
+
731
+### 윈도우 특수
732
+
733
+  * **pref**: 지원 되지 않는 반환`false`.
734
+
735
+  * **형식**: 지원 되지 않는 반환`null`.

+ 719
- 0
km0App/node_modules/cordova-plugin-contacts/doc/ko/index.md Parādīt failu

@@ -0,0 +1,719 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+이 플러그인 장치 연락처 데이터베이스에 대 한 액세스를 제공 하는 글로벌 `navigator.contacts` 개체를 정의 합니다.
23
+
24
+개체 `navigator` 글로벌 범위 첨부 아니에요 때까지 사용할 수 있는 `deviceready` 이벤트 후.
25
+
26
+    document.addEventListener("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {
28
+        console.log(navigator.contacts);
29
+    }
30
+    
31
+
32
+**경고**: 중요 한 개인 정보 보호 문제를 제기 하는 연락처 데이터의 수집 및 사용 합니다. 응용 프로그램의 개인 정보 보호 정책 응용 프로그램 연락처 데이터를 사용 하는 방법 및 다른 당사자와 함께 공유 하는 여부를 토론 해야 한다. 연락처 정보 누구와 통신 하는 사람이 사람들 보여 때문에 민감한으로 간주 됩니다. 따라서, 애플 리 케이 션의 개인 정보 보호 정책 뿐만 아니라 강력 하 게 고려해 야 장치 운영 체제는 이렇게 이미 하지 않는 경우 응용 프로그램 액세스 또는 연락처 데이터를 사용 하기 전에 그냥--시간 통지를 제공 합니다. 그 통지는 (예를 들어, **확인** 및 **아니오** 선택 제시) 하 여 사용자의 허가 취득 뿐만 아니라, 위에서 언급 된 동일한 정보를 제공 해야 합니다. Note 일부 애플 리 케이 션 장 터 그냥--시간 공지 및 연락처 데이터에 액세스 하기 전에 사용자의 허가 받아야 응용 프로그램에 필요할 수 있습니다. 연락처 데이터는 사용자의 혼동을 방지할 수의 사용 및 연락처 데이터의 인식된 오용 명확 하 고 이해 하기 쉬운 사용자 경험. 자세한 내용은 개인 정보 보호 가이드를 참조 하십시오.
33
+
34
+## 설치
35
+
36
+    cordova plugin add cordova-plugin-contacts
37
+    
38
+
39
+### 파이어 폭스 OS 단점
40
+
41
+[참고 문서][1]에 설명 된 대로 **www/manifest.webapp**를 만듭니다. 관련 부여할 추가 합니다. [참고 문서][2]에 "privileged"-webapp 유형을 변경 하려면 필요가 하다. **경고**: 모든 훌륭한 애플 리 케이 션 인라인 스크립트를 금지 하는 [콘텐츠 보안 정책][3]을 적용 합니다. 다른 방법으로 응용 프로그램을 초기화 합니다.
42
+
43
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
44
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
45
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
46
+
47
+    "type": "privileged",
48
+    "permissions": {
49
+        "contacts": {
50
+            "access": "readwrite",
51
+            "description": "Describe why there is a need for such permission"
52
+        }
53
+    }
54
+    
55
+
56
+### 윈도우 특수
57
+
58
+`find` 및 `pickContact` 메서드에서 반환 하는 모든 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다. `찾을` 방법은 Windows Phone 8.1 장치에만 사용할 수 있습니다.
59
+
60
+### 윈도우 8 단점
61
+
62
+윈도우 8 연락처는 읽기 전용입니다. 코르 도우 바 API 연락처를 통해 하지 쿼리/검색할 수 있습니다, 사용자 알려 '사람' 애플 리 케이 션을 열 것 이다 contacts.pickContact에 대 한 호출으로 연락처를 선택 하 여 사용자 연락처를 선택 해야 합니다. 반환 된 연락처는 읽기 전용 응용 프로그램을 수정할 수 없습니다.
63
+
64
+## navigator.contacts
65
+
66
+### 메서드
67
+
68
+*   navigator.contacts.create
69
+*   navigator.contacts.find
70
+*   navigator.contacts.pickContact
71
+
72
+### 개체
73
+
74
+*   연락처
75
+*   담당자 이름
76
+*   ContactField
77
+*   ContactAddress
78
+*   ContactOrganization
79
+*   ContactFindOptions
80
+*   ContactError
81
+*   ContactFieldType
82
+
83
+## navigator.contacts.create
84
+
85
+`navigator.contacts.create` 메서드는 동기적 및 새 `연락처` 개체를 반환 합니다.
86
+
87
+이 메서드는 `Contact.save` 메서드를 호출 해야 장치 연락처 데이터베이스에 연락처 개체를 유지 하지 않습니다.
88
+
89
+### 지원 되는 플랫폼
90
+
91
+*   안 드 로이드
92
+*   블랙베리 10
93
+*   Firefox 운영 체제
94
+*   iOS
95
+*   Windows Phone 7과 8
96
+
97
+### 예를 들어
98
+
99
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
100
+    
101
+
102
+## navigator.contacts.find
103
+
104
+장치 연락처 데이터베이스 쿼리 및 `Contact` 개체의 배열을 반환 `navigator.contacts.find` 메서드를 비동기적으로 실행 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
105
+
106
+**contactFields** 매개 변수는 검색 한정자로 사용할 필드를 지정 합니다. 길이가 0 인 **contactFields** 매개 변수가 유효 하 고 `ContactError.INVALID_ARGUMENT_ERROR`에서 결과. **contactFields** 값 `"*"` 모든 연락처 필드를 검색 합니다.
107
+
108
+**contactFindOptions.filter** 문자열 연락처 데이터베이스를 쿼리할 때 검색 필터로 사용할 수 있습니다. 제공 된, 대/소문자, 부분 값 일치 **contactFields** 매개 변수에 지정 된 각 필드에 적용 됩니다. *모든* 지정 된 필드의 일치 하는 경우 연락처 반환 됩니다. 사용 하 여 **contactFindOptions.desiredFields** 매개 변수 속성 문의 제어를 다시 반환 해야 합니다.
109
+
110
+### 매개 변수
111
+
112
+*   **contactFields**: 검색 한정자로 사용 하는 필드에 문의. *(DOMString[])* [Required]
113
+
114
+*   **contactSuccess**: 연락처 개체의 배열에 표시 되는 성공 콜백 함수는 데이터베이스에서 반환 된. [Required]
115
+
116
+*   **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
117
+
118
+*   **contactFindOptions**: navigator.contacts 필터링 옵션을 검색 합니다. [Optional]
119
+    
120
+    키 다음과 같습니다.
121
+    
122
+    *   **filter**: 검색 문자열 navigator.contacts를 찾는 데 사용 합니다. *(DOMString)* (기본: `""`)
123
+    
124
+    *   **multiple**: 여러 navigator.contacts 찾기 작업을 반환 합니다 경우 결정 합니다. *(부울)* (기본값: `false`)
125
+        
126
+        *   **desiredFields**: 연락처 필드를 다시 반환 합니다. 지정 된 경우 결과 `Contact` 기능 값만이 필드 개체입니다. *(DOMString[])* [Optional]
127
+
128
+### 지원 되는 플랫폼
129
+
130
+*   안 드 로이드
131
+*   블랙베리 10
132
+*   Firefox 운영 체제
133
+*   iOS
134
+*   Windows Phone 7과 8
135
+*   윈도우 (Windows Phone 8.1 소자만 해당)
136
+
137
+### 예를 들어
138
+
139
+    function onSuccess(contacts) {
140
+        alert('Found ' + contacts.length + ' contacts.');
141
+    };
142
+    
143
+    function onError(contactError) {
144
+        alert('onError!');
145
+    };
146
+    
147
+    // find all contacts with 'Bob' in any name field
148
+    var options      = new ContactFindOptions();
149
+    options.filter   = "Bob";
150
+    options.multiple = true;
151
+    options.desiredFields = [navigator.contacts.fieldType.id];
152
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
153
+    navigator.contacts.find(fields, onSuccess, onError, options);
154
+    
155
+
156
+### 윈도우 특수
157
+
158
+*   `__contactFields__`지원 되지 않으며 무시 됩니다. `find`메서드가 항상 이름, 이메일 주소 또는 연락처의 전화 번호를 일치 하도록 시도 합니다.
159
+
160
+## navigator.contacts.pickContact
161
+
162
+`navigator.contacts.pickContact` 메서드를 사용 하면 단일 연락처 선택 문의 선택 시작 합니다. 결과 개체는 **contactSuccess** 매개 변수에서 지정한 `contactSuccess` 콜백 함수에 전달 됩니다.
163
+
164
+### 매개 변수
165
+
166
+*   **contactSuccess**: 단일 연락처 개체와 호출 되는 성공 콜백 함수. [필수]
167
+
168
+*   **contactError**: 오류 콜백 함수에 오류가 발생할 때 호출 됩니다. [선택 사항]
169
+
170
+### 지원 되는 플랫폼
171
+
172
+*   안 드 로이드
173
+*   iOS
174
+*   Windows Phone 8
175
+*   윈도우 8
176
+*   윈도우
177
+
178
+### 예를 들어
179
+
180
+    navigator.contacts.pickContact(function(contact){
181
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
182
+        },function(err){
183
+            console.log('Error: ' + err);
184
+        });
185
+    
186
+
187
+## 연락처
188
+
189
+`Contact` 개체는 사용자의 연락처를 나타냅니다. 연락처 생성 수, 저장 또는 장치 연락처 데이터베이스에서 제거 합니다. 연락처도 검색할 수 있습니다 (개별적으로 또는 일괄적으로) 데이터베이스에서 `navigator.contacts.find` 메서드를 호출 하 여.
190
+
191
+**참고**: 모든 연락처 필드 위에 나열 된 모든 장치 플랫폼에서 지원 됩니다. 자세한 내용은 각 플랫폼의 *단점이* 섹션을 확인 하시기 바랍니다.
192
+
193
+### 속성
194
+
195
+*   **id**: 글로벌 고유 식별자. *(DOMString)*
196
+
197
+*   **displayName**: 최종 사용자에 게 표시에 적합이 연락처의 이름. *(DOMString)*
198
+
199
+*   **이름**: 사람 이름의 모든 구성 요소를 포함 하는 개체. *(담당자 이름)*
200
+
201
+*   **별명**: 캐주얼 이름 연락처 주소입니다. *(DOMString)*
202
+
203
+*   **phoneNumbers**: 모든 연락처의 전화 번호의 배열. *(ContactField[])*
204
+
205
+*   **이메일**: 모든 연락처의 전자 메일 주소의 배열. *(ContactField[])*
206
+
207
+*   **주소**: 모든 연락처의 주소 배열. *(ContactAddress[])*
208
+
209
+*   **ims**: 모든 연락처의 IM 주소 배열. *(ContactField[])*
210
+
211
+*   **조직**: 다양 한 모든 연락처의 조직. *(ContactOrganization[])*
212
+
213
+*   **생일**: 연락처의 생일. *(날짜)*
214
+
215
+*   **참고**: 연락처에 대 한 참고. *(DOMString)*
216
+
217
+*   **사진**: 연락처의 사진을 배열. *(ContactField[])*
218
+
219
+*   **카테고리**: 모든 사용자 정의 범주 연락처에 연결 된 배열. *(ContactField[])*
220
+
221
+*   **url**: 연락처에 연결 된 웹 페이지의 배열. *(ContactField[])*
222
+
223
+### 메서드
224
+
225
+*   **복제**: 새로운 반환 합니다 `Contact` 으로 호출 하는 개체의 전체 복사본은 개체는 `id` 속성으로 설정`null`.
226
+
227
+*   **제거**: 장치 연락처 데이터베이스에서 연락처를 제거 합니다, 그렇지 않으면와 오류 콜백을 실행 한 `ContactError` 개체.
228
+
229
+*   **저장**: 장치 연락처 데이터베이스를 새 연락처를 저장 또는 동일한 **id** 를 가진 연락처가 이미 있는 경우 기존 연락처를 업데이트 합니다.
230
+
231
+### 지원 되는 플랫폼
232
+
233
+*   아마존 화재 운영 체제
234
+*   안 드 로이드
235
+*   블랙베리 10
236
+*   Firefox 운영 체제
237
+*   iOS
238
+*   Windows Phone 7과 8
239
+*   윈도우 8
240
+*   윈도우
241
+
242
+### 예를 들어 저장
243
+
244
+    function onSuccess(contact) {
245
+        alert("Save Success");
246
+    };
247
+    
248
+    function onError(contactError) {
249
+        alert("Error = " + contactError.code);
250
+    };
251
+    
252
+    // create a new contact object
253
+    var contact = navigator.contacts.create();
254
+    contact.displayName = "Plumber";
255
+    contact.nickname = "Plumber";            // specify both to support all devices
256
+    
257
+    // populate some fields
258
+    var name = new ContactName();
259
+    name.givenName = "Jane";
260
+    name.familyName = "Doe";
261
+    contact.name = name;
262
+    
263
+    // save to device
264
+    contact.save(onSuccess,onError);
265
+    
266
+
267
+### 복제 예제
268
+
269
+        // clone the contact object
270
+        var clone = contact.clone();
271
+        clone.name.givenName = "John";
272
+        console.log("Original contact name = " + contact.name.givenName);
273
+        console.log("Cloned contact name = " + clone.name.givenName);
274
+    
275
+
276
+### 예제 제거
277
+
278
+    function onSuccess() {
279
+        alert("Removal Success");
280
+    };
281
+    
282
+    function onError(contactError) {
283
+        alert("Error = " + contactError.code);
284
+    };
285
+    
286
+    // remove the contact from the device
287
+    contact.remove(onSuccess,onError);
288
+    
289
+
290
+### 안 드 로이드 2.X 단점
291
+
292
+*   **카테고리**: 안 드 로이드 2.X 장치, 반환에서 지원 되지 않습니다`null`.
293
+
294
+### 블랙베리 10 단점
295
+
296
+*   **id**: 연락처를 저장 하면 장치에 할당 합니다.
297
+
298
+### FirefoxOS 특수
299
+
300
+*   **카테고리**: 부분적으로 지원 합니다. 필드 **pref** 및 **형식** 반환`null`
301
+
302
+*   **ims**: 지원 되지 않음
303
+
304
+*   **사진**: 지원 되지 않음
305
+
306
+### iOS 단점
307
+
308
+*   **displayName**: 반환 iOS에서 지원 되지 않는 `null` 가 아무 `ContactName` 지정 된,이 경우 복합 이름, **닉네임** 을 반환 합니다 또는 `""` , 각각.
309
+
310
+*   **생일**: 자바 스크립트로 입력 해야 합니다 `Date` 개체를 같은 방식으로 반환 됩니다.
311
+
312
+*   **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다. 응용 프로그램이 종료 될 때 임시 디렉터리의 내용은 제거 됩니다.
313
+
314
+*   **카테고리**:이 속성은 현재 지원 되지 않습니다, 반환`null`.
315
+
316
+### Windows Phone 7, 8 특수
317
+
318
+*   **displayName**: 연락처를 만들 때 표시 이름에서 표시 이름 매개 변수 다릅니다 제공 값 검색 연락처를 찾을 때.
319
+
320
+*   **url**: 연락처를 만들 때 사용자가 입력을 하나 이상의 웹 주소를 저장 하지만 하나만 사용할 수 있는 연락처를 검색할 때.
321
+
322
+*   **phoneNumbers**: *pref* 옵션이 지원 되지 않습니다. *형식* *찾기* 작업에서 지원 되지 않습니다. 단 하나 `phoneNumber` 각 *형식* 에 대 한 허용.
323
+
324
+*   **이메일**: *pref* 옵션이 지원 되지 않습니다. 가정 및 개인 동일한 이메일 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
325
+
326
+*   **주소**: 직장, 및 가정/개인 *유형*을 지원 합니다. 가정 및 개인 *유형* 동일한 주소 항목 참조. 각 *형식* 에 대 한 항목이 하나만 허용.
327
+
328
+*   **조직**: 하나만 허용 되 고 *pref*, *유형*및 *부서* 특성을 지원 하지 않습니다.
329
+
330
+*   **참고**: 지원 되지 않는 반환`null`.
331
+
332
+*   **ims**: 지원 되지 않는 반환`null`.
333
+
334
+*   **생일**: 지원 되지 않는 반환`null`.
335
+
336
+*   **카테고리**: 지원 되지 않는 반환`null`.
337
+
338
+### 윈도우 특수
339
+
340
+*   **사진**: 응용 프로그램의 임시 디렉터리에 저장 된 이미지 파일 URL을 반환 합니다.
341
+
342
+*   **생일**: 지원 되지 않는 반환`null`.
343
+
344
+*   **카테고리**: 지원 되지 않는 반환`null`.
345
+
346
+## ContactAddress
347
+
348
+`ContactAddress` 개체는 연락처의 단일 주소 속성을 저장합니다. `연락처` 개체는 `ContactAddress` 배열에 있는 하나 이상의 주소를 포함할 수 있습니다.
349
+
350
+### 속성
351
+
352
+*   **pref**: 설정 `true` 이 경우 `ContactAddress` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
353
+
354
+*   **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열. *(DOMString)*
355
+
356
+*   **포맷**: 전체 주소 표시를 위해 서식이 지정 된. *(DOMString)*
357
+
358
+*   **streetAddress**: 전체 주소. *(DOMString)*
359
+
360
+*   **지역**: 구, 군 또는 도시. *(DOMString)*
361
+
362
+*   **지역**: 상태 또는 지역. *(DOMString)*
363
+
364
+*   **postalCode**: 우편 번호 또는 우편 번호. *(DOMString)*
365
+
366
+*   **국가**: 국가 이름. *(DOMString)*
367
+
368
+### 지원 되는 플랫폼
369
+
370
+*   아마존 화재 운영 체제
371
+*   안 드 로이드
372
+*   블랙베리 10
373
+*   Firefox 운영 체제
374
+*   iOS
375
+*   Windows Phone 7과 8
376
+*   윈도우 8
377
+*   윈도우
378
+
379
+### 예를 들어
380
+
381
+    // display the address information for all contacts
382
+    
383
+    function onSuccess(contacts) {
384
+        for (var i = 0; i < contacts.length; i++) {
385
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
386
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
387
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
388
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
389
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
390
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
391
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
392
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
393
+                    "Country: "        + contacts[i].addresses[j].country);
394
+            }
395
+        }
396
+    };
397
+    
398
+    function onError(contactError) {
399
+        alert('onError!');
400
+    };
401
+    
402
+    // find all contacts
403
+    var options = new ContactFindOptions();
404
+    options.filter = "";
405
+    var filter = ["displayName", "addresses"];
406
+    navigator.contacts.find(filter, onSuccess, onError, options);
407
+    
408
+
409
+### 안 드 로이드 2.X 단점
410
+
411
+*   **pref**: 지원 되지 않는 반환 `false` 안 드 로이드 2.X 장치에.
412
+
413
+### 블랙베리 10 단점
414
+
415
+*   **pref**: 반환 BlackBerry 장치에서 지원 되지 않습니다`false`.
416
+
417
+*   **유형**: 부분적으로 지원 합니다. *작업* 및 *홈* 형식 주소 각 단 하나 접촉 당 저장할 수 있습니다.
418
+
419
+*   **포맷**: 부분적으로 지원 합니다. 모든 검은 딸기 주소 필드의 연결을 반환합니다.
420
+
421
+*   **streetAddress**: 지원. 블랙베리 **address1** **주소 2** 의 연결 주소 필드를 반환합니다.
422
+
423
+*   **지역**: 지원. 블랙베리 **시** 주소 필드에 저장 합니다.
424
+
425
+*   **지역**: 지원. 블랙베리 **stateProvince** 주소 필드에 저장 합니다.
426
+
427
+*   **postalCode**: 지원. 블랙베리 **zipPostal** 주소 필드에 저장 합니다.
428
+
429
+*   **국가**: 지원.
430
+
431
+### FirefoxOS 특수
432
+
433
+*   **포맷**: 현재 지원 되지 않습니다
434
+
435
+### iOS 단점
436
+
437
+*   **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
438
+
439
+*   **포맷**: 현재 지원 되지 않습니다.
440
+
441
+### 윈도우 8 단점
442
+
443
+*   **pref**: 지원 되지 않음
444
+
445
+### 윈도우 특수
446
+
447
+*   **pref**: 지원 되지 않음
448
+
449
+## ContactError
450
+
451
+`ContactError` 개체는 오류가 발생 하면 `contactError` 콜백 함수를 통해 사용자에 게 반환 됩니다.
452
+
453
+### 속성
454
+
455
+*   **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
456
+
457
+### 상수
458
+
459
+*   `ContactError.UNKNOWN_ERROR` (code 0)
460
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
461
+*   `ContactError.TIMEOUT_ERROR` (code 2)
462
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
463
+*   `ContactError.IO_ERROR` (code 4)
464
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
465
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
466
+
467
+## ContactField
468
+
469
+`ContactField` 개체는 재사용 가능한 구성 요소를 나타내는 필드를 일반적으로 문의입니다. 각 `ContactField` 개체에는 `value`, `type` 및 `pref` 속성을 포함 되어 있습니다. `Contact` 개체는 전화 번호 및 이메일 주소와 같은 `ContactField` 배열에서 몇 가지 속성을 저장합니다.
470
+
471
+대부분의 경우에서는 `ContactField` 개체의 **type** 속성에 대 한 미리 정해진된 값이 없습니다. 예를 들어 전화 번호 *홈*, *작품*, *모바일*, *아이폰* 또는 특정 장치 플랫폼의 연락처 데이터베이스에서 지원 되는 다른 값의 **유형** 값을 지정할 수 있습니다. 그러나, `연락처` **사진** 필드 **유형** 필드 나타냅니다 반환 된 이미지 형식: **url** **값** 특성 **값** 이미지 base64 인코딩된 문자열을 포함 하는 경우 사진 이미지 또는 *base64* URL이 포함 된 경우.
472
+
473
+### 속성
474
+
475
+*   **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. *(DOMString)*
476
+
477
+*   **값**: 전화 번호 또는 이메일 주소와 같은 필드 값. *(DOMString)*
478
+
479
+*   **pref**: 설정 `true` 이 경우 `ContactField` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
480
+
481
+### 지원 되는 플랫폼
482
+
483
+*   아마존 화재 운영 체제
484
+*   안 드 로이드
485
+*   블랙베리 10
486
+*   Firefox 운영 체제
487
+*   iOS
488
+*   Windows Phone 7과 8
489
+*   윈도우 8
490
+*   윈도우
491
+
492
+### 예를 들어
493
+
494
+        // create a new contact
495
+        var contact = navigator.contacts.create();
496
+    
497
+        // store contact phone numbers in ContactField[]
498
+        var phoneNumbers = [];
499
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
500
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
501
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
502
+        contact.phoneNumbers = phoneNumbers;
503
+    
504
+        // save the contact
505
+        contact.save();
506
+    
507
+
508
+### 안 드 로이드 단점
509
+
510
+*   **pref**: 지원 되지 않는 반환`false`.
511
+
512
+### 블랙베리 10 단점
513
+
514
+*   **유형**: 부분적으로 지원 합니다. 전화 번호에 대 한 사용.
515
+
516
+*   **값**: 지원.
517
+
518
+*   **pref**: 지원 되지 않는 반환`false`.
519
+
520
+### iOS 단점
521
+
522
+*   **pref**: 지원 되지 않는 반환`false`.
523
+
524
+### Windows8 단점
525
+
526
+*   **pref**: 지원 되지 않는 반환`false`.
527
+
528
+### 윈도우 특수
529
+
530
+*   **pref**: 지원 되지 않는 반환`false`.
531
+
532
+## 담당자 이름
533
+
534
+여러 종류의 `Contact` 개체의 이름에 대 한 정보를 포함합니다.
535
+
536
+### 속성
537
+
538
+*   **포맷**: 연락처의 전체 이름. *(DOMString)*
539
+
540
+*   **familyName**: 연락처의 성. *(DOMString)*
541
+
542
+*   **givenName**: 연락처의 이름. *(DOMString)*
543
+
544
+*   **middleName**: 연락처의 중간 이름을. *(DOMString)*
545
+
546
+*   **honorificPrefix**: 연락처의 접두사 (예: *미스터* 또는 *닥터*) *(DOMString)*
547
+
548
+*   **honorificSuffix**: 연락처의 접미사 ( *esq.*예). *(DOMString)*
549
+
550
+### 지원 되는 플랫폼
551
+
552
+*   아마존 화재 운영 체제
553
+*   안 드 로이드
554
+*   블랙베리 10
555
+*   Firefox 운영 체제
556
+*   iOS
557
+*   Windows Phone 7과 8
558
+*   윈도우 8
559
+*   윈도우
560
+
561
+### 예를 들어
562
+
563
+    function onSuccess(contacts) {
564
+        for (var i = 0; i < contacts.length; i++) {
565
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
566
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
567
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
568
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
569
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
570
+                "Prefix: "       + contacts[i].name.honorificSuffix);
571
+        }
572
+    };
573
+    
574
+    function onError(contactError) {
575
+        alert('onError!');
576
+    };
577
+    
578
+    var options = new ContactFindOptions();
579
+    options.filter = "";
580
+    filter = ["displayName", "name"];
581
+    navigator.contacts.find(filter, onSuccess, onError, options);
582
+    
583
+
584
+### 안 드 로이드 단점
585
+
586
+*   **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
587
+
588
+### 블랙베리 10 단점
589
+
590
+*   **포맷**: 부분적으로 지원 합니다. 블랙베리 **firstName** 및 **lastName** 필드의 연결을 반환합니다.
591
+
592
+*   **familyName**: 지원. 블랙베리 **lastName** 필드에 저장 합니다.
593
+
594
+*   **givenName**: 지원. 블랙베리 **firstName** 필드에 저장 합니다.
595
+
596
+*   **middleName**: 지원 되지 않는 반환`null`.
597
+
598
+*   **honorificPrefix**: 지원 되지 않는 반환`null`.
599
+
600
+*   **honorificSuffix**: 지원 되지 않는 반환`null`.
601
+
602
+### FirefoxOS 특수
603
+
604
+*   **포맷**: 부분적으로 지원 되 고 읽기 전용. 연결을 반환 합니다 `honorificPrefix` , `givenName` , `middleName` , `familyName` , 그리고`honorificSuffix`.
605
+
606
+### iOS 단점
607
+
608
+*   **포맷**: 부분적으로 지원 합니다. IOS 복합 이름 반환 하지만 읽기 전용입니다.
609
+
610
+### 윈도우 8 단점
611
+
612
+*   **형식**: 이것은 유일한 속성 이름과 동일 하다 `displayName` , 및`nickname`
613
+
614
+*   **familyName**: 지원 되지 않음
615
+
616
+*   **givenName**: 지원 되지 않음
617
+
618
+*   **middleName**: 지원 되지 않음
619
+
620
+*   **honorificPrefix**: 지원 되지 않음
621
+
622
+*   **honorificSuffix**: 지원 되지 않음
623
+
624
+### 윈도우 특수
625
+
626
+*   **형식**: 그것은 동일`displayName`
627
+
628
+## ContactOrganization
629
+
630
+`ContactOrganization` 개체는 연락처의 조직 속성을 저장합니다. `Contact` 개체 배열에 하나 이상의 `ContactOrganization` 개체를 저장합니다.
631
+
632
+### 속성
633
+
634
+*   **pref**: 설정 `true` 이 경우 `ContactOrganization` 사용자의 기본 설정된 값이 포함 됩니다. *(부울)*
635
+
636
+*   **유형**: 예를 들어 필드, *홈* 의 어떤 종류를 나타내는 문자열입니다. _(DOMString)
637
+
638
+*   **이름**: 조직 이름. *(DOMString)*
639
+
640
+*   **부서**: 계약을 위해 일 하는 부서. *(DOMString)*
641
+
642
+*   **제목**: 조직에서 연락처의 제목. *(DOMString)*
643
+
644
+### 지원 되는 플랫폼
645
+
646
+*   안 드 로이드
647
+*   블랙베리 10
648
+*   Firefox 운영 체제
649
+*   iOS
650
+*   Windows Phone 7과 8
651
+*   윈도우 (Windows 8.1와 Windows Phone 8.1 소자만 해당)
652
+
653
+### 예를 들어
654
+
655
+    function onSuccess(contacts) {
656
+        for (var i = 0; i < contacts.length; i++) {
657
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
658
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
659
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
660
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
661
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
662
+                    "Title: "       + contacts[i].organizations[j].title);
663
+            }
664
+        }
665
+    };
666
+    
667
+    function onError(contactError) {
668
+        alert('onError!');
669
+    };
670
+    
671
+    var options = new ContactFindOptions();
672
+    options.filter = "";
673
+    filter = ["displayName", "organizations"];
674
+    navigator.contacts.find(filter, onSuccess, onError, options);
675
+    
676
+
677
+### 안 드 로이드 2.X 단점
678
+
679
+*   **pref**: 반환 안 드 로이드 2.X 장치에 의해 지원 되지 않습니다`false`.
680
+
681
+### 블랙베리 10 단점
682
+
683
+*   **pref**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`false`.
684
+
685
+*   **유형**: 반환 블랙베리 장치에 의해 지원 되지 않습니다`null`.
686
+
687
+*   **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름 블랙베리 **회사** 필드에 저장 됩니다.
688
+
689
+*   **부서**: 지원 되지 않는 반환`null`.
690
+
691
+*   **제목**: 부분적으로 지원 합니다. 첫 번째 조직 제목 블랙베리 **jobTitle** 필드에 저장 됩니다.
692
+
693
+### 파이어 폭스 OS 단점
694
+
695
+*   **pref**: 지원 되지 않음
696
+
697
+*   **형식**: 지원 되지 않음
698
+
699
+*   **부서**: 지원 되지 않음
700
+
701
+*   필드 **이름** 및 **제목** **org** 및 **jobTitle** 에 저장.
702
+
703
+### iOS 단점
704
+
705
+*   **pref**: 반환 하는 iOS 장치에서 지원 되지 않습니다`false`.
706
+
707
+*   **유형**: 반환 하는 iOS 장치에서 지원 되지 않습니다`null`.
708
+
709
+*   **이름**: 부분적으로 지원 합니다. 첫 번째 조직 이름은 iOS **kABPersonOrganizationProperty** 필드에 저장 됩니다.
710
+
711
+*   **부서**: 부분적으로 지원 합니다. 첫 번째 부서 이름은 iOS **kABPersonDepartmentProperty** 필드에 저장 됩니다.
712
+
713
+*   **제목**: 부분적으로 지원 합니다. 첫 번째 타이틀 iOS **kABPersonJobTitleProperty** 필드에 저장 됩니다.
714
+
715
+### 윈도우 특수
716
+
717
+*   **pref**: 지원 되지 않는 반환`false`.
718
+
719
+*   **형식**: 지원 되지 않는 반환`null`.

+ 735
- 0
km0App/node_modules/cordova-plugin-contacts/doc/pl/README.md Parādīt failu

@@ -0,0 +1,735 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+Ten plugin definiuje obiekt globalny `navigator.contacts`, która zapewnia dostęp do bazy danych kontaktów urządzenia.
25
+
26
+Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**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.
35
+
36
+## Instalacja
37
+
38
+Wymaga to cordova 5.0 + (obecny v1.0.0 stabilne)
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+Starsze wersje cordova nadal można zainstalować za pomocą identyfikatora **przestarzałe** (starych v0.2.16)
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+Jest również możliwość instalacji za pośrednictwem repo url bezpośrednio (niestabilny)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### Firefox OS dziwactwa
54
+
55
+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.
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### Windows dziwactwa
67
+
68
+**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.
69
+
70
+**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.
71
+
72
+### Windows 8 dziwactwa
73
+
74
+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ć.
75
+
76
+## Navigator.Contacts
77
+
78
+### Metody
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### Obiekty
85
+
86
+  * Contact
87
+  * ContactName
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+Metoda `navigator.contacts.create` jest synchroniczna i zwraca nowy obiekt `Contact`.
98
+
99
+Ta metoda nie zachowuje kontakt obiektu bazy danych kontaktów urządzenie, dla którego należy wywołać metodę `Contact.save`.
100
+
101
+### Obsługiwane platformy
102
+
103
+  * Android
104
+  * BlackBerry 10
105
+  * Firefox OS
106
+  * iOS
107
+  * Windows Phone 7 i 8
108
+
109
+### Przykład
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+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**.
117
+
118
+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.
119
+
120
+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.
121
+
122
+### Parametry
123
+
124
+  * **contactFields**: kontakt z pól do wykorzystania jako kwalifikator Szukaj. *(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z tablicy obiektów kontaktów zwracane z bazy danych. [Required]
127
+
128
+  * **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
129
+
130
+  * **contactFindOptions**: Szukaj opcji filtrowania navigator.contacts. [Optional]
131
+    
132
+    Klucze obejmuje:
133
+    
134
+      * **filter**: ciąg wyszukiwania umożliwia znalezienie navigator.contacts. *(DOMString)* (Domyślnie: `""`)
135
+    
136
+      * **multiple**: określa, czy operacja Znajdź zwraca wiele navigator.contacts. *(Wartość logiczna)* (Domyślnie: `false`)
137
+        
138
+          * **desiredFields**: kontakt z pola, aby być zwrócona. Jeśli określony, wynikowy `kontakt` obiekt tylko funkcje wartości tych pól. *(DOMString[])* [Optional]
139
+
140
+### Obsługiwane platformy
141
+
142
+  * Android
143
+  * BlackBerry 10
144
+  * Firefox OS
145
+  * iOS
146
+  * Windows Phone 7 i 8
147
+  * Systemu Windows (Windows Phone 8.1 i Windows 10)
148
+
149
+### Przykład
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### Windows dziwactwa
169
+
170
+  * `__contactFields__`nie jest obsługiwane i zostanie zignorowana. `find`Metoda zawsze będzie próbował dopasować nazwę, adres e-mail lub numer telefonu kontaktu.
171
+
172
+## navigator.contacts.pickContact
173
+
174
+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**.
175
+
176
+### Parametry
177
+
178
+  * **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z jednego obiektu kontakt. [Wymagane]
179
+
180
+  * **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
181
+
182
+### Obsługiwane platformy
183
+
184
+  * Android
185
+  * iOS
186
+  * Windows Phone 8
187
+  * Windows 8
188
+  * Windows
189
+
190
+### Przykład
191
+
192
+    navigator.contacts.pickContact(function(contact){
193
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
194
+        },function(err){
195
+            console.log('Error: ' + err);
196
+        });
197
+    
198
+
199
+## Contact
200
+
201
+`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`.
202
+
203
+**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.
204
+
205
+### Właściwości
206
+
207
+  * **Identyfikator**: unikatowy identyfikator globalny. *(DOMString)*
208
+
209
+  * **displayName**: Nazwa tego kontaktu, nadaje się do wyświetlania użytkownikom końcowym. *(DOMString)*
210
+
211
+  * **Nazwa**: obiekt zawierający wszystkie składniki nazwy osób. *(Przedstawiciel)*
212
+
213
+  * **nick**: dorywczo nazwy na adres kontakt. *(DOMString)*
214
+
215
+  * **numery telefon≤w**: tablica numerów telefonów kontaktowych. *(ContactField[])*
216
+
217
+  * **e-maile**: tablica adresów e-mail kontakt. *(ContactField[])*
218
+
219
+  * **adresy**: tablica wszystkie adresy. *(ContactAddress[])*
220
+
221
+  * **IMS**: tablica kontakt IM adresy. *(ContactField[])*
222
+
223
+  * **organizacje**: tablicy wszystkie kontakty organizacji. *(ContactOrganization[])*
224
+
225
+  * **urodziny**: urodziny kontakt. *(Data)*
226
+
227
+  * **Uwaga**: Uwaga o kontakt. *(DOMString)*
228
+
229
+  * **zdjęcia**: tablica zdjęcia kontaktu. *(ContactField[])*
230
+
231
+  * **Kategorie**: tablica wszystkie zdefiniowane przez użytkownika kategorie związane z kontaktem. *(ContactField[])*
232
+
233
+  * **adresy URL**: tablicy stron internetowych związanych z kontaktem. *(ContactField[])*
234
+
235
+### Metody
236
+
237
+  * **klon**: Zwraca nowy `Contact` obiekt, który jest kopią głęboko obiektu wywołującego, z `id` Właściwość zestaw`null`.
238
+
239
+  * **Usuń**: usuwa kontakt z bazy danych kontaktów urządzenia, w przeciwnym razie wykonuje błąd wywołania zwrotnego z `ContactError` obiektu.
240
+
241
+  * **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** .
242
+
243
+### Obsługiwane platformy
244
+
245
+  * Amazon Fire OS
246
+  * Android
247
+  * BlackBerry 10
248
+  * Firefox OS
249
+  * iOS
250
+  * Windows Phone 7 i 8
251
+  * Windows 8
252
+  * Windows
253
+
254
+### Zapisz przykład
255
+
256
+    function onSuccess(contact) {
257
+        alert("Save Success");
258
+    };
259
+    
260
+    function onError(contactError) {
261
+        alert("Error = " + contactError.code);
262
+    };
263
+    
264
+    // create a new contact object
265
+    var contact = navigator.contacts.create();
266
+    contact.displayName = "Plumber";
267
+    contact.nickname = "Plumber";            // specify both to support all devices
268
+    
269
+    // populate some fields
270
+    var name = new ContactName();
271
+    name.givenName = "Jane";
272
+    name.familyName = "Doe";
273
+    contact.name = name;
274
+    
275
+    // save to device
276
+    contact.save(onSuccess,onError);
277
+    
278
+
279
+### Przykład klon
280
+
281
+        // clone the contact object
282
+        var clone = contact.clone();
283
+        clone.name.givenName = "John";
284
+        console.log("Original contact name = " + contact.name.givenName);
285
+        console.log("Cloned contact name = " + clone.name.givenName);
286
+    
287
+
288
+### Remove przykład
289
+
290
+    function onSuccess() {
291
+        alert("Removal Success");
292
+    };
293
+    
294
+    function onError(contactError) {
295
+        alert("Error = " + contactError.code);
296
+    };
297
+    
298
+    // remove the contact from the device
299
+    contact.remove(onSuccess,onError);
300
+    
301
+
302
+### Android 2.X dziwactwa
303
+
304
+  * **Kategorie**: nie obsługiwane na urządzeniach Android 2.X, powrót`null`.
305
+
306
+### Jeżyna 10 dziwactwa
307
+
308
+  * **Identyfikator**: przypisany przez urządzenie podczas zapisywania kontaktu.
309
+
310
+### Osobliwości FirefoxOS
311
+
312
+  * **Kategorie**: częściowo obsługiwane. Pola **pref** i **Typ** wracają`null`
313
+
314
+  * **IMS**: nie obsługiwane
315
+
316
+  * **zdjęcia**: nie obsługiwane
317
+
318
+### Dziwactwa iOS
319
+
320
+  * **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.
321
+
322
+  * **urodziny**: należy wpisać jako JavaScript `Date` obiektu, tak samo jest zwracany.
323
+
324
+  * **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.
325
+
326
+  * **Kategorie**: Ta właściwość obecnie jest nie obsługiwane, powrót`null`.
327
+
328
+### Windows Phone 7 i 8 dziwactwa
329
+
330
+  * **displayName**: podczas tworzenia kontaktu, Źródło wartość podana dla parametru nazwy wyświetlania różni się od nazwy wyświetlanej, gdy znalezienie kontaktu.
331
+
332
+  * **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.
333
+
334
+  * **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*.
335
+
336
+  * **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.
337
+
338
+  * **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.
339
+
340
+  * **organizacje**: tylko jeden jest dozwolone, a nie obsługuje * *pref*, *Typ*i* atrybuty.
341
+
342
+  * **Uwaga**: nie obsługiwane, powrót`null`.
343
+
344
+  * **IMS**: nie obsługiwane, powrót`null`.
345
+
346
+  * **urodziny**: nie obsługiwane, powrót`null`.
347
+
348
+  * **Kategorie**: nie obsługiwane, powrót`null`.
349
+
350
+  * **remove**: Metoda nie jest obsługiwana
351
+
352
+### Windows dziwactwa
353
+
354
+  * **zdjęcia**: zwraca adres URL pliku obrazu, który jest przechowywany w katalogu tymczasowego stosowania.
355
+
356
+  * **urodziny**: nie obsługiwane, powrót`null`.
357
+
358
+  * **Kategorie**: nie obsługiwane, powrót`null`.
359
+
360
+  * **remove**: Metoda jest obsługiwana tylko w systemie Windows 10 lub wyżej.
361
+
362
+## ContactAddress
363
+
364
+Obiekt `ContactAddress` przechowuje właściwości pojedynczego adresu kontaktu. Obiekt `Contact` może zawierać więcej niż jeden adres w tablicy `[ContactAddress]`.
365
+
366
+### Właściwości
367
+
368
+  * **Pref**: zestaw `true` Jeśli `ContactAddress` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
369
+
370
+  * **Typ**: string wskazującą typ pola, *do domu* na przykład. *(DOMString)*
371
+
372
+  * **w formacie**: pełny adres w formacie wyświetlania. *(DOMString)*
373
+
374
+  * **adres**: pełny adres. *(DOMString)*
375
+
376
+  * **miejscowości**: miasta lub miejscowości. *(DOMString)*
377
+
378
+  * **region**: Państwo lub region. *(DOMString)*
379
+
380
+  * **Kod pocztowy**: kod pocztowy lub kod pocztowy. *(DOMString)*
381
+
382
+  * **kraj**: nazwę kraju. *(DOMString)*
383
+
384
+### Obsługiwane platformy
385
+
386
+  * Amazon Fire OS
387
+  * Android
388
+  * BlackBerry 10
389
+  * Firefox OS
390
+  * iOS
391
+  * Windows Phone 7 i 8
392
+  * Windows 8
393
+  * Windows
394
+
395
+### Przykład
396
+
397
+    // display the address information for all contacts
398
+    
399
+    function onSuccess(contacts) {
400
+        for (var i = 0; i < contacts.length; i++) {
401
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
402
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
403
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
404
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
405
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
406
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
407
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
408
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
409
+                    "Country: "        + contacts[i].addresses[j].country);
410
+            }
411
+        }
412
+    };
413
+    
414
+    function onError(contactError) {
415
+        alert('onError!');
416
+    };
417
+    
418
+    // find all contacts
419
+    var options = new ContactFindOptions();
420
+    options.filter = "";
421
+    var filter = ["displayName", "addresses"];
422
+    navigator.contacts.find(filter, onSuccess, onError, options);
423
+    
424
+
425
+### Android 2.X dziwactwa
426
+
427
+  * **Pref**: nie obsługiwane, powrót `false` na urządzeniach Android 2.X.
428
+
429
+### Jeżyna 10 dziwactwa
430
+
431
+  * **Pref**: nie obsługiwane na urządzenia BlackBerry, powrót`false`.
432
+
433
+  * **Typ**: częściowo obsługiwane. Tylko jeden z *pracy* i *Strona główna* wpisz adresy mogą być przechowywane na kontakt.
434
+
435
+  * **w formacie**: częściowo obsługiwane. Zwraca łączenie wszystkich pól adres BlackBerry.
436
+
437
+  * **adres**: obsługiwane. Zwraca łączenie BlackBerry **address1** i **Adres2** pola adresu.
438
+
439
+  * **miejscowości**: obsługiwane. Przechowywane w polu adres **miasto** BlackBerry.
440
+
441
+  * **region**: obsługiwane. Przechowywane w polu adres **stateProvince** BlackBerry.
442
+
443
+  * **Kod pocztowy**: obsługiwane. Przechowywane w polu adres **zipPostal** BlackBerry.
444
+
445
+  * **kraj**: obsługiwane.
446
+
447
+### Osobliwości FirefoxOS
448
+
449
+  * **w formacie**: aktualnie nieobsługiwane
450
+
451
+### Dziwactwa iOS
452
+
453
+  * **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
454
+
455
+  * **w formacie**: obecnie nie jest obsługiwane.
456
+
457
+### Windows 8 dziwactwa
458
+
459
+  * **Pref**: nie obsługiwane
460
+
461
+### Windows dziwactwa
462
+
463
+  * **Pref**: nie obsługiwane
464
+
465
+## ContactError
466
+
467
+`ContactError` obiekt jest zwracany użytkownikowi za pośrednictwem funkcji wywołania zwrotnego `contactError`, gdy wystąpi błąd.
468
+
469
+### Właściwości
470
+
471
+  * **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
472
+
473
+### Stałe
474
+
475
+  * `ContactError.UNKNOWN_ERROR` (code 0)
476
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
477
+  * `ContactError.TIMEOUT_ERROR` (code 2)
478
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
479
+  * `ContactError.IO_ERROR` (code 4)
480
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
481
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
482
+
483
+## ContactField
484
+
485
+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.
486
+
487
+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.
488
+
489
+### Właściwości
490
+
491
+  * **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. *(DOMString)*
492
+
493
+  * **wartości**: wartość pola, na przykład adresu e-mail lub numer telefonu. *(DOMString)*
494
+
495
+  * **Pref**: zestaw `true` Jeśli `ContactField` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
496
+
497
+### Obsługiwane platformy
498
+
499
+  * Amazon Fire OS
500
+  * Android
501
+  * BlackBerry 10
502
+  * Firefox OS
503
+  * iOS
504
+  * Windows Phone 7 i 8
505
+  * Windows 8
506
+  * Windows
507
+
508
+### Przykład
509
+
510
+        // create a new contact
511
+        var contact = navigator.contacts.create();
512
+    
513
+        // store contact phone numbers in ContactField[]
514
+        var phoneNumbers = [];
515
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
516
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
517
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
518
+        contact.phoneNumbers = phoneNumbers;
519
+    
520
+        // save the contact
521
+        contact.save();
522
+    
523
+
524
+### Dziwactwa Androida
525
+
526
+  * **Pref**: nie obsługiwane, powrót`false`.
527
+
528
+### Jeżyna 10 dziwactwa
529
+
530
+  * **Typ**: częściowo obsługiwane. Używane numery telefonów.
531
+
532
+  * **wartość**: obsługiwane.
533
+
534
+  * **Pref**: nie obsługiwane, powrót`false`.
535
+
536
+### Dziwactwa iOS
537
+
538
+  * **Pref**: nie obsługiwane, powrót`false`.
539
+
540
+### Osobliwości Windows8
541
+
542
+  * **Pref**: nie obsługiwane, powrót`false`.
543
+
544
+### Windows dziwactwa
545
+
546
+  * **Pref**: nie obsługiwane, powrót`false`.
547
+
548
+## ContactName
549
+
550
+Zawiera różne rodzaje informacji o nazwę obiektu `Contact`.
551
+
552
+### Właściwości
553
+
554
+  * **w formacie**: pełną nazwę kontaktu. *(DOMString)*
555
+
556
+  * **danych**: nazwisko kontaktu. *(DOMString)*
557
+
558
+  * **imię**: imię kontaktu. *(DOMString)*
559
+
560
+  * **middleName**: nazwy bliskiego kontaktu. *(DOMString)*
561
+
562
+  * **honorificPrefix**: kontakt prefiks (przykład *Pan* lub *Dr*) *(DOMString)*
563
+
564
+  * **honorificSuffix**: kontakt sufiks (przykład *Esq.*). *(DOMString)*
565
+
566
+### Obsługiwane platformy
567
+
568
+  * Amazon Fire OS
569
+  * Android
570
+  * BlackBerry 10
571
+  * Firefox OS
572
+  * iOS
573
+  * Windows Phone 7 i 8
574
+  * Windows 8
575
+  * Windows
576
+
577
+### Przykład
578
+
579
+    function onSuccess(contacts) {
580
+        for (var i = 0; i < contacts.length; i++) {
581
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
582
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
583
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
584
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
585
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
586
+                "Prefix: "       + contacts[i].name.honorificSuffix);
587
+        }
588
+    };
589
+    
590
+    function onError(contactError) {
591
+        alert('onError!');
592
+    };
593
+    
594
+    var options = new ContactFindOptions();
595
+    options.filter = "";
596
+    filter = ["displayName", "name"];
597
+    navigator.contacts.find(filter, onSuccess, onError, options);
598
+    
599
+
600
+### Dziwactwa Androida
601
+
602
+  * **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
603
+
604
+### Jeżyna 10 dziwactwa
605
+
606
+  * **w formacie**: częściowo obsługiwane. Zwraca łączenie pól **imię** i **nazwisko** BlackBerry.
607
+
608
+  * **danych**: obsługiwane. Przechowywane w BlackBerry pola **nazwisko** .
609
+
610
+  * **imię**: obsługiwane. Przechowywane w polu **imię** BlackBerry.
611
+
612
+  * **middleName**: nie obsługiwane, powrót`null`.
613
+
614
+  * **honorificPrefix**: nie obsługiwane, powrót`null`.
615
+
616
+  * **honorificSuffix**: nie obsługiwane, powrót`null`.
617
+
618
+### Osobliwości FirefoxOS
619
+
620
+  * **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
621
+
622
+### Dziwactwa iOS
623
+
624
+  * **w formacie**: częściowo obsługiwane. Zwraca iOS nazwy, ale jest tylko do odczytu.
625
+
626
+### Windows 8 dziwactwa
627
+
628
+  * **w formacie**: to jest tylko nazwa właściwość i jest taka sama, jak `displayName` , i`nickname`
629
+
630
+  * **danych**: nie obsługiwane
631
+
632
+  * **imię**: nie obsługiwane
633
+
634
+  * **middleName**: nie obsługiwane
635
+
636
+  * **honorificPrefix**: nie obsługiwane
637
+
638
+  * **honorificSuffix**: nie obsługiwane
639
+
640
+### Windows dziwactwa
641
+
642
+  * **w formacie**: jest identyczny z`displayName`
643
+
644
+## ContactOrganization
645
+
646
+Obiekt `ContactOrganization` przechowuje właściwości organizacji kontaktu. Obiekt `Contact` sklepy jeden lub więcej obiektów `ContactOrganization` w tablicy.
647
+
648
+### Właściwości
649
+
650
+  * **Pref**: zestaw `true` Jeśli `ContactOrganization` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
651
+
652
+  * **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. _(DOMString)
653
+
654
+  * **Nazwa**: nazwa organizacji. *(DOMString)*
655
+
656
+  * **w departamencie**: dziale umowy działa. *(DOMString)*
657
+
658
+  * **tytuł**: tytuł kontaktu w organizacji. *(DOMString)*
659
+
660
+### Obsługiwane platformy
661
+
662
+  * Android
663
+  * BlackBerry 10
664
+  * Firefox OS
665
+  * iOS
666
+  * Windows Phone 7 i 8
667
+  * Windows (tylko urządzenia Windows 8.1 i Windows Phone 8.1)
668
+
669
+### Przykład
670
+
671
+    function onSuccess(contacts) {
672
+        for (var i = 0; i < contacts.length; i++) {
673
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
674
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
675
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
676
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
677
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
678
+                    "Title: "       + contacts[i].organizations[j].title);
679
+            }
680
+        }
681
+    };
682
+    
683
+    function onError(contactError) {
684
+        alert('onError!');
685
+    };
686
+    
687
+    var options = new ContactFindOptions();
688
+    options.filter = "";
689
+    filter = ["displayName", "organizations"];
690
+    navigator.contacts.find(filter, onSuccess, onError, options);
691
+    
692
+
693
+### Android 2.X dziwactwa
694
+
695
+  * **Pref**: nie obsługiwane przez urządzenia Android 2.X, powrót`false`.
696
+
697
+### Jeżyna 10 dziwactwa
698
+
699
+  * **Pref**: nie obsługiwane przez urządzenia BlackBerry, powrót`false`.
700
+
701
+  * **Typ**: nie obsługiwane przez urządzenia BlackBerry, powrót`null`.
702
+
703
+  * **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **firma** BlackBerry.
704
+
705
+  * **w departamencie**: nie obsługiwane, powrót`null`.
706
+
707
+  * **tytuł**: częściowo obsługiwane. Pierwszy tytuł organizacji są przechowywane w polu **jobTitle** BlackBerry.
708
+
709
+### Firefox OS dziwactwa
710
+
711
+  * **Pref**: nie obsługiwane
712
+
713
+  * **Typ**: nie obsługiwane
714
+
715
+  * **w departamencie**: nie obsługiwane
716
+
717
+  * Pola **Nazwa** i **tytuł** przechowywane w **org** i **jobTitle**.
718
+
719
+### Dziwactwa iOS
720
+
721
+  * **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
722
+
723
+  * **Typ**: nie obsługiwane urządzenia iOS, powrót`null`.
724
+
725
+  * **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **kABPersonOrganizationProperty** iOS.
726
+
727
+  * **w departamencie**: częściowo obsługiwane. Pierwsza nazwa jest przechowywana w polu **kABPersonDepartmentProperty** iOS.
728
+
729
+  * **tytuł**: częściowo obsługiwane. Pierwszy tytuł jest przechowywany w polu **kABPersonJobTitleProperty** iOS.
730
+
731
+### Windows dziwactwa
732
+
733
+  * **Pref**: nie obsługiwane, powrót`false`.
734
+
735
+  * **Typ**: nie obsługiwane, powrót`null`.

+ 719
- 0
km0App/node_modules/cordova-plugin-contacts/doc/pl/index.md Parādīt failu

@@ -0,0 +1,719 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+Ten plugin definiuje obiekt globalny `navigator.contacts`, która zapewnia dostęp do bazy danych kontaktów urządzenia.
23
+
24
+Mimo, że obiekt jest dołączony do globalnego zakresu `navigator`, to nie dostępne dopiero po zdarzeniu `deviceready`.
25
+
26
+    document.addEventListener("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {
28
+        console.log(navigator.contacts);
29
+    }
30
+    
31
+
32
+**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.
33
+
34
+## Instalacja
35
+
36
+    cordova plugin add cordova-plugin-contacts
37
+    
38
+
39
+### Firefox OS dziwactwa
40
+
41
+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.
42
+
43
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
44
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
45
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
46
+
47
+    "type": "privileged",
48
+    "permissions": {
49
+        "contacts": {
50
+            "access": "readwrite",
51
+            "description": "Describe why there is a need for such permission"
52
+        }
53
+    }
54
+    
55
+
56
+### Windows dziwactwa
57
+
58
+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.
59
+
60
+### Windows 8 dziwactwa
61
+
62
+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ć.
63
+
64
+## Navigator.Contacts
65
+
66
+### Metody
67
+
68
+*   navigator.contacts.create
69
+*   navigator.contacts.find
70
+*   navigator.contacts.pickContact
71
+
72
+### Obiekty
73
+
74
+*   Kontakt
75
+*   Przedstawiciel
76
+*   ContactField
77
+*   ContactAddress
78
+*   ContactOrganization
79
+*   ContactFindOptions
80
+*   ContactError
81
+*   ContactFieldType
82
+
83
+## Navigator.Contacts.Create
84
+
85
+Metoda `navigator.contacts.create` jest synchroniczna i zwraca nowy obiekt `Contact`.
86
+
87
+Ta metoda nie zachowuje kontakt obiektu bazy danych kontaktów urządzenie, dla którego należy wywołać metodę `Contact.save`.
88
+
89
+### Obsługiwane platformy
90
+
91
+*   Android
92
+*   BlackBerry 10
93
+*   Firefox OS
94
+*   iOS
95
+*   Windows Phone 7 i 8
96
+
97
+### Przykład
98
+
99
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
100
+    
101
+
102
+## navigator.contacts.find
103
+
104
+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**.
105
+
106
+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.
107
+
108
+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.
109
+
110
+### Parametry
111
+
112
+*   **contactFields**: kontakt z pól do wykorzystania jako kwalifikator Szukaj. *(DOMString[])* [Required]
113
+
114
+*   **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z tablicy obiektów kontaktów zwracane z bazy danych. [Required]
115
+
116
+*   **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
117
+
118
+*   **contactFindOptions**: Szukaj opcji filtrowania navigator.contacts. [Optional]
119
+    
120
+    Klucze obejmuje:
121
+    
122
+    *   **filter**: ciąg wyszukiwania umożliwia znalezienie navigator.contacts. *(DOMString)* (Domyślnie: `""`)
123
+    
124
+    *   **multiple**: określa, czy operacja Znajdź zwraca wiele navigator.contacts. *(Wartość logiczna)* (Domyślnie: `false`)
125
+        
126
+        *   **desiredFields**: kontakt z pola, aby być zwrócona. Jeśli określony, wynikowy `kontakt` obiekt tylko funkcje wartości tych pól. *(DOMString[])* [Optional]
127
+
128
+### Obsługiwane platformy
129
+
130
+*   Android
131
+*   BlackBerry 10
132
+*   Firefox OS
133
+*   iOS
134
+*   Windows Phone 7 i 8
135
+*   Windows (tylko urządzenia Windows Phone 8.1)
136
+
137
+### Przykład
138
+
139
+    function onSuccess(contacts) {
140
+        alert('Found ' + contacts.length + ' contacts.');
141
+    };
142
+    
143
+    function onError(contactError) {
144
+        alert('onError!');
145
+    };
146
+    
147
+    // find all contacts with 'Bob' in any name field
148
+    var options      = new ContactFindOptions();
149
+    options.filter   = "Bob";
150
+    options.multiple = true;
151
+    options.desiredFields = [navigator.contacts.fieldType.id];
152
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
153
+    navigator.contacts.find(fields, onSuccess, onError, options);
154
+    
155
+
156
+### Windows dziwactwa
157
+
158
+*   `__contactFields__`nie jest obsługiwane i zostanie zignorowana. `find`Metoda zawsze będzie próbował dopasować nazwę, adres e-mail lub numer telefonu kontaktu.
159
+
160
+## navigator.contacts.pickContact
161
+
162
+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**.
163
+
164
+### Parametry
165
+
166
+*   **contactSuccess**: sukcesu funkcji wywołania zwrotnego, wywoływane z jednego obiektu kontakt. [Wymagane]
167
+
168
+*   **contactError**: Błąd funkcji wywołania zwrotnego, wywoływana, gdy wystąpi błąd. [Opcjonalnie]
169
+
170
+### Obsługiwane platformy
171
+
172
+*   Android
173
+*   iOS
174
+*   Windows Phone 8
175
+*   Windows 8
176
+*   Windows
177
+
178
+### Przykład
179
+
180
+    navigator.contacts.pickContact(function(contact){
181
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
182
+        },function(err){
183
+            console.log('Error: ' + err);
184
+        });
185
+    
186
+
187
+## Kontakt
188
+
189
+`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`.
190
+
191
+**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.
192
+
193
+### Właściwości
194
+
195
+*   **Identyfikator**: unikatowy identyfikator globalny. *(DOMString)*
196
+
197
+*   **displayName**: Nazwa tego kontaktu, nadaje się do wyświetlania użytkownikom końcowym. *(DOMString)*
198
+
199
+*   **Nazwa**: obiekt zawierający wszystkie składniki nazwy osób. *(Przedstawiciel)*
200
+
201
+*   **nick**: dorywczo nazwy na adres kontakt. *(DOMString)*
202
+
203
+*   **numery telefon≤w**: tablica numerów telefonów kontaktowych. *(ContactField[])*
204
+
205
+*   **e-maile**: tablica adresów e-mail kontakt. *(ContactField[])*
206
+
207
+*   **adresy**: tablica wszystkie adresy. *(ContactAddress[])*
208
+
209
+*   **IMS**: tablica kontakt IM adresy. *(ContactField[])*
210
+
211
+*   **organizacje**: tablicy wszystkie kontakty organizacji. *(ContactOrganization[])*
212
+
213
+*   **urodziny**: urodziny kontakt. *(Data)*
214
+
215
+*   **Uwaga**: Uwaga o kontakt. *(DOMString)*
216
+
217
+*   **zdjęcia**: tablica zdjęcia kontaktu. *(ContactField[])*
218
+
219
+*   **Kategorie**: tablica wszystkie zdefiniowane przez użytkownika kategorie związane z kontaktem. *(ContactField[])*
220
+
221
+*   **adresy URL**: tablicy stron internetowych związanych z kontaktem. *(ContactField[])*
222
+
223
+### Metody
224
+
225
+*   **klon**: Zwraca nowy `Contact` obiekt, który jest kopią głęboko obiektu wywołującego, z `id` Właściwość zestaw`null`.
226
+
227
+*   **Usuń**: usuwa kontakt z bazy danych kontaktów urządzenia, w przeciwnym razie wykonuje błąd wywołania zwrotnego z `ContactError` obiektu.
228
+
229
+*   **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** .
230
+
231
+### Obsługiwane platformy
232
+
233
+*   Amazon Fire OS
234
+*   Android
235
+*   BlackBerry 10
236
+*   Firefox OS
237
+*   iOS
238
+*   Windows Phone 7 i 8
239
+*   Windows 8
240
+*   Windows
241
+
242
+### Zapisz przykład
243
+
244
+    function onSuccess(contact) {
245
+        alert("Save Success");
246
+    };
247
+    
248
+    function onError(contactError) {
249
+        alert("Error = " + contactError.code);
250
+    };
251
+    
252
+    // create a new contact object
253
+    var contact = navigator.contacts.create();
254
+    contact.displayName = "Plumber";
255
+    contact.nickname = "Plumber";            // specify both to support all devices
256
+    
257
+    // populate some fields
258
+    var name = new ContactName();
259
+    name.givenName = "Jane";
260
+    name.familyName = "Doe";
261
+    contact.name = name;
262
+    
263
+    // save to device
264
+    contact.save(onSuccess,onError);
265
+    
266
+
267
+### Przykład klon
268
+
269
+        // clone the contact object
270
+        var clone = contact.clone();
271
+        clone.name.givenName = "John";
272
+        console.log("Original contact name = " + contact.name.givenName);
273
+        console.log("Cloned contact name = " + clone.name.givenName);
274
+    
275
+
276
+### Remove przykład
277
+
278
+    function onSuccess() {
279
+        alert("Removal Success");
280
+    };
281
+    
282
+    function onError(contactError) {
283
+        alert("Error = " + contactError.code);
284
+    };
285
+    
286
+    // remove the contact from the device
287
+    contact.remove(onSuccess,onError);
288
+    
289
+
290
+### Android 2.X dziwactwa
291
+
292
+*   **Kategorie**: nie obsługiwane na urządzeniach Android 2.X, powrót`null`.
293
+
294
+### Jeżyna 10 dziwactwa
295
+
296
+*   **Identyfikator**: przypisany przez urządzenie podczas zapisywania kontaktu.
297
+
298
+### Osobliwości FirefoxOS
299
+
300
+*   **Kategorie**: częściowo obsługiwane. Pola **pref** i **Typ** wracają`null`
301
+
302
+*   **IMS**: nie obsługiwane
303
+
304
+*   **zdjęcia**: nie obsługiwane
305
+
306
+### Dziwactwa iOS
307
+
308
+*   **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.
309
+
310
+*   **urodziny**: należy wpisać jako JavaScript `Date` obiektu, tak samo jest zwracany.
311
+
312
+*   **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.
313
+
314
+*   **Kategorie**: Ta właściwość obecnie jest nie obsługiwane, powrót`null`.
315
+
316
+### Windows Phone 7 i 8 dziwactwa
317
+
318
+*   **displayName**: podczas tworzenia kontaktu, Źródło wartość podana dla parametru nazwy wyświetlania różni się od nazwy wyświetlanej, gdy znalezienie kontaktu.
319
+
320
+*   **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.
321
+
322
+*   **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*.
323
+
324
+*   **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.
325
+
326
+*   **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.
327
+
328
+*   **organizacje**: tylko jeden jest dozwolone, a nie obsługuje * *pref*, *Typ*i* atrybuty.
329
+
330
+*   **Uwaga**: nie obsługiwane, powrót`null`.
331
+
332
+*   **IMS**: nie obsługiwane, powrót`null`.
333
+
334
+*   **urodziny**: nie obsługiwane, powrót`null`.
335
+
336
+*   **Kategorie**: nie obsługiwane, powrót`null`.
337
+
338
+### Windows dziwactwa
339
+
340
+*   **zdjęcia**: zwraca adres URL pliku obrazu, który jest przechowywany w katalogu tymczasowego stosowania.
341
+
342
+*   **urodziny**: nie obsługiwane, powrót`null`.
343
+
344
+*   **Kategorie**: nie obsługiwane, powrót`null`.
345
+
346
+## ContactAddress
347
+
348
+Obiekt `ContactAddress` przechowuje właściwości pojedynczego adresu kontaktu. Obiekt `Contact` może zawierać więcej niż jeden adres w tablicy `[ContactAddress]`.
349
+
350
+### Właściwości
351
+
352
+*   **Pref**: zestaw `true` Jeśli `ContactAddress` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
353
+
354
+*   **Typ**: string wskazującą typ pola, *do domu* na przykład. *(DOMString)*
355
+
356
+*   **w formacie**: pełny adres w formacie wyświetlania. *(DOMString)*
357
+
358
+*   **adres**: pełny adres. *(DOMString)*
359
+
360
+*   **miejscowości**: miasta lub miejscowości. *(DOMString)*
361
+
362
+*   **region**: Państwo lub region. *(DOMString)*
363
+
364
+*   **Kod pocztowy**: kod pocztowy lub kod pocztowy. *(DOMString)*
365
+
366
+*   **kraj**: nazwę kraju. *(DOMString)*
367
+
368
+### Obsługiwane platformy
369
+
370
+*   Amazon Fire OS
371
+*   Android
372
+*   BlackBerry 10
373
+*   Firefox OS
374
+*   iOS
375
+*   Windows Phone 7 i 8
376
+*   Windows 8
377
+*   Windows
378
+
379
+### Przykład
380
+
381
+    // display the address information for all contacts
382
+    
383
+    function onSuccess(contacts) {
384
+        for (var i = 0; i < contacts.length; i++) {
385
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
386
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
387
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
388
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
389
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
390
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
391
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
392
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
393
+                    "Country: "        + contacts[i].addresses[j].country);
394
+            }
395
+        }
396
+    };
397
+    
398
+    function onError(contactError) {
399
+        alert('onError!');
400
+    };
401
+    
402
+    // find all contacts
403
+    var options = new ContactFindOptions();
404
+    options.filter = "";
405
+    var filter = ["displayName", "addresses"];
406
+    navigator.contacts.find(filter, onSuccess, onError, options);
407
+    
408
+
409
+### Android 2.X dziwactwa
410
+
411
+*   **Pref**: nie obsługiwane, powrót `false` na urządzeniach Android 2.X.
412
+
413
+### Jeżyna 10 dziwactwa
414
+
415
+*   **Pref**: nie obsługiwane na urządzenia BlackBerry, powrót`false`.
416
+
417
+*   **Typ**: częściowo obsługiwane. Tylko jeden z *pracy* i *Strona główna* wpisz adresy mogą być przechowywane na kontakt.
418
+
419
+*   **w formacie**: częściowo obsługiwane. Zwraca łączenie wszystkich pól adres BlackBerry.
420
+
421
+*   **adres**: obsługiwane. Zwraca łączenie BlackBerry **address1** i **Adres2** pola adresu.
422
+
423
+*   **miejscowości**: obsługiwane. Przechowywane w polu adres **miasto** BlackBerry.
424
+
425
+*   **region**: obsługiwane. Przechowywane w polu adres **stateProvince** BlackBerry.
426
+
427
+*   **Kod pocztowy**: obsługiwane. Przechowywane w polu adres **zipPostal** BlackBerry.
428
+
429
+*   **kraj**: obsługiwane.
430
+
431
+### Osobliwości FirefoxOS
432
+
433
+*   **w formacie**: aktualnie nieobsługiwane
434
+
435
+### Dziwactwa iOS
436
+
437
+*   **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
438
+
439
+*   **w formacie**: obecnie nie jest obsługiwane.
440
+
441
+### Windows 8 dziwactwa
442
+
443
+*   **Pref**: nie obsługiwane
444
+
445
+### Windows dziwactwa
446
+
447
+*   **Pref**: nie obsługiwane
448
+
449
+## ContactError
450
+
451
+`ContactError` obiekt jest zwracany użytkownikowi za pośrednictwem funkcji wywołania zwrotnego `contactError`, gdy wystąpi błąd.
452
+
453
+### Właściwości
454
+
455
+*   **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
456
+
457
+### Stałe
458
+
459
+*   `ContactError.UNKNOWN_ERROR` (code 0)
460
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
461
+*   `ContactError.TIMEOUT_ERROR` (code 2)
462
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
463
+*   `ContactError.IO_ERROR` (code 4)
464
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
465
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
466
+
467
+## ContactField
468
+
469
+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.
470
+
471
+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.
472
+
473
+### Właściwości
474
+
475
+*   **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. *(DOMString)*
476
+
477
+*   **wartości**: wartość pola, na przykład adresu e-mail lub numer telefonu. *(DOMString)*
478
+
479
+*   **Pref**: zestaw `true` Jeśli `ContactField` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
480
+
481
+### Obsługiwane platformy
482
+
483
+*   Amazon Fire OS
484
+*   Android
485
+*   BlackBerry 10
486
+*   Firefox OS
487
+*   iOS
488
+*   Windows Phone 7 i 8
489
+*   Windows 8
490
+*   Windows
491
+
492
+### Przykład
493
+
494
+        // create a new contact
495
+        var contact = navigator.contacts.create();
496
+    
497
+        // store contact phone numbers in ContactField[]
498
+        var phoneNumbers = [];
499
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
500
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
501
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
502
+        contact.phoneNumbers = phoneNumbers;
503
+    
504
+        // save the contact
505
+        contact.save();
506
+    
507
+
508
+### Dziwactwa Androida
509
+
510
+*   **Pref**: nie obsługiwane, powrót`false`.
511
+
512
+### Jeżyna 10 dziwactwa
513
+
514
+*   **Typ**: częściowo obsługiwane. Używane numery telefonów.
515
+
516
+*   **wartość**: obsługiwane.
517
+
518
+*   **Pref**: nie obsługiwane, powrót`false`.
519
+
520
+### Dziwactwa iOS
521
+
522
+*   **Pref**: nie obsługiwane, powrót`false`.
523
+
524
+### Osobliwości Windows8
525
+
526
+*   **Pref**: nie obsługiwane, powrót`false`.
527
+
528
+### Windows dziwactwa
529
+
530
+*   **Pref**: nie obsługiwane, powrót`false`.
531
+
532
+## Przedstawiciel
533
+
534
+Zawiera różne rodzaje informacji o nazwę obiektu `Contact`.
535
+
536
+### Właściwości
537
+
538
+*   **w formacie**: pełną nazwę kontaktu. *(DOMString)*
539
+
540
+*   **danych**: nazwisko kontaktu. *(DOMString)*
541
+
542
+*   **imię**: imię kontaktu. *(DOMString)*
543
+
544
+*   **middleName**: nazwy bliskiego kontaktu. *(DOMString)*
545
+
546
+*   **honorificPrefix**: kontakt prefiks (przykład *Pan* lub *Dr*) *(DOMString)*
547
+
548
+*   **honorificSuffix**: kontakt sufiks (przykład *Esq.*). *(DOMString)*
549
+
550
+### Obsługiwane platformy
551
+
552
+*   Amazon Fire OS
553
+*   Android
554
+*   BlackBerry 10
555
+*   Firefox OS
556
+*   iOS
557
+*   Windows Phone 7 i 8
558
+*   Windows 8
559
+*   Windows
560
+
561
+### Przykład
562
+
563
+    function onSuccess(contacts) {
564
+        for (var i = 0; i < contacts.length; i++) {
565
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
566
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
567
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
568
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
569
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
570
+                "Prefix: "       + contacts[i].name.honorificSuffix);
571
+        }
572
+    };
573
+    
574
+    function onError(contactError) {
575
+        alert('onError!');
576
+    };
577
+    
578
+    var options = new ContactFindOptions();
579
+    options.filter = "";
580
+    filter = ["displayName", "name"];
581
+    navigator.contacts.find(filter, onSuccess, onError, options);
582
+    
583
+
584
+### Dziwactwa Androida
585
+
586
+*   **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
587
+
588
+### Jeżyna 10 dziwactwa
589
+
590
+*   **w formacie**: częściowo obsługiwane. Zwraca łączenie pól **imię** i **nazwisko** BlackBerry.
591
+
592
+*   **danych**: obsługiwane. Przechowywane w BlackBerry pola **nazwisko** .
593
+
594
+*   **imię**: obsługiwane. Przechowywane w polu **imię** BlackBerry.
595
+
596
+*   **middleName**: nie obsługiwane, powrót`null`.
597
+
598
+*   **honorificPrefix**: nie obsługiwane, powrót`null`.
599
+
600
+*   **honorificSuffix**: nie obsługiwane, powrót`null`.
601
+
602
+### Osobliwości FirefoxOS
603
+
604
+*   **w formacie**: częściowo obsługiwane i tylko do odczytu. Zwraca składa się z `honorificPrefix` , `givenName` , `middleName` , `familyName` , i`honorificSuffix`.
605
+
606
+### Dziwactwa iOS
607
+
608
+*   **w formacie**: częściowo obsługiwane. Zwraca iOS nazwy, ale jest tylko do odczytu.
609
+
610
+### Windows 8 dziwactwa
611
+
612
+*   **w formacie**: to jest tylko nazwa właściwość i jest taka sama, jak `displayName` , i`nickname`
613
+
614
+*   **danych**: nie obsługiwane
615
+
616
+*   **imię**: nie obsługiwane
617
+
618
+*   **middleName**: nie obsługiwane
619
+
620
+*   **honorificPrefix**: nie obsługiwane
621
+
622
+*   **honorificSuffix**: nie obsługiwane
623
+
624
+### Windows dziwactwa
625
+
626
+*   **w formacie**: jest identyczny z`displayName`
627
+
628
+## ContactOrganization
629
+
630
+Obiekt `ContactOrganization` przechowuje właściwości organizacji kontaktu. Obiekt `Contact` sklepy jeden lub więcej obiektów `ContactOrganization` w tablicy.
631
+
632
+### Właściwości
633
+
634
+*   **Pref**: zestaw `true` Jeśli `ContactOrganization` zawiera wartości preferowanych użytkownika. *(wartość logiczna)*
635
+
636
+*   **Typ**: ciąg, który wskazuje typ pola, *do domu* , np. _(DOMString)
637
+
638
+*   **Nazwa**: nazwa organizacji. *(DOMString)*
639
+
640
+*   **w departamencie**: dziale umowy działa. *(DOMString)*
641
+
642
+*   **tytuł**: tytuł kontaktu w organizacji. *(DOMString)*
643
+
644
+### Obsługiwane platformy
645
+
646
+*   Android
647
+*   BlackBerry 10
648
+*   Firefox OS
649
+*   iOS
650
+*   Windows Phone 7 i 8
651
+*   Windows (tylko urządzenia Windows 8.1 i Windows Phone 8.1)
652
+
653
+### Przykład
654
+
655
+    function onSuccess(contacts) {
656
+        for (var i = 0; i < contacts.length; i++) {
657
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
658
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
659
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
660
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
661
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
662
+                    "Title: "       + contacts[i].organizations[j].title);
663
+            }
664
+        }
665
+    };
666
+    
667
+    function onError(contactError) {
668
+        alert('onError!');
669
+    };
670
+    
671
+    var options = new ContactFindOptions();
672
+    options.filter = "";
673
+    filter = ["displayName", "organizations"];
674
+    navigator.contacts.find(filter, onSuccess, onError, options);
675
+    
676
+
677
+### Android 2.X dziwactwa
678
+
679
+*   **Pref**: nie obsługiwane przez urządzenia Android 2.X, powrót`false`.
680
+
681
+### Jeżyna 10 dziwactwa
682
+
683
+*   **Pref**: nie obsługiwane przez urządzenia BlackBerry, powrót`false`.
684
+
685
+*   **Typ**: nie obsługiwane przez urządzenia BlackBerry, powrót`null`.
686
+
687
+*   **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **firma** BlackBerry.
688
+
689
+*   **w departamencie**: nie obsługiwane, powrót`null`.
690
+
691
+*   **tytuł**: częściowo obsługiwane. Pierwszy tytuł organizacji są przechowywane w polu **jobTitle** BlackBerry.
692
+
693
+### Firefox OS dziwactwa
694
+
695
+*   **Pref**: nie obsługiwane
696
+
697
+*   **Typ**: nie obsługiwane
698
+
699
+*   **w departamencie**: nie obsługiwane
700
+
701
+*   Pola **Nazwa** i **tytuł** przechowywane w **org** i **jobTitle**.
702
+
703
+### Dziwactwa iOS
704
+
705
+*   **Pref**: nie obsługiwane urządzenia iOS, powrót`false`.
706
+
707
+*   **Typ**: nie obsługiwane urządzenia iOS, powrót`null`.
708
+
709
+*   **Nazwa**: częściowo obsługiwane. Pierwsza nazwa organizacji są przechowywane w polu **kABPersonOrganizationProperty** iOS.
710
+
711
+*   **w departamencie**: częściowo obsługiwane. Pierwsza nazwa jest przechowywana w polu **kABPersonDepartmentProperty** iOS.
712
+
713
+*   **tytuł**: częściowo obsługiwane. Pierwszy tytuł jest przechowywany w polu **kABPersonJobTitleProperty** iOS.
714
+
715
+### Windows dziwactwa
716
+
717
+*   **Pref**: nie obsługiwane, powrót`false`.
718
+
719
+*   **Typ**: nie obsługiwane, powrót`null`.

+ 709
- 0
km0App/node_modules/cordova-plugin-contacts/doc/ru/index.md Parādīt failu

@@ -0,0 +1,709 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+Обеспечивает доступ к базе данных контактов устройства.
23
+
24
+**Предупреждение**: сбор и использование данные контактов поднимает важные вопросы конфиденциальности. Политика конфиденциальности вашего приложения должна объяснять, как приложение использует контактные данные и передается ли она третьим лицам. Контактная информация считается конфиденциальной, потому что он показывает людей, с которыми общается человек. Таким образом в дополнение к политике конфиденциальности приложения, вы должны рассмотреть возможность предоставления уведомления в момент времени перед тем как приложение обращается к, или использует контактные данные, если операционная системы устройства не делает этого. Это уведомление должно обеспечивать ту же информацию, указанную выше, а также получение разрешения пользователя (например, путем представления выбора **OK** и **Нет, спасибо**). Обратите внимание, что некоторые магазины приложения могут требовать от приложения уведомления в момент доступа к данным и получить разрешение пользователя перед доступом к контактным данным. Четкая и понятная эргономика использования контактных данных помогает избежать недоразумений и ощущаемых злоупотреблений контактными данными. Для получения дополнительной информации пожалуйста, смотрите в руководстве конфиденциальности.
25
+
26
+## Установка
27
+
28
+    cordova plugin add cordova-plugin-contacts
29
+    
30
+
31
+### Особенности Firefox OS
32
+
33
+Создайте **www/manifest.webapp** как описано в [Описание Манифеста][1]. Добавление соответствующих разрешений. Существует также необходимость изменить тип веб-приложения на «priviledged» - [Описание Манифеста][2]. **ВНИМАНИЕ**: Все привилегированные приложения применяют [Политику безопасности содержимого][3] которая запрещает встроенные скрипты. Инициализируйте приложение другим способом.
34
+
35
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
36
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
37
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
38
+
39
+    "type": "privileged",
40
+    "permissions": {
41
+        "contacts": {
42
+            "access": "readwrite",
43
+            "description": "Describe why there is a need for such permission"
44
+        }
45
+    }
46
+    
47
+
48
+### Совместимости Windows
49
+
50
+Любые контакты, вернулся из `find` и `pickContact` методы являются только для чтения, поэтому приложение не может изменять их. `find`метод доступен только на устройствах Windows Phone 8.1.
51
+
52
+### Совместимости Windows 8
53
+
54
+Windows 8 Контакты являются readonly. Через контакты Cordova API не являются queryable/для поиска, вы должны сообщить пользователю выбрать контакт как вызов contacts.pickContact, который откроет приложение «Люди», где пользователь должен выбрать контакт. Любые контакты вернулся, readonly, поэтому ваше приложение не может изменять их.
55
+
56
+## navigator.contacts
57
+
58
+### Методы
59
+
60
+*   navigator.contacts.create
61
+*   navigator.contacts.find
62
+*   navigator.contacts.pickContact
63
+
64
+### Объекты
65
+
66
+*   Contact
67
+*   ContactName
68
+*   ContactField
69
+*   ContactAddress
70
+*   ContactOrganization
71
+*   ContactFindOptions
72
+*   ContactError
73
+*   ContactFieldType
74
+
75
+## navigator.contacts.create
76
+
77
+Метод `navigator.contacts.create` является синхронным, и возвращает новый объект `Contact`.
78
+
79
+Этот метод не сохраняет объект контакта в базе данных контактов устройства, для которого необходимо вызвать метод `Contact.save`.
80
+
81
+### Поддерживаемые платформы
82
+
83
+*   Android
84
+*   BlackBerry 10
85
+*   Firefox OS
86
+*   iOS
87
+*   Windows Phone 7 и 8
88
+
89
+### Пример
90
+
91
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
92
+    
93
+
94
+## navigator.contacts.find
95
+
96
+Метод `navigator.contacts.find` выполняется асинхронно, запрашивая базу контактов устройства и возвращая массив объектов `Contact`. Полученные объекты передаются в функцию обратного вызова `contactSuccess`, указанную в параметре **contactSuccess** .
97
+
98
+Параметр **contactFields** указывает поля, чтобы использоваться в качестве квалификатора Поиск. Нулевой длины **contactFields** параметр является недопустимым и приводит к `ContactError.INVALID_ARGUMENT_ERROR` . Значение **contactFields** `"*"` возвращает все поля контактов.
99
+
100
+Строка **ContactFindOptions.filter** может использоваться как фильтр поиска при запросах к базе данных контактов. Если указано, то к каждому полю, указанному в параметре **contactFields**, применяется фильтр частичного поиска без учета регистра. Если есть совпадение для *любого* из указанных полей, контакт возвращается. Использование параметра **contactFindOptions.desiredFields** для управления свойства контакта должны быть возвращены обратно.
101
+
102
+### Параметры
103
+
104
+*   **contactSuccess**: Функция обратного вызова вызываемая в случае успешного поиска, с параметром в виде массива объектов Contact возвращенных из базы данных контактов. [Обязательный]
105
+
106
+*   **contactError**: Функция обратного вызова, вызывается при возникновении ошибки. [Опционально]
107
+
108
+*   **contactFields**: контакт поля для использования в качестве квалификатора Поиск. *(DOMString[])* [Требуется]
109
+
110
+*   **contactFindOptions**: Параметры поиска для фильтрации filter navigator.contacts. [Опционально] Ключи включают:
111
+
112
+*   **filter**: Строка поиска используемая для поиска по navigator.contacts. *(DOMString)* (по умолчанию: `""`)
113
+
114
+*   **multiple**: Определяет если операция поиска возвращает несколкько navigator.contacts. *(Булевое)* (По умолчанию: `false`)
115
+    
116
+    *   **desiredFields**: контакт поля возвращается обратно. Если указан, в результате `Contact` объект только функции значения для этих полей. *(DOMString[])* [Опционально]
117
+
118
+### Поддерживаемые платформы
119
+
120
+*   Android
121
+*   BlackBerry 10
122
+*   Firefox OS
123
+*   iOS
124
+*   Windows Phone 7 и 8
125
+*   Windows (только для устройств на Windows Phone 8.1)
126
+
127
+### Пример
128
+
129
+    function onSuccess(contacts) {
130
+        alert('Found ' + contacts.length + ' contacts.');
131
+    };
132
+    
133
+    function onError(contactError) {
134
+        alert('onError!');
135
+    };
136
+    
137
+    // find all contacts with 'Bob' in any name field
138
+    var options      = new ContactFindOptions();
139
+    options.filter   = "Bob";
140
+    options.multiple = true;
141
+    options.desiredFields = [navigator.contacts.fieldType.id];
142
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
143
+    navigator.contacts.find(fields, onSuccess, onError, options);
144
+    
145
+
146
+### Совместимости Windows
147
+
148
+*   `__contactFields__`не поддерживается и будет игнорироваться. `find`метод всегда будет пытаться соответствовать имя, адрес электронной почты или номер телефона контакта.
149
+
150
+## navigator.contacts.pickContact
151
+
152
+`navigator.contacts.pickContact`Метод запускает контакт выбора, чтобы выбрать один контакт. Результирующий объект передается в `contactSuccess` функции обратного вызова, указанный параметром **contactSuccess** .
153
+
154
+### Параметры
155
+
156
+*   **contactSuccess**: успех функция обратного вызова вызывается с одним объектом контакта. [Требуется]
157
+
158
+*   **contactError**: Функция обратного вызова, вызывается при возникновении ошибки. [Опционально]
159
+
160
+### Поддерживаемые платформы
161
+
162
+*   Android
163
+*   iOS
164
+*   Windows Phone 8
165
+*   Windows 8
166
+*   Windows
167
+
168
+### Пример
169
+
170
+    navigator.contacts.pickContact(function(contact){
171
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
172
+        },function(err){
173
+            console.log('Error: ' + err);
174
+        });
175
+    
176
+
177
+## Contact
178
+
179
+Объект `Contact` представляет контакт пользователя. Контакты могут быть созданы, сохранены или удалены из базы данных контактов устройства. Контакты также могут быть получены (индивидуально или массово) из базы данных путем вызова метода `navigator.contacts.find`.
180
+
181
+**Примечание**: не все поля контактов, перечисленных выше, поддерживаются на каждой платформе устройства. Пожалуйста, проверьте раздел *Особенности* каждой платформы для детальной информации.
182
+
183
+### Параметры
184
+
185
+*   **ID**: глобальный уникальный идентификатор. *(DOMString)*
186
+
187
+*   **displayName**: имя этого контакта, подходящую для отображения пользователю. *(DOMString)*
188
+
189
+*   **name**: объект, содержащий все компоненты имени человека. *(ContactName)*
190
+
191
+*   **nickname**: обычное имя, по которому определяется контакт. *(DOMString)*
192
+
193
+*   **phoneNumbers**: массив со всеми номерами контактных телефонов. *(ContactField[])*
194
+
195
+*   **emails**: массив всех адресов электронной почты контакта. *(ContactField[])*
196
+
197
+*   **addresses**: массив всех адресов контакта. *(ContactAddress[])*
198
+
199
+*   **IMS**: массив всех IM-адресов контакта. *(ContactField[])*
200
+
201
+*   **organizations**: массив всех организаций контакта. *(ContactOrganization[])*
202
+
203
+*   **birthday**: день рождения контакта. *(Дата)*
204
+
205
+*   **note**: Текстовая заметка о контакте. *(DOMString)*
206
+
207
+*   **photos**: массив фотографий контакта. *(ContactField[])*
208
+
209
+*   **categories**: массив всех определенных пользователем категории, связанных с контактом. *(ContactField[])*
210
+
211
+*   **urls**: массив веб-страниц, связанных с контактом. *(ContactField[])*
212
+
213
+### Методы
214
+
215
+*   **clone**: возвращает новый объект `Contact`, являющийся глубокой копией вызывающего объекта с значением свойства `id` равным `null`.
216
+
217
+*   **remove**: удаляет контакт из базы данных контактов устройства, в противном случае выполняет обратный вызов ошибки с объектом `ContactError` описывающим ошибку.
218
+
219
+*   **save**: сохраняет новый контакт в базе данных контактов устройства или обновляет существующий контакт, если контакт с тем же **id** уже существует.
220
+
221
+### Поддерживаемые платформы
222
+
223
+*   Amazon Fire OS
224
+*   Android
225
+*   BlackBerry 10
226
+*   Firefox OS
227
+*   iOS
228
+*   Windows Phone 7 и 8
229
+*   Windows 8
230
+*   Windows
231
+
232
+### Пример сохранения
233
+
234
+    function onSuccess(contact) {
235
+        alert("Save Success");
236
+    };
237
+    
238
+    function onError(contactError) {
239
+        alert("Error = " + contactError.code);
240
+    };
241
+    
242
+    // create a new contact object
243
+    var contact = navigator.contacts.create();
244
+    contact.displayName = "Plumber";
245
+    contact.nickname = "Plumber";            // specify both to support all devices
246
+    
247
+    // populate some fields
248
+    var name = new ContactName();
249
+    name.givenName = "Jane";
250
+    name.familyName = "Doe";
251
+    contact.name = name;
252
+    
253
+    // save to device
254
+    contact.save(onSuccess,onError);
255
+    
256
+
257
+### Пример клонирования
258
+
259
+        // clone the contact object
260
+        var clone = contact.clone();
261
+        clone.name.givenName = "John";
262
+        console.log("Original contact name = " + contact.name.givenName);
263
+        console.log("Cloned contact name = " + clone.name.givenName);
264
+    
265
+
266
+### Пример удаления
267
+
268
+    function onSuccess() {
269
+        alert("Removal Success");
270
+    };
271
+    
272
+    function onError(contactError) {
273
+        alert("Error = " + contactError.code);
274
+    };
275
+    
276
+    // remove the contact from the device
277
+    contact.remove(onSuccess,onError);
278
+    
279
+
280
+### Особенности Android 2.X
281
+
282
+*   **categories**: не поддерживается на устройствах Android 2.X, возвращая `null`.
283
+
284
+### Особенности BlackBerry 10
285
+
286
+*   **ID**: присвоенный устройства при сохранении контакта.
287
+
288
+### Особенности Firefox OS
289
+
290
+*   **categories**: частично поддерживается. Поля **pref** и **type** возвращают `null`
291
+
292
+*   **ims**: Не поддерживается
293
+
294
+*   **photos**: Не поддерживается
295
+
296
+### Особенности iOS
297
+
298
+*   **displayName**: не поддерживается на iOS, возвращая `null` Если `ContactName` не указан, в этом случае он возвращает составное имя, **nickname** или `""` , соответственно.
299
+
300
+*   **birthday**: Должен быть указан как объект JavaScript `Date`, таким же образом, значение этого поля и возвращается.
301
+
302
+*   **photos**: Возвращает URL-адрес файла изображения, которое хранится во временном каталоге приложения. Содержание временного каталога удаляются при выходе из приложения.
303
+
304
+*   **categories**: это свойство в настоящее время не поддерживается, возвращая`null`.
305
+
306
+### Особенности Windows Phone 7 и 8
307
+
308
+*   **displayName**: при создании контакта, значение, указанное в параметре отличается от отображаемого имени полученного при поиске контакта.
309
+
310
+*   **urls**: при создании контакта, пользователи могут ввести и сохранить более чем одного веб-адрес, но только один доступен при поиске контакта.
311
+
312
+*   **phoneNumbers**: параметр *pref* не поддерживается. *type* не поддерживается в операции *find* . Только один `phoneNumber` допускается для каждого *type*.
313
+
314
+*   **emails**: параметр *pref* не поддерживается. Домашний и рабочий email ссылаются на одну и ту же запись электронной почты. Разрешена только одна запись для каждого значения *type*.
315
+
316
+*   **addresses**: поддерживает только рабочий и домашний/личный *type*. Записи типа *type* home и personal ссылаются на одну и ту же запись адреса. Разрешена только одна запись для каждого значения *type*.
317
+
318
+*   **organizations**: только одна организация разрешена и она не поддерживает атрибуты *pref*, *type*и *department* .
319
+
320
+*   **note**: не поддерживается, возвращая`null`.
321
+
322
+*   **ims**: не поддерживается, возвращая `null`.
323
+
324
+*   **birthdays**: не поддерживается, возвращая`null`.
325
+
326
+*   **categories**: не поддерживается, возвращая`null`.
327
+
328
+### Совместимости Windows
329
+
330
+*   **фотографии**: Возвращает URL-адрес файла изображения, которое хранится во временном каталоге приложения.
331
+
332
+*   **birthdays**: не поддерживается, возвращая`null`.
333
+
334
+*   **categories**: не поддерживается, возвращая`null`.
335
+
336
+## ContactAddress
337
+
338
+Объект `ContactAddress` хранит свойства для одного адреса контакта. Объект `Contact` может включать более чем один адрес в массиве `ContactAddress[]`.
339
+
340
+### Параметры
341
+
342
+*   **pref**: Установите значение `true` если `ContactAddress` содержит предпочитаемое для пользователя значение. *(логический)*
343
+
344
+*   **type**: строка, указывающая тип поля, *home*, например. *(DOMString)*
345
+
346
+*   **formatted**: полный адрес отформатированый для отображения. *(DOMString)*
347
+
348
+*   **streetAddress**: полный почтовый адрес. *(DOMString)*
349
+
350
+*   **locality**: город или населенный пункт. *(DOMString)*
351
+
352
+*   **region**: штат или регион. *(DOMString)*
353
+
354
+*   **postalCode**: почтовый индекс или почтовый код. *(DOMString)*
355
+
356
+*   **country**: название страны. *(DOMString)*
357
+
358
+### Поддерживаемые платформы
359
+
360
+*   Amazon Fire OS
361
+*   Android
362
+*   BlackBerry 10
363
+*   Firefox OS
364
+*   iOS
365
+*   Windows Phone 7 и 8
366
+*   Windows 8
367
+*   Windows
368
+
369
+### Пример
370
+
371
+    // display the address information for all contacts
372
+    
373
+    function onSuccess(contacts) {
374
+        for (var i = 0; i < contacts.length; i++) {
375
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
376
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
377
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
378
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
379
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
380
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
381
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
382
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
383
+                    "Country: "        + contacts[i].addresses[j].country);
384
+            }
385
+        }
386
+    };
387
+    
388
+    function onError(contactError) {
389
+        alert('onError!');
390
+    };
391
+    
392
+    // find all contacts
393
+    var options = new ContactFindOptions();
394
+    options.filter = "";
395
+    var filter = ["displayName", "addresses"];
396
+    navigator.contacts.find(filter, onSuccess, onError, options);
397
+    
398
+
399
+### Особенности Android 2.X
400
+
401
+*   **ап**: не поддерживается, возвращая `false` на устройствах Android 2.X.
402
+
403
+### Особенности BlackBerry 10
404
+
405
+*   **ап**: не поддерживается на устройствах BlackBerry, возвращая`false`.
406
+
407
+*   **тип**: частично поддерживается. Контакт может храниться только один из *работы* и *дома* типа адреса.
408
+
409
+*   **Формат**: частично поддерживается. Возвращает объединение всех полей адреса BlackBerry.
410
+
411
+*   **streetAddress**: поддерживается. Возвращает объединение и BlackBerry **Адрес1** **Адрес2** поля адреса.
412
+
413
+*   **населенный пункт**: поддерживается. Хранится в поле адрес **город** BlackBerry.
414
+
415
+*   **регион**: поддерживает. Хранится в поле адреса **stateProvince** BlackBerry.
416
+
417
+*   **postalCode**: поддерживается. Хранится в поле адреса **zipPostal** BlackBerry.
418
+
419
+*   **страна**: поддерживается.
420
+
421
+### Особенности Firefox OS
422
+
423
+*   **formatted**: На данный момент не поддерживается
424
+
425
+### Особенности iOS
426
+
427
+*   **pref**: не поддерживается на устройствах iOS, возвращая `false`.
428
+
429
+*   **formatted**: На данный момент не поддерживается.
430
+
431
+### Совместимости Windows 8
432
+
433
+*   **pref**: Не поддерживается
434
+
435
+### Совместимости Windows
436
+
437
+*   **pref**: Не поддерживается
438
+
439
+## ContactError
440
+
441
+Объект `ContactError` возвращается пользователю через функцию обратного вызова `contactError` в случае возникновении ошибки.
442
+
443
+### Параметры
444
+
445
+*   **code**: один из стандартных кодов ошибок, перечисленных ниже.
446
+
447
+### Константы
448
+
449
+*   `ContactError.UNKNOWN_ERROR` (code 0)
450
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
451
+*   `ContactError.TIMEOUT_ERROR` (code 2)
452
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
453
+*   `ContactError.IO_ERROR` (code 4)
454
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
455
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
456
+
457
+## ContactField
458
+
459
+Объект `ContactField` является многократно используемым компонентом, который представляет контактные поля общего назначения. Каждый объект `ContactField` содержит свойства `value` , `type`, и `pref`. Объект `Contact` имеет несколько свойств сохраняющих данные в массиве `ContactField[]`, такие как номера телефонов и адреса электронной почты.
460
+
461
+В большинстве случаев не существует заранее определенные значения для атрибута **type** объекта `ContactField`. Например номер телефона можно указать значения **type** *home*, *work*, *mobile*, *iPhone* или любого другого значения, поддерживаемые базы данных контактов на платформе конкретного устройства . Однако, для `Contact` поля **photos**, поле **type** указывает формат возвращаемого изображения: **URL-адрес,** когда атрибут **value** содержит URL-адрес изображения фото или *base64* , если **value** содержит строку изображения в кодировке base64.
462
+
463
+### Параметры
464
+
465
+*   **type**: строка, указывающая тип поля, *home*, например. *(DOMString)*
466
+
467
+*   **value**: значение поля, например номер телефона или адрес электронной почты. *(DOMString)*
468
+
469
+*   **pref**: набор `true` Если `ContactField` содержит значение предпочитаемое пользователем. *(логический)*
470
+
471
+### Поддерживаемые платформы
472
+
473
+*   Amazon Fire OS
474
+*   Android
475
+*   BlackBerry 10
476
+*   Firefox OS
477
+*   iOS
478
+*   Windows Phone 7 и 8
479
+*   Windows 8
480
+*   Windows
481
+
482
+### Пример
483
+
484
+        // create a new contact
485
+        var contact = navigator.contacts.create();
486
+    
487
+        // store contact phone numbers in ContactField[]
488
+        var phoneNumbers = [];
489
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
490
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
491
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
492
+        contact.phoneNumbers = phoneNumbers;
493
+    
494
+        // save the contact
495
+        contact.save();
496
+    
497
+
498
+### Особенности Android
499
+
500
+*   **pref**: не поддерживается, возвращая `false`.
501
+
502
+### Особенности BlackBerry 10
503
+
504
+*   **type**: частично поддерживается. Используется для телефонных номеров.
505
+
506
+*   **value**: поддерживается.
507
+
508
+*   **pref**: не поддерживается, возвращая `false`.
509
+
510
+### Особенности iOS
511
+
512
+*   **pref**: не поддерживается, возвращая `false`.
513
+
514
+### Причуды Windows8
515
+
516
+*   **pref**: не поддерживается, возвращая `false`.
517
+
518
+### Совместимости Windows
519
+
520
+*   **pref**: не поддерживается, возвращая `false`.
521
+
522
+## ContactName
523
+
524
+Содержит различную информации об имени объекта `Contact`.
525
+
526
+### Параметры
527
+
528
+*   **formatted**: полное имя контакта. *(DOMString)*
529
+
530
+*   **familyName**: семья имя контакта. *(DOMString)*
531
+
532
+*   **givenName**: имя контакта. *(DOMString)*
533
+
534
+*   **middleName**: отчество контакта. *(DOMString)*
535
+
536
+*   **honorificPrefix**: префикс имени контакта (например, *г-н* или *д-р*) *(DOMString)*
537
+
538
+*   **honorificSuffix**: суффикс имени контакта (например, *эсквайр*). *(DOMString)*
539
+
540
+### Поддерживаемые платформы
541
+
542
+*   Amazon Fire OS
543
+*   Android 2.X
544
+*   BlackBerry 10
545
+*   Firefox OS
546
+*   iOS
547
+*   Windows Phone 7 и 8
548
+*   Windows 8
549
+*   Windows
550
+
551
+### Пример
552
+
553
+    function onSuccess(contacts) {
554
+        for (var i = 0; i < contacts.length; i++) {
555
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
556
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
557
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
558
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
559
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
560
+                "Prefix: "       + contacts[i].name.honorificSuffix);
561
+        }
562
+    };
563
+    
564
+    function onError(contactError) {
565
+        alert('onError!');
566
+    };
567
+    
568
+    var options = new ContactFindOptions();
569
+    options.filter = "";
570
+    filter = ["displayName", "name"];
571
+    navigator.contacts.find(filter, onSuccess, onError, options);
572
+    
573
+
574
+### Особенности Android
575
+
576
+*   **formatted**: частично поддерживается и только для чтения. Возвращает объединение значений `honorificPrefix`, `givenName`, `middleName`, `familyName`, и `honorificSuffix`.
577
+
578
+### Особенности BlackBerry 10
579
+
580
+*   **formatted**: частично поддерживается. Возвращает объединение полей BlackBerry **firstName** и **lastName** .
581
+
582
+*   **familyName**: поддерживается. Хранится в поле **lastName** BlackBerry.
583
+
584
+*   **givenName**: поддерживается. Хранится в поле **firstName** BlackBerry.
585
+
586
+*   **middleName**: не поддерживается, возвращая `null`.
587
+
588
+*   **honorificPrefix**: не поддерживается, возвращая `null`.
589
+
590
+*   **honorificSuffix**: не поддерживается, возвращая `null`.
591
+
592
+### Особенности Firefox OS
593
+
594
+*   **formatted**: частично поддерживается и только для чтения. Возвращает объединение значений `honorificPrefix`, `givenName`, `middleName`, `familyName`, и `honorificSuffix`.
595
+
596
+### Особенности iOS
597
+
598
+*   **formatted**: частично поддерживается. Возвращает составное имя iOS, но только для чтения.
599
+
600
+### Совместимости Windows 8
601
+
602
+*   **Формат**: это единственное имя свойства и идентичен `displayName` , и`nickname`
603
+
604
+*   **familyName**: не поддерживается
605
+
606
+*   **givenName**: не поддерживается
607
+
608
+*   **отчество**: не поддерживается
609
+
610
+*   **honorificPrefix**: не поддерживается
611
+
612
+*   **honorificSuffix**: не поддерживается
613
+
614
+### Совместимости Windows
615
+
616
+*   **Формат**: это же`displayName`
617
+
618
+## ContactOrganization
619
+
620
+Объект `ContactOrganization` сохраняет свойства организации контакта. A объект `Contact` хранит один или больше объектов `ContactOrganization` в массиве.
621
+
622
+### Параметры
623
+
624
+*   **pref**: Установите в `true` если `ContactOrganization` содержит значение предпочитаемое пользователем. *(логический)*
625
+
626
+*   **type**: строка, указывающая тип поля, *home*, например. _(DOMString)
627
+
628
+*   **name**: название организации. *(DOMString)*
629
+
630
+*   **department**: Отдел в котором работает контакт. *(DOMString)*
631
+
632
+*   **title**: должность контакта в организации. *(DOMString)*
633
+
634
+### Поддерживаемые платформы
635
+
636
+*   Android
637
+*   BlackBerry 10
638
+*   Firefox OS
639
+*   iOS
640
+*   Windows Phone 7 и 8
641
+*   Windows (только Windows 8.1 и 8.1 Windows Phone устройств)
642
+
643
+### Пример
644
+
645
+    function onSuccess(contacts) {
646
+        for (var i = 0; i < contacts.length; i++) {
647
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
648
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
649
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
650
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
651
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
652
+                    "Title: "       + contacts[i].organizations[j].title);
653
+            }
654
+        }
655
+    };
656
+    
657
+    function onError(contactError) {
658
+        alert('onError!');
659
+    };
660
+    
661
+    var options = new ContactFindOptions();
662
+    options.filter = "";
663
+    filter = ["displayName", "organizations"];
664
+    navigator.contacts.find(filter, onSuccess, onError, options);
665
+    
666
+
667
+### Особенности Android 2.X
668
+
669
+*   **pref**: не поддерживается устройствами Android 2.X, возвращая `false`.
670
+
671
+### Особенности BlackBerry 10
672
+
673
+*   **pref**: не поддерживается на устройствах BlackBerry, возвращая `false`.
674
+
675
+*   **type**: не поддерживается на устройствах BlackBerry, возвращая `null`.
676
+
677
+*   **name**: частично поддерживается. Первый название организации хранится в поле **company** BlackBerry.
678
+
679
+*   **department**: не поддерживается, возвращая `null`.
680
+
681
+*   **title**: частично поддерживается. Первый должность в организации хранится в поле **jobTitle** BlackBerry.
682
+
683
+### Особенности Firefox OS
684
+
685
+*   **pref**: Не поддерживается
686
+
687
+*   **type**: Не поддерживается
688
+
689
+*   **department**: Не поддерживается
690
+
691
+*   Поля **name** и **title** хранятся в полях **org** and **jobTitle**.
692
+
693
+### Особенности iOS
694
+
695
+*   **pref**: не поддерживается на устройствах iOS, возвращая `false`.
696
+
697
+*   **type**: не поддерживается на устройствах iOS, возвращая `null`.
698
+
699
+*   **name**: частично поддерживается. Первое название организации хранится в поле **kABPersonOrganizationProperty** iOS.
700
+
701
+*   **department**: частично поддерживается. Имя первого отдела хранится в поле **kABPersonDepartmentProperty** iOS.
702
+
703
+*   **title**: частично поддерживается. Первая должность хранится в поле **kABPersonJobTitleProperty** iOS.
704
+
705
+### Совместимости Windows
706
+
707
+*   **pref**: не поддерживается, возвращая `false`.
708
+
709
+*   **тип**: не поддерживается, возвращая`null`.

+ 735
- 0
km0App/node_modules/cordova-plugin-contacts/doc/zh/README.md Parādīt failu

@@ -0,0 +1,735 @@
1
+<!---
2
+# license: Licensed to the Apache Software Foundation (ASF) under one
3
+#         or more contributor license agreements.  See the NOTICE file
4
+#         distributed with this work for additional information
5
+#         regarding copyright ownership.  The ASF licenses this file
6
+#         to you under the Apache License, Version 2.0 (the
7
+#         "License"); you may not use this file except in compliance
8
+#         with the License.  You may obtain a copy of the License at
9
+#
10
+#           http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+#         Unless required by applicable law or agreed to in writing,
13
+#         software distributed under the License is distributed on an
14
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+#         KIND, either express or implied.  See the License for the
16
+#         specific language governing permissions and limitations
17
+#         under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-contacts.svg)](https://travis-ci.org/apache/cordova-plugin-contacts)
23
+
24
+這個外掛程式定義了一個全域 `navigator.contacts` 物件,提供對設備連絡人資料庫的訪問。
25
+
26
+雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
27
+
28
+    document.addEventListener("deviceready", onDeviceReady, false);
29
+    function onDeviceReady() {
30
+        console.log(navigator.contacts);
31
+    }
32
+    
33
+
34
+**警告**: 連絡人資料的收集和使用提出了重要的隱私問題。 您的應用程式的隱私權原則應該討論應用程式如何使用連絡人資料和它是否被共用與任何其他締約方。 聯繫資訊被認為是敏感,因為它揭示了的人與人溝通了。 因此,除了隱私權原則的應用程式,您應強烈考慮提供時間只是通知之前應用程式訪問或使用連絡人的資料,如果設備作業系統不已經這樣做了。 該通知應提供相同的資訊,如上所述,以及獲取該使用者的許可權 (例如,通過提出選擇 **確定** 並 **不感謝**)。 請注意一些應用程式市場可能需要應用程式提供只是時間的通知,並獲得使用者的許可才能訪問連絡人資料。 周圍的連絡人資料可以説明避免使用者混淆使用和連絡人資料感知的濫用的清楚和容易理解的使用者體驗。 有關詳細資訊,請參閱隱私指南。
35
+
36
+## 安裝
37
+
38
+這就要求科爾多瓦 5.0 + (當前穩定 v1.0.0)
39
+
40
+    cordova plugin add cordova-plugin-contacts
41
+    
42
+
43
+舊版本的科爾多瓦仍可以安裝通過**棄用**id (陳舊 v0.2.16)
44
+
45
+    cordova plugin add org.apache.cordova.contacts
46
+    
47
+
48
+它也是可以直接通過回購 url 安裝 (不穩定)
49
+
50
+    cordova plugin add https://github.com/apache/cordova-plugin-contacts.git
51
+    
52
+
53
+### 火狐瀏覽器作業系統的怪癖
54
+
55
+在 [清單檔](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)。 在另一種方式初始化您的應用程式。
56
+
57
+    "type": "privileged",
58
+    "permissions": {
59
+        "contacts": {
60
+            "access": "readwrite",
61
+            "description": "Describe why there is a need for such permission"
62
+        }
63
+    }
64
+    
65
+
66
+### Windows 的怪癖
67
+
68
+**之前 Windows 10:**從`發現`和`pickContact`方法返回任何連絡人是唯讀,因此您的應用程式不能修改它們。 僅在 Windows Phone 8.1 設備上可用的 `find` 方法。
69
+
70
+**Windows 10 及以上:**連絡人可能保存,並將保存到應用程式本地連絡人存儲。 連絡人也會被刪除。
71
+
72
+### Windows 8 的怪癖
73
+
74
+Windows 8 連絡人是唯讀的。 透過科爾多瓦 API 接觸的不是可查詢/搜索,您應通知使用者挑選連絡人作為調用 contacts.pickContact,將會打開 '人' 的應用程式,使用者必須選擇一個連絡人。 返回任何連絡人是唯讀,因此您的應用程式不能修改它們。
75
+
76
+## navigator.contacts
77
+
78
+### 方法
79
+
80
+  * navigator.contacts.create
81
+  * navigator.contacts.find
82
+  * navigator.contacts.pickContact
83
+
84
+### 物件
85
+
86
+  * 連絡人
87
+  * 連絡人姓名
88
+  * ContactField
89
+  * ContactAddress
90
+  * ContactOrganization
91
+  * ContactFindOptions
92
+  * ContactError
93
+  * ContactFieldType
94
+
95
+## navigator.contacts.create
96
+
97
+`navigator.contacts.create` 方法是同步的並返回一個新的 `Contact` 物件。
98
+
99
+此方法將不會保留在設備連絡人資料庫中,需要調用 `Contact.save` 方法的聯繫物件。
100
+
101
+### 支援的平臺
102
+
103
+  * Android 系統
104
+  * 黑莓 10
105
+  * 火狐瀏覽器作業系統
106
+  * iOS
107
+  * Windows Phone 7 和 8
108
+
109
+### 示例
110
+
111
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
112
+    
113
+
114
+## navigator.contacts.find
115
+
116
+`navigator.contacts.find` 方法以非同步方式,執行設備連絡人資料庫查詢並返回 `Contact` 物件的陣列。 生成的物件被傳遞到由 **contactSuccess** 參數指定的 `contactSuccess` 回呼函數。
117
+
118
+**contactFields** 參數指定的欄位用作搜索限定詞。 長度為零的 **contactFields** 參數是不正確並導致 `ContactError.INVALID_ARGUMENT_ERROR`。 **contactFields** 值為 `"*"` 搜索所有連絡人欄位。
119
+
120
+在連絡人資料庫查詢時,**contactFindOptions.filter** 字串可以用作搜索篩選器。 如果提供,不區分大小寫,部分值匹配被適用于在 **contactFields** 參數中指定的每個欄位。 如果存在匹配的 *任何* 指定的欄位,則返回連絡人。 使用 **contactFindOptions.desiredFields** 參數來控制哪些連絡人屬性必須回來。
121
+
122
+### 參數
123
+
124
+  * **contactFields**: '連絡人' 欄位用作搜索限定詞。*(DOMString[])* [Required]
125
+
126
+  * **contactSuccess**: 從資料庫返回的成功回呼函數調用時使用的連絡人物件的陣列。[Required]
127
+
128
+  * **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
129
+
130
+  * **contactFindOptions**: 搜索選項來篩選 navigator.contacts。[Optional]
131
+    
132
+    鍵包括:
133
+    
134
+      * **filter**: 用來找到 navigator.contacts 的搜索字串。*() DOMString*(預設: `""`)
135
+    
136
+      * **multiple**: 確定是否查找操作返回多個 navigator.contacts。*(布林值)*(預設值: `false`)
137
+        
138
+          * **desiredFields**: '連絡人' 欄位,又折回來。如果指定,由此產生的 `Contact` 物件只有這些欄位的功能值。*(DOMString[])* [Optional]
139
+
140
+### 支援的平臺
141
+
142
+  * Android 系統
143
+  * 黑莓 10
144
+  * 火狐瀏覽器作業系統
145
+  * iOS
146
+  * Windows Phone 7 和 8
147
+  * Windows (Windows Phone 8.1 和 Windows 10)
148
+
149
+### 示例
150
+
151
+    function onSuccess(contacts) {
152
+        alert('Found ' + contacts.length + ' contacts.');
153
+    };
154
+    
155
+    function onError(contactError) {
156
+        alert('onError!');
157
+    };
158
+    
159
+    // find all contacts with 'Bob' in any name field
160
+    var options      = new ContactFindOptions();
161
+    options.filter   = "Bob";
162
+    options.multiple = true;
163
+    options.desiredFields = [navigator.contacts.fieldType.id];
164
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
165
+    navigator.contacts.find(fields, onSuccess, onError, options);
166
+    
167
+
168
+### Windows 的怪癖
169
+
170
+  * `__contactFields__`不受支援,將被忽略。`find`方法將始終嘗試匹配名稱、 電子郵件地址或電話號碼的連絡人。
171
+
172
+## navigator.contacts.pickContact
173
+
174
+`navigator.contacts.pickContact` 方法啟動連絡人選取器來選擇一個連絡人。 將生成的物件傳遞給 **contactSuccess** 參數所指定的 `contactSuccess` 回呼函數。
175
+
176
+### 參數
177
+
178
+  * **contactSuccess**: 成功使用單個連絡人物件調用的回呼函數。[要求]
179
+
180
+  * **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
181
+
182
+### 支援的平臺
183
+
184
+  * Android 系統
185
+  * iOS
186
+  * Windows Phone 8
187
+  * Windows 8
188
+  * Windows
189
+
190
+### 示例
191
+
192
+    navigator.contacts.pickContact(function(contact){
193
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
194
+        },function(err){
195
+            console.log('Error: ' + err);
196
+        });
197
+    
198
+
199
+## 連絡人
200
+
201
+`Contact` 物件表示使用者的連絡人。 可以創建、 存儲,或從設備的連絡人資料庫中刪除連絡人。 連絡人可以也被 (單獨或批量) 從資料庫中檢索通過調用 `navigator.contacts.find` 方法。
202
+
203
+**注**: 並不是所有上面列出的連絡人欄位支援的每個設備的平臺。請檢查每個平臺 *的怪癖* 節瞭解詳細資訊。
204
+
205
+### 屬性
206
+
207
+  * **id**: 一個全域唯一識別碼。*() DOMString*
208
+
209
+  * **displayName**: 此連絡人,適合於向最終使用者顯示的名稱。*() DOMString*
210
+
211
+  * **name**: 一個物件,包含所有元件的一個人的名字。*(連絡人姓名)*
212
+
213
+  * **nickname**: 休閒的位址連絡人名稱。*() DOMString*
214
+
215
+  * **phoneNumbers**: 陣列的所有連絡人的電話號碼。*(ContactField[])*
216
+
217
+  * **emails**: 所有連絡人的電子郵件地址的陣列。*(ContactField[])*
218
+
219
+  * **addresses**: 該連絡人的所有位址的陣列。*(ContactAddress[])*
220
+
221
+  * **ims**: 所有連絡人的 IM 位址的陣列。*(ContactField[])*
222
+
223
+  * **organizations**: 該連絡人的所有組織的陣列。*(ContactOrganization[])*
224
+
225
+  * **birthday**: 連絡人的生日。*(Date)*
226
+
227
+  * **note**: 注意有關的聯繫。*() DOMString*
228
+
229
+  * **photos**: 陣列的連絡人的照片。*(ContactField[])*
230
+
231
+  * **categories**: 陣列與連絡人關聯的所有使用者定義的類別。*(ContactField[])*
232
+
233
+  * **url**: 陣列與連絡人關聯的 web 頁。*(ContactField[])*
234
+
235
+### 方法
236
+
237
+  * **clone**: 返回一個新的 `Contact` 物件就是調用物件的深層副本 `id` 屬性設置為`null`.
238
+
239
+  * **remove**: 從設備的連絡人資料庫中刪除連絡人,否則執行錯誤回檔與 `ContactError` 物件。
240
+
241
+  * **save**: 將一個新的連絡人保存到設備的連絡人資料庫中,或更新現有的連絡人,如果已存在具有相同 **id** 的連絡人。
242
+
243
+### 支援的平臺
244
+
245
+  * 亞馬遜火 OS
246
+  * Android 系統
247
+  * 黑莓 10
248
+  * 火狐瀏覽器作業系統
249
+  * iOS
250
+  * Windows Phone 7 和 8
251
+  * Windows 8
252
+  * Windows
253
+
254
+### 保存示例
255
+
256
+    function onSuccess(contact) {
257
+        alert("Save Success");
258
+    };
259
+    
260
+    function onError(contactError) {
261
+        alert("Error = " + contactError.code);
262
+    };
263
+    
264
+    // create a new contact object
265
+    var contact = navigator.contacts.create();
266
+    contact.displayName = "Plumber";
267
+    contact.nickname = "Plumber";            // specify both to support all devices
268
+    
269
+    // populate some fields
270
+    var name = new ContactName();
271
+    name.givenName = "Jane";
272
+    name.familyName = "Doe";
273
+    contact.name = name;
274
+    
275
+    // save to device
276
+    contact.save(onSuccess,onError);
277
+    
278
+
279
+### 克隆示例
280
+
281
+        // clone the contact object
282
+        var clone = contact.clone();
283
+        clone.name.givenName = "John";
284
+        console.log("Original contact name = " + contact.name.givenName);
285
+        console.log("Cloned contact name = " + clone.name.givenName);
286
+    
287
+
288
+### 刪除示例
289
+
290
+    function onSuccess() {
291
+        alert("Removal Success");
292
+    };
293
+    
294
+    function onError(contactError) {
295
+        alert("Error = " + contactError.code);
296
+    };
297
+    
298
+    // remove the contact from the device
299
+    contact.remove(onSuccess,onError);
300
+    
301
+
302
+### Android 2.X 的怪癖
303
+
304
+  * **categories**: 不支援 Android 2.X 在設備上,返回`null`.
305
+
306
+### 黑莓 10 怪癖
307
+
308
+  * **id**: 由該設備分配時保存該連絡人。
309
+
310
+### FirefoxOS 的怪癖
311
+
312
+  * **categories**: 部分支援。返回欄位**pref**和**type**`null`
313
+
314
+  * **ims**: 不支援
315
+
316
+  * **photos**: 不支援
317
+
318
+### iOS 的怪癖
319
+
320
+  * **displayName**: 上返回的 iOS 不支援 `null` 除非有沒有 `ContactName` 指定,在這種情況下它將返回複合名稱,**nickname**或 `""` ,分別。
321
+
322
+  * **birthday**: 必須輸入 JavaScript 作為 `Date` 物件,它將返回相同的方式。
323
+
324
+  * **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。當應用程式退出時刪除臨時目錄的內容。
325
+
326
+  * **categories**: 目前不支援此屬性,返回`null`.
327
+
328
+### Windows Phone 7 和 8 怪癖
329
+
330
+  * **displayName**: 當創建一個連絡人,提供的顯示名稱參數不同于顯示名稱的值檢索查找連絡人時。
331
+
332
+  * **url**: 當創建一個連絡人,使用者可以輸入和保存多個 web 位址,但只有一個是可用的搜索連絡人時。
333
+
334
+  * **phoneNumbers**:*pref*選項不受支援。 在*type*操作中不是支援的*find*。 只有一個 `phoneNumber` 允許的每個*type*.
335
+
336
+  * **emails**:*pref*選項不受支援。家庭和個人使用引用同一電子郵件項。只有一項是允許的每個*type*.
337
+
338
+  * **addresses**: 僅支援的工作和家庭/個人*type*。家庭和個人*type*引用相同的位址條目。只有一項是允許的每個*type*.
339
+
340
+  * **organizations**: 唯一一個允許的和不支援的*pref*、*type*和*department*的屬性。
341
+
342
+  * **note**: 不支援,返回`null`.
343
+
344
+  * **ims**: 不受支援,返回`null`.
345
+
346
+  * **birthdays**: 不受支援,返回`null`.
347
+
348
+  * **categories**: 不受支援,返回`null`.
349
+
350
+  * **remove**: 不支援方法
351
+
352
+### Windows 的怪癖
353
+
354
+  * **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。
355
+
356
+  * **birthdays**: 不受支援,返回`null`.
357
+
358
+  * **categories**: 不受支援,返回`null`.
359
+
360
+  * **remove**: 方法只支援 Windows 10 或以上。
361
+
362
+## ContactAddress
363
+
364
+`ContactAddress` 物件存儲單個位址的連絡人的屬性。 `Contact` 物件可能包括多個位址 `ContactAddress []` 陣列中。
365
+
366
+### 屬性
367
+
368
+  * **pref**: 設置為 `true` 如果這個 `ContactAddress` 包含使用者的首選的價值。*(Boolean)*
369
+
370
+  * **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
371
+
372
+  * **formatted**: 顯示格式的完整位址。*() DOMString*
373
+
374
+  * **streetAddress**: 完整的街道位址。*() DOMString*
375
+
376
+  * **locality**: 城市或地點。*() DOMString*
377
+
378
+  * **region**: 國家或地區。*() DOMString*
379
+
380
+  * **postalCode**: 郵遞區號。*() DOMString*
381
+
382
+  * **country**: 國家名稱。*() DOMString*
383
+
384
+### 支援的平臺
385
+
386
+  * 亞馬遜火 OS
387
+  * Android 系統
388
+  * 黑莓 10
389
+  * 火狐瀏覽器作業系統
390
+  * iOS
391
+  * Windows Phone 7 和 8
392
+  * Windows 8
393
+  * Windows
394
+
395
+### 示例
396
+
397
+    // display the address information for all contacts
398
+    
399
+    function onSuccess(contacts) {
400
+        for (var i = 0; i < contacts.length; i++) {
401
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
402
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
403
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
404
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
405
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
406
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
407
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
408
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
409
+                    "Country: "        + contacts[i].addresses[j].country);
410
+            }
411
+        }
412
+    };
413
+    
414
+    function onError(contactError) {
415
+        alert('onError!');
416
+    };
417
+    
418
+    // find all contacts
419
+    var options = new ContactFindOptions();
420
+    options.filter = "";
421
+    var filter = ["displayName", "addresses"];
422
+    navigator.contacts.find(filter, onSuccess, onError, options);
423
+    
424
+
425
+### Android 2.X 的怪癖
426
+
427
+  * **pref**: 不受支援,返回 `false` Android 2.X 的設備上。
428
+
429
+### 黑莓 10 怪癖
430
+
431
+  * **pref**: 在返回的黑莓設備上不支援`false`.
432
+
433
+  * **type**: 部分支援。只有一個*Word*和*Home*類型位址可以存儲每個連絡人。
434
+
435
+  * **formatted**: 部分支援。返回的串聯的所有黑莓手機位址欄位。
436
+
437
+  * **streetAddress**: 支援。返回和串聯組成的黑莓**address1** **address2**位址欄位。
438
+
439
+  * **locality**: 支援。黑莓手機**city**位址欄位中存儲。
440
+
441
+  * **region**: 支援。黑莓**stateProvince**位址欄位中存儲。
442
+
443
+  * **postalCode**: 支援。黑莓**zipPostal**位址欄位中存儲。
444
+
445
+  * **country**: 支援。
446
+
447
+### FirefoxOS 的怪癖
448
+
449
+  * **formatted**: 目前不支援
450
+
451
+### iOS 的怪癖
452
+
453
+  * **pref**: 不支援在 iOS 設備上,返回`false`.
454
+
455
+  * **formatted**: 目前不支援。
456
+
457
+### Windows 8 的怪癖
458
+
459
+  * **pref**: 不支援
460
+
461
+### Windows 的怪癖
462
+
463
+  * **pref**: 不支援
464
+
465
+## ContactError
466
+
467
+當發生錯誤時,通過 `contactError` 回呼函數為使用者情況下會返回的 `ContactError` 物件。
468
+
469
+### 屬性
470
+
471
+  * **code**: 下面列出的預定義的錯誤代碼之一。
472
+
473
+### 常量
474
+
475
+  * `ContactError.UNKNOWN_ERROR` (code 0)
476
+  * `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
477
+  * `ContactError.TIMEOUT_ERROR` (code 2)
478
+  * `ContactError.PENDING_OPERATION_ERROR` (code 3)
479
+  * `ContactError.IO_ERROR` (code 4)
480
+  * `ContactError.NOT_SUPPORTED_ERROR` (code 5)
481
+  * `ContactError.PERMISSION_DENIED_ERROR` (code 20)
482
+
483
+## ContactField
484
+
485
+`ContactField` 物件是可重用的元件代表一般連絡人欄位。 每個 `ContactField` 物件包含一個 `value`、 `type` 和 `pref` 的屬性。 `Contacat` 物件將幾個屬性存儲在 `ContactField []` 陣列,例如電話號碼和電子郵件地址。
486
+
487
+在大多數情況下,沒有預先確定的 `ContactField` 物件的 **type** 屬性值。 例如,一個電話號碼可以指定 **type** 值的 *home*、 *work*、 *mobile*、 *iPhone* 或由一個特定的設備平臺接觸資料庫系統支援的任何其他值。 然而,為 `photos` **照片** 欄位中,**type** 欄位指示返回圖像的格式: 當 **value** 屬性包含一個指向的照片圖像或 *base64* URL 時的 **value** 包含 string base64 編碼的圖像的 **url**。
488
+
489
+### 屬性
490
+
491
+  * **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
492
+
493
+  * **value**: 欄位的值,如電話號碼或電子郵件地址。*() DOMString*
494
+
495
+  * **pref**: 設置為 `true` 如果這個 `ContactField` 包含使用者的首選的價值。*(布林)*
496
+
497
+### 支援的平臺
498
+
499
+  * 亞馬遜火 OS
500
+  * Android 系統
501
+  * 黑莓 10
502
+  * 火狐瀏覽器作業系統
503
+  * iOS
504
+  * Windows Phone 7 和 8
505
+  * Windows 8
506
+  * Windows
507
+
508
+### 示例
509
+
510
+        // create a new contact
511
+        var contact = navigator.contacts.create();
512
+    
513
+        // store contact phone numbers in ContactField[]
514
+        var phoneNumbers = [];
515
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
516
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
517
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
518
+        contact.phoneNumbers = phoneNumbers;
519
+    
520
+        // save the contact
521
+        contact.save();
522
+    
523
+
524
+### Android 的怪癖
525
+
526
+  * **pref**: 不受支援,返回`false`.
527
+
528
+### 黑莓 10 怪癖
529
+
530
+  * **type**: 部分支援。使用的電話號碼。
531
+
532
+  * **value**: 支援。
533
+
534
+  * **pref**: 不受支援,返回`false`.
535
+
536
+### iOS 的怪癖
537
+
538
+  * **pref**: 不受支援,返回`false`.
539
+
540
+### Windows8 的怪癖
541
+
542
+  * **pref**: 不受支援,返回`false`.
543
+
544
+### Windows 的怪癖
545
+
546
+  * **pref**: 不受支援,返回`false`.
547
+
548
+## 連絡人姓名
549
+
550
+包含不同種類的 `Contact` 物件名稱有關的資訊。
551
+
552
+### 屬性
553
+
554
+  * **formatted**: 該連絡人的完整名稱。*() DOMString*
555
+
556
+  * **familyName**: 連絡人的姓氏。*() DOMString*
557
+
558
+  * **givenName**: 連絡人的名字。*() DOMString*
559
+
560
+  * **middleName**: 連絡人的中間名。*() DOMString*
561
+
562
+  * **honorificPrefix**: 連絡人的首碼 (例如*先生*或*博士*) *(DOMString)*
563
+
564
+  * **honorificSuffix**: 連絡人的尾碼 (例如*某某某*)。*() DOMString*
565
+
566
+### 支援的平臺
567
+
568
+  * 亞馬遜火 OS
569
+  * Android 系統
570
+  * 黑莓 10
571
+  * 火狐瀏覽器作業系統
572
+  * iOS
573
+  * Windows Phone 7 和 8
574
+  * Windows 8
575
+  * Windows
576
+
577
+### 示例
578
+
579
+    function onSuccess(contacts) {
580
+        for (var i = 0; i < contacts.length; i++) {
581
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
582
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
583
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
584
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
585
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
586
+                "Prefix: "       + contacts[i].name.honorificSuffix);
587
+        }
588
+    };
589
+    
590
+    function onError(contactError) {
591
+        alert('onError!');
592
+    };
593
+    
594
+    var options = new ContactFindOptions();
595
+    options.filter = "";
596
+    filter = ["displayName", "name"];
597
+    navigator.contacts.find(filter, onSuccess, onError, options);
598
+    
599
+
600
+### Android 的怪癖
601
+
602
+  * **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
603
+
604
+### 黑莓 10 怪癖
605
+
606
+  * **formatted**: 部分支援。返回的串聯的黑莓手機**firstName**和**lastName**欄位。
607
+
608
+  * **familyName**: 支援。黑莓**lastName**欄位中存儲。
609
+
610
+  * **givenName**: 支援。黑莓**firstName**欄位中存儲。
611
+
612
+  * **middleName**: 不受支援,返回`null`.
613
+
614
+  * **honorificPrefix**: 不受支援,返回`null`.
615
+
616
+  * **honorificSuffix**: 不受支援,返回`null`.
617
+
618
+### FirefoxOS 的怪癖
619
+
620
+  * **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
621
+
622
+### iOS 的怪癖
623
+
624
+  * **formatted**: 部分支援。返回 iOS 複合名稱,但為唯讀。
625
+
626
+### Windows 8 的怪癖
627
+
628
+  * **formatted**: 這是唯一名稱屬性,並且是相同的 `displayName` ,和`nickname`
629
+
630
+  * **familyName**: 不支援
631
+
632
+  * **givenName**: 不支援
633
+
634
+  * **middleName**: 不支援
635
+
636
+  * **honorificPrefix**: 不支援
637
+
638
+  * **honorificSuffix**: 不支援
639
+
640
+### Windows 的怪癖
641
+
642
+  * **formatted**: 它是完全相同`displayName`
643
+
644
+## ContactOrganization
645
+
646
+`ContactOrganization` 物件存儲連絡人的組織屬性。`Contact` 物件將一個或多個 `ContactOrganization` 物件存儲在一個陣列中。
647
+
648
+### 屬性
649
+
650
+  * **pref**: 設置為 `true` 如果這個 `ContactOrganization` 包含使用者的首選的價值。*(布林)*
651
+
652
+  * **type**: 一個字串,例如指示哪種類型的欄位,這是*回家*。_(DOMString)
653
+
654
+  * **name**: 組織的名稱。*() DOMString*
655
+
656
+  * **department**: 合同工作為的部門。*() DOMString*
657
+
658
+  * **title**: 在組織連絡人的標題。*() DOMString*
659
+
660
+### 支援的平臺
661
+
662
+  * Android 系統
663
+  * 黑莓 10
664
+  * 火狐瀏覽器作業系統
665
+  * iOS
666
+  * Windows Phone 7 和 8
667
+  * Windows (Windows 8.1 和 Windows Phone 8.1 設備)
668
+
669
+### 示例
670
+
671
+    function onSuccess(contacts) {
672
+        for (var i = 0; i < contacts.length; i++) {
673
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
674
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
675
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
676
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
677
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
678
+                    "Title: "       + contacts[i].organizations[j].title);
679
+            }
680
+        }
681
+    };
682
+    
683
+    function onError(contactError) {
684
+        alert('onError!');
685
+    };
686
+    
687
+    var options = new ContactFindOptions();
688
+    options.filter = "";
689
+    filter = ["displayName", "organizations"];
690
+    navigator.contacts.find(filter, onSuccess, onError, options);
691
+    
692
+
693
+### Android 2.X 的怪癖
694
+
695
+  * **pref**: 不支援的 Android 2.X 的設備,返回`false`.
696
+
697
+### 黑莓 10 怪癖
698
+
699
+  * **pref**: 不支援的黑莓手機,返回`false`.
700
+
701
+  * **type**: 不支援的黑莓手機,返回`null`.
702
+
703
+  * **name**: 部分支援。第一次組織名稱存儲在黑莓**company**欄位中。
704
+
705
+  * **department**: 不受支援,返回`null`.
706
+
707
+  * **title**: 部分支援。第一次組織標題存儲在欄位中黑莓**jobTitle**。
708
+
709
+### 火狐瀏覽器作業系統的怪癖
710
+
711
+  * **pref**: 不支援
712
+
713
+  * **type**: 不支援
714
+
715
+  * **department**: 不支援
716
+
717
+  * 欄位**name**和**title**存儲在**org**和**jobTitle**.
718
+
719
+### iOS 的怪癖
720
+
721
+  * **pref**: 不支援在 iOS 設備上,返回`false`.
722
+
723
+  * **type**: 不支援在 iOS 設備上,返回`null`.
724
+
725
+  * **name**: 部分支援。第一次組織名稱存儲在 iOS **kABPersonOrganizationProperty**欄位中。
726
+
727
+  * **department**: 部分支援。第一部門名稱存儲在 iOS **kABPersonDepartmentProperty**欄位中。
728
+
729
+  * **title**: 部分支援。第一個標題存儲在 iOS **kABPersonJobTitleProperty**欄位中。
730
+
731
+### Windows 的怪癖
732
+
733
+  * **pref**: 不受支援,返回`false`.
734
+
735
+  * **type**: 不受支援,返回`null`.

+ 719
- 0
km0App/node_modules/cordova-plugin-contacts/doc/zh/index.md Parādīt failu

@@ -0,0 +1,719 @@
1
+<!---
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+      http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+-->
19
+
20
+# cordova-plugin-contacts
21
+
22
+這個外掛程式定義了一個全域 `navigator.contacts` 物件,提供對設備連絡人資料庫的訪問。
23
+
24
+雖然該物件附加到全球範圍內 `導航器`,它不可用直到 `deviceready` 事件之後。
25
+
26
+    document.addEventListener("deviceready", onDeviceReady, false);
27
+    function onDeviceReady() {
28
+        console.log(navigator.contacts);
29
+    }
30
+    
31
+
32
+**警告**: 連絡人資料的收集和使用提出了重要的隱私問題。 您的應用程式的隱私權原則應該討論應用程式如何使用連絡人資料和它是否被共用與任何其他締約方。 聯繫資訊被認為是敏感,因為它揭示了的人與人溝通了。 因此,除了隱私權原則的應用程式,您應強烈考慮提供時間只是通知之前應用程式訪問或使用連絡人的資料,如果設備作業系統不已經這樣做了。 該通知應提供相同的資訊,如上所述,以及獲取該使用者的許可權 (例如,通過提出選擇 **確定** 並 **不感謝**)。 請注意一些應用程式市場可能需要應用程式提供只是時間的通知,並獲得使用者的許可才能訪問連絡人資料。 周圍的連絡人資料可以説明避免使用者混淆使用和連絡人資料感知的濫用的清楚和容易理解的使用者體驗。 有關詳細資訊,請參閱隱私指南。
33
+
34
+## 安裝
35
+
36
+    cordova plugin add cordova-plugin-contacts
37
+    
38
+
39
+### 火狐瀏覽器作業系統的怪癖
40
+
41
+在 [清單檔][1] 中所述創建 **www/manifest.webapp**。 添加相關的許可權。 也是需要的 web 應用程式類型更改為"privileged"— — [顯化的文檔][2]。 **警告**: 所有的特權應用程式強制執行禁止內聯腳本的 [內容的安全性原則][3]。 在另一種方式初始化您的應用程式。
42
+
43
+ [1]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest
44
+ [2]: https://developer.mozilla.org/en-US/Apps/Developing/Manifest#type
45
+ [3]: https://developer.mozilla.org/en-US/Apps/CSP
46
+
47
+    "type": "privileged",
48
+    "permissions": {
49
+        "contacts": {
50
+            "access": "readwrite",
51
+            "description": "Describe why there is a need for such permission"
52
+        }
53
+    }
54
+    
55
+
56
+### Windows 的怪癖
57
+
58
+從 `find` 和 `pickContact` 方法返回任何連絡人是唯讀,因此您的應用程式不能修改它們。 僅在 Windows Phone 8.1 設備上可用的 `find` 方法。
59
+
60
+### Windows 8 的怪癖
61
+
62
+Windows 8 連絡人是唯讀的。 透過科爾多瓦 API 接觸的不是可查詢/搜索,您應通知使用者挑選連絡人作為調用 contacts.pickContact,將會打開 '人' 的應用程式,使用者必須選擇一個連絡人。 返回任何連絡人是唯讀,因此您的應用程式不能修改它們。
63
+
64
+## navigator.contacts
65
+
66
+### 方法
67
+
68
+*   navigator.contacts.create
69
+*   navigator.contacts.find
70
+*   navigator.contacts.pickContact
71
+
72
+### 物件
73
+
74
+*   連絡人
75
+*   連絡人姓名
76
+*   ContactField
77
+*   ContactAddress
78
+*   ContactOrganization
79
+*   ContactFindOptions
80
+*   ContactError
81
+*   ContactFieldType
82
+
83
+## navigator.contacts.create
84
+
85
+`navigator.contacts.create` 方法是同步的並返回一個新的 `Contact` 物件。
86
+
87
+此方法將不會保留在設備連絡人資料庫中,需要調用 `Contact.save` 方法的聯繫物件。
88
+
89
+### 支援的平臺
90
+
91
+*   Android 系統
92
+*   黑莓 10
93
+*   火狐瀏覽器作業系統
94
+*   iOS
95
+*   Windows Phone 7 和 8
96
+
97
+### 示例
98
+
99
+    var myContact = navigator.contacts.create({"displayName": "Test User"});
100
+    
101
+
102
+## navigator.contacts.find
103
+
104
+`navigator.contacts.find` 方法以非同步方式,執行設備連絡人資料庫查詢並返回 `Contact` 物件的陣列。 生成的物件被傳遞到由 **contactSuccess** 參數指定的 `contactSuccess` 回呼函數。
105
+
106
+**contactFields** 參數指定的欄位用作搜索限定詞。 長度為零的 **contactFields** 參數是不正確並導致 `ContactError.INVALID_ARGUMENT_ERROR`。 **contactFields** 值為 `"*"` 搜索所有連絡人欄位。
107
+
108
+在連絡人資料庫查詢時,**contactFindOptions.filter** 字串可以用作搜索篩選器。 如果提供,不區分大小寫,部分值匹配被適用于在 **contactFields** 參數中指定的每個欄位。 如果存在匹配的 *任何* 指定的欄位,則返回連絡人。 使用 **contactFindOptions.desiredFields** 參數來控制哪些連絡人屬性必須回來。
109
+
110
+### 參數
111
+
112
+*   **contactFields**: '連絡人' 欄位用作搜索限定詞。*(DOMString[])* [Required]
113
+
114
+*   **contactSuccess**: 從資料庫返回的成功回呼函數調用時使用的連絡人物件的陣列。[Required]
115
+
116
+*   **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
117
+
118
+*   **contactFindOptions**: 搜索選項來篩選 navigator.contacts。[Optional]
119
+    
120
+    鍵包括:
121
+    
122
+    *   **filter**: 用來找到 navigator.contacts 的搜索字串。*() DOMString*(預設: `""`)
123
+    
124
+    *   **multiple**: 確定是否查找操作返回多個 navigator.contacts。*(布林值)*(預設值: `false`)
125
+        
126
+        *   **desiredFields**: '連絡人' 欄位,又折回來。如果指定,由此產生的 `Contact` 物件只有這些欄位的功能值。*(DOMString[])* [Optional]
127
+
128
+### 支援的平臺
129
+
130
+*   Android 系統
131
+*   黑莓 10
132
+*   火狐瀏覽器作業系統
133
+*   iOS
134
+*   Windows Phone 7 和 8
135
+*   Windows (僅適用于 Windows Phone 8.1 設備)
136
+
137
+### 示例
138
+
139
+    function onSuccess(contacts) {
140
+        alert('Found ' + contacts.length + ' contacts.');
141
+    };
142
+    
143
+    function onError(contactError) {
144
+        alert('onError!');
145
+    };
146
+    
147
+    // find all contacts with 'Bob' in any name field
148
+    var options      = new ContactFindOptions();
149
+    options.filter   = "Bob";
150
+    options.multiple = true;
151
+    options.desiredFields = [navigator.contacts.fieldType.id];
152
+    var fields       = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
153
+    navigator.contacts.find(fields, onSuccess, onError, options);
154
+    
155
+
156
+### Windows 的怪癖
157
+
158
+*   `__contactFields__`不受支援,將被忽略。`find`方法將始終嘗試匹配名稱、 電子郵件地址或電話號碼的連絡人。
159
+
160
+## navigator.contacts.pickContact
161
+
162
+`navigator.contacts.pickContact` 方法啟動連絡人選取器來選擇一個連絡人。 將生成的物件傳遞給 **contactSuccess** 參數所指定的 `contactSuccess` 回呼函數。
163
+
164
+### 參數
165
+
166
+*   **contactSuccess**: 成功使用單個連絡人物件調用的回呼函數。[要求]
167
+
168
+*   **contactError**: 錯誤回呼函數,當發生錯誤時調用。[可選]
169
+
170
+### 支援的平臺
171
+
172
+*   安卓系統
173
+*   iOS
174
+*   Windows Phone 8
175
+*   Windows 8
176
+*   Windows
177
+
178
+### 示例
179
+
180
+    navigator.contacts.pickContact(function(contact){
181
+            console.log('The following contact has been selected:' + JSON.stringify(contact));
182
+        },function(err){
183
+            console.log('Error: ' + err);
184
+        });
185
+    
186
+
187
+## 連絡人
188
+
189
+`Contact` 物件表示使用者的連絡人。 可以創建、 存儲,或從設備的連絡人資料庫中刪除連絡人。 連絡人可以也被 (單獨或批量) 從資料庫中檢索通過調用 `navigator.contacts.find` 方法。
190
+
191
+**注**: 並不是所有上面列出的連絡人欄位支援的每個設備的平臺。請檢查每個平臺 *的怪癖* 節瞭解詳細資訊。
192
+
193
+### 屬性
194
+
195
+*   **id**: 一個全域唯一識別碼。*() DOMString*
196
+
197
+*   **displayName**: 此連絡人,適合於向最終使用者顯示的名稱。*() DOMString*
198
+
199
+*   **name**: 一個物件,包含所有元件的一個人的名字。*(連絡人姓名)*
200
+
201
+*   **nickname**: 休閒的位址連絡人名稱。*() DOMString*
202
+
203
+*   **phoneNumbers**: 陣列的所有連絡人的電話號碼。*(ContactField[])*
204
+
205
+*   **emails**: 所有連絡人的電子郵件地址的陣列。*(ContactField[])*
206
+
207
+*   **addresses**: 該連絡人的所有位址的陣列。*(ContactAddress[])*
208
+
209
+*   **ims**: 所有連絡人的 IM 位址的陣列。*(ContactField[])*
210
+
211
+*   **organizations**: 該連絡人的所有組織的陣列。*(ContactOrganization[])*
212
+
213
+*   **birthday**: 連絡人的生日。*(Date)*
214
+
215
+*   **note**: 注意有關的聯繫。*() DOMString*
216
+
217
+*   **photos**: 陣列的連絡人的照片。*(ContactField[])*
218
+
219
+*   **categories**: 陣列與連絡人關聯的所有使用者定義的類別。*(ContactField[])*
220
+
221
+*   **url**: 陣列與連絡人關聯的 web 頁。*(ContactField[])*
222
+
223
+### 方法
224
+
225
+*   **clone**: 返回一個新的 `Contact` 物件就是調用物件的深層副本 `id` 屬性設置為`null`.
226
+
227
+*   **remove**: 從設備的連絡人資料庫中刪除連絡人,否則執行錯誤回檔與 `ContactError` 物件。
228
+
229
+*   **save**: 將一個新的連絡人保存到設備的連絡人資料庫中,或更新現有的連絡人,如果已存在具有相同 **id** 的連絡人。
230
+
231
+### 支援的平臺
232
+
233
+*   亞馬遜火 OS
234
+*   安卓系統
235
+*   黑莓 10
236
+*   火狐瀏覽器的作業系統
237
+*   iOS
238
+*   Windows Phone 7 和 8
239
+*   Windows 8
240
+*   Windows
241
+
242
+### 保存示例
243
+
244
+    function onSuccess(contact) {
245
+        alert("Save Success");
246
+    };
247
+    
248
+    function onError(contactError) {
249
+        alert("Error = " + contactError.code);
250
+    };
251
+    
252
+    // create a new contact object
253
+    var contact = navigator.contacts.create();
254
+    contact.displayName = "Plumber";
255
+    contact.nickname = "Plumber";            // specify both to support all devices
256
+    
257
+    // populate some fields
258
+    var name = new ContactName();
259
+    name.givenName = "Jane";
260
+    name.familyName = "Doe";
261
+    contact.name = name;
262
+    
263
+    // save to device
264
+    contact.save(onSuccess,onError);
265
+    
266
+
267
+### 克隆示例
268
+
269
+        // clone the contact object
270
+        var clone = contact.clone();
271
+        clone.name.givenName = "John";
272
+        console.log("Original contact name = " + contact.name.givenName);
273
+        console.log("Cloned contact name = " + clone.name.givenName);
274
+    
275
+
276
+### 刪除示例
277
+
278
+    function onSuccess() {
279
+        alert("Removal Success");
280
+    };
281
+    
282
+    function onError(contactError) {
283
+        alert("Error = " + contactError.code);
284
+    };
285
+    
286
+    // remove the contact from the device
287
+    contact.remove(onSuccess,onError);
288
+    
289
+
290
+### Android 2.X 的怪癖
291
+
292
+*   **categories**: 不支援 Android 2.X 在設備上,返回`null`.
293
+
294
+### 黑莓 10 的怪癖
295
+
296
+*   **id**: 由該設備分配時保存該連絡人。
297
+
298
+### FirefoxOS 的怪癖
299
+
300
+*   **categories**: 部分支援。返回欄位**pref**和**type**`null`
301
+
302
+*   **ims**: 不支援
303
+
304
+*   **photos**: 不支援
305
+
306
+### iOS 的怪癖
307
+
308
+*   **displayName**: 上返回的 iOS 不支援 `null` 除非有沒有 `ContactName` 指定,在這種情況下它將返回複合名稱,**nickname**或 `""` ,分別。
309
+
310
+*   **birthday**: 必須輸入 JavaScript 作為 `Date` 物件,它將返回相同的方式。
311
+
312
+*   **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。當應用程式退出時刪除臨時目錄的內容。
313
+
314
+*   **categories**: 目前不支援此屬性,返回`null`.
315
+
316
+### Windows Phone 7 和 8 的怪癖
317
+
318
+*   **displayName**: 當創建一個連絡人,提供的顯示名稱參數不同于顯示名稱的值檢索查找連絡人時。
319
+
320
+*   **url**: 當創建一個連絡人,使用者可以輸入和保存多個 web 位址,但只有一個是可用的搜索連絡人時。
321
+
322
+*   **phoneNumbers**:*pref*選項不受支援。 在*type*操作中不是支援的*find*。 只有一個 `phoneNumber` 允許的每個*type*.
323
+
324
+*   **emails**:*pref*選項不受支援。家庭和個人使用引用同一電子郵件項。只有一項是允許的每個*type*.
325
+
326
+*   **addresses**: 僅支援的工作和家庭/個人*type*。家庭和個人*type*引用相同的位址條目。只有一項是允許的每個*type*.
327
+
328
+*   **organizations**: 唯一一個允許的和不支援的*pref*、*type*和*department*的屬性。
329
+
330
+*   **note**: 不支援,返回`null`.
331
+
332
+*   **ims**: 不受支援,返回`null`.
333
+
334
+*   **birthdays**: 不受支援,返回`null`.
335
+
336
+*   **categories**: 不受支援,返回`null`.
337
+
338
+### Windows 的怪癖
339
+
340
+*   **photos**: 返回到圖像中,存儲在應用程式的臨時目錄中檔的 URL。
341
+
342
+*   **birthdays**: 不受支援,返回`null`.
343
+
344
+*   **categories**: 不受支援,返回`null`.
345
+
346
+## ContactAddress
347
+
348
+`ContactAddress` 物件存儲單個位址的連絡人的屬性。 `Contact` 物件可能包括多個位址 `ContactAddress []` 陣列中。
349
+
350
+### 屬性
351
+
352
+*   **pref**: 設置為 `true` 如果這個 `ContactAddress` 包含使用者的首選的價值。*(Boolean)*
353
+
354
+*   **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
355
+
356
+*   **formatted**: 顯示格式的完整位址。*() DOMString*
357
+
358
+*   **streetAddress**: 完整的街道位址。*() DOMString*
359
+
360
+*   **locality**: 城市或地點。*() DOMString*
361
+
362
+*   **region**: 國家或地區。*() DOMString*
363
+
364
+*   **postalCode**: 郵遞區號。*() DOMString*
365
+
366
+*   **country**: 國家名稱。*() DOMString*
367
+
368
+### 支援的平臺
369
+
370
+*   亞馬遜火 OS
371
+*   安卓系統
372
+*   黑莓 10
373
+*   火狐瀏覽器的作業系統
374
+*   iOS
375
+*   Windows Phone 7 和 8
376
+*   Windows 8
377
+*   Windows
378
+
379
+### 示例
380
+
381
+    // display the address information for all contacts
382
+    
383
+    function onSuccess(contacts) {
384
+        for (var i = 0; i < contacts.length; i++) {
385
+            for (var j = 0; j < contacts[i].addresses.length; j++) {
386
+                alert("Pref: "         + contacts[i].addresses[j].pref          + "\n" +
387
+                    "Type: "           + contacts[i].addresses[j].type          + "\n" +
388
+                    "Formatted: "      + contacts[i].addresses[j].formatted     + "\n" +
389
+                    "Street Address: " + contacts[i].addresses[j].streetAddress + "\n" +
390
+                    "Locality: "       + contacts[i].addresses[j].locality      + "\n" +
391
+                    "Region: "         + contacts[i].addresses[j].region        + "\n" +
392
+                    "Postal Code: "    + contacts[i].addresses[j].postalCode    + "\n" +
393
+                    "Country: "        + contacts[i].addresses[j].country);
394
+            }
395
+        }
396
+    };
397
+    
398
+    function onError(contactError) {
399
+        alert('onError!');
400
+    };
401
+    
402
+    // find all contacts
403
+    var options = new ContactFindOptions();
404
+    options.filter = "";
405
+    var filter = ["displayName", "addresses"];
406
+    navigator.contacts.find(filter, onSuccess, onError, options);
407
+    
408
+
409
+### Android 2.X 的怪癖
410
+
411
+*   **pref**: 不受支援,返回 `false` Android 2.X 的設備上。
412
+
413
+### 黑莓 10 的怪癖
414
+
415
+*   **pref**: 在返回的黑莓設備上不支援`false`.
416
+
417
+*   **type**: 部分支援。只有一個*Word*和*Home*類型位址可以存儲每個連絡人。
418
+
419
+*   **formatted**: 部分支援。返回的串聯的所有黑莓手機位址欄位。
420
+
421
+*   **streetAddress**: 支援。返回和串聯組成的黑莓**address1** **address2**位址欄位。
422
+
423
+*   **locality**: 支援。黑莓手機**city**位址欄位中存儲。
424
+
425
+*   **region**: 支援。黑莓**stateProvince**位址欄位中存儲。
426
+
427
+*   **postalCode**: 支援。黑莓**zipPostal**位址欄位中存儲。
428
+
429
+*   **country**: 支援。
430
+
431
+### FirefoxOS 的怪癖
432
+
433
+*   **formatted**: 目前不支援
434
+
435
+### iOS 的怪癖
436
+
437
+*   **pref**: 不支援在 iOS 設備上,返回`false`.
438
+
439
+*   **formatted**: 目前不支援。
440
+
441
+### Windows 8 的怪癖
442
+
443
+*   **pref**: 不支援
444
+
445
+### Windows 的怪癖
446
+
447
+*   **pref**: 不支援
448
+
449
+## ContactError
450
+
451
+當發生錯誤時,通過 `contactError` 回呼函數為使用者情況下會返回的 `ContactError` 物件。
452
+
453
+### 屬性
454
+
455
+*   **code**: 下面列出的預定義的錯誤代碼之一。
456
+
457
+### 常量
458
+
459
+*   `ContactError.UNKNOWN_ERROR` (code 0)
460
+*   `ContactError.INVALID_ARGUMENT_ERROR` (code 1)
461
+*   `ContactError.TIMEOUT_ERROR` (code 2)
462
+*   `ContactError.PENDING_OPERATION_ERROR` (code 3)
463
+*   `ContactError.IO_ERROR` (code 4)
464
+*   `ContactError.NOT_SUPPORTED_ERROR` (code 5)
465
+*   `ContactError.PERMISSION_DENIED_ERROR` (code 20)
466
+
467
+## ContactField
468
+
469
+`ContactField` 物件是可重用的元件代表一般連絡人欄位。 每個 `ContactField` 物件包含一個 `value`、 `type` 和 `pref` 的屬性。 `Contacat` 物件將幾個屬性存儲在 `ContactField []` 陣列,例如電話號碼和電子郵件地址。
470
+
471
+在大多數情況下,沒有預先確定的 `ContactField` 物件的 **type** 屬性值。 例如,一個電話號碼可以指定 **type** 值的 *home*、 *work*、 *mobile*、 *iPhone* 或由一個特定的設備平臺接觸資料庫系統支援的任何其他值。 然而,為 `photos` **照片** 欄位中,**type** 欄位指示返回圖像的格式: 當 **value** 屬性包含一個指向的照片圖像或 *base64* URL 時的 **value** 包含 string base64 編碼的圖像的 **url**。
472
+
473
+### 屬性
474
+
475
+*   **type**: 一個字串,例如指示哪種類型的欄位,這是*home*。*() DOMString*
476
+
477
+*   **value**: 欄位的值,如電話號碼或電子郵件地址。*() DOMString*
478
+
479
+*   **pref**: 設置為 `true` 如果這個 `ContactField` 包含使用者的首選的價值。*(布林)*
480
+
481
+### 支援的平臺
482
+
483
+*   亞馬遜火 OS
484
+*   安卓系統
485
+*   黑莓 10
486
+*   火狐瀏覽器的作業系統
487
+*   iOS
488
+*   Windows Phone 7 和 8
489
+*   Windows 8
490
+*   Windows
491
+
492
+### 示例
493
+
494
+        // create a new contact
495
+        var contact = navigator.contacts.create();
496
+    
497
+        // store contact phone numbers in ContactField[]
498
+        var phoneNumbers = [];
499
+        phoneNumbers[0] = new ContactField('work', '212-555-1234', false);
500
+        phoneNumbers[1] = new ContactField('mobile', '917-555-5432', true); // preferred number
501
+        phoneNumbers[2] = new ContactField('home', '203-555-7890', false);
502
+        contact.phoneNumbers = phoneNumbers;
503
+    
504
+        // save the contact
505
+        contact.save();
506
+    
507
+
508
+### Android 的怪癖
509
+
510
+*   **pref**: 不受支援,返回`false`.
511
+
512
+### 黑莓 10 的怪癖
513
+
514
+*   **type**: 部分支援。使用的電話號碼。
515
+
516
+*   **value**: 支援。
517
+
518
+*   **pref**: 不受支援,返回`false`.
519
+
520
+### iOS 的怪癖
521
+
522
+*   **pref**: 不受支援,返回`false`.
523
+
524
+### Windows8 的怪癖
525
+
526
+*   **pref**: 不受支援,返回`false`.
527
+
528
+### Windows 的怪癖
529
+
530
+*   **pref**: 不受支援,返回`false`.
531
+
532
+## ContactName
533
+
534
+包含不同種類的 `Contact` 物件名稱有關的資訊。
535
+
536
+### 屬性
537
+
538
+*   **formatted**: 該連絡人的完整名稱。*() DOMString*
539
+
540
+*   **familyName**: 連絡人的姓氏。*() DOMString*
541
+
542
+*   **givenName**: 連絡人的名字。*() DOMString*
543
+
544
+*   **middleName**: 連絡人的中間名。*() DOMString*
545
+
546
+*   **honorificPrefix**: 連絡人的首碼 (例如*先生*或*博士*) *(DOMString)*
547
+
548
+*   **honorificSuffix**: 連絡人的尾碼 (例如*某某某*)。*() DOMString*
549
+
550
+### 支援的平臺
551
+
552
+*   亞馬遜火 OS
553
+*   Android 系統
554
+*   黑莓 10
555
+*   火狐瀏覽器的作業系統
556
+*   iOS
557
+*   Windows Phone 7 和 8
558
+*   Windows 8
559
+*   Windows
560
+
561
+### 示例
562
+
563
+    function onSuccess(contacts) {
564
+        for (var i = 0; i < contacts.length; i++) {
565
+            alert("Formatted: "  + contacts[i].name.formatted       + "\n" +
566
+                "Family Name: "  + contacts[i].name.familyName      + "\n" +
567
+                "Given Name: "   + contacts[i].name.givenName       + "\n" +
568
+                "Middle Name: "  + contacts[i].name.middleName      + "\n" +
569
+                "Suffix: "       + contacts[i].name.honorificSuffix + "\n" +
570
+                "Prefix: "       + contacts[i].name.honorificSuffix);
571
+        }
572
+    };
573
+    
574
+    function onError(contactError) {
575
+        alert('onError!');
576
+    };
577
+    
578
+    var options = new ContactFindOptions();
579
+    options.filter = "";
580
+    filter = ["displayName", "name"];
581
+    navigator.contacts.find(filter, onSuccess, onError, options);
582
+    
583
+
584
+### Android 的怪癖
585
+
586
+*   **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
587
+
588
+### 黑莓 10 的怪癖
589
+
590
+*   **formatted**: 部分支援。返回的串聯的黑莓手機**firstName**和**lastName**欄位。
591
+
592
+*   **familyName**: 支援。黑莓**lastName**欄位中存儲。
593
+
594
+*   **givenName**: 支援。黑莓**firstName**欄位中存儲。
595
+
596
+*   **middleName**: 不受支援,返回`null`.
597
+
598
+*   **honorificPrefix**: 不受支援,返回`null`.
599
+
600
+*   **honorificSuffix**: 不受支援,返回`null`.
601
+
602
+### FirefoxOS 的怪癖
603
+
604
+*   **formatted**: 部分受支援,並為唯讀。 返回的串聯的 `honorificPrefix` , `givenName` , `middleName` , `familyName` ,和`honorificSuffix`.
605
+
606
+### iOS 的怪癖
607
+
608
+*   **formatted**: 部分支援。返回 iOS 複合名稱,但為唯讀。
609
+
610
+### Windows 8 的怪癖
611
+
612
+*   **formatted**: 這是唯一名稱屬性,並且是相同的 `displayName` ,和`nickname`
613
+
614
+*   **familyName**: 不支援
615
+
616
+*   **givenName**: 不支援
617
+
618
+*   **middleName**: 不支援
619
+
620
+*   **honorificPrefix**: 不支援
621
+
622
+*   **honorificSuffix**: 不支援
623
+
624
+### Windows 的怪癖
625
+
626
+*   **formatted**: 它是完全相同`displayName`
627
+
628
+## ContactOrganization
629
+
630
+`ContactOrganization` 物件存儲連絡人的組織屬性。`Contact` 物件將一個或多個 `ContactOrganization` 物件存儲在一個陣列中。
631
+
632
+### 屬性
633
+
634
+*   **pref**: 設置為 `true` 如果這個 `ContactOrganization` 包含使用者的首選的價值。*(布林)*
635
+
636
+*   **type**: 一個字串,例如指示哪種類型的欄位,這是*回家*。_(DOMString)
637
+
638
+*   **name**: 組織的名稱。*() DOMString*
639
+
640
+*   **department**: 合同工作為的部門。*() DOMString*
641
+
642
+*   **title**: 在組織連絡人的標題。*() DOMString*
643
+
644
+### 支援的平臺
645
+
646
+*   安卓系統
647
+*   黑莓 10
648
+*   火狐瀏覽器的作業系統
649
+*   iOS
650
+*   Windows Phone 7 和 8
651
+*   Windows (Windows 8.1 和 Windows Phone 8.1 設備)
652
+
653
+### 示例
654
+
655
+    function onSuccess(contacts) {
656
+        for (var i = 0; i < contacts.length; i++) {
657
+            for (var j = 0; j < contacts[i].organizations.length; j++) {
658
+                alert("Pref: "      + contacts[i].organizations[j].pref       + "\n" +
659
+                    "Type: "        + contacts[i].organizations[j].type       + "\n" +
660
+                    "Name: "        + contacts[i].organizations[j].name       + "\n" +
661
+                    "Department: "  + contacts[i].organizations[j].department + "\n" +
662
+                    "Title: "       + contacts[i].organizations[j].title);
663
+            }
664
+        }
665
+    };
666
+    
667
+    function onError(contactError) {
668
+        alert('onError!');
669
+    };
670
+    
671
+    var options = new ContactFindOptions();
672
+    options.filter = "";
673
+    filter = ["displayName", "organizations"];
674
+    navigator.contacts.find(filter, onSuccess, onError, options);
675
+    
676
+
677
+### Android 2.X 的怪癖
678
+
679
+*   **pref**: 不支援的 Android 2.X 的設備,返回`false`.
680
+
681
+### 黑莓 10 的怪癖
682
+
683
+*   **pref**: 不支援的黑莓手機,返回`false`.
684
+
685
+*   **type**: 不支援的黑莓手機,返回`null`.
686
+
687
+*   **name**: 部分支援。第一次組織名稱存儲在黑莓**company**欄位中。
688
+
689
+*   **department**: 不受支援,返回`null`.
690
+
691
+*   **title**: 部分支援。第一次組織標題存儲在欄位中黑莓**jobTitle**。
692
+
693
+### 火狐瀏覽器作業系統的怪癖
694
+
695
+*   **pref**: 不支援
696
+
697
+*   **type**: 不支援
698
+
699
+*   **department**: 不支援
700
+
701
+*   欄位**name**和**title**存儲在**org**和**jobTitle**.
702
+
703
+### iOS 的怪癖
704
+
705
+*   **pref**: 不支援在 iOS 設備上,返回`false`.
706
+
707
+*   **type**: 不支援在 iOS 設備上,返回`null`.
708
+
709
+*   **name**: 部分支援。第一次組織名稱存儲在 iOS **kABPersonOrganizationProperty**欄位中。
710
+
711
+*   **department**: 部分支援。第一部門名稱存儲在 iOS **kABPersonDepartmentProperty**欄位中。
712
+
713
+*   **title**: 部分支援。第一個標題存儲在 iOS **kABPersonJobTitleProperty**欄位中。
714
+
715
+### Windows 的怪癖
716
+
717
+*   **pref**: 不受支援,返回`false`.
718
+
719
+*   **type**: 不受支援,返回`null`.

+ 141
- 0
km0App/node_modules/cordova-plugin-contacts/package.json Parādīt failu

@@ -0,0 +1,141 @@
1
+{
2
+  "_args": [
3
+    [
4
+      "cordova-plugin-contacts@3.0.1",
5
+      "/home/manodg/Documents/kilometro0/km0App"
6
+    ]
7
+  ],
8
+  "_from": "cordova-plugin-contacts@3.0.1",
9
+  "_id": "cordova-plugin-contacts@3.0.1",
10
+  "_inCache": true,
11
+  "_installable": true,
12
+  "_location": "/cordova-plugin-contacts",
13
+  "_nodeVersion": "8.9.3",
14
+  "_npmOperationalInternal": {
15
+    "host": "s3://npm-registry-packages",
16
+    "tmp": "tmp/cordova-plugin-contacts-3.0.1.tgz_1513795145012_0.4988263240084052"
17
+  },
18
+  "_npmUser": {
19
+    "email": "stevengill97@gmail.com",
20
+    "name": "stevegill"
21
+  },
22
+  "_npmVersion": "4.6.1",
23
+  "_phantomChildren": {},
24
+  "_requested": {
25
+    "name": "cordova-plugin-contacts",
26
+    "raw": "cordova-plugin-contacts@3.0.1",
27
+    "rawSpec": "3.0.1",
28
+    "scope": null,
29
+    "spec": "3.0.1",
30
+    "type": "version"
31
+  },
32
+  "_requiredBy": [
33
+    "/"
34
+  ],
35
+  "_resolved": "https://registry.npmjs.org/cordova-plugin-contacts/-/cordova-plugin-contacts-3.0.1.tgz",
36
+  "_shasum": "37aadabec93c982c04a3dcda0e4f1cfa096a84ab",
37
+  "_shrinkwrap": null,
38
+  "_spec": "cordova-plugin-contacts@3.0.1",
39
+  "_where": "/home/manodg/Documents/kilometro0/km0App",
40
+  "author": {
41
+    "name": "Apache Software Foundation"
42
+  },
43
+  "bugs": {
44
+    "url": "https://issues.apache.org/jira/browse/CB"
45
+  },
46
+  "cordova": {
47
+    "id": "cordova-plugin-contacts",
48
+    "platforms": [
49
+      "amazon-fireos",
50
+      "android",
51
+      "blackberry10",
52
+      "firefoxos",
53
+      "ios",
54
+      "ubuntu",
55
+      "windows",
56
+      "windows8",
57
+      "wp8"
58
+    ]
59
+  },
60
+  "dependencies": {},
61
+  "deprecated": "This plugin has been deprecated",
62
+  "description": "Cordova Contacts Plugin",
63
+  "devDependencies": {
64
+    "jshint": "^2.6.0"
65
+  },
66
+  "directories": {},
67
+  "dist": {
68
+    "shasum": "37aadabec93c982c04a3dcda0e4f1cfa096a84ab",
69
+    "tarball": "https://registry.npmjs.org/cordova-plugin-contacts/-/cordova-plugin-contacts-3.0.1.tgz"
70
+  },
71
+  "engines": {
72
+    "cordovaDependencies": {
73
+      "3.0.0": {
74
+        "cordova-android": ">=6.3.0"
75
+      },
76
+      "4.0.0": {
77
+        "cordova": ">100"
78
+      }
79
+    }
80
+  },
81
+  "homepage": "https://github.com/apache/cordova-plugin-contacts#readme",
82
+  "keywords": [
83
+    "contacts",
84
+    "cordova",
85
+    "cordova-amazon-fireos",
86
+    "cordova-android",
87
+    "cordova-blackberry10",
88
+    "cordova-firefoxos",
89
+    "cordova-ios",
90
+    "cordova-ubuntu",
91
+    "cordova-windows",
92
+    "cordova-windows8",
93
+    "cordova-wp7",
94
+    "cordova-wp8",
95
+    "ecosystem:cordova"
96
+  ],
97
+  "license": "Apache-2.0",
98
+  "maintainers": [
99
+    {
100
+      "name": "vishalmishra",
101
+      "email": "vishalmishra0907@gmail.com"
102
+    },
103
+    {
104
+      "name": "bowserj",
105
+      "email": "bowserj@apache.org"
106
+    },
107
+    {
108
+      "name": "purplecabbage",
109
+      "email": "purplecabbage@gmail.com"
110
+    },
111
+    {
112
+      "name": "filmaj",
113
+      "email": "maj.fil@gmail.com"
114
+    },
115
+    {
116
+      "name": "shazron",
117
+      "email": "shazron@gmail.com"
118
+    },
119
+    {
120
+      "name": "csantanapr",
121
+      "email": "csantana23@gmail.com"
122
+    },
123
+    {
124
+      "name": "stevegill",
125
+      "email": "stevengill97@gmail.com"
126
+    }
127
+  ],
128
+  "name": "cordova-plugin-contacts",
129
+  "optionalDependencies": {},
130
+  "readme": "ERROR: No README data found!",
131
+  "repository": {
132
+    "type": "git",
133
+    "url": "git+https://github.com/apache/cordova-plugin-contacts.git"
134
+  },
135
+  "scripts": {
136
+    "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests",
137
+    "test": "npm run jshint"
138
+  },
139
+  "types": "./types/index.d.ts",
140
+  "version": "3.0.1"
141
+}

+ 237
- 0
km0App/node_modules/cordova-plugin-contacts/plugin.xml Parādīt failu

@@ -0,0 +1,237 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!--
3
+  Licensed to the Apache Software Foundation (ASF) under one
4
+  or more contributor license agreements.  See the NOTICE file
5
+  distributed with this work for additional information
6
+  regarding copyright ownership.  The ASF licenses this file
7
+  to you under the Apache License, Version 2.0 (the
8
+  "License"); you may not use this file except in compliance
9
+  with the License.  You may obtain a copy of the License at
10
+
11
+    http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+  Unless required by applicable law or agreed to in writing,
14
+  software distributed under the License is distributed on an
15
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+  KIND, either express or implied.  See the License for the
17
+  specific language governing permissions and limitations
18
+  under the License.
19
+-->
20
+
21
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
22
+    xmlns:rim="http://www.blackberry.com/ns/widgets"
23
+    xmlns:android="http://schemas.android.com/apk/res/android"
24
+    xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest"
25
+    xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
26
+    id="cordova-plugin-contacts"
27
+    version="3.0.1">
28
+
29
+    <name>Contacts</name>
30
+    <description>Cordova Contacts Plugin</description>
31
+    <license>Apache 2.0</license>
32
+    <keywords>cordova,contacts</keywords>
33
+    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts.git</repo>
34
+    <issue>https://issues.apache.org/jira/browse/CB/component/12320652</issue>
35
+
36
+    <engines>
37
+        <engine name="cordova-android" version=">=6.3.0" />
38
+    </engines>
39
+
40
+    <js-module src="www/contacts.js" name="contacts">
41
+        <clobbers target="navigator.contacts" />
42
+    </js-module>
43
+
44
+    <js-module src="www/Contact.js" name="Contact">
45
+        <clobbers target="Contact" />
46
+    </js-module>
47
+
48
+    <js-module src="www/convertUtils.js" name="convertUtils">
49
+    </js-module>
50
+
51
+    <js-module src="www/ContactAddress.js" name="ContactAddress">
52
+        <clobbers target="ContactAddress" />
53
+    </js-module>
54
+
55
+    <js-module src="www/ContactError.js" name="ContactError">
56
+        <clobbers target="ContactError" />
57
+    </js-module>
58
+
59
+    <js-module src="www/ContactField.js" name="ContactField">
60
+        <clobbers target="ContactField" />
61
+    </js-module>
62
+
63
+    <js-module src="www/ContactFindOptions.js" name="ContactFindOptions">
64
+        <clobbers target="ContactFindOptions" />
65
+    </js-module>
66
+
67
+    <js-module src="www/ContactName.js" name="ContactName">
68
+        <clobbers target="ContactName" />
69
+    </js-module>
70
+
71
+    <js-module src="www/ContactOrganization.js" name="ContactOrganization">
72
+        <clobbers target="ContactOrganization" />
73
+    </js-module>
74
+
75
+    <js-module src="www/ContactFieldType.js" name="ContactFieldType">
76
+        <merges target="" />
77
+    </js-module>
78
+
79
+    <!-- android -->
80
+    <platform name="android">
81
+        <config-file target="res/xml/config.xml" parent="/*">
82
+            <feature name="Contacts">
83
+                <param name="android-package" value="org.apache.cordova.contacts.ContactManager"/>
84
+            </feature>
85
+        </config-file>
86
+
87
+        <config-file target="AndroidManifest.xml" parent="/*">
88
+            <uses-permission android:name="android.permission.READ_CONTACTS" />
89
+            <uses-permission android:name="android.permission.WRITE_CONTACTS" />
90
+            <uses-permission android:name="android.permission.GET_ACCOUNTS" />
91
+        </config-file>
92
+
93
+        <source-file src="src/android/ContactAccessor.java" target-dir="src/org/apache/cordova/contacts" />
94
+        <source-file src="src/android/ContactAccessorSdk5.java" target-dir="src/org/apache/cordova/contacts" />
95
+        <source-file src="src/android/ContactManager.java" target-dir="src/org/apache/cordova/contacts" />
96
+        <source-file src="src/android/ContactInfoDTO.java" target-dir="src/org/apache/cordova/contacts" />
97
+    </platform>
98
+
99
+    <!-- amazon-fireos -->
100
+    <platform name="amazon-fireos">
101
+        <config-file target="res/xml/config.xml" parent="/*">
102
+            <feature name="Contacts">
103
+                <param name="android-package" value="org.apache.cordova.contacts.ContactManager"/>
104
+            </feature>
105
+        </config-file>
106
+
107
+        <config-file target="AndroidManifest.xml" parent="/*">
108
+            <uses-permission android:name="android.permission.READ_CONTACTS" />
109
+            <uses-permission android:name="android.permission.WRITE_CONTACTS" />
110
+            <uses-permission android:name="android.permission.GET_ACCOUNTS" />
111
+        </config-file>
112
+
113
+        <source-file src="src/android/ContactAccessor.java" target-dir="src/org/apache/cordova/contacts" />
114
+        <source-file src="src/android/ContactAccessorSdk5.java" target-dir="src/org/apache/cordova/contacts" />
115
+        <source-file src="src/android/ContactManager.java" target-dir="src/org/apache/cordova/contacts" />
116
+    </platform>
117
+
118
+    <!-- ubuntu -->
119
+    <platform name="ubuntu">
120
+        <config-file target="config.xml" parent="/*">
121
+            <feature name="Contacts">
122
+                <param policy_group="contacts" policy_version="1" />
123
+            </feature>
124
+        </config-file>
125
+        <header-file src="src/ubuntu/contacts.h" />
126
+        <source-file src="src/ubuntu/contacts.cpp" />
127
+    </platform>
128
+
129
+    <!-- ios -->
130
+    <platform name="ios">
131
+        <config-file target="config.xml" parent="/*">
132
+            <feature name="Contacts">
133
+                <param name="ios-package" value="CDVContacts"/>
134
+            </feature>
135
+        </config-file>
136
+
137
+        <js-module src="www/ios/contacts.js" name="contacts-ios">
138
+            <merges target="navigator.contacts" />
139
+        </js-module>
140
+
141
+        <js-module src="www/ios/Contact.js" name="Contact-iOS">
142
+            <merges target="Contact" />
143
+        </js-module>
144
+
145
+        <header-file src="src/ios/CDVContacts.h" />
146
+        <source-file src="src/ios/CDVContacts.m" />
147
+        <header-file src="src/ios/CDVContact.h" />
148
+        <source-file src="src/ios/CDVContact.m" />
149
+
150
+        <framework src="AddressBook.framework" weak="true" />
151
+        <framework src="AddressBookUI.framework" weak="true" />
152
+        <framework src="CoreGraphics.framework" />
153
+    </platform>
154
+
155
+    <!-- Browser -->
156
+    <platform name="browser">
157
+        <js-module src="src/browser/ContactsProxy.js" name="ContactsProxy">
158
+            <merges target="navigator.contacts" />
159
+        </js-module>
160
+    </platform>
161
+
162
+    <!-- blackberry10 -->
163
+    <platform name="blackberry10">
164
+        <config-file target="www/config.xml" parent="/widget">
165
+            <feature name="Contacts" value="Contacts"/>
166
+        </config-file>
167
+        <config-file target="www/config.xml" parent="/widget/rim:permissions">
168
+            <rim:permit>access_pimdomain_contacts</rim:permit>
169
+        </config-file>
170
+        <source-file src="src/blackberry10/index.js" target-dir="Contacts"></source-file>
171
+        <source-file src="src/blackberry10/ContactActivity.js" target-dir="Contacts"></source-file>
172
+        <source-file src="src/blackberry10/ContactAddress.js" target-dir="Contacts"></source-file>
173
+        <source-file src="src/blackberry10/contactConsts.js" target-dir="Contacts"></source-file>
174
+        <source-file src="src/blackberry10/ContactError.js" target-dir="Contacts"></source-file>
175
+        <source-file src="src/blackberry10/ContactField.js" target-dir="Contacts"></source-file>
176
+        <source-file src="src/blackberry10/ContactFindOptions.js" target-dir="Contacts"></source-file>
177
+        <source-file src="src/blackberry10/ContactName.js" target-dir="Contacts"></source-file>
178
+        <source-file src="src/blackberry10/ContactNews.js" target-dir="Contacts"></source-file>
179
+        <source-file src="src/blackberry10/ContactOrganization.js" target-dir="Contacts"></source-file>
180
+        <source-file src="src/blackberry10/ContactPhoto.js" target-dir="Contacts"></source-file>
181
+        <source-file src="src/blackberry10/contactUtils.js" target-dir="Contacts"></source-file>
182
+        <dependency id="cordova-plugin-bb-contacts" />
183
+        <dependency id="cordova-plugin-bb-pimlib" />
184
+    </platform>
185
+
186
+
187
+    <!-- wp8 -->
188
+    <platform name="wp8">
189
+        <config-file target="config.xml" parent="/*">
190
+            <feature name="Contacts">
191
+                <param name="wp-package" value="Contacts"/>
192
+            </feature>
193
+        </config-file>
194
+
195
+        <config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
196
+            <Capability Name="ID_CAP_CONTACTS" />
197
+        </config-file>
198
+
199
+        <source-file src="src/wp/Contacts.cs" />
200
+        <source-file src="src/wp/ContactsHelper.cs" />
201
+        <source-file src="src/wp/ContactPicker.xaml" />
202
+        <source-file src="src/wp/ContactPicker.xaml.cs" />
203
+        <source-file src="src/wp/ContactPickerTask.cs" />
204
+    </platform>
205
+
206
+    <!-- firefoxos -->
207
+    <platform name="firefoxos">
208
+        <config-file target="config.xml" parent="/*">
209
+            <permission name="contacts" access="readwrite" description="Required for accessing address book."
210
+                        privileged="true"/>
211
+        </config-file>
212
+        <js-module src="src/firefoxos/ContactsProxy.js" name="ContactsProxy">
213
+            <runs />
214
+        </js-module>
215
+    </platform>
216
+
217
+    <!-- Windows 8 -->
218
+    <platform name="windows8">
219
+        <js-module src="src/windows8/ContactProxy.js" name="ContactProxy">
220
+            <runs />
221
+        </js-module>
222
+    </platform>
223
+
224
+    <!-- Windows -->
225
+    <platform name="windows">
226
+        <js-module src="src/windows/ContactProxy.js" name="ContactProxy">
227
+            <runs />
228
+        </js-module>
229
+        <config-file target="package.phone.appxmanifest" parent="/Package/Capabilities">
230
+            <m3:Capability Name="contacts" />
231
+        </config-file>
232
+        <config-file target="package.appxmanifest" parent="/Package/Capabilities" versions=">=10.0.0">
233
+            <uap:Capability Name="contacts" />
234
+        </config-file>
235
+    </platform>
236
+
237
+</plugin>

+ 194
- 0
km0App/node_modules/cordova-plugin-contacts/src/android/ContactAccessor.java Parādīt failu

@@ -0,0 +1,194 @@
1
+/*
2
+ * Copyright (C) 2009 The Android Open Source Project
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *      http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.apache.cordova.contacts;
18
+
19
+import java.util.HashMap;
20
+
21
+import android.Manifest;
22
+import android.content.pm.PackageManager;
23
+import org.apache.cordova.CordovaInterface;
24
+import org.apache.cordova.LOG;
25
+import org.json.JSONArray;
26
+import org.json.JSONException;
27
+import org.json.JSONObject;
28
+
29
+/**
30
+ * This abstract class defines SDK-independent API for communication with
31
+ * Contacts Provider. The actual implementation used by the application depends
32
+ * on the level of API available on the device. If the API level is Cupcake or
33
+ * Donut, we want to use the {@link ContactAccessorSdk3_4} class. If it is
34
+ * Eclair or higher, we want to use {@link ContactAccessorSdk5}.
35
+ */
36
+public abstract class ContactAccessor {
37
+
38
+    protected final String LOG_TAG = "ContactsAccessor";
39
+    protected CordovaInterface mApp;
40
+
41
+    /**
42
+     * Check to see if the data associated with the key is required to
43
+     * be populated in the Contact object.
44
+     * @param key
45
+     * @param map created by running buildPopulationSet.
46
+     * @return true if the key data is required
47
+     */
48
+    protected boolean isRequired(String key, HashMap<String,Boolean> map) {
49
+        Boolean retVal = map.get(key);
50
+        return (retVal == null) ? false : retVal.booleanValue();
51
+    }
52
+
53
+    /**
54
+     * Create a hash map of what data needs to be populated in the Contact object
55
+     * @param fields the list of fields to populate
56
+     * @return the hash map of required data
57
+     */
58
+    protected HashMap<String, Boolean> buildPopulationSet(JSONObject options) {
59
+        HashMap<String, Boolean> map = new HashMap<String, Boolean>();
60
+
61
+        String key;
62
+        try {
63
+            JSONArray desiredFields = null;
64
+            if (options!=null && options.has("desiredFields")) {
65
+                desiredFields = options.getJSONArray("desiredFields");
66
+            }
67
+            if (desiredFields == null || desiredFields.length() == 0) {
68
+                map.put("displayName", true);
69
+                map.put("name", true);
70
+                map.put("nickname", true);
71
+                map.put("phoneNumbers", true);
72
+                map.put("emails", true);
73
+                map.put("addresses", true);
74
+                map.put("ims", true);
75
+                map.put("organizations", true);
76
+                map.put("birthday", true);
77
+                map.put("note", true);
78
+                map.put("urls", true);
79
+                map.put("photos", true);
80
+                map.put("categories", true);
81
+            } else {
82
+                for (int i = 0; i < desiredFields.length(); i++) {
83
+                    key = desiredFields.getString(i);
84
+                    if (key.startsWith("displayName")) {
85
+                        map.put("displayName", true);
86
+                    } else if (key.startsWith("name")) {
87
+                        map.put("displayName", true);
88
+                        map.put("name", true);
89
+                    } else if (key.startsWith("nickname")) {
90
+                        map.put("nickname", true);
91
+                    } else if (key.startsWith("phoneNumbers")) {
92
+                        map.put("phoneNumbers", true);
93
+                    } else if (key.startsWith("emails")) {
94
+                        map.put("emails", true);
95
+                    } else if (key.startsWith("addresses")) {
96
+                        map.put("addresses", true);
97
+                    } else if (key.startsWith("ims")) {
98
+                        map.put("ims", true);
99
+                    } else if (key.startsWith("organizations")) {
100
+                        map.put("organizations", true);
101
+                    } else if (key.startsWith("birthday")) {
102
+                        map.put("birthday", true);
103
+                    } else if (key.startsWith("note")) {
104
+                        map.put("note", true);
105
+                    } else if (key.startsWith("urls")) {
106
+                        map.put("urls", true);
107
+                    } else if (key.startsWith("photos")) {
108
+                        map.put("photos", true);
109
+                    } else if (key.startsWith("categories")) {
110
+                        map.put("categories", true);
111
+                    }
112
+                }
113
+            }
114
+        } catch (JSONException e) {
115
+            LOG.e(LOG_TAG, e.getMessage(), e);
116
+        }
117
+        return map;
118
+    }
119
+
120
+    /**
121
+     * Convenience method to get a string from a JSON object.  Saves a
122
+     * lot of try/catch writing.
123
+     * If the property is not found in the object null will be returned.
124
+     *
125
+     * @param obj contact object to search
126
+     * @param property to be looked up
127
+     * @return The value of the property
128
+     */
129
+    protected String getJsonString(JSONObject obj, String property) {
130
+        String value = null;
131
+        try {
132
+            if (obj != null) {
133
+                value = obj.getString(property);
134
+                if (value.equals("null")) {
135
+                    LOG.d(LOG_TAG, property + " is string called 'null'");
136
+                    value = null;
137
+                }
138
+            }
139
+       }
140
+        catch (JSONException e) {
141
+            LOG.d(LOG_TAG, "Could not get = " + e.getMessage());
142
+        }
143
+        return value;
144
+    }
145
+
146
+    /**
147
+     * Handles adding a JSON Contact object into the database.
148
+     * @return TODO
149
+     */
150
+    public abstract String save(JSONObject contact);
151
+
152
+    /**
153
+     * Handles searching through SDK-specific contacts API.
154
+     */
155
+    public abstract JSONArray search(JSONArray filter, JSONObject options);
156
+
157
+    /**
158
+     * Handles searching through SDK-specific contacts API.
159
+     * @throws JSONException
160
+     */
161
+    public abstract JSONObject getContactById(String id) throws JSONException;
162
+
163
+    /**
164
+     * Handles searching through SDK-specific contacts API.
165
+     * @param desiredFields fields that will filled. All fields will be filled if null
166
+     * @throws JSONException
167
+     */
168
+    public abstract JSONObject getContactById(String id, JSONArray desiredFields) throws JSONException;
169
+
170
+    /**
171
+     * Handles removing a contact from the database.
172
+     */
173
+    public abstract boolean remove(String id);
174
+
175
+   /**
176
+     * A class that represents the where clause to be used in the database query
177
+     */
178
+    class WhereOptions {
179
+        private String where;
180
+        private String[] whereArgs;
181
+        public void setWhere(String where) {
182
+            this.where = where;
183
+        }
184
+        public String getWhere() {
185
+            return where;
186
+        }
187
+        public void setWhereArgs(String[] whereArgs) {
188
+            this.whereArgs = whereArgs;
189
+        }
190
+        public String[] getWhereArgs() {
191
+            return whereArgs;
192
+        }
193
+    }
194
+}

+ 2388
- 0
km0App/node_modules/cordova-plugin-contacts/src/android/ContactAccessorSdk5.java
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 59
- 0
km0App/node_modules/cordova-plugin-contacts/src/android/ContactInfoDTO.java Parādīt failu

@@ -0,0 +1,59 @@
1
+/*
2
+       Licensed to the Apache Software Foundation (ASF) under one
3
+       or more contributor license agreements.  See the NOTICE file
4
+       distributed with this work for additional information
5
+       regarding copyright ownership.  The ASF licenses this file
6
+       to you under the Apache License, Version 2.0 (the
7
+       "License"); you may not use this file except in compliance
8
+       with the License.  You may obtain a copy of the License at
9
+
10
+         http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+       Unless required by applicable law or agreed to in writing,
13
+       software distributed under the License is distributed on an
14
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+       KIND, either express or implied.  See the License for the
16
+       specific language governing permissions and limitations
17
+       under the License.
18
+*/
19
+
20
+package org.apache.cordova.contacts;
21
+
22
+import java.util.HashMap;
23
+
24
+import org.json.JSONArray;
25
+import org.json.JSONObject;
26
+
27
+public class ContactInfoDTO {
28
+
29
+ String displayName;
30
+ JSONObject name;
31
+ JSONArray organizations;
32
+ JSONArray addresses;
33
+ JSONArray phones;
34
+ JSONArray emails;
35
+ JSONArray ims;
36
+ JSONArray websites;
37
+ JSONArray photos;
38
+ String note;
39
+ String nickname;
40
+ String birthday;
41
+ HashMap<String, Object> desiredFieldsWithVals;
42
+
43
+ public ContactInfoDTO() {
44
+
45
+  displayName = "";
46
+  name = new JSONObject();
47
+  organizations = new JSONArray();
48
+  addresses = new JSONArray();
49
+  phones = new JSONArray();
50
+  emails = new JSONArray();
51
+  ims = new JSONArray();
52
+  websites = new JSONArray();
53
+  photos = new JSONArray();
54
+  note = "";
55
+  nickname = "";
56
+  desiredFieldsWithVals = new HashMap<String, Object>();
57
+ }
58
+
59
+}

+ 307
- 0
km0App/node_modules/cordova-plugin-contacts/src/android/ContactManager.java Parādīt failu

@@ -0,0 +1,307 @@
1
+/*
2
+       Licensed to the Apache Software Foundation (ASF) under one
3
+       or more contributor license agreements.  See the NOTICE file
4
+       distributed with this work for additional information
5
+       regarding copyright ownership.  The ASF licenses this file
6
+       to you under the Apache License, Version 2.0 (the
7
+       "License"); you may not use this file except in compliance
8
+       with the License.  You may obtain a copy of the License at
9
+
10
+         http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+       Unless required by applicable law or agreed to in writing,
13
+       software distributed under the License is distributed on an
14
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+       KIND, either express or implied.  See the License for the
16
+       specific language governing permissions and limitations
17
+       under the License.
18
+*/
19
+package org.apache.cordova.contacts;
20
+
21
+import org.apache.cordova.CallbackContext;
22
+import org.apache.cordova.CordovaActivity;
23
+import org.apache.cordova.CordovaPlugin;
24
+import org.apache.cordova.LOG;
25
+import org.apache.cordova.PermissionHelper;
26
+import org.apache.cordova.PluginResult;
27
+import org.json.JSONArray;
28
+import org.json.JSONException;
29
+import org.json.JSONObject;
30
+
31
+import android.Manifest;
32
+import android.app.Activity;
33
+import android.content.Intent;
34
+import android.content.pm.PackageManager;
35
+import android.database.Cursor;
36
+import android.os.Build;
37
+import android.os.Bundle;
38
+import android.provider.ContactsContract.Contacts;
39
+import android.provider.ContactsContract.RawContacts;
40
+
41
+import java.lang.reflect.Method;
42
+
43
+public class ContactManager extends CordovaPlugin {
44
+
45
+    private ContactAccessor contactAccessor;
46
+    private CallbackContext callbackContext;        // The callback context from which we were invoked.
47
+    private JSONArray executeArgs;
48
+
49
+    private static final String LOG_TAG = "Contact Query";
50
+
51
+    public static final int UNKNOWN_ERROR = 0;
52
+    public static final int INVALID_ARGUMENT_ERROR = 1;
53
+    public static final int TIMEOUT_ERROR = 2;
54
+    public static final int PENDING_OPERATION_ERROR = 3;
55
+    public static final int IO_ERROR = 4;
56
+    public static final int NOT_SUPPORTED_ERROR = 5;
57
+    public static final int OPERATION_CANCELLED_ERROR = 6;
58
+    public static final int PERMISSION_DENIED_ERROR = 20;
59
+    private static final int CONTACT_PICKER_RESULT = 1000;
60
+    public static String [] permissions;
61
+
62
+
63
+    //Request code for the permissions picker (Pick is async and uses intents)
64
+    public static final int SEARCH_REQ_CODE = 0;
65
+    public static final int SAVE_REQ_CODE = 1;
66
+    public static final int REMOVE_REQ_CODE = 2;
67
+    public static final int PICK_REQ_CODE = 3;
68
+
69
+    public static final String READ = Manifest.permission.READ_CONTACTS;
70
+    public static final String WRITE = Manifest.permission.WRITE_CONTACTS;
71
+
72
+
73
+    /**
74
+     * Constructor.
75
+     */
76
+    public ContactManager() {
77
+
78
+    }
79
+
80
+
81
+    protected void getReadPermission(int requestCode)
82
+    {
83
+        PermissionHelper.requestPermission(this, requestCode, READ);
84
+    }
85
+
86
+
87
+    protected void getWritePermission(int requestCode)
88
+    {
89
+        PermissionHelper.requestPermission(this, requestCode, WRITE);
90
+    }
91
+
92
+
93
+    /**
94
+     * Executes the request and returns PluginResult.
95
+     *
96
+     * @param action            The action to execute.
97
+     * @param args              JSONArray of arguments for the plugin.
98
+     * @param callbackContext   The callback context used when calling back into JavaScript.
99
+     * @return                  True if the action was valid, false otherwise.
100
+     */
101
+    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
102
+
103
+        this.callbackContext = callbackContext;
104
+        this.executeArgs = args;
105
+
106
+        /**
107
+         * Check to see if we are on an Android 1.X device.  If we are return an error as we
108
+         * do not support this as of Cordova 1.0.
109
+         */
110
+        if (android.os.Build.VERSION.RELEASE.startsWith("1.")) {
111
+            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, ContactManager.NOT_SUPPORTED_ERROR));
112
+            return true;
113
+        }
114
+
115
+        /**
116
+         * Only create the contactAccessor after we check the Android version or the program will crash
117
+         * older phones.
118
+         */
119
+        if (this.contactAccessor == null) {
120
+            this.contactAccessor = new ContactAccessorSdk5(this.cordova);
121
+        }
122
+
123
+        if (action.equals("search")) {
124
+            if(PermissionHelper.hasPermission(this, READ)) {
125
+                search(executeArgs);
126
+            }
127
+            else
128
+            {
129
+                getReadPermission(SEARCH_REQ_CODE);
130
+            }
131
+        }
132
+        else if (action.equals("save")) {
133
+            if(PermissionHelper.hasPermission(this, WRITE))
134
+            {
135
+                save(executeArgs);
136
+            }
137
+            else
138
+            {
139
+                getWritePermission(SAVE_REQ_CODE);
140
+            }
141
+        }
142
+        else if (action.equals("remove")) {
143
+            if(PermissionHelper.hasPermission(this, WRITE))
144
+            {
145
+                remove(executeArgs);
146
+            }
147
+            else
148
+            {
149
+                getWritePermission(REMOVE_REQ_CODE);
150
+            }
151
+        }
152
+        else if (action.equals("pickContact")) {
153
+            if(PermissionHelper.hasPermission(this, READ))
154
+            {
155
+                pickContactAsync();
156
+            }
157
+            else
158
+            {
159
+                getReadPermission(PICK_REQ_CODE);
160
+            }
161
+        }
162
+        else {
163
+            return false;
164
+        }
165
+        return true;
166
+    }
167
+
168
+    private void remove(JSONArray args) throws JSONException {
169
+        final String contactId = args.getString(0);
170
+        this.cordova.getThreadPool().execute(new Runnable() {
171
+            public void run() {
172
+                if (contactAccessor.remove(contactId)) {
173
+                    callbackContext.success();
174
+                } else {
175
+                    callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, UNKNOWN_ERROR));
176
+                }
177
+            }
178
+        });
179
+    }
180
+
181
+    private void save(JSONArray args) throws JSONException {
182
+        final JSONObject contact = args.getJSONObject(0);
183
+        this.cordova.getThreadPool().execute(new Runnable(){
184
+            public void run() {
185
+                JSONObject res = null;
186
+                String id = contactAccessor.save(contact);
187
+                if (id != null) {
188
+                    try {
189
+                        res = contactAccessor.getContactById(id);
190
+                    } catch (JSONException e) {
191
+                        LOG.e(LOG_TAG, "JSON fail.", e);
192
+                    }
193
+                }
194
+                if (res != null) {
195
+                    callbackContext.success(res);
196
+                } else {
197
+                    callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, UNKNOWN_ERROR));
198
+                }
199
+            }
200
+        });
201
+    }
202
+
203
+    private void search(JSONArray args) throws JSONException
204
+    {
205
+        final JSONArray filter = args.getJSONArray(0);
206
+        final JSONObject options = args.get(1) == null ? null : args.getJSONObject(1);
207
+        this.cordova.getThreadPool().execute(new Runnable() {
208
+            public void run() {
209
+                JSONArray res = contactAccessor.search(filter, options);
210
+                callbackContext.success(res);
211
+            }
212
+        });
213
+    }
214
+
215
+
216
+    /**
217
+     * Launches the Contact Picker to select a single contact.
218
+     */
219
+    private void pickContactAsync() {
220
+        final CordovaPlugin plugin = (CordovaPlugin) this;
221
+        Runnable worker = new Runnable() {
222
+            public void run() {
223
+                Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
224
+                plugin.cordova.startActivityForResult(plugin, contactPickerIntent, CONTACT_PICKER_RESULT);
225
+            }
226
+        };
227
+        this.cordova.getThreadPool().execute(worker);
228
+    }
229
+
230
+    /**
231
+     * Called when user picks contact.
232
+     * @param requestCode       The request code originally supplied to startActivityForResult(),
233
+     *                          allowing you to identify who this result came from.
234
+     * @param resultCode        The integer result code returned by the child activity through its setResult().
235
+     * @param intent            An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
236
+     * @throws JSONException
237
+     */
238
+    public void onActivityResult(int requestCode, int resultCode, final Intent intent) {
239
+        if (requestCode == CONTACT_PICKER_RESULT) {
240
+            if (resultCode == Activity.RESULT_OK) {
241
+                String contactId = intent.getData().getLastPathSegment();
242
+                // to populate contact data we require  Raw Contact ID
243
+                // so we do look up for contact raw id first
244
+                Cursor c =  this.cordova.getActivity().getContentResolver().query(RawContacts.CONTENT_URI,
245
+                            new String[] {RawContacts._ID}, RawContacts.CONTACT_ID + " = " + contactId, null, null);
246
+                if (!c.moveToFirst()) {
247
+                    this.callbackContext.error("Error occured while retrieving contact raw id");
248
+                    return;
249
+                }
250
+                String id = c.getString(c.getColumnIndex(RawContacts._ID));
251
+                c.close();
252
+
253
+                try {
254
+                    JSONObject contact = contactAccessor.getContactById(id);
255
+                    this.callbackContext.success(contact);
256
+                    return;
257
+                } catch (JSONException e) {
258
+                    LOG.e(LOG_TAG, "JSON fail.", e);
259
+                }
260
+            } else if (resultCode == Activity.RESULT_CANCELED) {
261
+                callbackContext.error(OPERATION_CANCELLED_ERROR);
262
+                return;
263
+            }
264
+
265
+            this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, UNKNOWN_ERROR));
266
+        }
267
+    }
268
+
269
+    public void onRequestPermissionResult(int requestCode, String[] permissions,
270
+                                             int[] grantResults) throws JSONException
271
+    {
272
+        for(int r:grantResults)
273
+        {
274
+            if(r == PackageManager.PERMISSION_DENIED)
275
+            {
276
+                this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, PERMISSION_DENIED_ERROR));
277
+                return;
278
+            }
279
+        }
280
+        switch(requestCode)
281
+        {
282
+            case SEARCH_REQ_CODE:
283
+                search(executeArgs);
284
+                break;
285
+            case SAVE_REQ_CODE:
286
+                save(executeArgs);
287
+                break;
288
+            case REMOVE_REQ_CODE:
289
+                remove(executeArgs);
290
+                break;
291
+            case PICK_REQ_CODE:
292
+                pickContactAsync();
293
+                break;
294
+        }
295
+    }
296
+
297
+    /**
298
+     * This plugin launches an external Activity when a contact is picked, so we
299
+     * need to implement the save/restore API in case the Activity gets killed
300
+     * by the OS while it's in the background. We don't actually save anything
301
+     * because picking a contact doesn't take in any arguments.
302
+     */
303
+    public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {
304
+        this.callbackContext = callbackContext;
305
+        this.contactAccessor = new ContactAccessorSdk5(this.cordova);
306
+    }
307
+}

+ 31
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactActivity.js Parādīt failu

@@ -0,0 +1,31 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactActivity = function (args) {
22
+    this.direction = args.direction || null;
23
+    this.description = args.description || "";
24
+    this.mimeType = args.mimeType || "";
25
+    this.timestamp = new Date(parseInt(args.timestamp, 10)) || null;
26
+};
27
+
28
+Object.defineProperty(ContactActivity, "INCOMING", {"value": true});
29
+Object.defineProperty(ContactActivity, "OUTGOING", {"value": false});
30
+
31
+module.exports = ContactActivity;

+ 35
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactAddress.js Parādīt failu

@@ -0,0 +1,35 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactAddress = function (properties) {
22
+    this.type = properties && properties.type ? properties.type : "";
23
+    this.streetAddress = properties && properties.streetAddress ? properties.streetAddress : "";
24
+    this.streetOther = properties && properties.streetOther ? properties.streetOther : "";
25
+    this.locality = properties && properties.locality ? properties.locality : "";
26
+    this.region = properties && properties.region ? properties.region : "";
27
+    this.postalCode = properties && properties.postalCode ? properties.postalCode : "";
28
+    this.country = properties && properties.country ? properties.country : "";
29
+};
30
+
31
+Object.defineProperty(ContactAddress, "HOME", {"value": "home"});
32
+Object.defineProperty(ContactAddress, "WORK", {"value": "work"});
33
+Object.defineProperty(ContactAddress, "OTHER", {"value": "other"});
34
+
35
+module.exports = ContactAddress;

+ 35
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactError.js Parādīt failu

@@ -0,0 +1,35 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactError = function (code, msg) {
22
+    this.code = code;
23
+    this.message = msg;
24
+};
25
+
26
+Object.defineProperty(ContactError, "UNKNOWN_ERROR", { "value": 0 });
27
+Object.defineProperty(ContactError, "INVALID_ARGUMENT_ERROR", { "value": 1 });
28
+Object.defineProperty(ContactError, "TIMEOUT_ERROR", { "value": 2 });
29
+Object.defineProperty(ContactError, "PENDING_OPERATION_ERROR", { "value": 3 });
30
+Object.defineProperty(ContactError, "IO_ERROR", { "value": 4 });
31
+Object.defineProperty(ContactError, "NOT_SUPPORTED_ERROR", { "value": 5 });
32
+Object.defineProperty(ContactError, "PERMISSION_DENIED_ERROR", { "value": 20 });
33
+
34
+module.exports = ContactError;
35
+

+ 32
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactField.js Parādīt failu

@@ -0,0 +1,32 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactField = function (type, value) {
22
+    this.type = type || "";
23
+    this.value = value || "";
24
+};
25
+
26
+Object.defineProperty(ContactField, "HOME", {"value": "home"});
27
+Object.defineProperty(ContactField, "WORK", {"value": "work"});
28
+Object.defineProperty(ContactField, "OTHER", {"value": "other"});
29
+Object.defineProperty(ContactField, "MOBILE", {"value": "mobile"});
30
+Object.defineProperty(ContactField, "DIRECT", {"value": "direct"});
31
+
32
+module.exports = ContactField;

+ 55
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactFindOptions.js Parādīt failu

@@ -0,0 +1,55 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+/**
23
+ * ContactFindOptions.
24
+ * @constructor
25
+ * @param filter search fields
26
+ * @param sort sort fields and order
27
+ * @param limit max number of contacts to return
28
+ * @param favorite if set, only favorite contacts will be returned
29
+ */
30
+
31
+var ContactFindOptions = function (filter, sort, limit, favorite) {
32
+    this.filter = filter || null;
33
+    this.sort = sort || null;
34
+    this.limit = limit || -1; // -1 for returning all results
35
+    this.favorite = favorite || false;
36
+    this.includeAccounts = [];
37
+    this.excludeAccounts = [];
38
+};
39
+
40
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_GIVEN_NAME", { "value": 0 });
41
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_FAMILY_NAME", { "value": 1 });
42
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_ORGANIZATION_NAME", { "value": 2 });
43
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_PHONE", { "value": 3 });
44
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_EMAIL", { "value": 4 });
45
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_BBMPIN", { "value": 5 });
46
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_LINKEDIN", { "value": 6 });
47
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_TWITTER", { "value": 7 });
48
+Object.defineProperty(ContactFindOptions, "SEARCH_FIELD_VIDEO_CHAT", { "value": 8 });
49
+
50
+Object.defineProperty(ContactFindOptions, "SORT_FIELD_GIVEN_NAME", { "value": 0 });
51
+Object.defineProperty(ContactFindOptions, "SORT_FIELD_FAMILY_NAME", { "value": 1 });
52
+Object.defineProperty(ContactFindOptions, "SORT_FIELD_ORGANIZATION_NAME", { "value": 2 });
53
+
54
+module.exports = ContactFindOptions;
55
+

+ 44
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactName.js Parādīt failu

@@ -0,0 +1,44 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+function toFormattedName(properties) {
23
+    var formatted = "";
24
+    if (properties && properties.givenName) {
25
+        formatted = properties.givenName;
26
+        if (properties && properties.familyName) {
27
+            formatted += " " + properties.familyName;
28
+        }
29
+    }
30
+    return formatted;
31
+}
32
+
33
+var ContactName = function (properties) {
34
+    this.familyName = properties && properties.familyName ? properties.familyName : "";
35
+    this.givenName = properties && properties.givenName ? properties.givenName : "";
36
+    this.formatted = toFormattedName(properties);
37
+    this.middleName = properties && properties.middleName ? properties.middleName : "";
38
+    this.honorificPrefix = properties && properties.honorificPrefix ? properties.honorificPrefix : "";
39
+    this.honorificSuffix = properties && properties.honorificSuffix ? properties.honorificSuffix : "";
40
+    this.phoneticFamilyName = properties && properties.phoneticFamilyName ? properties.phoneticFamilyName : "";
41
+    this.phoneticGivenName = properties && properties.phoneticGivenName ? properties.phoneticGivenName : "";
42
+};
43
+
44
+module.exports = ContactName;

+ 31
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactNews.js Parādīt failu

@@ -0,0 +1,31 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactNews = function (args) {
22
+    this.title = args.title || "";
23
+    this.body = args.body || "";
24
+    this.articleSource = args.articleSource || "";
25
+    this.companies = args.companies || [];
26
+    this.publishedAt = new Date(parseInt(args.publishedAt, 10)) || null;
27
+    this.uri = args.uri || "";
28
+    this.type = args.type || "";
29
+};
30
+
31
+module.exports = ContactNews;

+ 27
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactOrganization.js Parādīt failu

@@ -0,0 +1,27 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactOrganization = function (properties) {
22
+    this.name = properties && properties.name ? properties.name : "";
23
+    this.department = properties && properties.department ? properties.department : "";
24
+    this.title = properties && properties.title ? properties.title : "";
25
+};
26
+
27
+module.exports = ContactOrganization;

+ 28
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/ContactPhoto.js Parādīt failu

@@ -0,0 +1,28 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+var ContactPhoto = function (originalFilePath, pref) {
22
+    this.originalFilePath = originalFilePath || "";
23
+    this.pref = pref || false;
24
+    this.largeFilePath = "";
25
+    this.smallFilePath = "";
26
+};
27
+
28
+module.exports = ContactPhoto;

+ 225
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/contactConsts.js Parādīt failu

@@ -0,0 +1,225 @@
1
+/*
2
+* Copyright 2012 Research In Motion Limited.
3
+*
4
+* Licensed under the Apache License, Version 2.0 (the "License");
5
+* you may not use this file except in compliance with the License.
6
+* You may obtain a copy of the License at
7
+*
8
+* http://www.apache.org/licenses/LICENSE-2.0
9
+*
10
+* Unless required by applicable law or agreed to in writing, software
11
+* distributed under the License is distributed on an "AS IS" BASIS,
12
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+* See the License for the specific language governing permissions and
14
+* limitations under the License.
15
+*/
16
+
17
+var ATTRIBUTE_KIND,
18
+    ATTRIBUTE_SUBKIND,
19
+    kindAttributeMap = {},
20
+    subKindAttributeMap = {},
21
+    _TITLE = 26,
22
+    _START_DATE = 43,
23
+    _END_DATE = 44;
24
+
25
+function populateKindAttributeMap() {
26
+    ATTRIBUTE_KIND = {
27
+        Invalid: 0,
28
+        Phone: 1,
29
+        Fax: 2,
30
+        Pager: 3,
31
+        Email: 4,
32
+        Website: 5,
33
+        Feed: 6,
34
+        Profile: 7,
35
+        Family: 8,
36
+        Person: 9,
37
+        Date: 10,
38
+        Group: 11,
39
+        Name: 12,
40
+        StockSymbol: 13,
41
+        Ranking: 14,
42
+        OrganizationAffiliation: 15,
43
+        Education: 16,
44
+        Note: 17,
45
+        InstantMessaging: 18,
46
+        VideoChat: 19,
47
+        ConnectionCount: 20,
48
+        Hidden: 21,
49
+        Biography: 22,
50
+        Sound: 23,
51
+        Notification: 24,
52
+        MessageSound: 25,
53
+        MessageNotification: 26
54
+    };
55
+
56
+    kindAttributeMap[ATTRIBUTE_KIND.Phone] = "phoneNumbers";
57
+    kindAttributeMap[ATTRIBUTE_KIND.Fax] = "faxNumbers";
58
+    kindAttributeMap[ATTRIBUTE_KIND.Pager] = "pagerNumber";
59
+    kindAttributeMap[ATTRIBUTE_KIND.Email] = "emails";
60
+    kindAttributeMap[ATTRIBUTE_KIND.Website] = "urls";
61
+    kindAttributeMap[ATTRIBUTE_KIND.Profile] = "socialNetworks";
62
+    kindAttributeMap[ATTRIBUTE_KIND.OrganizationAffiliation] = "organizations";
63
+    kindAttributeMap[ATTRIBUTE_KIND.Education] = "education";
64
+    kindAttributeMap[ATTRIBUTE_KIND.Note] = "note";
65
+    kindAttributeMap[ATTRIBUTE_KIND.InstantMessaging] = "ims";
66
+    kindAttributeMap[ATTRIBUTE_KIND.VideoChat] = "videoChat";
67
+    kindAttributeMap[ATTRIBUTE_KIND.Sound] = "ringtone";
68
+}
69
+
70
+function populateSubKindAttributeMap() {
71
+    ATTRIBUTE_SUBKIND = {
72
+        Invalid: 0,
73
+        Other: 1,
74
+        Home: 2,
75
+        Work: 3,
76
+        PhoneMobile: 4,
77
+        FaxDirect: 5,
78
+        Blog: 6,
79
+        WebsiteResume: 7,
80
+        WebsitePortfolio: 8,
81
+        WebsitePersonal: 9,
82
+        WebsiteCompany: 10,
83
+        ProfileFacebook: 11,
84
+        ProfileTwitter: 12,
85
+        ProfileLinkedIn: 13,
86
+        ProfileGist: 14,
87
+        ProfileTungle: 15,
88
+        FamilySpouse: 16,
89
+        FamilyChild: 17,
90
+        FamilyParent: 18,
91
+        PersonManager: 19,
92
+        PersonAssistant: 20,
93
+        DateBirthday: 21,
94
+        DateAnniversary: 22,
95
+        GroupDepartment: 23,
96
+        NameGiven: 24,
97
+        NameSurname: 25,
98
+        Title: _TITLE,
99
+        NameSuffix: 27,
100
+        NameMiddle: 28,
101
+        NameNickname: 29,
102
+        NameAlias: 30,
103
+        NameDisplayName: 31,
104
+        NamePhoneticGiven: 32,
105
+        NamePhoneticSurname: 33,
106
+        StockSymbolNyse: 34,
107
+        StockSymbolNasdaq: 35,
108
+        StockSymbolTse: 36,
109
+        StockSymbolLse: 37,
110
+        StockSymbolTsx: 38,
111
+        RankingKlout: 39,
112
+        RankingTrstRank: 40,
113
+        OrganizationAffiliationName: 41,
114
+        OrganizationAffiliationPhoneticName: 42,
115
+        OrganizationAffiliationTitle: _TITLE,
116
+        StartDate: _START_DATE,
117
+        EndDate: _END_DATE,
118
+        OrganizationAffiliationDetails: 45,
119
+        EducationInstitutionName: 46,
120
+        EducationStartDate: _START_DATE,
121
+        EducationEndDate: _END_DATE,
122
+        EducationDegree: 47,
123
+        EducationConcentration: 48,
124
+        EducationActivities: 49,
125
+        EducationNotes: 50,
126
+        InstantMessagingBbmPin: 51,
127
+        InstantMessagingAim: 52,
128
+        InstantMessagingAliwangwang: 53,
129
+        InstantMessagingGoogleTalk: 54,
130
+        InstantMessagingSametime: 55,
131
+        InstantMessagingIcq: 56,
132
+        InstantMessagingIrc: 57,
133
+        InstantMessagingJabber: 58,
134
+        InstantMessagingMsLcs: 59,
135
+        InstantMessagingMsn: 60,
136
+        InstantMessagingQq: 61,
137
+        InstantMessagingSkype: 62,
138
+        InstantMessagingYahooMessenger: 63,
139
+        InstantMessagingYahooMessengerJapan: 64,
140
+        VideoChatBbPlaybook: 65,
141
+        HiddenLinkedIn: 66,
142
+        HiddenFacebook: 67,
143
+        HiddenTwitter: 68,
144
+        ConnectionCountLinkedIn: 69,
145
+        ConnectionCountFacebook: 70,
146
+        ConnectionCountTwitter: 71,
147
+        HiddenChecksum: 72,
148
+        HiddenSpeedDial: 73,
149
+        BiographyFacebook: 74,
150
+        BiographyTwitter: 75,
151
+        BiographyLinkedIn: 76,
152
+        SoundRingtone: 77,
153
+        SimContactType: 78,
154
+        EcoID: 79,
155
+        Personal: 80,
156
+        StockSymbolAll: 81,
157
+        NotificationVibration: 82,
158
+        NotificationLED: 83,
159
+        MessageNotificationVibration: 84,
160
+        MessageNotificationLED: 85,
161
+        MessageNotificationDuringCall: 86,
162
+        VideoChatPin: 87
163
+    };
164
+
165
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Other] = "other";
166
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Home] = "home";
167
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Work] = "work";
168
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.PhoneMobile] = "mobile";
169
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.FaxDirect] = "direct";
170
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Blog] = "blog";
171
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsiteResume] = "resume";
172
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsitePortfolio] = "portfolio";
173
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsitePersonal] = "personal";
174
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.WebsiteCompany] = "company";
175
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileFacebook] = "facebook";
176
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileTwitter] = "twitter";
177
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileLinkedIn] = "linkedin";
178
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileGist] = "gist";
179
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.ProfileTungle] = "tungle";
180
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.DateBirthday] = "birthday";
181
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.DateAnniversary] = "anniversary";
182
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NameGiven] = "givenName";
183
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NameSurname] = "familyName";
184
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Title] = "honorificPrefix";
185
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NameSuffix] = "honorificSuffix";
186
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NameMiddle] = "middleName";
187
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NamePhoneticGiven] = "phoneticGivenName";
188
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NamePhoneticSurname] = "phoneticFamilyName";
189
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NameNickname] = "nickname";
190
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.NameDisplayName] = "displayName";
191
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.OrganizationAffiliationName] = "name";
192
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.OrganizationAffiliationDetails] = "department";
193
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Title] = "title";
194
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingBbmPin] = "BbmPin";
195
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingAim] = "Aim";
196
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingAliwangwang] = "Aliwangwang";
197
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingGoogleTalk] = "GoogleTalk";
198
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingSametime] = "Sametime";
199
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingIcq] = "Icq";
200
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingJabber] = "Jabber";
201
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingMsLcs] = "MsLcs";
202
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingSkype] = "Skype";
203
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingYahooMessenger] = "YahooMessenger";
204
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.InstantMessagingYahooMessengerJapan] = "YahooMessegerJapan";
205
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.VideoChatBbPlaybook] = "BbPlaybook";
206
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.SoundRingtone] = "ringtone";
207
+    subKindAttributeMap[ATTRIBUTE_SUBKIND.Personal] = "personal";
208
+}
209
+
210
+module.exports = {
211
+    getKindAttributeMap: function () {
212
+        if (!ATTRIBUTE_KIND) {
213
+            populateKindAttributeMap();
214
+        }
215
+
216
+        return kindAttributeMap;
217
+    },
218
+    getSubKindAttributeMap: function () {
219
+        if (!ATTRIBUTE_SUBKIND) {
220
+            populateSubKindAttributeMap();
221
+        }
222
+
223
+        return subKindAttributeMap;
224
+    }
225
+};

+ 230
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/contactUtils.js Parādīt failu

@@ -0,0 +1,230 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+/* global ContactPickerOptions */
23
+
24
+var self,
25
+    ContactFindOptions = require("./ContactFindOptions"),
26
+    ContactError = require("./ContactError"),
27
+    ContactName = require("./ContactName"),
28
+    ContactOrganization = require("./ContactOrganization"),
29
+    ContactAddress = require("./ContactAddress"),
30
+    ContactField = require("./ContactField"),
31
+    contactConsts = require("./contactConsts"),
32
+    ContactPhoto = require("./ContactPhoto"),
33
+    ContactNews = require("./ContactNews"),
34
+    ContactActivity = require("./ContactActivity");
35
+
36
+function populateFieldArray(contactProps, field, ClassName) {
37
+    if (contactProps[field]) {
38
+        var list = [],
39
+        obj;
40
+
41
+        contactProps[field].forEach(function (args) {
42
+            if (ClassName === ContactField) {
43
+                list.push(new ClassName(args.type, args.value));
44
+            } else if (ClassName === ContactPhoto) {
45
+                obj = new ContactPhoto(args.originalFilePath, args.pref);
46
+                obj.largeFilePath = args.largeFilePath;
47
+                obj.smallFilePath = args.smallFilePath;
48
+                list.push(obj);
49
+            } else if (ClassName === ContactNews) {
50
+                obj = new ContactNews(args);
51
+                list.push(obj);
52
+            } else if (ClassName === ContactActivity) {
53
+                obj = new ContactActivity(args);
54
+                list.push(obj);
55
+            } else {
56
+                list.push(new ClassName(args));
57
+            }
58
+        });
59
+        contactProps[field] = list;
60
+    }
61
+}
62
+
63
+function populateDate(contactProps, field) {
64
+    if (contactProps[field]) {
65
+        contactProps[field] = new Date(contactProps[field]);
66
+    }
67
+}
68
+
69
+function validateFindArguments(findOptions) {
70
+    var error = false;
71
+    
72
+    // findOptions is mandatory
73
+    if (!findOptions) {
74
+        error = true;
75
+    } else {
76
+        // findOptions.filter is optional
77
+        if (findOptions.filter) {
78
+            findOptions.filter.forEach(function (f) {
79
+                switch (f.fieldName) {
80
+                case ContactFindOptions.SEARCH_FIELD_GIVEN_NAME:
81
+                case ContactFindOptions.SEARCH_FIELD_FAMILY_NAME:
82
+                case ContactFindOptions.SEARCH_FIELD_ORGANIZATION_NAME:
83
+                case ContactFindOptions.SEARCH_FIELD_PHONE:
84
+                case ContactFindOptions.SEARCH_FIELD_EMAIL:
85
+                case ContactFindOptions.SEARCH_FIELD_BBMPIN:
86
+                case ContactFindOptions.SEARCH_FIELD_LINKEDIN:
87
+                case ContactFindOptions.SEARCH_FIELD_TWITTER:
88
+                case ContactFindOptions.SEARCH_FIELD_VIDEO_CHAT:
89
+                    break;
90
+                default:
91
+                    error = true;
92
+                }
93
+
94
+                if (!f.fieldValue) {
95
+                    error = true;
96
+                }
97
+            });
98
+        } 
99
+
100
+        //findOptions.limit is optional
101
+        if (findOptions.limit) {
102
+            if (typeof findOptions.limit !== "number") {
103
+                error = true;
104
+            } 
105
+        } 
106
+
107
+        //findOptions.favorite is optional
108
+        if (findOptions.favorite) {
109
+            if (typeof findOptions.favorite !== "boolean") {
110
+                error = true;
111
+            }
112
+        }
113
+
114
+        // findOptions.sort is optional
115
+        if (!error && findOptions.sort && Array.isArray(findOptions.sort)) {
116
+            findOptions.sort.forEach(function (s) {
117
+                switch (s.fieldName) {
118
+                case ContactFindOptions.SORT_FIELD_GIVEN_NAME:
119
+                case ContactFindOptions.SORT_FIELD_FAMILY_NAME:
120
+                case ContactFindOptions.SORT_FIELD_ORGANIZATION_NAME:
121
+                    break;
122
+                default:
123
+                    error = true;
124
+                }
125
+
126
+                if (s.desc === undefined || typeof s.desc !== "boolean") {
127
+                    error = true;
128
+                }
129
+            });
130
+        }
131
+
132
+        if (!error && findOptions.includeAccounts) {
133
+            if (!Array.isArray(findOptions.includeAccounts)) {
134
+                error = true;
135
+            } else {
136
+                findOptions.includeAccounts.forEach(function (acct) {
137
+                    if (!error && (!acct.id || window.isNaN(window.parseInt(acct.id, 10)))) {
138
+                        error = true;
139
+                    }
140
+                });
141
+            }
142
+        }
143
+
144
+        if (!error && findOptions.excludeAccounts) {
145
+            if (!Array.isArray(findOptions.excludeAccounts)) {
146
+                error = true;
147
+            } else {
148
+                findOptions.excludeAccounts.forEach(function (acct) {
149
+                    if (!error && (!acct.id || window.isNaN(window.parseInt(acct.id, 10)))) {
150
+                        error = true;
151
+                    }
152
+                });
153
+            }
154
+        }
155
+    }
156
+    return !error;
157
+}
158
+
159
+function validateContactsPickerFilter(filter) {
160
+    var isValid = true,
161
+        availableFields = {};
162
+
163
+    if (typeof(filter) === "undefined") {
164
+        isValid = false;
165
+    } else {
166
+        if (filter && Array.isArray(filter)) {
167
+            availableFields = contactConsts.getKindAttributeMap();
168
+            filter.forEach(function (e) {
169
+                isValid = isValid && Object.getOwnPropertyNames(availableFields).reduce(
170
+                    function (found, key) {
171
+                        return found || availableFields[key] === e;
172
+                    }, false);
173
+            });
174
+        }
175
+    }
176
+
177
+    return isValid;
178
+}
179
+
180
+function validateContactsPickerOptions(options) {
181
+    var isValid = false,
182
+        mode = options.mode;
183
+
184
+    if (typeof(options) === "undefined") {
185
+        isValid = false;
186
+    } else {
187
+        isValid = mode === ContactPickerOptions.MODE_SINGLE || mode === ContactPickerOptions.MODE_MULTIPLE || mode === ContactPickerOptions.MODE_ATTRIBUTE;
188
+
189
+        // if mode is attribute, fields must be defined
190
+        if (mode === ContactPickerOptions.MODE_ATTRIBUTE && !validateContactsPickerFilter(options.fields)) {
191
+            isValid = false;
192
+        }
193
+    }
194
+
195
+    return isValid;
196
+}
197
+
198
+self = module.exports = {
199
+    populateContact: function (contact) {
200
+        if (contact.name) {
201
+            contact.name = new ContactName(contact.name);
202
+        }
203
+
204
+        populateFieldArray(contact, "addresses", ContactAddress);
205
+        populateFieldArray(contact, "organizations", ContactOrganization);
206
+        populateFieldArray(contact, "emails", ContactField);
207
+        populateFieldArray(contact, "phoneNumbers", ContactField);
208
+        populateFieldArray(contact, "faxNumbers", ContactField);
209
+        populateFieldArray(contact, "pagerNumbers", ContactField);
210
+        populateFieldArray(contact, "ims", ContactField);
211
+        populateFieldArray(contact, "socialNetworks", ContactField);
212
+        populateFieldArray(contact, "urls", ContactField);
213
+        populateFieldArray(contact, "photos", ContactPhoto);
214
+        populateFieldArray(contact, "news", ContactNews);
215
+        populateFieldArray(contact, "activities", ContactActivity);
216
+        // TODO categories
217
+
218
+        populateDate(contact, "birthday");
219
+        populateDate(contact, "anniversary");
220
+    },
221
+    invokeErrorCallback: function (errorCallback, code) {
222
+        if (errorCallback) {
223
+            errorCallback(new ContactError(code));
224
+        }
225
+    },
226
+    validateFindArguments: validateFindArguments,
227
+    validateContactsPickerFilter: validateContactsPickerFilter,
228
+    validateContactsPickerOptions: validateContactsPickerOptions
229
+};
230
+

+ 357
- 0
km0App/node_modules/cordova-plugin-contacts/src/blackberry10/index.js Parādīt failu

@@ -0,0 +1,357 @@
1
+/*
2
+ * Copyright 2013 Research In Motion Limited.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+/* global PluginResult, JNEXT, escape */
18
+
19
+var pimContacts,
20
+    ContactError = require("./ContactError"),
21
+    ContactName = require("./ContactName"),
22
+    ContactFindOptions = require("./ContactFindOptions");
23
+
24
+function populateSearchFields(fields) {
25
+    var i,
26
+        l,
27
+        key,
28
+        searchFieldsObject = {},
29
+        searchFields = [];
30
+
31
+    for (i = 0, l = fields.length; i < l; i++) {
32
+        if (fields[i] === "*") {
33
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_GIVEN_NAME] = true;
34
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_FAMILY_NAME] = true;
35
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_PHONE] = true;
36
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_EMAIL] = true;
37
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_ORGANIZATION_NAME] = true;
38
+        } else if (fields[i] === "displayName" || fields[i] === "name") {
39
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_GIVEN_NAME] = true;
40
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_FAMILY_NAME] = true;
41
+        } else if (fields[i] === "nickname") {
42
+            // not supported by Cascades
43
+        } else if (fields[i] === "phoneNumbers") {
44
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_PHONE] = true;
45
+        } else if (fields[i] === "emails") {
46
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_EMAIL] = true;
47
+        } else if (fields[i] === "addresses") {
48
+            // not supported by Cascades
49
+        } else if (fields[i] === "ims") {
50
+            // not supported by Cascades
51
+        } else if (fields[i] === "organizations") {
52
+            searchFieldsObject[ContactFindOptions.SEARCH_FIELD_ORGANIZATION_NAME] = true;
53
+        } else if (fields[i] === "birthday") {
54
+            // not supported by Cascades
55
+        } else if (fields[i] === "note") {
56
+            // not supported by Cascades
57
+        } else if (fields[i] === "photos") {
58
+            // not supported by Cascades
59
+        } else if (fields[i] === "categories") {
60
+            // not supported by Cascades
61
+        } else if (fields[i] === "urls") {
62
+            // not supported by Cascades
63
+        }
64
+    }
65
+
66
+    for (key in searchFieldsObject) {
67
+        if (searchFieldsObject.hasOwnProperty(key)) {
68
+            searchFields.push(window.parseInt(key));
69
+        }
70
+    }
71
+
72
+    return searchFields;
73
+}
74
+
75
+function convertBirthday(birthday) {
76
+    //Convert date string from native to milliseconds since epoch for cordova-js
77
+    var birthdayInfo;
78
+    if (birthday) {
79
+        birthdayInfo = birthday.split("-");
80
+        return new Date(birthdayInfo[0], birthdayInfo[1] - 1, birthdayInfo[2]).getTime();
81
+    } else {
82
+        return null;
83
+    }
84
+}
85
+
86
+function processJnextSaveData(result, JnextData) {
87
+    var data = JnextData;
88
+
89
+    if (data._success === true) {
90
+        data.birthday = convertBirthday(data.birthday);
91
+        result.callbackOk(data, false);
92
+    } else {
93
+        result.callbackError(data.code, false);
94
+    }
95
+}
96
+
97
+function processJnextRemoveData(result, JnextData) {
98
+    var data = JnextData;
99
+
100
+    if (data._success === true) {
101
+        result.callbackOk(data);
102
+    } else {
103
+        result.callbackError(ContactError.UNKNOWN_ERROR, false);
104
+    }
105
+}
106
+
107
+function processJnextFindData(eventId, eventHandler, JnextData) {
108
+    var data = JnextData,
109
+        i,
110
+        l,
111
+        more = false,
112
+        resultsObject = {};
113
+
114
+    if (data.contacts) {
115
+        for (i = 0, l = data.contacts.length; i < l; i++) {
116
+            data.contacts[i].birthday = convertBirthday(data.contacts[i].birthday);
117
+            data.contacts[i].name = new ContactName(data.contacts[i].name);
118
+        }
119
+    } else {
120
+        data.contacts = []; // if JnextData.contacts return null, return an empty array
121
+    }
122
+
123
+    if (data._success === true) {
124
+        eventHandler.error = false;
125
+    }
126
+
127
+    if (eventHandler.multiple) {
128
+        // Concatenate results; do not add the same contacts
129
+        for (i = 0, l = eventHandler.searchResult.length; i < l; i++) {
130
+            resultsObject[eventHandler.searchResult[i].id] = true;
131
+        }
132
+
133
+        for (i = 0, l = data.contacts.length; i < l; i++) {
134
+            if (resultsObject[data.contacts[i].id]) {
135
+                // Already existing
136
+            } else {
137
+                eventHandler.searchResult.push(data.contacts[i]);
138
+            }
139
+        }
140
+
141
+        // check if more search is required
142
+        eventHandler.searchFieldIndex++;
143
+        if (eventHandler.searchFieldIndex < eventHandler.searchFields.length) {
144
+            more = true;
145
+        }
146
+    } else {
147
+        eventHandler.searchResult = data.contacts;
148
+    }
149
+
150
+    if (more) {
151
+        pimContacts.getInstance().invokeJnextSearch(eventId);
152
+    } else {
153
+        if (eventHandler.error) {
154
+            eventHandler.result.callbackError(data.code, false);
155
+        } else {
156
+            eventHandler.result.callbackOk(eventHandler.searchResult, false);
157
+        }
158
+    }
159
+}
160
+
161
+module.exports = {
162
+    search: function (successCb, failCb, args, env) {
163
+        var cordovaFindOptions = {},
164
+            result = new PluginResult(args, env),
165
+            key;
166
+
167
+        for (key in args) {
168
+            if (args.hasOwnProperty(key)) {
169
+                cordovaFindOptions[key] = JSON.parse(decodeURIComponent(args[key]));
170
+            }
171
+        }
172
+
173
+        pimContacts.getInstance().find(cordovaFindOptions, result, processJnextFindData);
174
+        result.noResult(true);
175
+    },
176
+    save: function (successCb, failCb, args, env) {
177
+        var attributes = {},
178
+            result = new PluginResult(args, env),
179
+            nativeEmails = [];
180
+
181
+        attributes = JSON.parse(decodeURIComponent(args[0]));
182
+
183
+        //convert birthday format for our native .so file
184
+        if (attributes.birthday) {
185
+            attributes.birthday = new Date(attributes.birthday).toDateString();
186
+        }
187
+
188
+        if (attributes.emails) {
189
+            attributes.emails.forEach(function (email) {
190
+                if (email.value) {
191
+                    if (email.type) {
192
+                        nativeEmails.push({ "type" : email.type, "value" : email.value });
193
+                    } else {
194
+                        nativeEmails.push({ "type" : "home", "value" : email.value });
195
+                    }
196
+                }
197
+            });
198
+            attributes.emails = nativeEmails;
199
+        }
200
+
201
+        if (attributes.id !== null) {
202
+            attributes.id = window.parseInt(attributes.id);
203
+        }
204
+
205
+        attributes._eventId = result.callbackId;
206
+        pimContacts.getInstance().save(attributes, result, processJnextSaveData);
207
+        result.noResult(true);
208
+    },
209
+    remove: function (successCb, failCb, args, env) {
210
+        var result = new PluginResult(args, env),
211
+            attributes = {
212
+                "contactId": window.parseInt(JSON.parse(decodeURIComponent(args[0]))),
213
+                "_eventId": result.callbackId
214
+            };
215
+
216
+        if (!window.isNaN(attributes.contactId)) {
217
+            pimContacts.getInstance().remove(attributes, result, processJnextRemoveData);
218
+            result.noResult(true);
219
+        } else {
220
+            result.error(ContactError.UNKNOWN_ERROR);
221
+            result.noResult(false);
222
+        }
223
+    }
224
+};
225
+
226
+///////////////////////////////////////////////////////////////////
227
+// JavaScript wrapper for JNEXT plugin
228
+///////////////////////////////////////////////////////////////////
229
+
230
+JNEXT.PimContacts = function ()
231
+{
232
+    var self = this,
233
+        hasInstance = false;
234
+
235
+    self.find = function (cordovaFindOptions, pluginResult, handler) {
236
+        //register find eventHandler for when JNEXT onEvent fires
237
+        self.eventHandlers[cordovaFindOptions.callbackId] = {
238
+            "result" : pluginResult,
239
+            "action" : "find",
240
+            "multiple" : cordovaFindOptions[1].filter ? true : false,
241
+            "fields" : cordovaFindOptions[0],
242
+            "searchFilter" : cordovaFindOptions[1].filter,
243
+            "searchFields" : cordovaFindOptions[1].filter ? populateSearchFields(cordovaFindOptions[0]) : null,
244
+            "searchFieldIndex" : 0,
245
+            "searchResult" : [],
246
+            "handler" : handler,
247
+            "error" : true
248
+        };
249
+
250
+        self.invokeJnextSearch(cordovaFindOptions.callbackId);
251
+        return "";
252
+    };
253
+
254
+    self.invokeJnextSearch = function(eventId) {
255
+        var jnextArgs = {},
256
+            findHandler = self.eventHandlers[eventId];
257
+
258
+        jnextArgs._eventId = eventId;
259
+        jnextArgs.fields = findHandler.fields;
260
+        jnextArgs.options = {};
261
+        jnextArgs.options.filter = [];
262
+
263
+        if (findHandler.multiple) {
264
+            jnextArgs.options.filter.push({
265
+                "fieldName" : findHandler.searchFields[findHandler.searchFieldIndex],
266
+                "fieldValue" : findHandler.searchFilter
267
+            });
268
+            //findHandler.searchFieldIndex++;
269
+        }
270
+
271
+        JNEXT.invoke(self.m_id, "find " + JSON.stringify(jnextArgs));
272
+    };
273
+
274
+    self.getContact = function (args) {
275
+        return JSON.parse(JNEXT.invoke(self.m_id, "getContact " + JSON.stringify(args)));
276
+    };
277
+
278
+    self.save = function (args, pluginResult, handler) {
279
+        //register save eventHandler for when JNEXT onEvent fires
280
+        self.eventHandlers[args._eventId] = {
281
+            "result" : pluginResult,
282
+            "action" : "save",
283
+            "handler" : handler
284
+        };
285
+        JNEXT.invoke(self.m_id, "save " + JSON.stringify(args));
286
+        return "";
287
+    };
288
+
289
+    self.remove = function (args, pluginResult, handler) {
290
+        //register remove eventHandler for when JNEXT onEvent fires
291
+        self.eventHandlers[args._eventId] = {
292
+            "result" : pluginResult,
293
+            "action" : "remove",
294
+            "handler" : handler
295
+        };
296
+        JNEXT.invoke(self.m_id, "remove " + JSON.stringify(args));
297
+        return "";
298
+    };
299
+
300
+    self.getId = function () {
301
+        return self.m_id;
302
+    };
303
+
304
+    self.getContactAccounts = function () {
305
+        var value = JNEXT.invoke(self.m_id, "getContactAccounts");
306
+        return JSON.parse(value);
307
+    };
308
+
309
+    self.init = function () {
310
+        if (!JNEXT.require("libpimcontacts")) {
311
+            return false;
312
+        }
313
+
314
+        self.m_id = JNEXT.createObject("libpimcontacts.PimContacts");
315
+
316
+        if (self.m_id === "") {
317
+            return false;
318
+        }
319
+
320
+        JNEXT.registerEvents(self);
321
+    };
322
+
323
+    // Handle data coming back from JNEXT native layer. Each async function registers a handler and a PluginResult object.
324
+    // When JNEXT fires onEvent we parse the result string  back into JSON and trigger the appropriate handler (eventHandlers map
325
+    // uses callbackId as key), along with the actual data coming back from the native layer. Each function may have its own way of
326
+    // processing native data so we do not do any processing here.
327
+
328
+    self.onEvent = function (strData) {
329
+        var arData = strData.split(" "),
330
+            strEventDesc = arData[0],
331
+            eventHandler,
332
+            args = {};
333
+
334
+        if (strEventDesc === "result") {
335
+            args.result = escape(strData.split(" ").slice(2).join(" "));
336
+            eventHandler = self.eventHandlers[arData[1]];
337
+            if (eventHandler.action === "save" || eventHandler.action === "remove") {
338
+                eventHandler.handler(eventHandler.result, JSON.parse(decodeURIComponent(args.result)));
339
+            } else if (eventHandler.action === "find") {
340
+                eventHandler.handler(arData[1], eventHandler, JSON.parse(decodeURIComponent(args.result)));
341
+            }
342
+        }
343
+    };
344
+
345
+    self.m_id = "";
346
+    self.eventHandlers = {};
347
+
348
+    self.getInstance = function () {
349
+        if (!hasInstance) {
350
+            self.init();
351
+            hasInstance = true;
352
+        }
353
+        return self;
354
+    };
355
+};
356
+
357
+pimContacts = new JNEXT.PimContacts();

+ 33
- 0
km0App/node_modules/cordova-plugin-contacts/src/browser/ContactsProxy.js Parādīt failu

@@ -0,0 +1,33 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+function notSupported() {
23
+    console.log('Contacts is not supported');
24
+    return false;
25
+}
26
+
27
+module.exports = {
28
+    create: notSupported,
29
+    find: notSupported,
30
+    pickContact: notSupported
31
+};
32
+
33
+require('cordova/exec/proxy').add('Contacts', module.exports);

+ 467
- 0
km0App/node_modules/cordova-plugin-contacts/src/firefoxos/ContactsProxy.js Parādīt failu

@@ -0,0 +1,467 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/ 
21
+
22
+/* global mozContact */
23
+
24
+// Cordova contact definition: 
25
+// http://cordova.apache.org/docs/en/2.5.0/cordova_contacts_contacts.md.html#Contact
26
+// FxOS contact definition:
27
+// https://developer.mozilla.org/en-US/docs/Web/API/mozContact
28
+
29
+
30
+var Contact = require('./Contact');
31
+var ContactField = require('./ContactField');
32
+var ContactName = require('./ContactName');
33
+
34
+// XXX: a hack to check if id is "empty". Cordova inserts a
35
+// string "this string is supposed to be a unique identifier that will 
36
+// never show up on a device" if id is empty
37
+function _hasId(id) {
38
+    if (!id || id.indexOf(' ') >= 0) {
39
+        return false;
40
+    }
41
+    return true;
42
+}
43
+
44
+// Extend mozContact prototype to provide update from Cordova
45
+function updateFromCordova(contact, fromContact) {
46
+
47
+    function exportContactFieldArray(contactFieldArray, key) {
48
+        if (!key) {
49
+            key = 'value';
50
+        }
51
+        var arr = [];
52
+        for (var i=0; i < contactFieldArray.length; i++) {
53
+            arr.push(contactFieldArray[i][key]);
54
+        }
55
+        return arr;
56
+    }
57
+
58
+    function exportAddress(addresses) {
59
+        // TODO: check moz address format
60
+        var arr = [];
61
+        
62
+        for (var i=0; i < addresses.length; i++) {
63
+            var addr = {};
64
+            for (var key in addresses[i]) {
65
+                if (key == 'formatted' || key == 'id') {
66
+                    continue;
67
+                } else if (key == 'type') {
68
+                    addr[key] = [addresses[i][key]];
69
+                } else if (key == 'country') {
70
+                    addr.countryName = addresses[i][key];
71
+                } else {
72
+                    addr[key] = addresses[i][key];
73
+                }
74
+            }
75
+            arr.push(addr);
76
+        }
77
+        return arr;
78
+    }
79
+
80
+    function exportContactField(data) {
81
+        var contactFields = [];
82
+        for (var i=0; i < data.length; i++) {
83
+            var item = data[i];
84
+            if (item.value) {
85
+                var itemData = {value: item.value};
86
+                if (item.type) {
87
+                    itemData.type = [item.type];
88
+                }
89
+                if (item.pref) {
90
+                    itemData.pref = item.pref;
91
+                }
92
+                contactFields.push(itemData);
93
+            }
94
+        }
95
+        return contactFields;
96
+    }
97
+    // adding simple fields [contactField, eventualMozContactField]
98
+    var nameFields = [['givenName'], ['familyName'],  
99
+                      ['honorificPrefix'], ['honorificSuffix'],
100
+                      ['middleName', 'additionalName']];
101
+    var baseArrayFields = [['displayName', 'name'], ['nickname']];
102
+    var baseStringFields = [];
103
+    var j = 0, field; while(field = nameFields[j++]) { // jshint ignore:line
104
+      if (fromContact.name[field[0]]) {
105
+        contact[field[1] || field[0]] = fromContact.name[field[0]].split(' ');
106
+      }
107
+    }
108
+    j = 0; while(field = baseArrayFields[j++]) { // jshint ignore:line
109
+      if (fromContact[field[0]]) {
110
+        contact[field[1] || field[0]] = fromContact[field[0]].split(' ');
111
+      }
112
+    }
113
+    j = 0; while(field = baseStringFields[j++]) { // jshint ignore:line
114
+      if (fromContact[field[0]]) {
115
+        contact[field[1] || field[0]] = fromContact[field[0]];
116
+      }
117
+    }
118
+    if (fromContact.birthday) {
119
+      contact.bday = new Date(fromContact.birthday);
120
+    }
121
+    if (fromContact.emails) {
122
+        var emails = exportContactField(fromContact.emails);
123
+        contact.email = emails;
124
+    }
125
+    if (fromContact.categories) {
126
+        contact.category = exportContactFieldArray(fromContact.categories);
127
+    }
128
+    if (fromContact.addresses) {
129
+        contact.adr = exportAddress(fromContact.addresses);
130
+    }
131
+    if (fromContact.phoneNumbers) {
132
+        contact.tel = exportContactField(fromContact.phoneNumbers);
133
+    }
134
+    if (fromContact.organizations) {
135
+        // XXX: organizations are saved in 2 arrays - org and jobTitle
136
+        //      depending on the usecase it might generate issues
137
+        //      where wrong title will be added to an organization
138
+        contact.org = exportContactFieldArray(fromContact.organizations, 'name');
139
+        contact.jobTitle = exportContactFieldArray(fromContact.organizations, 'title');
140
+    }
141
+    if (fromContact.note) {
142
+        contact.note = [fromContact.note];
143
+    }
144
+}
145
+
146
+
147
+// Extend Cordova Contact prototype to provide update from FFOS contact
148
+Contact.prototype.updateFromMozilla = function(moz) {
149
+    function exportContactField(data) {
150
+        var contactFields = [];
151
+        for (var i=0; i < data.length; i++) {
152
+            var item = data[i];
153
+            var itemData = new ContactField(item.type, item.value, item.pref);
154
+            contactFields.push(itemData);
155
+        }
156
+        return contactFields;
157
+    }
158
+
159
+    function makeContactFieldFromArray(data) {
160
+        var contactFields = [];
161
+        for (var i=0; i < data.length; i++) {
162
+            var itemData = new ContactField(null, data[i]);
163
+            contactFields.push(itemData);
164
+        }
165
+        return contactFields;
166
+    }
167
+
168
+    function exportAddresses(addresses) {
169
+        // TODO: check moz address format
170
+        var arr = [];
171
+        
172
+        for (var i=0; i < addresses.length; i++) {
173
+            var addr = {};
174
+            for (var key in addresses[i]) {
175
+                if (key == 'countryName') {
176
+                    addr.country = addresses[i][key];
177
+                } else if (key == 'type') {
178
+                    addr[key] = addresses[i][key].join(' ');
179
+                } else {
180
+                    addr[key] = addresses[i][key];
181
+                }
182
+            }
183
+            arr.push(addr);
184
+        }
185
+        return arr;
186
+    }
187
+
188
+    function createOrganizations(orgs, jobs) {
189
+        orgs = (orgs) ? orgs : [];
190
+        jobs = (jobs) ? jobs : [];
191
+        var max_length = Math.max(orgs.length, jobs.length);
192
+        var organizations = [];
193
+        for (var i=0; i < max_length; i++) {
194
+            organizations.push(new ContactOrganization(
195
+                  null, null, orgs[i] || null, null, jobs[i] || null));
196
+        }
197
+        return organizations;
198
+    }
199
+
200
+    function createFormatted(name) {
201
+        var fields = ['honorificPrefix', 'givenName', 'middleName', 
202
+                      'familyName', 'honorificSuffix'];
203
+        var f = '';
204
+        for (var i = 0; i < fields.length; i++) {
205
+            if (name[fields[i]]) {
206
+                if (f) {
207
+                    f += ' ';
208
+                }
209
+                f += name[fields[i]];
210
+            }
211
+        }
212
+        return f;
213
+    }
214
+
215
+
216
+    if (moz.id) {
217
+        this.id = moz.id;
218
+    }
219
+    var nameFields = [['givenName'], ['familyName'], 
220
+                       ['honorificPrefix'], ['honorificSuffix'],
221
+                       ['additionalName', 'middleName']];
222
+    var baseArrayFields = [['name', 'displayName'], 'nickname', ['note']];
223
+    var baseStringFields = [];
224
+    var name = new ContactName();
225
+    var j = 0, field; while(field = nameFields[j++]) { // jshint ignore:line
226
+        if (moz[field[0]]) {
227
+            name[field[1] || field[0]] = moz[field[0]].join(' ');
228
+        }
229
+    }
230
+    this.name = name;
231
+    j = 0; while(field = baseArrayFields[j++]) { // jshint ignore:line
232
+        if (moz[field[0]]) {
233
+            this[field[1] || field[0]] = moz[field[0]].join(' ');
234
+        }
235
+    }
236
+    j = 0; while(field = baseStringFields[j++]) { // jshint ignore:line
237
+        if (moz[field[0]]) {
238
+            this[field[1] || field[0]] = moz[field[0]];
239
+        }
240
+    }
241
+    // emails
242
+    if (moz.email) {
243
+        this.emails = exportContactField(moz.email);
244
+    }
245
+    // categories
246
+    if (moz.category) {
247
+        this.categories = makeContactFieldFromArray(moz.category);
248
+    }
249
+
250
+    // addresses
251
+    if (moz.adr) {
252
+        this.addresses = exportAddresses(moz.adr);
253
+    }
254
+
255
+    // phoneNumbers
256
+    if (moz.tel) {
257
+        this.phoneNumbers = exportContactField(moz.tel);
258
+    }
259
+    // birthday
260
+    if (moz.bday) {
261
+      this.birthday = Date.parse(moz.bday);
262
+    }
263
+    // organizations
264
+    if (moz.org || moz.jobTitle) {
265
+        // XXX: organizations array is created from org and jobTitle
266
+        this.organizations = createOrganizations(moz.org, moz.jobTitle);
267
+    }
268
+    // construct a read-only formatted value
269
+    this.name.formatted = createFormatted(this.name);
270
+
271
+    /*  Find out how to translate these parameters
272
+        // photo: Blob
273
+        // url: Array with metadata (?)
274
+        // impp: exportIM(contact.ims), TODO: find the moz impp definition
275
+        // anniversary
276
+        // sex
277
+        // genderIdentity
278
+        // key
279
+    */
280
+};
281
+
282
+
283
+function createMozillaFromCordova(successCB, errorCB, contact) {
284
+    var moz;
285
+    // get contact if exists
286
+    if (_hasId(contact.id)) {
287
+      var search = navigator.mozContacts.find({
288
+        filterBy: ['id'], filterValue: contact.id, filterOp: 'equals'});
289
+      search.onsuccess = function() {
290
+        moz = search.result[0];
291
+        updateFromCordova(moz, contact);
292
+        successCB(moz);
293
+      };
294
+      search.onerror = errorCB;
295
+      return;
296
+    }
297
+
298
+    // create empty contact
299
+    moz = new mozContact();
300
+    // if ('init' in moz) {
301
+      // 1.2 and below compatibility
302
+      // moz.init();
303
+    // }
304
+    updateFromCordova(moz, contact);
305
+    successCB(moz);
306
+}
307
+
308
+
309
+function createCordovaFromMozilla(moz) {
310
+    var contact = new Contact();
311
+    contact.updateFromMozilla(moz);
312
+    return contact;
313
+}
314
+
315
+
316
+// However API requires the ability to save multiple contacts, it is 
317
+// used to save only one element array
318
+function saveContacts(successCB, errorCB, contacts) {
319
+    // a closure which is holding the right moz contact
320
+    function makeSaveSuccessCB(moz) {
321
+        return function(result) {
322
+            // create contact from FXOS contact (might be different than
323
+            // the original one due to differences in API)
324
+            var contact = createCordovaFromMozilla(moz);
325
+            // call callback
326
+            successCB(contact);
327
+        };
328
+    }
329
+    var i=0;
330
+    var contact;
331
+    /*jshint -W083 */
332
+    while(contact = contacts[i++]) { // jshint ignore:line
333
+        createMozillaFromCordova(function(moz) {
334
+            var request = navigator.mozContacts.save(moz);
335
+            // success and/or fail will be called every time a contact is saved
336
+            request.onsuccess = makeSaveSuccessCB(moz);
337
+            request.onerror = errorCB;
338
+        }, function() {}, contact);
339
+    }
340
+    /*jshint +W083 */
341
+}
342
+
343
+
344
+// API provides a list of ids to be removed
345
+function remove(successCB, errorCB, ids) {
346
+    var i;
347
+    /*jshint -W083 */
348
+    for (i = 0; i < ids.length; i++){
349
+        // throw an error if no id provided
350
+        if (!_hasId(ids[i])) {
351
+            console.error('FFOS: Attempt to remove unsaved contact');
352
+            errorCB(0);
353
+            return;
354
+        }
355
+        // check if provided id actually exists 
356
+        var search = navigator.mozContacts.find({
357
+            filterBy: ['id'], filterValue: ids[i], filterOp: 'equals'});
358
+        search.onsuccess = function() {
359
+            if (search.result.length === 0) {
360
+                console.error('FFOS: Attempt to remove a non existing contact');
361
+                errorCB(0);
362
+                return;
363
+            }
364
+            var moz = search.result[0];
365
+            var request = navigator.mozContacts.remove(moz);
366
+            request.onsuccess = successCB;
367
+            request.onerror = errorCB;
368
+        };
369
+        search.onerror = errorCB;
370
+    }
371
+    /*jshint +W083 */
372
+}
373
+
374
+
375
+var mozContactSearchFields = [['name', 'displayName'], ['givenName'], 
376
+    ['familyName'], ['email'], ['tel'], ['jobTitle'], ['note'], 
377
+    ['tel', 'phoneNumbers'], ['email', 'emails']]; 
378
+// Searching by nickname and additionalName is forbidden in  1.3 and below
379
+// Searching by name is forbidden in 1.2 and below
380
+
381
+// finds if a key is allowed and returns FFOS name if different
382
+function getMozSearchField(key) {
383
+    if (mozContactSearchFields.indexOf([key]) >= 0) {
384
+        return key;
385
+    }
386
+    for (var i=0; i < mozContactSearchFields.length; i++) {
387
+        if (mozContactSearchFields[i].length > 1) {
388
+            if (mozContactSearchFields[i][1] === key) {
389
+                return mozContactSearchFields[i][0];
390
+            }
391
+        }
392
+    }
393
+    return false;
394
+}
395
+
396
+
397
+function _getAll(successCB, errorCB, params) {
398
+    // [contactField, eventualMozContactField]
399
+    var getall = navigator.mozContacts.getAll({});
400
+    var contacts = [];
401
+
402
+    getall.onsuccess = function() {
403
+        if (getall.result) {
404
+            contacts.push(createCordovaFromMozilla(getall.result));
405
+            getall.continue();
406
+        } else {
407
+            successCB(contacts);
408
+        }
409
+    };
410
+    getall.onerror = errorCB;
411
+}
412
+
413
+
414
+function search(successCB, errorCB, params) {
415
+    var options = params[1] || {}; 
416
+    if (!options.filter) {
417
+        return _getAll(successCB, errorCB, params);
418
+    }
419
+    var filterBy = [];
420
+    // filter and translate fields
421
+    for (var i=0; i < params[0].length; i++) {
422
+        var searchField = params[0][i];
423
+        var mozField = getMozSearchField(searchField);
424
+        if (searchField === 'name') {
425
+            // Cordova uses name for search by all name fields.
426
+            filterBy.push('givenName');
427
+            filterBy.push('familyName');
428
+            continue;
429
+        } 
430
+        if (searchField === 'displayName' && 'init' in new mozContact()) {
431
+            // ``init`` in ``mozContact`` indicates FFOS version 1.2 or below
432
+            // Searching by name (in moz) is then forbidden
433
+            console.log('FFOS ContactProxy: Unable to search by displayName on FFOS 1.2');
434
+            continue;
435
+        } 
436
+        if (mozField) {
437
+            filterBy.push(mozField);
438
+        } else {
439
+            console.log('FXOS ContactProxy: inallowed field passed to search filtered out: ' + searchField);
440
+        }
441
+    }
442
+
443
+    var mozOptions = {filterBy: filterBy, filterOp: 'startsWith'};
444
+    if (!options.multiple) {
445
+        mozOptions.filterLimit = 1;
446
+    }
447
+    mozOptions.filterValue = options.filter;
448
+    var request = navigator.mozContacts.find(mozOptions);
449
+    request.onsuccess = function() {
450
+        var contacts = [];
451
+        var mozContacts = request.result;
452
+        for (var i=0; i < mozContacts.length; i++) {
453
+            contacts.push(createCordovaFromMozilla(mozContacts[i]));
454
+        }
455
+        successCB(contacts);
456
+    };
457
+    request.onerror = errorCB;
458
+}
459
+
460
+
461
+module.exports = {
462
+    save: saveContacts,
463
+    remove: remove,
464
+    search: search
465
+};    
466
+    
467
+require("cordova/exec/proxy").add("Contacts", module.exports);

+ 148
- 0
km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContact.h Parādīt failu

@@ -0,0 +1,148 @@
1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <Foundation/Foundation.h>
21
+#import <AddressBook/ABAddressBook.h>
22
+#import <AddressBookUI/AddressBookUI.h>
23
+
24
+enum CDVContactError {
25
+    UNKNOWN_ERROR = 0,
26
+    INVALID_ARGUMENT_ERROR = 1,
27
+    TIMEOUT_ERROR = 2,
28
+    PENDING_OPERATION_ERROR = 3,
29
+    IO_ERROR = 4,
30
+    NOT_SUPPORTED_ERROR = 5,
31
+    OPERATION_CANCELLED_ERROR = 6,
32
+    PERMISSION_DENIED_ERROR = 20
33
+};
34
+typedef NSUInteger CDVContactError;
35
+
36
+@interface CDVContact : NSObject {
37
+    ABRecordRef record;         // the ABRecord associated with this contact
38
+    NSDictionary* returnFields; // dictionary of fields to return when performing search
39
+}
40
+
41
+@property (nonatomic, assign) ABRecordRef record;
42
+@property (nonatomic, strong) NSDictionary* returnFields;
43
+
44
++ (NSDictionary*)defaultABtoW3C;
45
++ (NSDictionary*)defaultW3CtoAB;
46
++ (NSSet*)defaultW3CtoNull;
47
++ (NSDictionary*)defaultObjectAndProperties;
48
++ (NSDictionary*)defaultFields;
49
+
50
++ (NSDictionary*)calcReturnFields:(NSArray*)fields;
51
+- (id)init;
52
+- (id)initFromABRecord:(ABRecordRef)aRecord;
53
+- (bool)setFromContactDict:(NSDictionary*)aContact asUpdate:(BOOL)bUpdate;
54
+
55
++ (BOOL)needsConversion:(NSString*)W3Label;
56
++ (NSDictionary *) getContactLabels;
57
++ (NSArray *) filterLabels: (NSString *) contactApiLabel;
58
++ (CFStringRef)convertContactTypeToPropertyLabel:(NSString*)label;
59
++ (NSString*)convertPropertyLabelToContactType:(NSString*)label;
60
++ (BOOL)isValidW3ContactType:(NSString*)label;
61
+- (bool)setValue:(id)aValue forProperty:(ABPropertyID)aProperty inRecord:(ABRecordRef)aRecord asUpdate:(BOOL)bUpdate;
62
+
63
+- (NSDictionary*)toDictionary:(NSDictionary*)withFields;
64
+- (NSNumber*)getDateAsNumber:(ABPropertyID)datePropId;
65
+- (NSObject*)extractName;
66
+- (NSObject*)extractMultiValue:(NSString*)propertyId;
67
+- (NSObject*)extractAddresses;
68
+- (NSObject*)extractIms;
69
+- (NSObject*)extractOrganizations;
70
+- (NSObject*)extractPhotos;
71
+
72
+- (NSMutableDictionary*)translateW3Dict:(NSDictionary*)dict forProperty:(ABPropertyID)prop;
73
+- (bool)setMultiValueStrings:(NSArray*)fieldArray forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person asUpdate:(BOOL)bUpdate;
74
+- (bool)setMultiValueDictionary:(NSArray*)array forProperty:(ABPropertyID)prop inRecord:(ABRecordRef)person asUpdate:(BOOL)bUpdate;
75
+- (ABMultiValueRef)allocStringMultiValueFromArray:array;
76
+- (ABMultiValueRef)allocDictMultiValueFromArray:array forProperty:(ABPropertyID)prop;
77
+- (BOOL)foundValue:(NSString*)testValue inFields:(NSDictionary*)searchFields;
78
+- (BOOL)testStringValue:(NSString*)testValue forW3CProperty:(NSString*)property;
79
+- (BOOL)testDateValue:(NSString*)testValue forW3CProperty:(NSString*)property;
80
+- (BOOL)searchContactFields:(NSArray*)fields forMVStringProperty:(ABPropertyID)propId withValue:testValue;
81
+- (BOOL)testMultiValueStrings:(NSString*)testValue forProperty:(ABPropertyID)propId ofType:(NSString*)type;
82
+- (NSArray*)valuesForProperty:(ABPropertyID)propId inRecord:(ABRecordRef)aRecord;
83
+- (NSArray*)labelsForProperty:(ABPropertyID)propId inRecord:(ABRecordRef)aRecord;
84
+- (BOOL)searchContactFields:(NSArray*)fields forMVDictionaryProperty:(ABPropertyID)propId withValue:(NSString*)testValue;
85
+
86
+@end
87
+
88
+// generic ContactField types
89
+#define kW3ContactFieldType @"type"
90
+#define kW3ContactFieldValue @"value"
91
+#define kW3ContactFieldPrimary @"pref"
92
+// Various labels for ContactField types
93
+#define kW3ContactWorkLabel @"work"
94
+#define kW3ContactHomeLabel @"home"
95
+#define kW3ContactOtherLabel @"other"
96
+#define kW3ContactPhoneWorkFaxLabel @"work fax"
97
+#define kW3ContactPhoneHomeFaxLabel @"home fax"
98
+#define kW3ContactPhoneMobileLabel @"mobile"
99
+#define kW3ContactPhonePagerLabel @"pager"
100
+#define kW3ContactPhoneIPhoneLabel @"iphone"
101
+#define kW3ContactPhoneMainLabel @"main"
102
+#define kW3ContactUrlBlog @"blog"
103
+#define kW3ContactUrlProfile @"profile"
104
+#define kW3ContactImAIMLabel @"aim"
105
+#define kW3ContactImICQLabel @"icq"
106
+#define kW3ContactImMSNLabel @"msn"
107
+#define kW3ContactImYahooLabel @"yahoo"
108
+#define kW3ContactImSkypeLabel @"skype"
109
+#define kW3ContactImFacebookMessengerLabel @"facebook"
110
+#define kW3ContactImGoogleTalkLabel @"gtalk"
111
+#define kW3ContactImJabberLabel @"jabber"
112
+#define kW3ContactImQQLabel @"qq"
113
+#define kW3ContactImGaduLabel @"gadu"  
114
+#define kW3ContactFieldId @"id"
115
+// special translation for IM field value and type
116
+#define kW3ContactImType @"type"
117
+#define kW3ContactImValue @"value"
118
+
119
+// Contact object
120
+#define kW3ContactId @"id"
121
+#define kW3ContactName @"name"
122
+#define kW3ContactFormattedName @"formatted"
123
+#define kW3ContactGivenName @"givenName"
124
+#define kW3ContactFamilyName @"familyName"
125
+#define kW3ContactMiddleName @"middleName"
126
+#define kW3ContactHonorificPrefix @"honorificPrefix"
127
+#define kW3ContactHonorificSuffix @"honorificSuffix"
128
+#define kW3ContactDisplayName @"displayName"
129
+#define kW3ContactNickname @"nickname"
130
+#define kW3ContactPhoneNumbers @"phoneNumbers"
131
+#define kW3ContactAddresses @"addresses"
132
+#define kW3ContactAddressFormatted @"formatted"
133
+#define kW3ContactStreetAddress @"streetAddress"
134
+#define kW3ContactLocality @"locality"
135
+#define kW3ContactRegion @"region"
136
+#define kW3ContactPostalCode @"postalCode"
137
+#define kW3ContactCountry @"country"
138
+#define kW3ContactEmails @"emails"
139
+#define kW3ContactIms @"ims"
140
+#define kW3ContactOrganizations @"organizations"
141
+#define kW3ContactOrganizationName @"name"
142
+#define kW3ContactTitle @"title"
143
+#define kW3ContactDepartment @"department"
144
+#define kW3ContactBirthday @"birthday"
145
+#define kW3ContactNote @"note"
146
+#define kW3ContactPhotos @"photos"
147
+#define kW3ContactCategories @"categories"
148
+#define kW3ContactUrls @"urls"

+ 1764
- 0
km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContact.m
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 160
- 0
km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContacts.h Parādīt failu

@@ -0,0 +1,160 @@
1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import <Foundation/Foundation.h>
21
+#import <AddressBook/ABAddressBook.h>
22
+#import <AddressBookUI/AddressBookUI.h>
23
+#import <Cordova/CDVPlugin.h>
24
+#import "CDVContact.h"
25
+
26
+@interface CDVContacts : CDVPlugin <ABNewPersonViewControllerDelegate,
27
+                         ABPersonViewControllerDelegate,
28
+                         ABPeoplePickerNavigationControllerDelegate
29
+                         >
30
+{
31
+    ABAddressBookRef addressBook;
32
+}
33
+
34
+/*
35
+ * newContact - create a new contact via the GUI
36
+ *
37
+ * arguments:
38
+ *	1: successCallback: this is the javascript function that will be called with the newly created contactId
39
+ */
40
+- (void)newContact:(CDVInvokedUrlCommand*)command;
41
+
42
+/*
43
+ * displayContact  - IN PROGRESS
44
+ *
45
+ * arguments:
46
+ *	1: recordID of the contact to display in the iPhone contact display
47
+ *	2: successCallback - currently not used
48
+ *  3: error callback
49
+ * options:
50
+ *	allowsEditing: set to true to allow the user to edit the contact - currently not supported
51
+ */
52
+- (void)displayContact:(CDVInvokedUrlCommand*)command;
53
+
54
+/*
55
+ * chooseContact
56
+ *
57
+ * arguments:
58
+ *	1: this is the javascript function that will be called with the contact data as a JSON object (as the first param)
59
+ * options:
60
+ *	allowsEditing: set to true to not choose the contact, but to edit it in the iPhone contact editor
61
+ */
62
+- (void)chooseContact:(CDVInvokedUrlCommand*)command;
63
+
64
+- (void)newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person;
65
+- (BOOL)personViewController:(ABPersonViewController*)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
66
+                    property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue;
67
+/*
68
+ * Launches the Contact Picker to select a single contact.
69
+ *
70
+ * arguments:
71
+ *	1: this is the javascript function that will be called with the contact data as a JSON object (as the first param)
72
+ * options:
73
+ *	desiredFields: ContactFields array to be returned back
74
+ */
75
+- (void)pickContact:(CDVInvokedUrlCommand*)command;
76
+
77
+/*
78
+ * search - searches for contacts.  Only person records are currently supported.
79
+ *
80
+ * arguments:
81
+ *  1: successcallback - this is the javascript function that will be called with the array of found contacts
82
+ *  2:  errorCallback - optional javascript function to be called in the event of an error with an error code.
83
+ * options:  dictionary containing ContactFields and ContactFindOptions
84
+ *	fields - ContactFields array
85
+ *  findOptions - ContactFindOptions object as dictionary
86
+ *
87
+ */
88
+- (void)search:(CDVInvokedUrlCommand*)command;
89
+
90
+/*
91
+ * save - saves a new contact or updates and existing contact
92
+ *
93
+ * arguments:
94
+ *  1: success callback - this is the javascript function that will be called with the JSON representation of the saved contact
95
+ *		search calls a fixed navigator.service.contacts._findCallback which then calls the success callback stored before making the call into obj-c
96
+ */
97
+- (void)save:(CDVInvokedUrlCommand*)command;
98
+
99
+/*
100
+ * remove - removes a contact from the address book
101
+ *
102
+ * arguments:
103
+ *  1:  1: successcallback - this is the javascript function that will be called with a (now) empty contact object
104
+ *
105
+ * options:  dictionary containing Contact object to remove
106
+ *	contact - Contact object as dictionary
107
+ */
108
+- (void)remove:(CDVInvokedUrlCommand*)command;
109
+
110
+// - (void) dealloc;
111
+
112
+@end
113
+
114
+@interface CDVContactsPicker : ABPeoplePickerNavigationController
115
+{
116
+    BOOL allowsEditing;
117
+    NSString* callbackId;
118
+    NSDictionary* options;
119
+    NSDictionary* pickedContactDictionary;
120
+}
121
+
122
+@property BOOL allowsEditing;
123
+@property (copy) NSString* callbackId;
124
+@property (nonatomic, strong) NSDictionary* options;
125
+@property (nonatomic, strong) NSDictionary* pickedContactDictionary;
126
+
127
+@end
128
+
129
+@interface CDVNewContactsController : ABNewPersonViewController
130
+{
131
+    NSString* callbackId;
132
+}
133
+@property (copy) NSString* callbackId;
134
+@end
135
+
136
+/* 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.
137
+    The solution was to create an empty NavController in front of the ABPersonViewController. This
138
+    causes the ABPersonViewController to have a back button. By subclassing the ABPersonViewController,
139
+    we can override viewWillDisappear and take down the entire NavigationController at that time.
140
+ */
141
+@interface CDVDisplayContactViewController : ABPersonViewController
142
+{}
143
+@property (nonatomic, strong) CDVPlugin* contactsPlugin;
144
+
145
+@end
146
+@interface CDVAddressBookAccessError : NSObject
147
+{}
148
+@property (assign) CDVContactError errorCode;
149
+- (CDVAddressBookAccessError*)initWithCode:(CDVContactError)code;
150
+@end
151
+
152
+typedef void (^ CDVAddressBookWorkerBlock)(
153
+    ABAddressBookRef         addressBook,
154
+    CDVAddressBookAccessError* error
155
+    );
156
+@interface CDVAddressBookHelper : NSObject
157
+{}
158
+
159
+- (void)createAddressBook:(CDVAddressBookWorkerBlock)workerBlock;
160
+@end

+ 613
- 0
km0App/node_modules/cordova-plugin-contacts/src/ios/CDVContacts.m Parādīt failu

@@ -0,0 +1,613 @@
1
+/*
2
+ Licensed to the Apache Software Foundation (ASF) under one
3
+ or more contributor license agreements.  See the NOTICE file
4
+ distributed with this work for additional information
5
+ regarding copyright ownership.  The ASF licenses this file
6
+ to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance
8
+ with the License.  You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing,
13
+ software distributed under the License is distributed on an
14
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, either express or implied.  See the License for the
16
+ specific language governing permissions and limitations
17
+ under the License.
18
+ */
19
+
20
+#import "CDVContacts.h"
21
+#import <UIKit/UIKit.h>
22
+
23
+@implementation CDVContactsPicker
24
+
25
+@synthesize allowsEditing;
26
+@synthesize callbackId;
27
+@synthesize options;
28
+@synthesize pickedContactDictionary;
29
+
30
+@end
31
+@implementation CDVNewContactsController
32
+
33
+@synthesize callbackId;
34
+
35
+@end
36
+
37
+@implementation CDVContacts
38
+
39
+// overridden to clean up Contact statics
40
+- (void)onAppTerminate
41
+{
42
+    // NSLog(@"Contacts::onAppTerminate");
43
+}
44
+
45
+// iPhone only method to create a new contact through the GUI
46
+- (void)newContact:(CDVInvokedUrlCommand*)command
47
+{
48
+    NSString* callbackId = command.callbackId;
49
+
50
+    CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
51
+    CDVContacts* __weak weakSelf = self;  // play it safe to avoid retain cycles
52
+
53
+    [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errCode) {
54
+        if (addrBook == NULL) {
55
+            // permission was denied or other error just return (no error callback)
56
+            return;
57
+        }
58
+        CDVNewContactsController* npController = [[CDVNewContactsController alloc] init];
59
+        npController.addressBook = addrBook;     // a CF retaining assign
60
+        CFRelease(addrBook);
61
+
62
+        npController.newPersonViewDelegate = self;
63
+        npController.callbackId = callbackId;
64
+
65
+        UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:npController];
66
+
67
+        [weakSelf.viewController presentViewController:navController animated:YES completion:nil];
68
+    }];
69
+}
70
+
71
+- (void)newPersonViewController:(ABNewPersonViewController*)newPersonViewController didCompleteWithNewPerson:(ABRecordRef)person
72
+{
73
+    ABRecordID recordId = kABRecordInvalidID;
74
+    CDVNewContactsController* newCP = (CDVNewContactsController*)newPersonViewController;
75
+    NSString* callbackId = newCP.callbackId;
76
+
77
+    if (person != NULL) {
78
+        // return the contact id
79
+        recordId = ABRecordGetRecordID(person);
80
+    }
81
+
82
+    [[newPersonViewController presentingViewController] dismissViewControllerAnimated:YES completion:^{
83
+     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:recordId];
84
+     [self.commandDelegate sendPluginResult:result callbackId:callbackId];
85
+    }];
86
+}
87
+
88
+- (bool)existsValue:(NSDictionary*)dict val:(NSString*)expectedValue forKey:(NSString*)key
89
+{
90
+    id val = [dict valueForKey:key];
91
+    bool exists = false;
92
+    
93
+    if (val != nil) {
94
+        exists = [(NSString*)val compare : expectedValue options : NSCaseInsensitiveSearch] == 0;
95
+    }
96
+    
97
+    return exists;
98
+}
99
+
100
+- (void)displayContact:(CDVInvokedUrlCommand*)command
101
+{
102
+    NSString* callbackId = command.callbackId;
103
+    ABRecordID recordID = [[command argumentAtIndex:0] intValue];
104
+    NSDictionary* options = [command argumentAtIndex:1 withDefault:[NSNull null]];
105
+    bool bEdit = [options isKindOfClass:[NSNull class]] ? false : [self existsValue:options val:@"true" forKey:@"allowsEditing"];
106
+
107
+    CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
108
+    CDVContacts* __weak weakSelf = self;  // play it safe to avoid retain cycles
109
+
110
+    [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errCode) {
111
+        if (addrBook == NULL) {
112
+            // permission was denied or other error - return error
113
+            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:errCode ? (int)errCode.errorCode:UNKNOWN_ERROR];
114
+            [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
115
+            return;
116
+        }
117
+        ABRecordRef rec = ABAddressBookGetPersonWithRecordID(addrBook, recordID);
118
+
119
+        if (rec) {
120
+            CDVDisplayContactViewController* personController = [[CDVDisplayContactViewController alloc] init];
121
+            personController.displayedPerson = rec;
122
+            personController.personViewDelegate = self;
123
+            personController.allowsEditing = NO;
124
+
125
+            // create this so DisplayContactViewController will have a "back" button.
126
+            UIViewController* parentController = [[UIViewController alloc] init];
127
+            UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:parentController];
128
+
129
+            [navController pushViewController:personController animated:YES];
130
+
131
+            [self.viewController presentViewController:navController animated:YES completion:nil];
132
+
133
+            if (bEdit) {
134
+                // create the editing controller and push it onto the stack
135
+                ABPersonViewController* editPersonController = [[ABPersonViewController alloc] init];
136
+                editPersonController.displayedPerson = rec;
137
+                editPersonController.personViewDelegate = self;
138
+                editPersonController.allowsEditing = YES;
139
+                [navController pushViewController:editPersonController animated:YES];
140
+            }
141
+        } else {
142
+            // no record, return error
143
+            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:UNKNOWN_ERROR];
144
+            [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
145
+        }
146
+        CFRelease(addrBook);
147
+    }];
148
+}
149
+
150
+- (BOOL)personViewController:(ABPersonViewController*)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person
151
+                    property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue
152
+{
153
+    return YES;
154
+}
155
+
156
+- (void)chooseContact:(CDVInvokedUrlCommand*)command
157
+{
158
+    NSString* callbackId = command.callbackId;
159
+    NSDictionary* options = [command argumentAtIndex:0 withDefault:[NSNull null]];
160
+
161
+    CDVContactsPicker* pickerController = [[CDVContactsPicker alloc] init];
162
+
163
+    pickerController.peoplePickerDelegate = self;
164
+    pickerController.callbackId = callbackId;
165
+    pickerController.options = options;
166
+    pickerController.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kABRecordInvalidID], kW3ContactId, nil];
167
+    id allowsEditingValue = [options valueForKey:@"allowsEditing"];
168
+    BOOL allowsEditing = NO;
169
+    if ([allowsEditingValue isKindOfClass:[NSNumber class]]) {
170
+        allowsEditing = [(NSNumber*)allowsEditingValue boolValue];
171
+    }
172
+    pickerController.allowsEditing = allowsEditing;
173
+
174
+    [self.viewController presentViewController:pickerController animated:YES completion:nil];
175
+}
176
+
177
+- (void)pickContact:(CDVInvokedUrlCommand *)command
178
+{
179
+    // mimic chooseContact method call with required for us parameters
180
+    NSArray* desiredFields = [command argumentAtIndex:0 withDefault:[NSArray array]];
181
+    if (desiredFields == nil || desiredFields.count == 0) {
182
+        desiredFields = [NSArray arrayWithObjects:@"*", nil];
183
+    }
184
+    NSMutableDictionary* options = [NSMutableDictionary dictionaryWithCapacity:2];
185
+    
186
+    [options setObject: desiredFields forKey:@"fields"];
187
+    [options setObject: [NSNumber numberWithBool: FALSE] forKey:@"allowsEditing"];
188
+    
189
+    NSArray* args = [NSArray arrayWithObjects:options, nil];
190
+    
191
+    CDVInvokedUrlCommand* newCommand = [[CDVInvokedUrlCommand alloc] initWithArguments:args
192
+                 callbackId:command.callbackId
193
+                  className:command.className
194
+                 methodName:command.methodName];
195
+
196
+    // First check for Address book permissions
197
+    ABAuthorizationStatus status = ABAddressBookGetAuthorizationStatus();
198
+    if (status == kABAuthorizationStatusAuthorized) {
199
+        [self chooseContact:newCommand];
200
+        return;
201
+    }
202
+
203
+    CDVPluginResult *errorResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsInt:PERMISSION_DENIED_ERROR];
204
+
205
+    // if the access is already restricted/denied the only way is to fail
206
+    if (status == kABAuthorizationStatusRestricted || status == kABAuthorizationStatusDenied) {
207
+        [self.commandDelegate sendPluginResult: errorResult callbackId:command.callbackId];
208
+        return;
209
+    }
210
+
211
+    // if no permissions granted try to request them first
212
+    if (status == kABAuthorizationStatusNotDetermined) {
213
+        ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
214
+            if (granted) {
215
+                [self chooseContact:newCommand];
216
+                return;
217
+            }
218
+
219
+            [self.commandDelegate sendPluginResult: errorResult callbackId:command.callbackId];
220
+        });
221
+    }
222
+}
223
+
224
+- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker
225
+      shouldContinueAfterSelectingPerson:(ABRecordRef)person
226
+{
227
+    [self peoplePickerNavigationController:peoplePicker didSelectPerson:person];
228
+    return NO;
229
+}
230
+
231
+- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker
232
+      shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
233
+{
234
+    return YES;
235
+}
236
+
237
+- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController*)peoplePicker
238
+{
239
+    // return contactId or invalid if none picked
240
+    CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
241
+
242
+    if (picker.allowsEditing) {
243
+        // get the info after possible edit
244
+        // if we got this far, user has already approved/ disapproved addressBook access
245
+        ABAddressBookRef addrBook = ABAddressBookCreateWithOptions(NULL, NULL);
246
+        ABRecordRef person = ABAddressBookGetPersonWithRecordID(addrBook, (int)[[picker.pickedContactDictionary objectForKey:kW3ContactId] integerValue]);
247
+        if (person) {
248
+            CDVContact* pickedContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)person];
249
+            NSArray* fields = [picker.options objectForKey:@"fields"];
250
+            NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
251
+            picker.pickedContactDictionary = [pickedContact toDictionary:returnFields];
252
+        }
253
+        CFRelease(addrBook);
254
+    }
255
+    
256
+    NSNumber* recordId = picker.pickedContactDictionary[kW3ContactId];
257
+    
258
+    [[peoplePicker presentingViewController] dismissViewControllerAnimated:YES completion:^{
259
+        CDVPluginResult* result = nil;
260
+        if ([recordId isEqualToNumber:[NSNumber numberWithInt:kABRecordInvalidID]]) {
261
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:OPERATION_CANCELLED_ERROR] ;
262
+        } else {
263
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
264
+        }
265
+        [self.commandDelegate sendPluginResult:result callbackId:picker.callbackId];
266
+    }];
267
+}
268
+
269
+// Called after a person has been selected by the user.
270
+- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker didSelectPerson:(ABRecordRef)person
271
+{
272
+    CDVContactsPicker* picker = (CDVContactsPicker*)peoplePicker;
273
+    NSNumber* pickedId = [NSNumber numberWithInt:ABRecordGetRecordID(person)];
274
+    
275
+    if (picker.allowsEditing) {
276
+        ABPersonViewController* personController = [[ABPersonViewController alloc] init];
277
+        personController.displayedPerson = person;
278
+        personController.personViewDelegate = self;
279
+        personController.allowsEditing = picker.allowsEditing;
280
+        // store id so can get info in peoplePickerNavigationControllerDidCancel
281
+        picker.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:pickedId, kW3ContactId, nil];
282
+        
283
+        [peoplePicker pushViewController:personController animated:YES];
284
+    } else {
285
+        // Retrieve and return pickedContact information
286
+        CDVContact* pickedContact = [[CDVContact alloc] initFromABRecord:(ABRecordRef)person];
287
+        NSArray* fields = [picker.options objectForKey:@"fields"];
288
+        NSDictionary* returnFields = [[CDVContact class] calcReturnFields:fields];
289
+        picker.pickedContactDictionary = [pickedContact toDictionary:returnFields];
290
+        
291
+        [[picker presentingViewController] dismissViewControllerAnimated:YES completion:^{
292
+            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:picker.pickedContactDictionary];
293
+            [self.commandDelegate sendPluginResult:result callbackId:picker.callbackId];
294
+        }];
295
+    }
296
+}
297
+
298
+// Called after a property has been selected by the user.
299
+- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
300
+{
301
+    // not implemented
302
+}
303
+
304
+- (void)search:(CDVInvokedUrlCommand*)command
305
+{
306
+    NSString* callbackId = command.callbackId;
307
+    NSArray* fields = [command argumentAtIndex:0];
308
+    NSDictionary* findOptions = [command argumentAtIndex:1 withDefault:[NSNull null]];
309
+
310
+    [self.commandDelegate runInBackground:^{
311
+        // from Apple:  Important You must ensure that an instance of ABAddressBookRef is used by only one thread.
312
+        // which is why address book is created within the dispatch queue.
313
+        // more details here: http: //blog.byadrian.net/2012/05/05/ios-addressbook-framework-and-gcd/
314
+        CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
315
+        CDVContacts* __weak weakSelf = self;     // play it safe to avoid retain cycles
316
+        // it gets uglier, block within block.....
317
+        [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errCode) {
318
+            if (addrBook == NULL) {
319
+                // permission was denied or other error - return error
320
+                CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:errCode ? (int)errCode.errorCode:UNKNOWN_ERROR];
321
+                [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
322
+                return;
323
+            }
324
+
325
+            NSArray* foundRecords = nil;
326
+            // get the findOptions values
327
+            BOOL multiple = NO;         // default is false
328
+            NSString* filter = nil;
329
+            NSArray* desiredFields = nil;
330
+            if (![findOptions isKindOfClass:[NSNull class]]) {
331
+                id value = nil;
332
+                id filterValue = [findOptions objectForKey:@"filter"];
333
+                BOOL filterValueIsNumber = [filterValue isKindOfClass:[NSNumber class]];
334
+                filter = filterValueIsNumber ? [filterValue stringValue] : (NSString *) filterValue;
335
+                value = [findOptions objectForKey:@"multiple"];
336
+                if ([value isKindOfClass:[NSNumber class]]) {
337
+                    // multiple is a boolean that will come through as an NSNumber
338
+                    multiple = [(NSNumber*)value boolValue];
339
+                    // NSLog(@"multiple is: %d", multiple);
340
+                }
341
+                desiredFields = [findOptions objectForKey:@"desiredFields"];
342
+                // return all fields if desired fields are not explicitly defined
343
+                if (desiredFields == nil || desiredFields.count == 0) {
344
+                    desiredFields = [NSArray arrayWithObjects:@"*", nil];
345
+                }
346
+            }
347
+
348
+            NSDictionary* searchFields = [[CDVContact class] calcReturnFields:fields];
349
+            NSDictionary* returnFields = [[CDVContact class] calcReturnFields:desiredFields];
350
+
351
+            NSMutableArray* matches = nil;
352
+            if (!filter || [filter isEqualToString:@""]) {
353
+                // get all records
354
+                foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addrBook);
355
+                if (foundRecords && ([foundRecords count] > 0)) {
356
+                    // create Contacts and put into matches array
357
+                    // doesn't make sense to ask for all records when multiple == NO but better check
358
+                    int xferCount = multiple == YES ? (int)[foundRecords count] : 1;
359
+                    matches = [NSMutableArray arrayWithCapacity:xferCount];
360
+
361
+                    for (int k = 0; k < xferCount; k++) {
362
+                        CDVContact* xferContact = [[CDVContact alloc] initFromABRecord:(__bridge ABRecordRef)[foundRecords objectAtIndex:k]];
363
+                        [matches addObject:xferContact];
364
+                        xferContact = nil;
365
+                    }
366
+                }
367
+            } else {
368
+                foundRecords = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addrBook);
369
+                matches = [NSMutableArray arrayWithCapacity:1];
370
+                BOOL bFound = NO;
371
+                int testCount = (int)[foundRecords count];
372
+
373
+                for (int j = 0; j < testCount; j++) {
374
+                    CDVContact* testContact = [[CDVContact alloc] initFromABRecord:(__bridge ABRecordRef)[foundRecords objectAtIndex:j]];
375
+                    if (testContact) {
376
+                        bFound = [testContact foundValue:filter inFields:searchFields];
377
+                        if (bFound) {
378
+                            [matches addObject:testContact];
379
+                        }
380
+                        testContact = nil;
381
+                    }
382
+                }
383
+            }
384
+            NSMutableArray* returnContacts = [NSMutableArray arrayWithCapacity:1];
385
+
386
+            if ((matches != nil) && ([matches count] > 0)) {
387
+                // convert to JS Contacts format and return in callback
388
+                // - returnFields  determines what properties to return
389
+                @autoreleasepool {
390
+                    int count = multiple == YES ? (int)[matches count] : 1;
391
+
392
+                    for (int i = 0; i < count; i++) {
393
+                        CDVContact* newContact = [matches objectAtIndex:i];
394
+                        NSDictionary* aContact = [newContact toDictionary:returnFields];
395
+                        [returnContacts addObject:aContact];
396
+                    }
397
+                }
398
+            }
399
+            // return found contacts (array is empty if no contacts found)
400
+            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:returnContacts];
401
+            [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
402
+            // NSLog(@"findCallback string: %@", jsString);
403
+
404
+            if (addrBook) {
405
+                CFRelease(addrBook);
406
+            }
407
+        }];
408
+    }];     // end of workQueue block
409
+
410
+    return;
411
+}
412
+
413
+- (void)save:(CDVInvokedUrlCommand*)command
414
+{
415
+    NSString* callbackId = command.callbackId;
416
+    NSDictionary* contactDict = [command argumentAtIndex:0];
417
+
418
+    [self.commandDelegate runInBackground:^{
419
+        CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
420
+        CDVContacts* __weak weakSelf = self;     // play it safe to avoid retain cycles
421
+
422
+        [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errorCode) {
423
+            CDVPluginResult* result = nil;
424
+            if (addrBook == NULL) {
425
+                // permission was denied or other error - return error
426
+                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode ? (int)errorCode.errorCode:UNKNOWN_ERROR];
427
+                [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
428
+                return;
429
+            }
430
+
431
+            bool bIsError = FALSE, bSuccess = FALSE;
432
+            BOOL bUpdate = NO;
433
+            CDVContactError errCode = UNKNOWN_ERROR;
434
+            CFErrorRef error;
435
+            NSNumber* cId = [contactDict valueForKey:kW3ContactId];
436
+            CDVContact* aContact = nil;
437
+            ABRecordRef rec = nil;
438
+            if (cId && ![cId isKindOfClass:[NSNull class]]) {
439
+                rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
440
+                if (rec) {
441
+                    aContact = [[CDVContact alloc] initFromABRecord:rec];
442
+                    bUpdate = YES;
443
+                }
444
+            }
445
+            if (!aContact) {
446
+                aContact = [[CDVContact alloc] init];
447
+            }
448
+
449
+            bSuccess = [aContact setFromContactDict:contactDict asUpdate:bUpdate];
450
+            if (bSuccess) {
451
+                if (!bUpdate) {
452
+                    bSuccess = ABAddressBookAddRecord(addrBook, [aContact record], &error);
453
+                }
454
+                if (bSuccess) {
455
+                    bSuccess = ABAddressBookSave(addrBook, &error);
456
+                }
457
+                if (!bSuccess) {         // need to provide error codes
458
+                    bIsError = TRUE;
459
+                    errCode = IO_ERROR;
460
+                } else {
461
+                    // give original dictionary back?  If generate dictionary from saved contact, have no returnFields specified
462
+                    // so would give back all fields (which W3C spec. indicates is not desired)
463
+                    // for now (while testing) give back saved, full contact
464
+                    NSDictionary* newContact = [aContact toDictionary:[CDVContact defaultFields]];
465
+                    // NSString* contactStr = [newContact JSONRepresentation];
466
+                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newContact];
467
+                }
468
+            } else {
469
+                bIsError = TRUE;
470
+                errCode = IO_ERROR;
471
+            }
472
+            CFRelease(addrBook);
473
+
474
+            if (bIsError) {
475
+                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:(int)errCode];
476
+            }
477
+
478
+            if (result) {
479
+                [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
480
+            }
481
+        }];
482
+    }];     // end of  queue
483
+}
484
+
485
+- (void)remove:(CDVInvokedUrlCommand*)command
486
+{
487
+    NSString* callbackId = command.callbackId;
488
+    NSNumber* cId = [command argumentAtIndex:0];
489
+
490
+    CDVAddressBookHelper* abHelper = [[CDVAddressBookHelper alloc] init];
491
+    CDVContacts* __weak weakSelf = self;  // play it safe to avoid retain cycles
492
+
493
+    [abHelper createAddressBook: ^(ABAddressBookRef addrBook, CDVAddressBookAccessError* errorCode) {
494
+        CDVPluginResult* result = nil;
495
+        if (addrBook == NULL) {
496
+            // permission was denied or other error - return error
497
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode ? (int)errorCode.errorCode:UNKNOWN_ERROR];
498
+            [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
499
+            return;
500
+        }
501
+
502
+        bool bIsError = FALSE, bSuccess = FALSE;
503
+        CDVContactError errCode = UNKNOWN_ERROR;
504
+        CFErrorRef error;
505
+        ABRecordRef rec = nil;
506
+        if (cId && ![cId isKindOfClass:[NSNull class]] && ([cId intValue] != kABRecordInvalidID)) {
507
+            rec = ABAddressBookGetPersonWithRecordID(addrBook, [cId intValue]);
508
+            if (rec) {
509
+                bSuccess = ABAddressBookRemoveRecord(addrBook, rec, &error);
510
+                if (!bSuccess) {
511
+                    bIsError = TRUE;
512
+                    errCode = IO_ERROR;
513
+                } else {
514
+                    bSuccess = ABAddressBookSave(addrBook, &error);
515
+                    if (!bSuccess) {
516
+                        bIsError = TRUE;
517
+                        errCode = IO_ERROR;
518
+                    } else {
519
+                        // set id to null
520
+                        // [contactDict setObject:[NSNull null] forKey:kW3ContactId];
521
+                        // result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: contactDict];
522
+                        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
523
+                        // NSString* contactStr = [contactDict JSONRepresentation];
524
+                    }
525
+                }
526
+            } else {
527
+                // no record found return error
528
+                bIsError = TRUE;
529
+                errCode = UNKNOWN_ERROR;
530
+            }
531
+        } else {
532
+            // invalid contact id provided
533
+            bIsError = TRUE;
534
+            errCode = INVALID_ARGUMENT_ERROR;
535
+        }
536
+
537
+        if (addrBook) {
538
+            CFRelease(addrBook);
539
+        }
540
+        if (bIsError) {
541
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:(int)errCode];
542
+        }
543
+        if (result) {
544
+            [weakSelf.commandDelegate sendPluginResult:result callbackId:callbackId];
545
+        }
546
+    }];
547
+    return;
548
+}
549
+
550
+@end
551
+
552
+/* ABPersonViewController does not have any UI to dismiss.  Adding navigationItems to it does not work properly
553
+ * The navigationItems are lost when the app goes into the background.  The solution was to create an empty
554
+ * 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.
555
+ */
556
+@implementation CDVDisplayContactViewController
557
+@synthesize contactsPlugin;
558
+
559
+- (void)viewWillDisappear:(BOOL)animated
560
+{
561
+    [super viewWillDisappear:animated];
562
+
563
+    [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
564
+}
565
+
566
+@end
567
+@implementation CDVAddressBookAccessError
568
+
569
+@synthesize errorCode;
570
+
571
+- (CDVAddressBookAccessError*)initWithCode:(CDVContactError)code
572
+{
573
+    self = [super init];
574
+    if (self) {
575
+        self.errorCode = code;
576
+    }
577
+    return self;
578
+}
579
+
580
+@end
581
+
582
+@implementation CDVAddressBookHelper
583
+
584
+/**
585
+ * NOTE: workerBlock is responsible for releasing the addressBook that is passed to it
586
+ */
587
+- (void)createAddressBook:(CDVAddressBookWorkerBlock)workerBlock
588
+{
589
+    // TODO: this probably should be reworked - seems like the workerBlock can just create and release its own AddressBook,
590
+    // and also this important warning from (http://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/BasicObjects.html):
591
+    // "Important: Instances of ABAddressBookRef cannot be used by multiple threads. Each thread must make its own instance."
592
+    ABAddressBookRef addressBook;
593
+
594
+    CFErrorRef error = nil;
595
+    // CFIndex status = ABAddressBookGetAuthorizationStatus();
596
+    addressBook = ABAddressBookCreateWithOptions(NULL, &error);
597
+    // NSLog(@"addressBook access: %lu", status);
598
+    ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
599
+            // callback can occur in background, address book must be accessed on thread it was created on
600
+            dispatch_sync(dispatch_get_main_queue(), ^{
601
+                if (error) {
602
+                    workerBlock(NULL, [[CDVAddressBookAccessError alloc] initWithCode:UNKNOWN_ERROR]);
603
+                } else if (!granted) {
604
+                    workerBlock(NULL, [[CDVAddressBookAccessError alloc] initWithCode:PERMISSION_DENIED_ERROR]);
605
+                } else {
606
+                    // access granted
607
+                    workerBlock(addressBook, [[CDVAddressBookAccessError alloc] initWithCode:UNKNOWN_ERROR]);
608
+                }
609
+            });
610
+        });
611
+}
612
+
613
+@end

+ 576
- 0
km0App/node_modules/cordova-plugin-contacts/src/ubuntu/contacts.cpp Parādīt failu

@@ -0,0 +1,576 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+#include "contacts.h"
23
+
24
+#if defined QTCONTACTS_USE_NAMESPACE
25
+QTCONTACTS_USE_NAMESPACE
26
+#endif
27
+
28
+Contacts::Contacts(Cordova *cordova): CPlugin(cordova) {
29
+    m_fieldNamePairs.clear();
30
+
31
+    m_fieldNamePairs["displayName"] = QContactDetail::TypeDisplayLabel;
32
+    m_fieldNamePairs["name"] = QContactDetail::TypeName;
33
+    m_fieldNamePairs["nickname"] = QContactDetail::TypeNickname;
34
+    m_fieldNamePairs["phoneNumbers"] = QContactDetail::TypePhoneNumber;
35
+    m_fieldNamePairs["emails"] = QContactDetail::TypeEmailAddress;
36
+    m_fieldNamePairs["addresses"] = QContactDetail::TypeAddress;
37
+    m_fieldNamePairs["ims"] = QContactDetail::TypeOnlineAccount;
38
+    m_fieldNamePairs["organizations"] = QContactDetail::TypeOrganization;
39
+    m_fieldNamePairs["birthday"] = QContactDetail::TypeBirthday;
40
+    m_fieldNamePairs["note"] = QContactDetail::TypeNote;
41
+    m_fieldNamePairs["photos"] = QContactDetail::TypeAvatar;
42
+    m_fieldNamePairs["urls"] = QContactDetail::TypeUrl;
43
+
44
+    m_notSupportedFields.clear();
45
+    m_notSupportedFields << "categories";
46
+    m_manager.clear();
47
+    m_manager = QSharedPointer<QContactManager>(new QContactManager());
48
+}
49
+
50
+void Contacts::save(int scId, int ecId, const QVariantMap &params) {
51
+    QContact result;
52
+    QList<QContactDetail *> detailsToDelete;
53
+
54
+    if (params.find("id") != params.end()) {
55
+        QString id = params.find("id")->toString();
56
+        if (!id.isEmpty()) {
57
+            result = m_manager->contact(QContactId::fromString(id));
58
+            result.clearDetails();
59
+        }
60
+    }
61
+
62
+    foreach (QString field, params.keys()) {
63
+        QContactDetail::DetailType qtDefinition = cordovaFieldNameToQtDefinition(field);
64
+        if (qtDefinition == QContactDetail::TypeUndefined)
65
+            continue;
66
+
67
+        if (field == "nickname") {
68
+            QContactNickname *detail = new QContactNickname;
69
+            detail->setNickname(params[field].toString());
70
+            detailsToDelete << detail;
71
+            result.saveDetail(detail);
72
+        } else if (field == "note") {
73
+            QContactNote *detail = new QContactNote;
74
+            detail->setNote(params[field].toString());
75
+            detailsToDelete << detail;
76
+            result.saveDetail(detail);
77
+        } else if (field == "phoneNumbers") {
78
+            if (params[field].type() != QVariant::List)
79
+                continue;
80
+            QVariantList phonesList = params[field].toList();
81
+            foreach (const QVariant &phoneDesc, phonesList) {
82
+                if (phoneDesc.type() != QVariant::Map)
83
+                    continue;
84
+                QContactPhoneNumber *detail = new QContactPhoneNumber;
85
+                detail->setNumber(phoneDesc.toMap()["value"].toString());
86
+                if (!phoneDesc.toMap()["type"].toString().isEmpty() &&
87
+                        phoneDesc.toMap()["type"].toString() != "phone")
88
+                    detail->setSubTypes(QList<int>() <<
89
+                                        subTypePhoneFromString(phoneDesc.toMap()["type"].toString()));
90
+                detailsToDelete << detail;
91
+                result.saveDetail(detail);
92
+            }
93
+        } else if (field == "emails") {
94
+            if (params[field].type() != QVariant::List)
95
+                continue;
96
+            QVariantList emailsList = params[field].toList();
97
+            foreach (const QVariant &emailDesc, emailsList) {
98
+                if (emailDesc.type() != QVariant::Map)
99
+                    continue;
100
+                if (emailDesc.toMap()["value"].toString().isEmpty())
101
+                    continue;
102
+                QContactEmailAddress *detail = new QContactEmailAddress;
103
+                detail->setEmailAddress(emailDesc.toMap()["value"].toString());
104
+                detailsToDelete << detail;
105
+                result.saveDetail(detail);
106
+            }
107
+        } else if (field == "ims") {
108
+            if (params[field].type() != QVariant::List)
109
+                continue;
110
+            QVariantList imsList = params[field].toList();
111
+            foreach (const QVariant &imDesc, imsList) {
112
+                if (imDesc.type() != QVariant::Map)
113
+                    continue;
114
+                QContactOnlineAccount *detail = new QContactOnlineAccount;
115
+                detail->setAccountUri(imDesc.toMap()["value"].toString());
116
+                if (!imDesc.toMap()["type"].toString().isEmpty())
117
+                    detail->setSubTypes(QList<int>() <<
118
+                                        subTypeOnlineAccountFromString(imDesc.toMap()["type"].toString()));
119
+                detailsToDelete << detail;
120
+                result.saveDetail(detail);
121
+            }
122
+        } else if (field == "photos") {
123
+            if (params[field].type() != QVariant::List)
124
+                continue;
125
+            QVariantList photosList = params[field].toList();
126
+            foreach (const QVariant &photoDesc, photosList) {
127
+                if (photoDesc.type() != QVariant::Map)
128
+                    continue;
129
+                //TODO: we need to decide should we support base64 images or not
130
+                if (photoDesc.toMap()["type"].toString() != "url")
131
+                    continue;
132
+                QContactAvatar *detail = new QContactAvatar;
133
+                detail->setImageUrl(QUrl(photoDesc.toMap()["value"].toString()));
134
+                detailsToDelete << detail;
135
+                result.saveDetail(detail);
136
+            }
137
+        } else if (field == "urls") {
138
+            if (params[field].type() != QVariant::List)
139
+                continue;
140
+            QVariantList urlsList = params[field].toList();
141
+            foreach (const QVariant &urlDesc, urlsList) {
142
+                if (urlDesc.type() != QVariant::Map)
143
+                    continue;
144
+                QContactUrl *detail = new QContactUrl;
145
+                detail->setUrl(urlDesc.toMap()["value"].toString());
146
+                if (!urlDesc.toMap()["type"].toString().isEmpty())
147
+                    detail->setSubType((QContactUrl::SubType) subTypeUrlFromString(urlDesc.toMap()["type"].toString()));
148
+                detailsToDelete << detail;
149
+                result.saveDetail(detail);
150
+            }
151
+        } else if (field == "birthday") {
152
+            QDateTime birthday;
153
+            birthday.setTime_t(params[field].toLongLong() / 1000);
154
+
155
+            QContactBirthday *detail = new QContactBirthday;
156
+            detail->setDateTime(birthday);
157
+            detailsToDelete << detail;
158
+            result.saveDetail(detail);
159
+        } else if (field == "organizations") {
160
+
161
+            if (params[field].type() != QVariant::List)
162
+                continue;
163
+            QVariantList organizationsList = params[field].toList();
164
+            foreach (const QVariant &organizationDesc, organizationsList) {
165
+                if (organizationDesc.type() != QVariant::Map)
166
+                    continue;
167
+                QContactOrganization *detail = new QContactOrganization;
168
+                detail->setName(organizationDesc.toMap()["name"].toString());
169
+                detail->setDepartment(QStringList() << organizationDesc.toMap()["department"].toString());
170
+                detail->setRole(organizationDesc.toMap()["title"].toString());
171
+                detailsToDelete << detail;
172
+                result.saveDetail(detail);
173
+            }
174
+
175
+        } else if (field == "name") {
176
+            QContactName *detail = new QContactName;
177
+            QVariantMap nameMap = params[field].toMap();
178
+            detail->setLastName(nameMap["familyName"].toString());
179
+            detail->setFirstName(nameMap["givenName"].toString());
180
+            detail->setMiddleName(nameMap["middleName"].toString());
181
+            detail->setPrefix(nameMap["honorificPrefix"].toString());
182
+            detail->setSuffix(nameMap["honorificSuffix"].toString());
183
+            detailsToDelete << detail;
184
+            result.saveDetail(detail);
185
+        }
186
+
187
+    }
188
+    if (!m_manager->saveContact(&result)) {
189
+        switch (m_manager->error()) {
190
+        case QContactManager::DoesNotExistError:
191
+        case QContactManager::AlreadyExistsError:
192
+        case QContactManager::InvalidDetailError:
193
+        case QContactManager::InvalidRelationshipError:
194
+        case QContactManager::BadArgumentError:
195
+        case QContactManager::InvalidContactTypeError:
196
+            callback(ecId, "ContactError.INVALID_ARGUMENT_ERROR");
197
+            break;
198
+        case QContactManager::DetailAccessError:
199
+        case QContactManager::PermissionsError:
200
+            callback(ecId, "ContactError.PERMISSION_DENIED_ERROR");
201
+            break;
202
+        case QContactManager::NotSupportedError:
203
+            callback(ecId, "ContactError.NOT_SUPPORTED_ERROR");
204
+            break;
205
+        case QContactManager::TimeoutError:
206
+            callback(ecId, "ContactError.TIMEOUT_ERROR");
207
+            break;
208
+        case QContactManager::UnspecifiedError:
209
+        case QContactManager::LockedError:
210
+        case QContactManager::OutOfMemoryError:
211
+        case QContactManager::VersionMismatchError:
212
+        case QContactManager::LimitReachedError:
213
+        case QContactManager::NoError:
214
+        default:
215
+            callback(ecId, "ContactError.UNKNOWN_ERROR");
216
+            break;
217
+        }
218
+    } else {
219
+        callback(scId, jsonedContact(result));
220
+    }
221
+    qDeleteAll(detailsToDelete);
222
+}
223
+
224
+void Contacts::remove(int scId, int ecId, const QString &localId) {
225
+    QContactId id = QContactId::fromString(localId);
226
+
227
+    if (!m_manager->removeContact(id)) {
228
+        switch (m_manager->error()) {
229
+        case QContactManager::AlreadyExistsError:
230
+        case QContactManager::InvalidDetailError:
231
+        case QContactManager::InvalidRelationshipError:
232
+        case QContactManager::BadArgumentError:
233
+        case QContactManager::InvalidContactTypeError:
234
+            callback(ecId, "ContactError.INVALID_ARGUMENT_ERROR");
235
+            break;
236
+        case QContactManager::DetailAccessError:
237
+        case QContactManager::PermissionsError:
238
+            callback(ecId, "ContactError.PERMISSION_DENIED_ERROR");
239
+            break;
240
+        case QContactManager::NotSupportedError:
241
+            callback(ecId, "ContactError.NOT_SUPPORTED_ERROR");
242
+            break;
243
+        case QContactManager::TimeoutError:
244
+            callback(ecId, "ContactError.TIMEOUT_ERROR");
245
+            break;
246
+        case QContactManager::UnspecifiedError:
247
+        case QContactManager::LockedError:
248
+        case QContactManager::OutOfMemoryError:
249
+        case QContactManager::VersionMismatchError:
250
+        case QContactManager::LimitReachedError:
251
+        case QContactManager::NoError:
252
+        case QContactManager::DoesNotExistError:
253
+        default:
254
+            callback(ecId, "ContactError.UNKNOWN_ERROR");
255
+            break;
256
+        }
257
+
258
+    } else {
259
+        cb(scId);
260
+    }
261
+}
262
+
263
+void Contacts::search(int scId, int ecId, const QStringList &fields, const QVariantMap &params) {
264
+    QString filter;
265
+    bool multiple = true;
266
+
267
+    if (params.find("filter") != params.end()) {
268
+        filter = params["filter"].toString();
269
+    }
270
+    if (params.find("multiple") != params.end()) {
271
+        multiple = params["multiple"].toBool();
272
+    }
273
+
274
+    findContacts(scId, ecId, fields, filter, multiple);
275
+}
276
+
277
+void Contacts::findContacts(int scId, int ecId, const QStringList &fields, const QString &filter, bool multiple) {
278
+    if (fields.length() <= 0){
279
+        callback(ecId, "new ContactError(ContactError.INVALID_ARGUMENT_ERROR)");
280
+    }
281
+
282
+    QContactUnionFilter unionFilter;
283
+
284
+    QMap<QContactDetail::DetailType, QList<int> > fieldNames;
285
+    fieldNames[QContactDetail::TypeDisplayLabel] << QContactDisplayLabel::FieldLabel;
286
+    fieldNames[QContactDetail::TypeName] << QContactName::FieldFirstName << QContactName::FieldLastName << QContactName::FieldMiddleName << QContactName::FieldPrefix << QContactName::FieldSuffix;
287
+    fieldNames[QContactDetail::TypeNickname] << QContactNickname::FieldNickname;
288
+    fieldNames[QContactDetail::TypePhoneNumber] << QContactPhoneNumber::FieldNumber;
289
+    fieldNames[QContactDetail::TypeEmailAddress] << QContactEmailAddress::FieldEmailAddress;
290
+    fieldNames[QContactDetail::TypeAddress] << QContactAddress::FieldCountry << QContactAddress::FieldLocality << QContactAddress::FieldPostcode << QContactAddress::FieldPostOfficeBox << QContactAddress::FieldRegion << QContactAddress::FieldStreet;
291
+    fieldNames[QContactDetail::TypeOnlineAccount] << QContactOnlineAccount::FieldAccountUri;
292
+    fieldNames[QContactDetail::TypeOrganization] << QContactOrganization::FieldAssistantName << QContactOrganization::FieldDepartment << QContactOrganization::FieldLocation << QContactOrganization::FieldName << QContactOrganization::FieldRole << QContactOrganization::FieldTitle;
293
+    fieldNames[QContactDetail::TypeBirthday] << QContactBirthday::FieldBirthday;
294
+    fieldNames[QContactDetail::TypeNote] << QContactNote::FieldNote;
295
+    fieldNames[QContactDetail::TypeUrl] << QContactUrl::FieldUrl;
296
+
297
+    foreach (const QContactDetail::DetailType &defName, fieldNames.keys()) {
298
+        foreach(int fieldName, fieldNames[defName]) {
299
+            QContactDetailFilter subFilter;
300
+            subFilter.setDetailType(defName, fieldName);
301
+            subFilter.setValue(filter);
302
+            subFilter.setMatchFlags(QContactFilter::MatchContains);
303
+            unionFilter.append(subFilter);
304
+        }
305
+    }
306
+
307
+    QList<QContact> contacts = m_manager->contacts(unionFilter);
308
+    if (contacts.empty()) {
309
+        callback(scId, "[]");
310
+    } else {
311
+        QStringList stringifiedContacts;
312
+        foreach (const QContact &contact, contacts) {
313
+            stringifiedContacts << jsonedContact(contact, fields);
314
+
315
+            if (!multiple)
316
+                break;
317
+        }
318
+        callback(scId, QString("[%1]").arg(stringifiedContacts.join(", ")));
319
+    }
320
+}
321
+
322
+QContactDetail::DetailType Contacts::cordovaFieldNameToQtDefinition(const QString &cordovaFieldName) const {
323
+    if (m_fieldNamePairs.contains(cordovaFieldName))
324
+        return m_fieldNamePairs[cordovaFieldName];
325
+
326
+    return QContactDetail::TypeUndefined;
327
+}
328
+
329
+int Contacts::subTypePhoneFromString(const QString &cordovaSubType) const
330
+{
331
+    QString preparedSubType = cordovaSubType.toLower();
332
+    if (preparedSubType == "mobile")
333
+        return QContactPhoneNumber::SubTypeMobile;
334
+    else if (preparedSubType == "fax")
335
+        return QContactPhoneNumber::SubTypeFax;
336
+    else if (preparedSubType == "pager")
337
+        return QContactPhoneNumber::SubTypePager;
338
+    else if (preparedSubType == "voice")
339
+        return QContactPhoneNumber::SubTypeVoice;
340
+    else if (preparedSubType == "modem")
341
+        return QContactPhoneNumber::SubTypeModem;
342
+    else if (preparedSubType == "video")
343
+        return QContactPhoneNumber::SubTypeVideo;
344
+    else if (preparedSubType == "car")
345
+        return QContactPhoneNumber::SubTypeCar;
346
+    else if (preparedSubType == "assistant")
347
+        return QContactPhoneNumber::SubTypeAssistant;
348
+    return QContactPhoneNumber::SubTypeLandline;
349
+}
350
+
351
+int Contacts::subTypeOnlineAccountFromString(const QString &cordovaSubType) const {
352
+    QString preparedSubType = cordovaSubType.toLower();
353
+    if (preparedSubType == "aim")
354
+        return QContactOnlineAccount::ProtocolAim;
355
+    else if (preparedSubType == "icq")
356
+        return QContactOnlineAccount::ProtocolIcq;
357
+    else if (preparedSubType == "irc")
358
+        return QContactOnlineAccount::ProtocolIrc;
359
+    else if (preparedSubType == "jabber")
360
+        return QContactOnlineAccount::ProtocolJabber;
361
+    else if (preparedSubType == "msn")
362
+        return QContactOnlineAccount::ProtocolMsn;
363
+    else if (preparedSubType == "qq")
364
+        return QContactOnlineAccount::ProtocolQq;
365
+    else if (preparedSubType == "skype")
366
+        return QContactOnlineAccount::ProtocolSkype;
367
+    else if (preparedSubType == "yahoo")
368
+        return QContactOnlineAccount::ProtocolYahoo;
369
+    return QContactOnlineAccount::ProtocolUnknown;
370
+}
371
+
372
+int Contacts::subTypeUrlFromString(const QString &cordovaSubType) const {
373
+    QString preparedSubType = cordovaSubType.toLower();
374
+    if (preparedSubType == "blog")
375
+        return QContactUrl::SubTypeBlog;
376
+    else if (preparedSubType == "favourite")
377
+        return QContactUrl::SubTypeFavourite;
378
+    return QContactUrl::SubTypeHomePage;
379
+}
380
+
381
+QString Contacts::subTypePhoneToString(int qtSubType) const {
382
+    if (qtSubType == QContactPhoneNumber::SubTypeMobile)
383
+        return "mobile";
384
+    else if (qtSubType == QContactPhoneNumber::SubTypeFax)
385
+        return "fax";
386
+    else if (qtSubType == QContactPhoneNumber::SubTypePager)
387
+        return "pager";
388
+    else if (qtSubType == QContactPhoneNumber::SubTypeVoice)
389
+        return "voice";
390
+    else if (qtSubType == QContactPhoneNumber::SubTypeModem)
391
+        return "modem";
392
+    else if (qtSubType == QContactPhoneNumber::SubTypeVideo)
393
+        return "video";
394
+    else if (qtSubType == QContactPhoneNumber::SubTypeCar)
395
+        return "car";
396
+    else if (qtSubType == QContactPhoneNumber::SubTypeAssistant)
397
+        return "assistant";
398
+    return "home";
399
+}
400
+
401
+QString Contacts::subTypeOnlineAccountToString(int qtSubType) const {
402
+    if (qtSubType == QContactOnlineAccount::ProtocolAim)
403
+        return "aim";
404
+    else if (qtSubType == QContactOnlineAccount::ProtocolIcq)
405
+        return "icq";
406
+    else if (qtSubType == QContactOnlineAccount::ProtocolIrc)
407
+        return "irc";
408
+    else if (qtSubType == QContactOnlineAccount::ProtocolJabber)
409
+        return "jabber";
410
+    else if (qtSubType == QContactOnlineAccount::ProtocolMsn)
411
+        return "msn";
412
+    else if (qtSubType == QContactOnlineAccount::ProtocolQq)
413
+        return "qq";
414
+    else if (qtSubType == QContactOnlineAccount::ProtocolSkype)
415
+        return "skype";
416
+    else if (qtSubType == QContactOnlineAccount::ProtocolYahoo)
417
+        return "yahoo";
418
+    return "unknown";
419
+}
420
+
421
+QString Contacts::subTypeUrlToString(int qtSubType) const {
422
+    if (qtSubType == QContactUrl::SubTypeBlog)
423
+        return "blog";
424
+    else if (qtSubType == QContactUrl::SubTypeFavourite)
425
+        return "favourite";
426
+    return "homepage";
427
+}
428
+
429
+QString Contacts::jsonedContact(const QContact &contact, const QStringList &fields) const {
430
+    QStringList resultingFields = fields;
431
+    if (resultingFields.empty())
432
+        resultingFields.append(m_fieldNamePairs.keys());
433
+    if (!resultingFields.contains("id"))
434
+        resultingFields << "id";
435
+    QStringList fieldValuesList;
436
+    foreach (const QString &field, resultingFields) {
437
+        QContactDetail::DetailType qtDefinitionName = cordovaFieldNameToQtDefinition(field);
438
+        if (field == "id") {
439
+            fieldValuesList << QString("%1: \"%2\"")
440
+                               .arg(field)
441
+                               .arg(contact.id().toString());
442
+        } else if (field == "displayName") {
443
+            QContactDisplayLabel detail = contact.detail(qtDefinitionName);
444
+            fieldValuesList << QString("%1: \"%2\"")
445
+                               .arg(field)
446
+                               .arg(detail.label());
447
+        } else if (field == "nickname") {
448
+            QContactNickname detail = contact.detail(qtDefinitionName);
449
+            fieldValuesList << QString("%1: \"%2\"")
450
+                               .arg(field)
451
+                               .arg(detail.nickname());
452
+        } else if (field == "note") {
453
+            QContactNote detail = contact.detail(qtDefinitionName);
454
+            fieldValuesList << QString("%1: \"%2\"")
455
+                               .arg(field)
456
+                               .arg(detail.note());
457
+        } else if (field == "phoneNumbers") {
458
+            QStringList fieldValues;
459
+            QList<QContactDetail> details = contact.details(qtDefinitionName);
460
+            foreach (const QContactDetail &detail, details) {
461
+                QContactPhoneNumber castedDetail = detail;
462
+                QStringList subTypes;
463
+                foreach (int subType, castedDetail.subTypes())
464
+                    subTypes << subTypePhoneToString(subType);
465
+
466
+                if (subTypes.isEmpty())
467
+                    subTypes << "phone";
468
+                foreach(const QString &subType, subTypes) {
469
+                    fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
470
+                                   .arg(subType)
471
+                                   .arg(castedDetail.number())
472
+                                   .arg("false");
473
+                }
474
+            }
475
+            fieldValuesList << QString("%1: [%2]")
476
+                               .arg(field)
477
+                               .arg(fieldValues.join(", "));
478
+        } else if (field == "emails") {
479
+            QStringList fieldValues;
480
+            QList<QContactDetail> details = contact.details(qtDefinitionName);
481
+            foreach (const QContactDetail &detail, details) {
482
+                QContactEmailAddress castedDetail = detail;
483
+                fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
484
+                               .arg("email")
485
+                               .arg(castedDetail.emailAddress())
486
+                               .arg("false");
487
+            }
488
+            fieldValuesList << QString("%1: [%2]")
489
+                               .arg(field)
490
+                               .arg(fieldValues.join(", "));
491
+        } else if (field == "ims") {
492
+            QStringList fieldValues;
493
+            QList<QContactDetail> details = contact.details(qtDefinitionName);
494
+            foreach (const QContactDetail &detail, details) {
495
+                QContactOnlineAccount castedDetail = detail;
496
+                QStringList subTypes;
497
+                foreach (int subType, castedDetail.subTypes())
498
+                    subTypes << subTypeOnlineAccountToString(subType);
499
+
500
+                if (subTypes.isEmpty())
501
+                    subTypes << "IM";
502
+                foreach(const QString &subType, subTypes) {
503
+                    fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
504
+                                   .arg(subType)
505
+                                   .arg(castedDetail.accountUri())
506
+                                   .arg("false");
507
+                }
508
+            }
509
+            fieldValuesList << QString("%1: [%2]")
510
+                               .arg(field)
511
+                               .arg(fieldValues.join(", "));
512
+        } else if (field == "photos") {
513
+            QStringList fieldValues;
514
+            QList<QContactDetail> details = contact.details(qtDefinitionName);
515
+            foreach (const QContactDetail &detail, details) {
516
+                QContactAvatar castedDetail = detail;
517
+                fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
518
+                               .arg("url")
519
+                               .arg(castedDetail.imageUrl().toString())
520
+                               .arg("false");
521
+            }
522
+            fieldValuesList << QString("%1: [%2]")
523
+                               .arg(field)
524
+                               .arg(fieldValues.join(", "));
525
+        } else if (field == "urls") {
526
+            QStringList fieldValues;
527
+            QList<QContactDetail> details = contact.details(qtDefinitionName);
528
+
529
+            foreach (const QContactDetail &detail, details) {
530
+                QContactUrl castedDetail = detail;
531
+                QString subType = subTypeUrlToString(castedDetail.subType());
532
+
533
+                fieldValues << QString("{type: \"%1\", value: \"%2\", pref: %3}")
534
+                               .arg(subType)
535
+                               .arg(castedDetail.url())
536
+                               .arg("false");
537
+            }
538
+            fieldValuesList << QString("%1: [%2]")
539
+                               .arg(field)
540
+                               .arg(fieldValues.join(", "));
541
+        } else if (field == "birthday") {
542
+            QContactBirthday detail = contact.detail(qtDefinitionName);
543
+            fieldValuesList << QString("%1: %2")
544
+                               .arg(field)
545
+                               .arg(detail.dateTime().toMSecsSinceEpoch());
546
+        } else if (field == "organizations") {
547
+            QStringList fieldValues;
548
+            QList<QContactDetail> details = contact.details(qtDefinitionName);
549
+            foreach (const QContactDetail &detail, details) {
550
+                QContactOrganization castedDetail = detail;
551
+                fieldValues << QString("{type: \"%1\", name: \"%2\", department: \"%3\", title: \"%4\", pref: %5}")
552
+                               .arg("organization")
553
+                               .arg(castedDetail.name())
554
+                               .arg(castedDetail.department().join(" "))
555
+                               .arg(castedDetail.role())
556
+                               .arg("false");
557
+            }
558
+            fieldValuesList << QString("%1: [%2]")
559
+                               .arg(field)
560
+                               .arg(fieldValues.join(", "));
561
+        } else if (field == "name") {
562
+            QContactName detail = contact.detail(qtDefinitionName);
563
+            fieldValuesList <<  QString("%1: {familyName: \"%2\", givenName: \"%3\", middleName: \"%4\", honorificPrefix: \"%5\", honorificSuffix: \"%6\"}")
564
+                                .arg(field)
565
+                                .arg(detail.lastName())
566
+                                .arg(detail.firstName())
567
+                                .arg(detail.middleName())
568
+                                .arg(detail.prefix())
569
+                                .arg(detail.suffix());
570
+        }
571
+
572
+
573
+    }
574
+
575
+    return QString("{%1}").arg(fieldValuesList.join(", "));
576
+}

+ 70
- 0
km0App/node_modules/cordova-plugin-contacts/src/ubuntu/contacts.h Parādīt failu

@@ -0,0 +1,70 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+#ifndef CONTACTS_H_SSSSSSS
23
+#define CONTACTS_H_SSSSSSS
24
+
25
+#include <cplugin.h>
26
+
27
+#include <QtContacts>
28
+#include <QtCore>
29
+
30
+QTCONTACTS_USE_NAMESPACE
31
+
32
+class Contacts : public CPlugin {
33
+    Q_OBJECT
34
+public:
35
+    explicit Contacts(Cordova *cordova);
36
+
37
+    virtual const QString fullName() override {
38
+        return Contacts::fullID();
39
+    }
40
+
41
+    virtual const QString shortName() override {
42
+        return "Contacts";
43
+    }
44
+
45
+    static const QString fullID() {
46
+        return "Contacts";
47
+    }
48
+
49
+public slots:
50
+    void save(int scId, int ecId, const QVariantMap &params);
51
+    void remove(int scId, int ecId, const QString &localId);
52
+    void search(int scId, int ecId, const QStringList &fields, const QVariantMap &params);
53
+
54
+private:
55
+    void findContacts(int scId, int ecId, const QStringList &fields, const QString &filter, bool multiple);
56
+    QContactDetail::DetailType cordovaFieldNameToQtDefinition(const QString &cordovaFieldName) const;
57
+    int subTypePhoneFromString(const QString &cordovaSubType) const;
58
+    int subTypeOnlineAccountFromString(const QString &cordovaSubType) const;
59
+    int subTypeUrlFromString(const QString &cordovaSubType) const;
60
+    QString subTypePhoneToString(int qtSubType) const;
61
+    QString subTypeOnlineAccountToString(int qtSubType) const;
62
+    QString subTypeUrlToString(int qtSubType) const;
63
+    QString jsonedContact(const QContact &contact, const QStringList &fields = QStringList()) const;
64
+
65
+    QHash<QString, QContactDetail::DetailType> m_fieldNamePairs;
66
+    QSet<QString> m_notSupportedFields;
67
+    QSharedPointer<QContactManager> m_manager;
68
+};
69
+
70
+#endif

+ 430
- 0
km0App/node_modules/cordova-plugin-contacts/src/windows/ContactProxy.js Parādīt failu

@@ -0,0 +1,430 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ * 
20
+ */
21
+
22
+/* global Windows, WinJS */
23
+
24
+var ContactField = require('./ContactField'),
25
+    ContactAddress = require('./ContactAddress'),
26
+    ContactOrganization = require('./ContactOrganization'),
27
+    ContactName = require('./ContactName'),
28
+    ContactError = require('./ContactError'),
29
+    Contact = require('./Contact');
30
+
31
+
32
+function convertToContact(windowsContact) {
33
+    var contact = new Contact();
34
+
35
+    // displayName & nickname
36
+    contact.displayName = windowsContact.displayName || windowsContact.name;
37
+    contact.nickname = windowsContact.name;
38
+    contact.id = windowsContact.id;
39
+
40
+    // name
41
+    // Additional fields like lastName, middleName etc. available on windows8.1/wp8.1 only
42
+    contact.name = new ContactName(
43
+        windowsContact.displayName || windowsContact.name,
44
+        windowsContact.lastName,
45
+        windowsContact.firstName || windowsContact.name,
46
+        windowsContact.middleName,
47
+        windowsContact.honorificNamePrefix || windowsContact.honorificPrefix,
48
+        windowsContact.honorificNameSuffix || windowsContact.honorificSuffix);
49
+
50
+    // phoneNumbers
51
+    contact.phoneNumbers = [];
52
+    var phoneSource = windowsContact.phoneNumbers || windowsContact.phones;
53
+    var i;
54
+    for (i = 0; i < phoneSource.size; i++) {
55
+        var rawPhone = phoneSource[i];
56
+        var phone = new ContactField(rawPhone.category || rawPhone.kind, rawPhone.value || rawPhone.number);
57
+        contact.phoneNumbers.push(phone);
58
+    }
59
+
60
+    // emails
61
+    contact.emails = [];
62
+    var emailSource = windowsContact.emails;
63
+    for (i = 0; i < emailSource.size; i++) {
64
+        var rawEmail = emailSource[i];
65
+        var email = new ContactField(rawEmail.category || rawEmail.kind, rawEmail.value || rawEmail.address);
66
+        contact.emails.push(email);
67
+    }
68
+
69
+    // addressres
70
+    contact.addresses = [];
71
+    var addressSource = windowsContact.locations || windowsContact.addresses;
72
+    for (i = 0; i < addressSource.size; i++) {
73
+        var rawAddress = addressSource[i];
74
+        var address = new ContactAddress(
75
+            null,
76
+            rawAddress.category || rawAddress.kind,
77
+            rawAddress.unstructuredAddress,
78
+            rawAddress.street || rawAddress.streetAddress,
79
+            rawAddress.city || rawAddress.locality,
80
+            rawAddress.region,
81
+            rawAddress.postalCode,
82
+            rawAddress.country);
83
+        contact.addresses.push(address);
84
+    }
85
+
86
+    // ims
87
+    contact.ims = [];
88
+    var imSource = windowsContact.instantMessages || windowsContact.connectedServiceAccounts;
89
+    for (i = 0; i < imSource.size; i++) {
90
+        var rawIm = imSource[i];
91
+        var im = new ContactField(rawIm.category || rawIm.serviceName, rawIm.userName || rawIm.id);
92
+        contact.ims.push(im);
93
+    }
94
+
95
+    // jobInfo field available on Windows 8.1/WP8.1 only
96
+    var jobInfo = windowsContact.jobInfo;
97
+    if (jobInfo) {
98
+        contact.organizations = [];
99
+        for (var j = 0; j < jobInfo.size; j++) {
100
+            var rawJob = jobInfo[i];
101
+            contact.organizations.push(new ContactOrganization(false, null,
102
+                rawJob.companyName, rawJob.department, rawJob.title));
103
+        }
104
+    }
105
+
106
+    // note field available on Windows 8.1/WP8.1 only
107
+    var contactNotes = windowsContact.notes;
108
+    if (contactNotes) {
109
+        contact.note = contactNotes;
110
+    }
111
+
112
+    // returned is a file, a blob url can be made 
113
+    var contactPhoto = windowsContact.thumbnail;
114
+    if (contactPhoto && contactPhoto.path) {
115
+        contact.photos = [new ContactField('url', URL.createObjectURL(contactPhoto) , false)];
116
+    }
117
+
118
+    return contact;
119
+}
120
+
121
+// Win API Contacts namespace
122
+var contactsNS = Windows.ApplicationModel.Contacts;
123
+
124
+function cdvContactToWindowsContact(contact) {
125
+    var result = new contactsNS.Contact();
126
+    
127
+    // name first
128
+    if (contact.name) {
129
+        result.displayNameOverride = contact.name.formatted;
130
+        result.firstName = contact.name.givenName;
131
+        result.middleName = contact.name.middleName;
132
+        result.lastName = contact.name.familyName;
133
+        result.honorificNamePrefix = contact.name.honorificPrefix;
134
+        result.honorificNameSuffix = contact.name.honorificSuffix;
135
+    }
136
+    
137
+    result.nickname = contact.nickname;
138
+    
139
+    // phone numbers
140
+    if (contact.phoneNumbers) {
141
+        contact.phoneNumbers.forEach(function(contactPhone) {
142
+            var resultPhone = new contactsNS.ContactPhone();
143
+            resultPhone.description = contactPhone.type;
144
+            resultPhone.number = contactPhone.value;
145
+            result.phones.push(resultPhone);
146
+        });
147
+    }
148
+    
149
+    // emails
150
+    if (contact.emails) {
151
+        contact.emails.forEach(function(contactEmail) {
152
+            var resultEmail = new contactsNS.ContactEmail();
153
+            resultEmail.description = contactEmail.type;
154
+            resultEmail.address = contactEmail.value;
155
+            result.emails.push(resultEmail);
156
+        });
157
+    }
158
+    
159
+    // Addresses
160
+    if (contact.addresses) {
161
+        contact.addresses.forEach(function(contactAddress) {
162
+            var address = new contactsNS.ContactAddress();
163
+            address.description = contactAddress.type;
164
+            address.streetAddress = contactAddress.streetAddress;
165
+            address.locality = contactAddress.locality;
166
+            address.region = contactAddress.region;
167
+            address.postalCode = contactAddress.postalCode;
168
+            address.country = contactAddress.country;
169
+            result.addresses.push(address);
170
+        });
171
+    }
172
+    
173
+    // IMs
174
+    if (contact.ims) {
175
+        contact.ims.forEach(function(contactIM) {
176
+            var acct = new contactsNS.ContactConnectedServiceAccount();
177
+            acct.serviceName = contactIM.type;
178
+            acct.id = contactIM.value;
179
+            result.connectedServiceAccounts.push(acct);
180
+        });
181
+    }
182
+    
183
+    // JobInfo 
184
+    if (contact.organizations) {
185
+        contact.organizations.forEach(function(contactOrg) {
186
+            var job = new contactsNS.ContactJobInfo();
187
+            job.companyName = contactOrg.name;
188
+            job.department = contactOrg.department;
189
+            job.description = contactOrg.type;
190
+            job.title = contactOrg.title;
191
+            result.jobInfo.push(job);
192
+        });
193
+    }
194
+    
195
+    result.notes = contact.note;
196
+    
197
+    if (contact.photos) {
198
+        var eligiblePhotos = contact.photos.filter(function(photo) { 
199
+            return typeof photo.value !== 'undefined';
200
+        });
201
+        if (eligiblePhotos.length > 0) {
202
+            var supportedPhoto = eligiblePhotos[0];
203
+            var path = supportedPhoto.value;
204
+            
205
+            try {
206
+                var streamRef;
207
+                if (/^([a-z][a-z0-9+\-.]*):\/\//i.test(path)) {
208
+                    streamRef = Windows.Storage.Streams.RandomAccessStreamReference.createFromUri(new Windows.Foundation.Uri(path));
209
+                } else {
210
+                    streamRef = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(path);
211
+                }
212
+                result.thumbnail = streamRef;
213
+            }
214
+            catch (e) {
215
+                // incompatible reference to the photo
216
+            }
217
+        }
218
+    }
219
+    
220
+    return result;
221
+}
222
+
223
+module.exports = {
224
+
225
+    pickContact: function (win, fail, args) {
226
+
227
+        // ContactPicker class works differently on Windows8/8.1 and Windows Phone 8.1
228
+        // so we need to detect when we are running on phone
229
+        var runningOnPhone = navigator.userAgent.indexOf('Windows Phone') !== -1;
230
+
231
+        var picker = new contactsNS.ContactPicker();
232
+        if (runningOnPhone) {
233
+            // TODO: Windows Phone 8.1 requires this specification. This should be noted in quirks
234
+            // See http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.contacts.contactpicker.desiredfieldswithcontactfieldtype.aspx for details
235
+            // Multiple ContactFieldType items, appended to array causes `Request not suported` error.
236
+            picker.desiredFieldsWithContactFieldType.append(Windows.ApplicationModel.Contacts.ContactFieldType.phoneNumber);
237
+        }
238
+
239
+        // pickContactAsync is available on Windows 8.1 or later, instead of
240
+        // pickSingleContactAsync, which is deprecated in Windows 8.1,
241
+        // so try to use newer method, if available.
242
+        // see http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.contacts.contactpicker.picksinglecontactasync.aspx
243
+
244
+        var pickRequest = picker.pickContactAsync ? picker.pickContactAsync() : picker.pickSingleContactAsync();
245
+        pickRequest.done(function (contact) {
246
+            // if contact was not picked
247
+            if (!contact) {
248
+                var cancelledError = new ContactError(ContactError.OPERATION_CANCELLED_ERROR);
249
+                cancelledError.message = "User did not pick a contact.";
250
+                fail(cancelledError);
251
+                return;
252
+            }
253
+            // If we are on desktop, just send em back
254
+            if (!runningOnPhone) {
255
+                win(convertToContact(contact));
256
+                return;
257
+            }
258
+            // On WP8.1 fields set in resulted Contact object depends on desiredFieldsWithContactFieldType property of contact picker
259
+            // so we retrieve full contact by its' Id
260
+            contactsNS.ContactManager.requestStoreAsync().done(function (contactStore) {
261
+                contactStore.getContactAsync(contact.id).done(function(con) {
262
+                    win(convertToContact(con));
263
+                }, function() {
264
+                    fail(new ContactError(ContactError.UNKNOWN_ERROR));
265
+                });
266
+            }, function () {
267
+                fail(new ContactError(ContactError.UNKNOWN_ERROR));
268
+            });
269
+        });
270
+    },
271
+
272
+    save: function (win, fail, args) {
273
+        if (typeof contactsNS.ContactList === 'undefined') {
274
+            // Not supported yet since WinJS API do not provide methods to manage contactStore
275
+            // On Windows Phone 8.1 this can be implemented using native class library 
276
+            // See Windows.Phone.PersonalInformation namespace
277
+            // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.phone.personalinformation.aspx
278
+    
279
+            //We don't need to create Error object here since it will be created at navigator.contacts.find() method
280
+            if (fail) {
281
+                fail(ContactError.NOT_SUPPORTED_ERROR);
282
+            }
283
+            return;
284
+        }
285
+        
286
+        var winContact = cdvContactToWindowsContact(args[0]);
287
+        
288
+        contactsNS.ContactManager.requestStoreAsync(contactsNS.ContactStoreAccessType.appContactsReadWrite).then(function(store) {
289
+                return store.findContactListsAsync().then(function(lists) {
290
+                        if (lists.length > 0) {
291
+                            return lists[0];    
292
+                        } else {
293
+                            return store.createContactListAsync('');
294
+                        }
295
+                    }, function(error) {
296
+                        return store.createContactListAsync('');
297
+                    });
298
+            }).then(function(list) {
299
+                return list.saveContactAsync(winContact);
300
+            }).done(function(result) {
301
+                win(convertToContact(winContact));
302
+            }, function(error) {
303
+                fail(error);
304
+            });
305
+    },
306
+    
307
+    remove: function(win, fail, args) {
308
+        if (typeof contactsNS.ContactList === 'undefined') {
309
+            // Not supported yet since WinJS API do not provide methods to manage contactStore
310
+            // On Windows Phone 8.1 this can be implemented using native class library 
311
+            // See Windows.Phone.PersonalInformation namespace
312
+            // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.phone.personalinformation.aspx
313
+    
314
+            //We don't need to create Error object here since it will be created at navigator.contacts.find() method
315
+            if (fail) {
316
+                fail(ContactError.NOT_SUPPORTED_ERROR);
317
+            }
318
+            return;
319
+        }
320
+        
321
+        // This is a complicated scenario because in Win10, there is a notion of 'app contacts' vs 'global contacts'.
322
+        // search() returns all global contacts, which are "aggregate contacts", so the IDs of contacts that Cordova
323
+        // creates never match the IDs of the contacts returned from search().
324
+        // In order to work around this, we need to:
325
+        //  - Get two Stores: one that is read-write to the app-contacts list, one which is read-only for global contacts  
326
+        //  - Read the app-local store to see if a contact with the passed-in ID matches
327
+        //  - Grab the global aggregate contact manager, then ask it for raw contacts (app-local ACM returns access denied)
328
+        //  - Find my app-list of contacts
329
+        //  - Enumerate the raw contacts and see if there is a raw contact whose parent list matches the app-list
330
+        //  - If so, remove the raw contact from the app-list
331
+        //  - If any of this fails, the operation fails
332
+        WinJS.Promise.join([contactsNS.ContactManager.requestStoreAsync(contactsNS.ContactStoreAccessType.appContactsReadWrite), 
333
+                            contactsNS.ContactManager.requestStoreAsync(contactsNS.ContactStoreAccessType.allContactsReadOnly)]).then(function(stores) {
334
+                var readOnlyStore = stores[1];
335
+                var writableStore = stores[0];
336
+                
337
+                var storeReader = writableStore.getContactReader();
338
+                return storeReader.readBatchAsync().then(function(batch) {
339
+                    if (batch.status !== contactsNS.ContactBatchStatus.success) {
340
+                        // Couldn't read contacts store
341
+                        throw new ContactError(ContactError.IO_ERROR);
342
+                    }
343
+                    
344
+                    var candidates = batch.contacts.filter(function(testContact) {
345
+                        return testContact.id === args[0];
346
+                    });
347
+                    
348
+                    if (candidates.length === 0) {
349
+                        // No matching contact from aggregate store
350
+                        throw new ContactError(ContactError.IO_ERROR);
351
+                    }
352
+                    
353
+                    return candidates[0];
354
+                }).then(function(contactToDelete) {
355
+                    return readOnlyStore.aggregateContactManager.findRawContactsAsync(contactToDelete);
356
+                }).then(function(rawContacts) {
357
+                    return writableStore.findContactListsAsync().then(function(lists) {
358
+                        var deleteList = null;
359
+                        var deleteContact = null;
360
+                        var matched = lists.some(function(list) {
361
+                            for (var i = 0; i < rawContacts.length; i++) {
362
+                                if (rawContacts[i].contactListId === list.id) {
363
+                                    deleteList = list;
364
+                                    deleteContact = rawContacts[i];
365
+                                    return true;
366
+                                }
367
+                            }
368
+                            return false;
369
+                        });
370
+                        
371
+                        if (!matched) {
372
+                            throw new ContactError(ContactError.IO_ERROR);
373
+                        }
374
+                        
375
+                        return deleteList.deleteContactAsync(deleteContact);
376
+                    });
377
+                });
378
+            }).done(function() {
379
+                win();
380
+            }, function(error) {
381
+                fail(error);
382
+            });
383
+    },
384
+
385
+    search: function (win, fail, options) {
386
+
387
+        // searchFields is not supported yet due to WP8.1 API limitations.
388
+        // findContactsAsync(String) method will attempt to match the name, email address, or phone number of a contact. 
389
+        // see http://msdn.microsoft.com/en-us/library/windows/apps/dn624861.aspx for details
390
+        var searchFields = options[0], // jshint ignore:line
391
+            searchOptions = options[1],
392
+            searchFilter = searchOptions.filter,
393
+            searchMultiple = searchOptions && searchOptions.multiple;
394
+
395
+        // Check if necessary API is available.
396
+        // If not available, we are running on desktop, which doesn't support searching for contacts
397
+        if (!(contactsNS.ContactManager && contactsNS.ContactManager.requestStoreAsync)) {
398
+            fail(new ContactError(ContactError.NOT_SUPPORTED_ERROR));
399
+            return;
400
+        }
401
+
402
+        // Retrieve contact store instance
403
+        var contactStoreRequest = contactsNS.ContactManager.requestStoreAsync();
404
+
405
+        // When contact store retrieved
406
+        contactStoreRequest.done(function (contactStore) {
407
+            // determine, which function we use depending on whether searchOptions.filter specified or not
408
+            var contactsRequest = searchFilter ? contactStore.findContactsAsync(searchFilter) : contactStore.findContactsAsync();
409
+            // request contacts and resolve either with success or error callback
410
+            contactsRequest.done(function (contacts) {
411
+                var result = [];
412
+                if (contacts.size !== 0) {
413
+                    // Depending on searchOptions we should return all contacts found or only first 
414
+                    var outputContactsArray = searchMultiple ? contacts : [contacts[0]];
415
+                    outputContactsArray.forEach(function (contact) {
416
+                        // Convert windows contacts to plugin's contact objects
417
+                        result.push(convertToContact(contact));
418
+                    });
419
+                }
420
+                win(result);
421
+            }, function() {
422
+                fail(new ContactError(ContactError.UNKNOWN_ERROR));
423
+            });
424
+        }, function() {
425
+            fail(new ContactError(ContactError.UNKNOWN_ERROR));
426
+        });
427
+    }
428
+};
429
+
430
+require("cordova/exec/proxy").add("Contacts", module.exports);

+ 130
- 0
km0App/node_modules/cordova-plugin-contacts/src/windows8/ContactProxy.js Parādīt failu

@@ -0,0 +1,130 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ * 
20
+ */
21
+
22
+/* global Windows */
23
+
24
+var ContactField = require('./ContactField'),
25
+    ContactAddress = require('./ContactAddress'),
26
+    ContactName = require('./ContactName'),
27
+    Contact = require('./Contact');
28
+
29
+
30
+function convertToContact(windowsContact) {
31
+    var contact = new Contact();
32
+    var i;
33
+
34
+    // displayName & nickname
35
+    contact.displayName = windowsContact.name;
36
+    contact.nickname = windowsContact.name;
37
+
38
+    // name
39
+    contact.name = new ContactName(windowsContact.name);
40
+
41
+    // phoneNumbers
42
+    contact.phoneNumbers = [];
43
+    for (i = 0; i < windowsContact.phoneNumbers.size; i++) {
44
+        var phone = new ContactField(windowsContact.phoneNumbers[i].category, windowsContact.phoneNumbers[i].value);
45
+        contact.phoneNumbers.push(phone);
46
+    }
47
+
48
+    // emails
49
+    contact.emails = [];
50
+    for (i = 0; i < windowsContact.emails.size; i++) {
51
+        var email = new ContactField(windowsContact.emails[i].category, windowsContact.emails[i].value);
52
+        contact.emails.push(email);
53
+    }
54
+
55
+    // addressres
56
+    contact.addresses = [];
57
+    for (i = 0; i < windowsContact.locations.size; i++) {
58
+        var address = new ContactAddress(null, windowsContact.locations[i].category,
59
+            windowsContact.locations[i].unstructuredAddress, windowsContact.locations[i].street,
60
+            null, windowsContact.locations[i].region, windowsContact.locations[i].postalCode,
61
+            windowsContact.locations[i].country);
62
+        contact.addresses.push(address);
63
+    }
64
+
65
+    // ims
66
+    contact.ims = [];
67
+    for (i = 0; i < windowsContact.instantMessages.size; i++) {
68
+        var im = new ContactField(windowsContact.instantMessages[i].category, windowsContact.instantMessages[i].userName);
69
+        contact.ims.push(im);
70
+    }
71
+
72
+    return contact;
73
+}
74
+
75
+module.exports = {
76
+    pickContact: function(win, fail, args) {
77
+        var picker = new Windows.ApplicationModel.Contacts.ContactPicker();
78
+
79
+        function success(con) {
80
+            // if contact was not picked
81
+            if (!con) {
82
+                if (fail) {
83
+                    setTimeout(function() {
84
+                        fail(new Error("User did not pick a contact."));
85
+                    }, 0);
86
+                }
87
+                return;
88
+            }
89
+
90
+            // send em back
91
+            win(convertToContact(con));
92
+        }
93
+
94
+        picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.contacts; // select entire contact
95
+
96
+        // pickContactAsync is available on Windows 8.1 or later, instead of
97
+        // pickSingleContactAsync, which is deprecated after Windows 8,
98
+        // so try to use newer method, if available.
99
+        // see http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.contacts.contactpicker.picksinglecontactasync.aspx
100
+        if (picker.pickContactAsync) {
101
+            // TODO: 8.1 has better contact support via the 'Contact' object
102
+        } else {
103
+            picker.pickSingleContactAsync().done(success, fail);
104
+        }
105
+    },
106
+
107
+    save:function(win,fail,args){
108
+        if (console && console.error) {
109
+            console.error("Error : Windows 8 does not support creating/saving contacts");
110
+        }
111
+        if (fail) {
112
+            setTimeout(function () {
113
+                fail(new Error("Contact create/save not supported on Windows 8"));
114
+            }, 0);
115
+        }
116
+    },
117
+
118
+    search: function(win, fail, args) {
119
+        if (console && console.error) {
120
+            console.error("Error : Windows 8 does not support searching contacts");
121
+        }
122
+        if (fail) {
123
+            setTimeout(function() {
124
+                fail(new Error("Contact search not supported on Windows 8"));
125
+            }, 0);
126
+        }
127
+    }
128
+};
129
+
130
+require("cordova/exec/proxy").add("Contacts", module.exports);

+ 73
- 0
km0App/node_modules/cordova-plugin-contacts/src/wp/ContactPicker.xaml Parādīt failu

@@ -0,0 +1,73 @@
1
+<!--
2
+  Licensed to the Apache Software Foundation (ASF) under one
3
+  or more contributor license agreements.  See the NOTICE file
4
+  distributed with this work for additional information
5
+  regarding copyright ownership.  The ASF licenses this file
6
+  to you under the Apache License, Version 2.0 (the
7
+  "License"); you may not use this file except in compliance
8
+  with the License.  You may obtain a copy of the License at
9
+
10
+  http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+  Unless required by applicable law or agreed to in writing, software
13
+  distributed under the License is distributed on an "AS IS" BASIS,
14
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+  See the License for the specific language governing permissions and
16
+  limitations under the License.
17
+-->
18
+
19
+<phone:PhoneApplicationPage
20
+    x:Class="WPCordovaClassLib.Cordova.Commands.ContactPicker"
21
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
23
+    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
24
+    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
25
+    FontFamily="{StaticResource PhoneFontFamilyNormal}"
26
+    FontSize="{StaticResource PhoneFontSizeLarge}"
27
+    Foreground="{StaticResource PhoneForegroundBrush}"
28
+    SupportedOrientations="Portrait" Orientation="Portrait"
29
+    shell:SystemTray.IsVisible="False">
30
+
31
+    <Grid x:Name="ContentRoot" Background="Transparent">
32
+        
33
+        <Grid.RowDefinitions>
34
+            <RowDefinition Height="Auto"></RowDefinition>
35
+            <RowDefinition Height="*"></RowDefinition>
36
+        </Grid.RowDefinitions>
37
+
38
+        <TextBlock Name="HeaderBlock"
39
+                   Text="CHOOSE A CONTACT" 
40
+                   Margin="20,50,0,50" 
41
+                   FontSize="{StaticResource PhoneFontSizeMedium}"
42
+                   FontFamily="{StaticResource PhoneFontFamilySemiBold}"
43
+                   Grid.Row="0"
44
+                   />
45
+
46
+        <TextBlock Name="NoContactsBlock"
47
+                   Margin="20,0,0,0" 
48
+                   Text="Sorry, we couldn't find any contacts."
49
+                   TextWrapping="Wrap"
50
+                   FontSize="{StaticResource PhoneFontSizeLarge}"
51
+                   FontFamily="{StaticResource PhoneFontFamilyLight}"
52
+                   Visibility="Collapsed"
53
+                   Grid.Row="1"
54
+                   />
55
+        
56
+        <phone:LongListSelector Name="lstContacts"
57
+                                SelectionChanged="ContactsListSelectionChanged"
58
+                                Grid.Row="1">
59
+            <phone:LongListSelector.ItemTemplate>
60
+                <DataTemplate>
61
+                    <StackPanel Orientation="Horizontal" Margin="16,0,0,0">
62
+                        <StackPanel Margin="0,20,0,10">
63
+                            <TextBlock Text="{Binding DisplayName}"
64
+                                       TextWrapping="Wrap"
65
+                                       Style="{StaticResource PhoneTextExtraLargeStyle}" />
66
+                        </StackPanel>
67
+                    </StackPanel>
68
+                </DataTemplate>
69
+            </phone:LongListSelector.ItemTemplate>
70
+        </phone:LongListSelector>
71
+        
72
+    </Grid>
73
+</phone:PhoneApplicationPage>

+ 125
- 0
km0App/node_modules/cordova-plugin-contacts/src/wp/ContactPicker.xaml.cs Parādīt failu

@@ -0,0 +1,125 @@
1
+/*
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+        http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+*/
19
+
20
+namespace WPCordovaClassLib.Cordova.Commands
21
+{
22
+    using System;
23
+    using System.Linq;
24
+    using System.Windows;
25
+    using System.Windows.Controls;
26
+    using System.Windows.Navigation;
27
+    using Microsoft.Phone.Tasks;
28
+    using Microsoft.Phone.UserData;
29
+    using DeviceContacts = Microsoft.Phone.UserData.Contacts;
30
+
31
+    /// <summary>
32
+    /// Custom implemented class for picking single contact
33
+    /// </summary>
34
+    public partial class ContactPicker
35
+    {
36
+        #region Fields
37
+
38
+        /// <summary>
39
+        /// Result of ContactPicker call, represent contact returned.
40
+        /// </summary>
41
+        private ContactPickerTask.PickResult result;
42
+
43
+        #endregion
44
+
45
+        #region Constructors
46
+
47
+        /// <summary>
48
+        /// Initializes a new instance of the <see cref="ContactPicker"/> class. 
49
+        /// </summary>
50
+        public ContactPicker()
51
+        {
52
+            InitializeComponent();
53
+            var cons = new DeviceContacts();
54
+            cons.SearchCompleted += this.OnSearchCompleted;
55
+            cons.SearchAsync(string.Empty, FilterKind.None, string.Empty);
56
+        }
57
+
58
+        #endregion
59
+
60
+        #region Callbacks
61
+
62
+        /// <summary>
63
+        /// Occurs when contact is selected or pick operation cancelled.
64
+        /// </summary>
65
+        public event EventHandler<ContactPickerTask.PickResult> Completed;
66
+
67
+        #endregion
68
+
69
+        /// <summary>
70
+        /// The on navigated from.
71
+        /// </summary>
72
+        /// <param name="e">
73
+        /// The e.
74
+        /// </param>
75
+        protected override void OnNavigatedFrom(NavigationEventArgs e)
76
+        {
77
+            if (this.result == null)
78
+            {
79
+                this.Completed(this, new ContactPickerTask.PickResult(TaskResult.Cancel));
80
+            }
81
+
82
+            base.OnNavigatedFrom(e);
83
+        }
84
+
85
+        /// <summary>
86
+        /// Called when contacts retrieval completed.
87
+        /// </summary>
88
+        /// <param name="sender">The sender.</param>
89
+        /// <param name="e">The <see cref="ContactsSearchEventArgs"/> instance containing the event data.</param>
90
+        private void OnSearchCompleted(object sender, ContactsSearchEventArgs e)
91
+        {
92
+            if (e.Results.Count() != 0)
93
+            {
94
+                lstContacts.ItemsSource = e.Results.ToList();
95
+                lstContacts.Visibility = Visibility.Visible;
96
+                NoContactsBlock.Visibility = Visibility.Collapsed;
97
+            }
98
+            else
99
+            {
100
+                lstContacts.Visibility = Visibility.Collapsed;
101
+                NoContactsBlock.Visibility = Visibility.Visible;
102
+            }
103
+        }
104
+
105
+        /// <summary>
106
+        /// Called when any contact is selected.
107
+        /// </summary>
108
+        /// <param name="sender">
109
+        /// The sender.
110
+        /// </param>
111
+        /// <param name="e">
112
+        /// The e.
113
+        /// </param>
114
+        private void ContactsListSelectionChanged(object sender, SelectionChangedEventArgs e)
115
+        {
116
+            this.result = new ContactPickerTask.PickResult(TaskResult.OK) { Contact = e.AddedItems[0] as Contact };
117
+            this.Completed(this, this.result);
118
+
119
+            if (NavigationService.CanGoBack)
120
+            {
121
+                NavigationService.GoBack();
122
+            }
123
+        }
124
+    }
125
+}

+ 122
- 0
km0App/node_modules/cordova-plugin-contacts/src/wp/ContactPickerTask.cs Parādīt failu

@@ -0,0 +1,122 @@
1
+/*
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+        http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+*/
19
+
20
+namespace WPCordovaClassLib.Cordova.Commands
21
+{
22
+    using System;
23
+    using System.Windows;
24
+    using Microsoft.Phone.Controls;
25
+    using Microsoft.Phone.Tasks;
26
+    using Microsoft.Phone.UserData;
27
+
28
+    /// <summary>
29
+    /// Allows an application to pick contact. 
30
+    /// Use this to allow users to pick contact from your application.
31
+    /// </summary>
32
+    public class ContactPickerTask
33
+    {
34
+        /// <summary>
35
+        /// Occurs when a Pick task is completed.
36
+        /// </summary>
37
+        public event EventHandler<PickResult> Completed;
38
+
39
+        /// <summary>
40
+        /// Shows Contact pick application
41
+        /// </summary>
42
+        public void Show()
43
+        {
44
+            Deployment.Current.Dispatcher.BeginInvoke(() =>
45
+            {
46
+                var root = Application.Current.RootVisual as PhoneApplicationFrame;
47
+
48
+                string baseUrl = "/";
49
+
50
+                if (root != null)
51
+                {
52
+                    root.Navigated += this.OnNavigate;
53
+
54
+                    // dummy parameter is used to always open a fresh version
55
+                    root.Navigate(
56
+                        new Uri(
57
+                            baseUrl + "Plugins/cordova-plugin-contacts/ContactPicker.xaml?dummy="
58
+                            + Guid.NewGuid(),
59
+                            UriKind.Relative));
60
+                }
61
+            });
62
+        }
63
+
64
+        /// <summary>
65
+        /// Performs additional configuration of the picker application.
66
+        /// </summary>
67
+        /// <param name="sender">The source of the event.</param>
68
+        /// <param name="e">The <see cref="System.Windows.Navigation.NavigationEventArgs"/> instance containing the event data.</param>
69
+        private void OnNavigate(object sender, System.Windows.Navigation.NavigationEventArgs e)
70
+        {
71
+            if (!(e.Content is ContactPicker))
72
+            {
73
+                return;
74
+            }
75
+
76
+            var phoneApplicationFrame = Application.Current.RootVisual as PhoneApplicationFrame;
77
+            if (phoneApplicationFrame != null)
78
+            {
79
+                phoneApplicationFrame.Navigated -= this.OnNavigate;
80
+            }
81
+
82
+            ContactPicker contactPicker = (ContactPicker)e.Content;
83
+
84
+            if (contactPicker != null)
85
+            {
86
+                contactPicker.Completed += this.Completed;
87
+            }
88
+            else if (this.Completed != null)
89
+            {
90
+                this.Completed(this, new PickResult(TaskResult.Cancel));
91
+            }
92
+        }
93
+
94
+        /// <summary>
95
+        /// Represents contact returned
96
+        /// </summary>
97
+        public class PickResult : TaskEventArgs
98
+        {
99
+            /// <summary>
100
+            /// Initializes a new instance of the PickResult class.
101
+            /// </summary>
102
+            public PickResult()
103
+            {
104
+            }
105
+
106
+            /// <summary>
107
+            /// Initializes a new instance of the PickResult class
108
+            /// with the specified Microsoft.Phone.Tasks.TaskResult.
109
+            /// </summary>
110
+            /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
111
+            public PickResult(TaskResult taskResult)
112
+                : base(taskResult)
113
+            {
114
+            }
115
+
116
+            /// <summary>
117
+            ///  Gets the contact.
118
+            /// </summary>
119
+            public Contact Contact { get; internal set; }
120
+        }
121
+    }
122
+}

+ 592
- 0
km0App/node_modules/cordova-plugin-contacts/src/wp/Contacts.cs Parādīt failu

@@ -0,0 +1,592 @@
1
+/*
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+        http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+*/
19
+
20
+using Microsoft.Phone.Tasks;
21
+using Microsoft.Phone.UserData;
22
+using System;
23
+using System.Collections.Generic;
24
+using System.Diagnostics;
25
+using System.Globalization;
26
+using System.Linq;
27
+using System.Runtime.Serialization;
28
+using System.Windows;
29
+using DeviceContacts = Microsoft.Phone.UserData.Contacts;
30
+
31
+
32
+namespace WPCordovaClassLib.Cordova.Commands
33
+{
34
+    [DataContract]
35
+    public class SearchOptions
36
+    {
37
+        [DataMember]
38
+        public string filter { get; set; }
39
+
40
+        [DataMember]
41
+        public bool multiple { get; set; }
42
+
43
+        [DataMember]
44
+        public string[] desiredFields { get; set; }
45
+    }
46
+
47
+    [DataContract]
48
+    public class ContactSearchParams
49
+    {
50
+        [DataMember]
51
+        public string[] fields { get; set; }
52
+
53
+        [DataMember]
54
+        public SearchOptions options { get; set; }
55
+    }
56
+
57
+    [DataContract]
58
+    public class JSONContactAddress
59
+    {
60
+        [DataMember]
61
+        public string formatted { get; set; }
62
+
63
+        [DataMember]
64
+        public string type { get; set; }
65
+
66
+        [DataMember]
67
+        public string streetAddress { get; set; }
68
+
69
+        [DataMember]
70
+        public string locality { get; set; }
71
+
72
+        [DataMember]
73
+        public string region { get; set; }
74
+
75
+        [DataMember]
76
+        public string postalCode { get; set; }
77
+
78
+        [DataMember]
79
+        public string country { get; set; }
80
+
81
+        [DataMember]
82
+        public bool pref { get; set; }
83
+    }
84
+
85
+    [DataContract]
86
+    public class JSONContactName
87
+    {
88
+        [DataMember]
89
+        public string formatted { get; set; }
90
+
91
+        [DataMember]
92
+        public string familyName { get; set; }
93
+
94
+        [DataMember]
95
+        public string givenName { get; set; }
96
+
97
+        [DataMember]
98
+        public string middleName { get; set; }
99
+
100
+        [DataMember]
101
+        public string honorificPrefix { get; set; }
102
+
103
+        [DataMember]
104
+        public string honorificSuffix { get; set; }
105
+    }
106
+
107
+    [DataContract]
108
+    public class JSONContactField
109
+    {
110
+        [DataMember]
111
+        public string type { get; set; }
112
+
113
+        [DataMember]
114
+        public string value { get; set; }
115
+
116
+        [DataMember]
117
+        public bool pref { get; set; }
118
+    }
119
+
120
+    [DataContract]
121
+    public class JSONContactOrganization
122
+    {
123
+        [DataMember]
124
+        public string type { get; set; }
125
+
126
+        [DataMember]
127
+        public string name { get; set; }
128
+
129
+        [DataMember]
130
+        public bool pref { get; set; }
131
+
132
+        [DataMember]
133
+        public string department { get; set; }
134
+
135
+        [DataMember]
136
+        public string title { get; set; }
137
+    }
138
+
139
+    [DataContract]
140
+    public class JSONContact
141
+    {
142
+        [DataMember]
143
+        public string id { get; set; }
144
+
145
+        [DataMember]
146
+        public string rawId { get; set; }
147
+
148
+        [DataMember]
149
+        public string displayName { get; set; }
150
+
151
+        [DataMember]
152
+        public string nickname { get; set; }
153
+
154
+        [DataMember]
155
+        public string note { get; set; }
156
+
157
+        [DataMember]
158
+        public JSONContactName name { get; set; }
159
+
160
+        [DataMember]
161
+        public JSONContactField[] emails { get; set; }
162
+
163
+        [DataMember]
164
+        public JSONContactField[] phoneNumbers { get; set; }
165
+
166
+        [DataMember]
167
+        public JSONContactField[] ims { get; set; }
168
+
169
+        [DataMember]
170
+        public JSONContactField[] photos { get; set; }
171
+
172
+        [DataMember]
173
+        public JSONContactField[] categories { get; set; }
174
+
175
+        [DataMember]
176
+        public JSONContactField[] urls { get; set; }
177
+
178
+        [DataMember]
179
+        public JSONContactOrganization[] organizations { get; set; }
180
+
181
+        [DataMember]
182
+        public JSONContactAddress[] addresses { get; set; }
183
+    }
184
+
185
+
186
+    public class Contacts : BaseCommand
187
+    {
188
+        public const int UNKNOWN_ERROR = 0;
189
+        public const int INVALID_ARGUMENT_ERROR = 1;
190
+        public const int TIMEOUT_ERROR = 2;
191
+        public const int PENDING_OPERATION_ERROR = 3;
192
+        public const int IO_ERROR = 4;
193
+        public const int NOT_SUPPORTED_ERROR = 5;
194
+        public const int PERMISSION_DENIED_ERROR = 20;
195
+        public const int SYNTAX_ERR = 8;
196
+
197
+        // 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
198
+        public void save(string jsonContact)
199
+        {
200
+            // jsonContact is actually an array of 1 {contact}
201
+            string[] args = JSON.JsonHelper.Deserialize<string[]>(jsonContact);
202
+
203
+
204
+            JSONContact contact = JSON.JsonHelper.Deserialize<JSONContact>(args[0]);
205
+
206
+            SaveContactTask contactTask = new SaveContactTask();
207
+
208
+            if (contact.nickname != null)
209
+            {
210
+                contactTask.Nickname = contact.nickname;
211
+            }
212
+            if (contact.urls != null && contact.urls.Length > 0)
213
+            {
214
+                contactTask.Website = contact.urls[0].value;
215
+            }
216
+            if (contact.note != null)
217
+            {
218
+                contactTask.Notes = contact.note;
219
+            }
220
+
221
+            #region contact.name
222
+
223
+            if (contact.name != null)
224
+            {
225
+                if (contact.name.givenName != null)
226
+                    contactTask.FirstName = contact.name.givenName;
227
+                if (contact.name.familyName != null)
228
+                    contactTask.LastName = contact.name.familyName;
229
+                if (contact.name.middleName != null)
230
+                    contactTask.MiddleName = contact.name.middleName;
231
+                if (contact.name.honorificSuffix != null)
232
+                    contactTask.Suffix = contact.name.honorificSuffix;
233
+                if (contact.name.honorificPrefix != null)
234
+                    contactTask.Title = contact.name.honorificPrefix;
235
+            }
236
+
237
+            #endregion
238
+
239
+            #region contact.org
240
+
241
+            if (contact.organizations != null && contact.organizations.Count() > 0)
242
+            {
243
+                contactTask.Company = contact.organizations[0].name;
244
+                contactTask.JobTitle = contact.organizations[0].title;
245
+            }
246
+
247
+            #endregion
248
+
249
+            #region contact.phoneNumbers
250
+
251
+            if (contact.phoneNumbers != null && contact.phoneNumbers.Length > 0)
252
+            {
253
+                foreach (JSONContactField field in contact.phoneNumbers)
254
+                {
255
+                    string fieldType = field.type.ToLower();
256
+                    if (fieldType == "work")
257
+                    {
258
+                        contactTask.WorkPhone = field.value;
259
+                    }
260
+                    else if (fieldType == "home")
261
+                    {
262
+                        contactTask.HomePhone = field.value;
263
+                    }
264
+                    else if (fieldType == "mobile")
265
+                    {
266
+                        contactTask.MobilePhone = field.value;
267
+                    }
268
+                }
269
+            }
270
+
271
+            #endregion
272
+
273
+            #region contact.emails
274
+
275
+            if (contact.emails != null && contact.emails.Length > 0)
276
+            {
277
+                // set up different email types if they are not explicitly defined
278
+                foreach (string type in new[] {"personal", "work", "other"})
279
+                {
280
+                    foreach (JSONContactField field in contact.emails)
281
+                    {
282
+                        if (field != null && String.IsNullOrEmpty(field.type))
283
+                        {
284
+                            field.type = type;
285
+                            break;
286
+                        }
287
+                    }
288
+                }
289
+
290
+                foreach (JSONContactField field in contact.emails)
291
+                {
292
+                    if (field != null)
293
+                    {
294
+                        if (field.type != null && field.type != "other")
295
+                        {
296
+                            string fieldType = field.type.ToLower();
297
+                            if (fieldType == "work")
298
+                            {
299
+                                contactTask.WorkEmail = field.value;
300
+                            }
301
+                            else if (fieldType == "home" || fieldType == "personal")
302
+                            {
303
+                                contactTask.PersonalEmail = field.value;
304
+                            }
305
+                        }
306
+                        else
307
+                        {
308
+                            contactTask.OtherEmail = field.value;
309
+                        }
310
+                    }
311
+                }
312
+            }
313
+
314
+            #endregion
315
+
316
+            if (contact.note != null && contact.note.Length > 0)
317
+            {
318
+                contactTask.Notes = contact.note;
319
+            }
320
+
321
+            #region contact.addresses
322
+
323
+            if (contact.addresses != null && contact.addresses.Length > 0)
324
+            {
325
+                foreach (JSONContactAddress address in contact.addresses)
326
+                {
327
+                    if (address.type == null)
328
+                    {
329
+                        address.type = "home"; // set a default
330
+                    }
331
+                    string fieldType = address.type.ToLower();
332
+                    if (fieldType == "work")
333
+                    {
334
+                        contactTask.WorkAddressCity = address.locality;
335
+                        contactTask.WorkAddressCountry = address.country;
336
+                        contactTask.WorkAddressState = address.region;
337
+                        contactTask.WorkAddressStreet = address.streetAddress;
338
+                        contactTask.WorkAddressZipCode = address.postalCode;
339
+                    }
340
+                    else if (fieldType == "home" || fieldType == "personal")
341
+                    {
342
+                        contactTask.HomeAddressCity = address.locality;
343
+                        contactTask.HomeAddressCountry = address.country;
344
+                        contactTask.HomeAddressState = address.region;
345
+                        contactTask.HomeAddressStreet = address.streetAddress;
346
+                        contactTask.HomeAddressZipCode = address.postalCode;
347
+                    }
348
+                    else
349
+                    {
350
+                        // no other address fields available ...
351
+                        Debug.WriteLine("Creating contact with unsupported address type :: " + address.type);
352
+                    }
353
+                }
354
+            }
355
+
356
+            #endregion
357
+
358
+            contactTask.Completed += ContactSaveTaskCompleted;
359
+            contactTask.Show();
360
+        }
361
+
362
+        private void ContactSaveTaskCompleted(object sender, SaveContactResult e)
363
+        {
364
+            SaveContactTask task = sender as SaveContactTask;
365
+
366
+            if (e.TaskResult == TaskResult.OK)
367
+            {
368
+                Deployment.Current.Dispatcher.BeginInvoke(() =>
369
+                    {
370
+                        var deviceContacts = new DeviceContacts();
371
+                        deviceContacts.SearchCompleted +=
372
+                            postAdd_SearchCompleted;
373
+
374
+                        if (task != null)
375
+                        {
376
+                            string displayName = String.Format("{0}{2}{1}", task.FirstName, task.LastName,
377
+                                                               String.IsNullOrEmpty(task.FirstName) ? "" : " ");
378
+
379
+                            deviceContacts.SearchAsync(displayName, FilterKind.DisplayName, task);
380
+                        }
381
+                    });
382
+            }
383
+            else if (e.TaskResult == TaskResult.Cancel)
384
+            {
385
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Operation cancelled."));
386
+            }
387
+        }
388
+
389
+        private void postAdd_SearchCompleted(object sender, ContactsSearchEventArgs e)
390
+        {
391
+            if (e.Results.Any())
392
+            {
393
+                new List<Contact>();
394
+
395
+                int n = (from Contact contact in e.Results select contact.GetHashCode()).Max();
396
+                Contact newContact = (from Contact contact in e.Results
397
+                                      where contact.GetHashCode() == n
398
+                                      select contact).First();
399
+
400
+                DispatchCommandResult(new PluginResult(PluginResult.Status.OK, newContact.ToJson(null)));
401
+            }
402
+            else
403
+            {
404
+                DispatchCommandResult(new PluginResult(PluginResult.Status.NO_RESULT));
405
+            }
406
+        }
407
+
408
+
409
+        public void remove(string id)
410
+        {
411
+            // note id is wrapped in [] and always has exactly one string ...
412
+            DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "{\"code\":" + NOT_SUPPORTED_ERROR + "}"));
413
+        }
414
+
415
+        public void pickContact(string arguments)
416
+        {
417
+            string[] args = JSON.JsonHelper.Deserialize<string[]>(arguments);
418
+
419
+            // Use custom contact picker because WP8 api doesn't provide its' own
420
+            // contact picker, only PhoneNumberChooser or EmailAddressChooserTask 
421
+            var task = new ContactPickerTask();
422
+            var desiredFields = JSON.JsonHelper.Deserialize<string[]>(args[0]);
423
+
424
+            task.Completed += delegate(Object sender, ContactPickerTask.PickResult e)
425
+                {
426
+                    if (e.TaskResult == TaskResult.OK)
427
+                    {
428
+                        string strResult = e.Contact.ToJson(desiredFields);
429
+                        var result = new PluginResult(PluginResult.Status.OK)
430
+                            {
431
+                                Message = strResult
432
+                            };
433
+                        DispatchCommandResult(result);
434
+                    }
435
+                    if (e.TaskResult == TaskResult.Cancel)
436
+                    {
437
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Operation cancelled."));
438
+                    }
439
+                };
440
+
441
+            task.Show();
442
+        }
443
+
444
+        public void search(string searchCriteria)
445
+        {
446
+            string[] args = JSON.JsonHelper.Deserialize<string[]>(searchCriteria);
447
+
448
+            ContactSearchParams searchParams = new ContactSearchParams();
449
+            try
450
+            {
451
+                searchParams.fields = JSON.JsonHelper.Deserialize<string[]>(args[0]);
452
+                searchParams.options = JSON.JsonHelper.Deserialize<SearchOptions>(args[1]);
453
+            }
454
+            catch (Exception)
455
+            {
456
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, INVALID_ARGUMENT_ERROR));
457
+                return;
458
+            }
459
+
460
+            if (searchParams.options == null)
461
+            {
462
+                searchParams.options = new SearchOptions();
463
+                searchParams.options.filter = "";
464
+                searchParams.options.multiple = true;
465
+            }
466
+            else if (searchParams.options.filter == null)
467
+            {
468
+                searchParams.options.filter = "";
469
+            }
470
+
471
+            DeviceContacts deviceContacts = new DeviceContacts();
472
+            deviceContacts.SearchCompleted += contacts_SearchCompleted;
473
+
474
+            // default is to search all fields
475
+            FilterKind filterKind = FilterKind.None;
476
+            // if only one field is specified, we will try the 3 available DeviceContact search filters
477
+            if (searchParams.fields.Count() == 1)
478
+            {
479
+                if (searchParams.fields.Contains("name"))
480
+                {
481
+                    filterKind = FilterKind.DisplayName;
482
+                }
483
+                else if (searchParams.fields.Contains("emails"))
484
+                {
485
+                    filterKind = FilterKind.EmailAddress;
486
+                }
487
+                else if (searchParams.fields.Contains("phoneNumbers"))
488
+                {
489
+                    filterKind = FilterKind.PhoneNumber;
490
+                }
491
+            }
492
+
493
+            try
494
+            {
495
+                deviceContacts.SearchAsync(searchParams.options.filter, filterKind, searchParams);
496
+            }
497
+            catch (Exception ex)
498
+            {
499
+                Debug.WriteLine("search contacts exception :: " + ex.Message);
500
+            }
501
+        }
502
+
503
+        private void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
504
+        {
505
+            var searchParams = (ContactSearchParams) e.State;
506
+
507
+            List<Contact> foundContacts = null;
508
+            // used for comparing strings, ""  instantiates with InvariantCulture
509
+            CultureInfo culture = new CultureInfo("");
510
+            // make the search comparisons case insensitive.
511
+            CompareOptions compare_option = CompareOptions.IgnoreCase;
512
+
513
+            // if we have multiple search fields
514
+
515
+            if (!String.IsNullOrEmpty(searchParams.options.filter) && searchParams.fields.Count() > 1)
516
+            {
517
+                foundContacts = new List<Contact>();
518
+                if (searchParams.fields.Contains("emails"))
519
+                {
520
+                    foundContacts.AddRange(from Contact con in e.Results
521
+                                           from ContactEmailAddress a in con.EmailAddresses
522
+                                           where
523
+                                               culture.CompareInfo.IndexOf(a.EmailAddress, searchParams.options.filter,
524
+                                                                           compare_option) >= 0
525
+                                           select con);
526
+                }
527
+                if (searchParams.fields.Contains("displayName"))
528
+                {
529
+                    foundContacts.AddRange(from Contact con in e.Results
530
+                                           where
531
+                                               culture.CompareInfo.IndexOf(con.DisplayName, searchParams.options.filter,
532
+                                                                           compare_option) >= 0
533
+                                           select con);
534
+                }
535
+                if (searchParams.fields.Contains("name"))
536
+                {
537
+                    foundContacts.AddRange(
538
+                        from Contact con in e.Results
539
+                        where con.CompleteName != null && (
540
+                            (con.CompleteName.FirstName != null     && culture.CompareInfo.IndexOf(con.CompleteName.FirstName, searchParams.options.filter, compare_option) >= 0) ||
541
+                            (con.CompleteName.LastName != null      && culture.CompareInfo.IndexOf(con.CompleteName.LastName, searchParams.options.filter, compare_option) >= 0) ||
542
+                            (con.CompleteName.MiddleName != null    && culture.CompareInfo.IndexOf(con.CompleteName.MiddleName, searchParams.options.filter, compare_option) >= 0) ||
543
+                            (con.CompleteName.Nickname != null      && culture.CompareInfo.IndexOf(con.CompleteName.Nickname, searchParams.options.filter, compare_option) >= 0) ||
544
+                            (con.CompleteName.Suffix != null        && culture.CompareInfo.IndexOf(con.CompleteName.Suffix, searchParams.options.filter, compare_option) >= 0) ||
545
+                            (con.CompleteName.Title != null         && culture.CompareInfo.IndexOf(con.CompleteName.Title, searchParams.options.filter, compare_option) >= 0) ||
546
+                            (con.CompleteName.YomiFirstName != null && culture.CompareInfo.IndexOf(con.CompleteName.YomiFirstName, searchParams.options.filter, compare_option) >= 0) ||
547
+                            (con.CompleteName.YomiLastName != null  && culture.CompareInfo.IndexOf(con.CompleteName.YomiLastName, searchParams.options.filter, compare_option) >= 0))
548
+                        select con);
549
+                }
550
+                if (searchParams.fields.Contains("phoneNumbers"))
551
+                {
552
+                    foundContacts.AddRange(from Contact con in e.Results
553
+                                           from ContactPhoneNumber a in con.PhoneNumbers
554
+                                           where
555
+                                               culture.CompareInfo.IndexOf(a.PhoneNumber, searchParams.options.filter,
556
+                                                                           compare_option) >= 0
557
+                                           select con);
558
+                }
559
+                if (searchParams.fields.Contains("urls"))
560
+                {
561
+                    foundContacts.AddRange(from Contact con in e.Results
562
+                                           from string a in con.Websites
563
+                                           where
564
+                                               culture.CompareInfo.IndexOf(a, searchParams.options.filter,
565
+                                                                           compare_option) >= 0
566
+                                           select con);
567
+                }
568
+            }
569
+            else
570
+            {
571
+                foundContacts = new List<Contact>(e.Results);
572
+            }
573
+
574
+            string strResult = "";
575
+
576
+            IEnumerable<Contact> distinctContacts = foundContacts.Distinct();
577
+
578
+            foreach (Contact contact in distinctContacts)
579
+            {
580
+                strResult += contact.ToJson(searchParams.options.desiredFields) + ",";
581
+
582
+                if (!searchParams.options.multiple)
583
+                {
584
+                    break; // just return the first item
585
+                }
586
+            }
587
+            PluginResult result = new PluginResult(PluginResult.Status.OK);
588
+            result.Message = "[" + strResult.TrimEnd(',') + "]";
589
+            DispatchCommandResult(result);
590
+        }
591
+    }
592
+}

+ 335
- 0
km0App/node_modules/cordova-plugin-contacts/src/wp/ContactsHelper.cs Parādīt failu

@@ -0,0 +1,335 @@
1
+/*
2
+    Licensed to the Apache Software Foundation (ASF) under one
3
+    or more contributor license agreements.  See the NOTICE file
4
+    distributed with this work for additional information
5
+    regarding copyright ownership.  The ASF licenses this file
6
+    to you under the Apache License, Version 2.0 (the
7
+    "License"); you may not use this file except in compliance
8
+    with the License.  You may obtain a copy of the License at
9
+
10
+        http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+    Unless required by applicable law or agreed to in writing,
13
+    software distributed under the License is distributed on an
14
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+    KIND, either express or implied.  See the License for the
16
+    specific language governing permissions and limitations
17
+    under the License.
18
+*/
19
+
20
+namespace WPCordovaClassLib.Cordova.Commands
21
+{
22
+    using System;
23
+    using System.Collections.Generic;
24
+    using System.Linq;
25
+    using System.Text;
26
+    using Microsoft.Phone.UserData;
27
+    using System.IO;
28
+
29
+    /// <summary>
30
+    /// Implements helper functionality to serialize contact to JSON string.
31
+    /// </summary>
32
+    internal static class ContactsHelper
33
+    {
34
+        /// <summary>
35
+        /// Converts Contact object to string representation
36
+        /// </summary>
37
+        /// <param name="contact">Contact object</param>
38
+        /// <param name="desiredFields">array of fields names</param>
39
+        /// <returns>JSON string</returns>
40
+        public static string ToJson(this Contact contact, string[] desiredFields)
41
+        {
42
+            var contactFieldsWithJsonVals = contact.PopulateContactDictionary();
43
+
44
+            // if desiredFields are not defined, use all avilable fields
45
+            if (desiredFields == null || desiredFields.Length == 0)
46
+            {
47
+                desiredFields = contactFieldsWithJsonVals.Keys.ToArray();
48
+            }
49
+
50
+            return FillResultWithFields(desiredFields, contactFieldsWithJsonVals);
51
+        }
52
+
53
+        /// <summary>
54
+        /// Returns JSON string with desired fields only.
55
+        /// </summary>
56
+        /// <param name="desiredFields">The desired fields.</param>
57
+        /// <param name="contactFieldsWithJsonVals">The contact fields with JSON values.</param>
58
+        /// <returns>JSON string</returns>
59
+        private static string FillResultWithFields(string[] desiredFields, Dictionary<string, Func<string>> contactFieldsWithJsonVals)
60
+        {
61
+            var result = new StringBuilder();
62
+            for (int i = 0; i < desiredFields.Count(); i++)
63
+            {
64
+                if (!contactFieldsWithJsonVals.ContainsKey(desiredFields[i]))
65
+                {
66
+                    continue;
67
+                }
68
+
69
+                result.Append(contactFieldsWithJsonVals[desiredFields[i]]());
70
+                if (i != desiredFields.Count() - 1)
71
+                {
72
+                    result.Append(",");
73
+                }
74
+            }
75
+
76
+            return "{" + result + "}";
77
+        }
78
+
79
+        /// <summary>
80
+        /// Populates the contact dictionary.
81
+        /// </summary>
82
+        /// <param name="contact">Contact, that converted to JSON</param>
83
+        /// <returns>JSON string with populated data</returns>
84
+        private static Dictionary<string, Func<string>> PopulateContactDictionary(this Contact contact)
85
+        {
86
+            var contactFieldsJsonValsDictionary = new Dictionary<string, Func<string>>(StringComparer.InvariantCultureIgnoreCase)
87
+                {
88
+                    { "id", () => string.Format("\"id\":\"{0}\"", contact.GetHashCode()) },
89
+                    { "displayName", () => string.Format("\"displayName\":\"{0}\"", EscapeJson(contact.DisplayName)) },
90
+                    {
91
+                        "nickname",
92
+                        () =>
93
+                        string.Format(
94
+                            "\"nickname\":\"{0}\"",
95
+                            EscapeJson(contact.CompleteName != null ? contact.CompleteName.Nickname : string.Empty))
96
+                    },
97
+                    { "phoneNumbers", () => string.Format("\"phoneNumbers\":[{0}]", FormatJsonPhoneNumbers(contact)) },
98
+                    { "emails", () => string.Format("\"emails\":[{0}]", FormatJsonEmails(contact)) },
99
+                    { "addresses", () => string.Format("\"addresses\":[{0}]", FormatJsonAddresses(contact)) },
100
+                    { "urls", () => string.Format("\"urls\":[{0}]", FormatJsonWebsites(contact)) },
101
+                    { "photos", () => string.Format("\"photos\":[{0}]", FormatJsonPhotos(contact)) },
102
+                    { "name", () => string.Format("\"name\":{0}", FormatJsonName(contact)) },
103
+                    { "note", () => string.Format("\"note\":\"{0}\"", EscapeJson(contact.Notes.FirstOrDefault())) },
104
+                    {
105
+                        "birthday",
106
+                        () =>
107
+                        string.Format(
108
+                            "\"birthday\":\"{0}\"",
109
+                            EscapeJson(Convert.ToString(contact.Birthdays.FirstOrDefault())))
110
+                    }
111
+                };
112
+            return contactFieldsJsonValsDictionary;
113
+        }
114
+
115
+        /// <summary>
116
+        /// Add escape characters to the JSON string.
117
+        /// </summary>
118
+        /// <param name="str">Input JSON formatted string</param>
119
+        /// <returns>Escaped JSON string</returns>
120
+        private static string EscapeJson(string str)
121
+        {
122
+            if (string.IsNullOrEmpty(str))
123
+            {
124
+                return str;
125
+            }
126
+
127
+            return str.Replace("\n", "\\n")
128
+                      .Replace("\r", "\\r")
129
+                      .Replace("\t", "\\t")
130
+                      .Replace("\"", "\\\"")
131
+                      .Replace("&", "\\&");
132
+        }
133
+
134
+        /// <summary>
135
+        /// Formats phone numbers to JSON string.
136
+        /// </summary>
137
+        /// <param name="con">Contact object</param>
138
+        /// <returns>JSON string</returns>
139
+        private static string FormatJsonPhoneNumbers(Contact con)
140
+        {
141
+            string retVal = string.Empty;
142
+            const string ContactFieldFormat = "\"type\":\"{0}\",\"value\":\"{1}\",\"pref\":\"false\"";
143
+            foreach (ContactPhoneNumber number in con.PhoneNumbers)
144
+            {
145
+                string contactField = string.Format(ContactFieldFormat, number.Kind.ToString(), number.PhoneNumber);
146
+                retVal += "{" + contactField + "},";
147
+            }
148
+
149
+            return retVal.TrimEnd(',');
150
+        }
151
+
152
+        /*
153
+         *  formatted: The complete name of the contact. (DOMString)
154
+            familyName: The contacts family name. (DOMString)
155
+            givenName: The contacts given name. (DOMString)
156
+            middleName: The contacts middle name. (DOMString)
157
+            honorificPrefix: The contacts prefix (example Mr. or Dr.) (DOMString)
158
+            honorificSuffix: The contacts suffix (example Esq.). (DOMString)
159
+         */
160
+
161
+        /// <summary>
162
+        /// Formats the name to JSON string.
163
+        /// </summary>
164
+        /// <param name="con">Contact object</param>
165
+        /// <returns>JSON string</returns>
166
+        private static string FormatJsonName(Contact con)
167
+        {
168
+            string retVal;
169
+            const string FormatStr = "\"formatted\":\"{0}\"," +
170
+                               "\"familyName\":\"{1}\"," +
171
+                               "\"givenName\":\"{2}\"," +
172
+                               "\"middleName\":\"{3}\"," +
173
+                               "\"honorificPrefix\":\"{4}\"," +
174
+                               "\"honorificSuffix\":\"{5}\"";
175
+
176
+            if (con.CompleteName != null)
177
+            {
178
+                retVal = string.Format(
179
+                    FormatStr,
180
+                    EscapeJson(con.CompleteName.FirstName + " " + con.CompleteName.LastName),
181
+                    //// TODO: does this need suffix? middlename?
182
+                    EscapeJson(con.CompleteName.LastName),
183
+                    EscapeJson(con.CompleteName.FirstName),
184
+                    EscapeJson(con.CompleteName.MiddleName),
185
+                    EscapeJson(con.CompleteName.Title),
186
+                    EscapeJson(con.CompleteName.Suffix));
187
+            }
188
+            else
189
+            {
190
+                retVal = string.Format(FormatStr, "", "", "", "", "", "");
191
+            }
192
+
193
+            return "{" + retVal + "}";
194
+        }
195
+
196
+        /// <summary>
197
+        /// Format Emails to JSON string.
198
+        /// </summary>
199
+        /// <param name="con">Contact object</param>
200
+        /// <returns>JSON string</returns>
201
+        private static string FormatJsonEmails(Contact con)
202
+        {
203
+            string retVal = string.Empty;
204
+            const string ContactFieldFormat = "\"type\":\"{0}\",\"value\":\"{1}\",\"pref\":\"false\"";
205
+            foreach (ContactEmailAddress address in con.EmailAddresses)
206
+            {
207
+                string contactField = string.Format(
208
+                    ContactFieldFormat,
209
+                    address.Kind.ToString(),
210
+                    EscapeJson(address.EmailAddress));
211
+
212
+                retVal += "{" + contactField + "},";
213
+            }
214
+
215
+            return retVal.TrimEnd(',');
216
+        }
217
+
218
+        /// <summary>
219
+        /// Format Addresses to JSON string.
220
+        /// </summary>
221
+        /// <param name="con">Contact object</param>
222
+        /// <returns>JSON string</returns>
223
+        private static string FormatJsonAddresses(Contact con)
224
+        {
225
+            string retVal = string.Empty;
226
+            foreach (ContactAddress address in con.Addresses)
227
+            {
228
+                retVal += GetFormattedJsonAddress(address, false) + ",";
229
+            }
230
+
231
+            return retVal.TrimEnd(',');
232
+        }
233
+
234
+        /// <summary>
235
+        /// Format Websites to JSON string.
236
+        /// </summary>
237
+        /// <param name="con">Contact object</param>
238
+        /// <returns>JSON string</returns>
239
+        private static string FormatJsonWebsites(Contact con)
240
+        {
241
+            string retVal = string.Empty;
242
+            foreach (string website in con.Websites)
243
+            {
244
+                retVal += "\"" + EscapeJson(website) + "\",";
245
+            }
246
+
247
+            return retVal.TrimEnd(',');
248
+        }
249
+
250
+        /// <summary>
251
+        /// Format single address to JSON string.
252
+        /// </summary>
253
+        /// <param name="address">
254
+        /// Contact address.
255
+        /// </param>
256
+        /// <param name="isPrefered">
257
+        /// Contact is preferred?
258
+        /// </param>
259
+        /// <returns>
260
+        /// JSON string
261
+        /// </returns>
262
+        private static string GetFormattedJsonAddress(ContactAddress address, bool isPrefered)
263
+        {
264
+            const string AddressFormatString = "\"pref\":{0}," + // bool
265
+                                         "\"type\":\"{1}\"," +
266
+                                         "\"formatted\":\"{2}\"," +
267
+                                         "\"streetAddress\":\"{3}\"," +
268
+                                         "\"locality\":\"{4}\"," +
269
+                                         "\"region\":\"{5}\"," +
270
+                                         "\"postalCode\":\"{6}\"," +
271
+                                         "\"country\":\"{7}\"";
272
+
273
+            string formattedAddress = EscapeJson(address.PhysicalAddress.AddressLine1 + " "
274
+                + address.PhysicalAddress.AddressLine2 + " "
275
+                + address.PhysicalAddress.City + " "
276
+                + address.PhysicalAddress.StateProvince + " "
277
+                + address.PhysicalAddress.CountryRegion + " "
278
+                + address.PhysicalAddress.PostalCode);
279
+
280
+            string jsonAddress = string.Format(
281
+                AddressFormatString,
282
+                isPrefered ? "\"true\"" : "\"false\"",
283
+                address.Kind.ToString(),
284
+                formattedAddress,
285
+                EscapeJson(address.PhysicalAddress.AddressLine1 + " " + address.PhysicalAddress.AddressLine2),
286
+                address.PhysicalAddress.City,
287
+                address.PhysicalAddress.StateProvince,
288
+                address.PhysicalAddress.PostalCode,
289
+                address.PhysicalAddress.CountryRegion);
290
+
291
+            return "{" + jsonAddress + "}";
292
+        }
293
+
294
+        /// <summary>
295
+        /// Formats contact photos to JSON string.
296
+        /// </summary>
297
+        /// <param name="con">Contact object</param>
298
+        /// <returns>JSON string</returns>
299
+        private static string FormatJsonPhotos(Contact con) {
300
+
301
+            // we return single photo since contact object instance contains single picture only
302
+            var photoStream = con.GetPicture();
303
+ 
304
+            if (photoStream == null) {
305
+                return "";
306
+            }
307
+
308
+            return String.Format("{{value:\"{0}\", type: \"data\", pref: false}}", GetImageContent(photoStream));
309
+        }
310
+
311
+        /// <summary>
312
+        /// Returns image content in a form of base64 string
313
+        /// </summary>
314
+        /// <param name="stream">Image stream</param>
315
+        /// <returns>Base64 representation of the image</returns>
316
+        private static string GetImageContent(Stream stream)
317
+        {
318
+            byte[] imageContent = null;
319
+
320
+            try
321
+            {
322
+                int streamLength = (int)stream.Length;
323
+                imageContent = new byte[streamLength + 1];
324
+                stream.Read(imageContent, 0, streamLength);
325
+
326
+            }
327
+            finally
328
+            {
329
+                stream.Dispose();
330
+            }
331
+
332
+            return Convert.ToBase64String(imageContent);
333
+        }
334
+    }
335
+}

+ 14
- 0
km0App/node_modules/cordova-plugin-contacts/tests/package.json Parādīt failu

@@ -0,0 +1,14 @@
1
+{
2
+  "name": "cordova-plugin-contacts-tests",
3
+  "version": "2.3.1-dev",
4
+  "description": "",
5
+  "cordova": {
6
+    "id": "cordova-plugin-contacts-tests",
7
+    "platforms": []
8
+  },
9
+  "keywords": [
10
+    "ecosystem:cordova"
11
+  ],
12
+  "author": "",
13
+  "license": "Apache 2.0"
14
+}

+ 31
- 0
km0App/node_modules/cordova-plugin-contacts/tests/plugin.xml Parādīt failu

@@ -0,0 +1,31 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!--
3
+  Licensed to the Apache Software Foundation (ASF) under one
4
+  or more contributor license agreements.  See the NOTICE file
5
+  distributed with this work for additional information
6
+  regarding copyright ownership.  The ASF licenses this file
7
+  to you under the Apache License, Version 2.0 (the
8
+  "License"); you may not use this file except in compliance
9
+  with the License.  You may obtain a copy of the License at
10
+
11
+    http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+  Unless required by applicable law or agreed to in writing,
14
+  software distributed under the License is distributed on an
15
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+  KIND, either express or implied.  See the License for the
17
+  specific language governing permissions and limitations
18
+  under the License.
19
+-->
20
+
21
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
22
+    xmlns:rim="http://www.blackberry.com/ns/widgets"
23
+    xmlns:android="http://schemas.android.com/apk/res/android"
24
+    id="cordova-plugin-contacts-tests"
25
+    version="3.0.1">
26
+    <name>Cordova Contacts Plugin Tests</name>
27
+    <license>Apache 2.0</license>
28
+
29
+    <js-module src="tests.js" name="tests">
30
+    </js-module>
31
+</plugin>

+ 1097
- 0
km0App/node_modules/cordova-plugin-contacts/tests/tests.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 337
- 0
km0App/node_modules/cordova-plugin-contacts/types/index.d.ts Parādīt failu

@@ -0,0 +1,337 @@
1
+// Type definitions for Apache Cordova Contacts plugin
2
+// Project: https://github.com/apache/cordova-plugin-contacts
3
+// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
4
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+//
6
+// Copyright (c) Microsoft Open Technologies, Inc.
7
+// Licensed under the MIT license.
8
+
9
+interface Navigator {
10
+    /** Provides access to the device contacts database. */
11
+    contacts: Contacts;
12
+}
13
+
14
+interface Contacts {
15
+    /**
16
+     * The navigator.contacts.create method is synchronous, and returns a new Contact object.
17
+     * This method does not retain the Contact object in the device contacts database,
18
+     * for which you need to invoke the Contact.save method.
19
+     * @param  properties Object with contact fields
20
+     */
21
+    create(properties?: ContactProperties): Contact;
22
+    /**
23
+     * The navigator.contacts.find method executes asynchronously, querying the device contacts database
24
+     * and returning an array of Contact objects. The resulting objects are passed to the onSuccess
25
+     * callback function specified by the onSuccess parameter.
26
+     * @param fields The fields parameter specifies the fields to be used as a search qualifier,
27
+     * and only those results are passed to the onSuccess callback function. A zero-length fields parameter
28
+     * is invalid and results in ContactError.INVALID_ARGUMENT_ERROR. A contactFields value of "*" returns all contact fields.
29
+     * @param onSuccess Success callback function invoked with the array of Contact objects returned from the database
30
+     * @param onError Error callback function, invoked when an error occurs.
31
+     * @param options Search options to filter navigator.contacts.
32
+     */
33
+    find(fields: string[],
34
+        onSuccess: (contacts: Contact[]) => void,
35
+        onError?: (error: ContactError) => void,
36
+        options?: ContactFindOptions): void;
37
+    /**
38
+     * The navigator.contacts.pickContact method launches the Contact Picker to select a single contact.
39
+     * The resulting object is passed to the contactSuccess callback function specified by the contactSuccess parameter.
40
+     * @param onSuccess Success callback function invoked with the array of Contact objects returned from the database
41
+     * @param onError Error callback function, invoked when an error occurs.
42
+     */
43
+    pickContact(onSuccess: (contact: Contact) => void,
44
+        onError: (error: ContactError) => void): void
45
+
46
+    /**
47
+     * This allows us to use an enumeration when setting the desired fields for the ContactFindOptions.
48
+     * The values will correspond to the type of string literals in ContactFieldType.
49
+     */
50
+    fieldType: {
51
+        addresses: "addresses",
52
+        birthday: "birthday",
53
+        categories: "categories",
54
+        country: "country",
55
+        department: "department",
56
+        displayName: "displayName",
57
+        emails: "emails",
58
+        familyName: "familyName",
59
+        formatted: "formatted",
60
+        givenName: "givenName",
61
+        honorificPrefix: "honorificPrefix",
62
+        honorificSuffix: "honorificSuffix",
63
+        id: "id",
64
+        ims: "ims",
65
+        locality: "locality",
66
+        middleName: "middleName",
67
+        name: "name",
68
+        nickname: "nickname",
69
+        note: "note",
70
+        organizations: "organizations",
71
+        phoneNumbers: "phoneNumbers",
72
+        photos: "photos",
73
+        postalCode: "postalCode",
74
+        region: "region",
75
+        streetAddress: "streetAddress",
76
+        title: "title",
77
+        urls: "urls"
78
+    }
79
+}
80
+
81
+interface ContactProperties {
82
+    /** A globally unique identifier. */
83
+    id?: string;
84
+    /** The name of this Contact, suitable for display to end users. */
85
+    displayName?: string;
86
+    /** An object containing all components of a persons name. */
87
+    name?: ContactName;
88
+    /** A casual name by which to address the contact. */
89
+    nickname?: string;
90
+    /** An array of all the contact's phone numbers. */
91
+    phoneNumbers?: ContactField[];
92
+    /** An array of all the contact's email addresses. */
93
+    emails?: ContactField[];
94
+    /** An array of all the contact's addresses. */
95
+    addresses?: ContactAddress[];
96
+    /** An array of all the contact's IM addresses. */
97
+    ims?: ContactField[];
98
+    /** An array of all the contact's organizations. */
99
+    organizations?: ContactOrganization[];
100
+    /** The birthday of the contact. */
101
+    birthday?: Date;
102
+    /** A note about the contact. */
103
+    note?: string;
104
+    /** An array of the contact's photos. */
105
+    photos?: ContactField[];
106
+    /** An array of all the user-defined categories associated with the contact. */
107
+    categories?: ContactField[];
108
+    /** An array of web pages associated with the contact. */
109
+    urls?: ContactField[];
110
+}
111
+
112
+/**
113
+ * The Contact object represents a user's contact. Contacts can be created, stored, or removed
114
+ * from the device contacts database. Contacts can also be retrieved (individually or in bulk)
115
+ * from the database by invoking the navigator.contacts.find method.
116
+ */
117
+interface Contact extends ContactProperties {
118
+    /**
119
+     * Returns a new Contact object that is a deep copy of the calling object, with the id property set to null
120
+     */
121
+    clone(): Contact;
122
+    /**
123
+     * Removes the contact from the device contacts database, otherwise executes an error callback with a ContactError object.
124
+     * @param onSuccess Success callback function invoked on success operation.
125
+     * @param onError Error callback function, invoked when an error occurs.
126
+     */
127
+    remove(
128
+        onSuccess: () => void,
129
+        onError: (error: Error) => void): void;
130
+    /**
131
+     * Saves a new contact to the device contacts database, or updates an existing contact if a contact with the same id already exists.
132
+     * @param onSuccess Success callback function invoked on success operation with che Contact object.
133
+     * @param onError Error callback function, invoked when an error occurs.
134
+     */
135
+    save(
136
+        onSuccess: (contact: Contact) => void,
137
+        onError: (error: Error) => void): void;
138
+}
139
+
140
+declare var Contact: {
141
+    /** Constructor of Contact object */
142
+    new (id?: string,
143
+        displayName?: string,
144
+        name?: ContactName,
145
+        nickname?: string,
146
+        phoneNumbers?: ContactField[],
147
+        emails?: ContactField[],
148
+        addresses?: ContactAddress[],
149
+        ims?: ContactField[],
150
+        organizations?: ContactOrganization[],
151
+        birthday?: Date,
152
+        note?: string,
153
+        photos?: ContactField[],
154
+        categories?: ContactField,
155
+        urls?: ContactField[]): Contact
156
+};
157
+
158
+/** The ContactError object is returned to the user through the contactError callback function when an error occurs. */
159
+interface ContactError {
160
+    /** Error code */
161
+    code: number;
162
+    /** Error message */
163
+    message: string;
164
+}
165
+
166
+declare var ContactError: {
167
+    new (code: number): ContactError;
168
+    UNKNOWN_ERROR: number;
169
+    INVALID_ARGUMENT_ERROR: number;
170
+    TIMEOUT_ERROR: number;
171
+    PENDING_OPERATION_ERROR: number;
172
+    IO_ERROR: number;
173
+    NOT_SUPPORTED_ERROR: number;
174
+    PERMISSION_DENIED_ERROR: number
175
+};
176
+
177
+/** Contains different kinds of information about a Contact object's name. */
178
+interface ContactName {
179
+    /** The complete name of the contact. */
180
+    formatted?: string;
181
+    /** The contact's family name. */
182
+    familyName?: string;
183
+    /** The contact's given name. */
184
+    givenName?: string;
185
+    /** The contact's middle name. */
186
+    middleName?: string;
187
+    /** The contact's prefix (example Mr. or Dr.) */
188
+    honorificPrefix?: string;
189
+    /** The contact's suffix (example Esq.). */
190
+    honorificSuffix?: string;
191
+}
192
+
193
+declare var ContactName: {
194
+    /** Constructor for ContactName object */
195
+    new (formatted?: string,
196
+        familyName?: string,
197
+        givenName?: string,
198
+        middleName?: string,
199
+        honorificPrefix?: string,
200
+        honorificSuffix?: string): ContactName
201
+};
202
+
203
+/**
204
+ * The ContactField object is a reusable component that represents contact fields generically.
205
+ * Each ContactField object contains a value, type, and pref property. A Contact object stores
206
+ * several properties in ContactField[] arrays, such as phone numbers and email addresses.
207
+ *
208
+ * In most instances, there are no pre-determined values for a ContactField object's type attribute.
209
+ * For example, a phone number can specify type values of home, work, mobile, iPhone,
210
+ * or any other value that is supported by a particular device platform's contact database.
211
+ * However, for the Contact photos field, the type field indicates the format of the returned image:
212
+ * url when the value attribute contains a URL to the photo image, or base64 when the value
213
+ * contains a base64-encoded image string.
214
+ */
215
+interface ContactField {
216
+    /** A string that indicates what type of field this is, home for example. */
217
+    type: string;
218
+    /** The value of the field, such as a phone number or email address. */
219
+    value: string;
220
+    /** Set to true if this ContactField contains the user's preferred value. */
221
+    pref: boolean;
222
+}
223
+
224
+declare var ContactField: {
225
+    /** Constructor for ContactField object */
226
+    new (type?: string,
227
+        value?: string,
228
+        pref?: boolean): ContactField
229
+};
230
+
231
+/**
232
+ * The ContactAddress object stores the properties of a single address of a contact.
233
+ * A Contact object may include more than one address in a ContactAddress[] array.
234
+ */
235
+interface ContactAddress {
236
+    /** Set to true if this ContactAddress contains the user's preferred value. */
237
+    pref?: boolean;
238
+    /** A string indicating what type of field this is, home for example. */
239
+    type?: string;
240
+    /** The full address formatted for display. */
241
+    formatted?: string;
242
+    /** The full street address. */
243
+    streetAddress?: string;
244
+    /** The city or locality. */
245
+    locality?: string;
246
+    /** The state or region. */
247
+    region?: string;
248
+    /** The zip code or postal code. */
249
+    postalCode?: string;
250
+    /** The country name. */
251
+    country?: string;
252
+}
253
+
254
+declare var ContactAddress: {
255
+    /** Constructor of ContactAddress object */
256
+    new (pref?: boolean,
257
+        type?: string,
258
+        formatted?: string,
259
+        streetAddress?: string,
260
+        locality?: string,
261
+        region?: string,
262
+        postalCode?: string,
263
+        country?: string): ContactAddress
264
+};
265
+
266
+/**
267
+ * The ContactOrganization object stores a contact's organization properties. A Contact object stores
268
+ * one or more ContactOrganization objects in an array.
269
+ */
270
+interface ContactOrganization {
271
+    /** Set to true if this ContactOrganization contains the user's preferred value. */
272
+    pref?: boolean;
273
+    /** A string that indicates what type of field this is, home for example. */
274
+    type?: string;
275
+    /** The name of the organization. */
276
+    name?: string;
277
+    /** The department the contract works for. */
278
+    department?: string;
279
+    /** The contact's title at the organization. */
280
+    title?: string;
281
+}
282
+
283
+declare var ContactOrganization: {
284
+    /** Constructor for ContactOrganization object */
285
+    new (pref?: boolean,
286
+        type?: string,
287
+        name?: string,
288
+        department?: string,
289
+        title?: string): ContactOrganization
290
+};
291
+
292
+/** Search options to filter navigator.contacts.  */
293
+interface ContactFindOptions {
294
+    /** The search string used to find navigator.contacts. */
295
+    filter?: string;
296
+    /** Determines if the find operation returns multiple navigator.contacts. */
297
+    multiple?: boolean;
298
+    /* Contact fields to be returned back. If specified, the resulting Contact object only features values for these fields. */
299
+    desiredFields?: ContactFieldType[];
300
+}
301
+
302
+/** these are the string values that are valid for the desired fields in ContactFindOptions */
303
+declare type ContactFieldType =
304
+    "addresses"
305
+    | "birthday"
306
+    | "categories"
307
+    | "country"
308
+    | "department"
309
+    | "displayName"
310
+    | "emails"
311
+    | "familyName"
312
+    | "formatted"
313
+    | "givenName"
314
+    | "honorificPrefix"
315
+    | "honorificSuffix"
316
+    | "id"
317
+    | "ims"
318
+    | "locality"
319
+    | "middleName"
320
+    | "name"
321
+    | "nickname"
322
+    | "note"
323
+    | "organizations"
324
+    | "phoneNumbers"
325
+    | "photos"
326
+    | "postalCode"
327
+    | "region"
328
+    | "streetAddress"
329
+    | "title"
330
+    | "urls";
331
+
332
+declare var ContactFindOptions: {
333
+    /** Constructor for ContactFindOptions object */
334
+    new (filter?: string,
335
+        multiple?: boolean,
336
+        desiredFields?: ContactFieldType[]): ContactFindOptions
337
+};

+ 140
- 0
km0App/node_modules/cordova-plugin-contacts/www/Contact.js Parādīt failu

@@ -0,0 +1,140 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+var argscheck = require('cordova/argscheck'),
23
+    exec = require('cordova/exec'),
24
+    ContactError = require('./ContactError'),
25
+    utils = require('cordova/utils'),
26
+    convertUtils = require('./convertUtils');
27
+
28
+/**
29
+* Contains information about a single contact.
30
+* @constructor
31
+* @param {DOMString} id unique identifier
32
+* @param {DOMString} displayName
33
+* @param {ContactName} name
34
+* @param {DOMString} nickname
35
+* @param {Array.<ContactField>} phoneNumbers array of phone numbers
36
+* @param {Array.<ContactField>} emails array of email addresses
37
+* @param {Array.<ContactAddress>} addresses array of addresses
38
+* @param {Array.<ContactField>} ims instant messaging user ids
39
+* @param {Array.<ContactOrganization>} organizations
40
+* @param {DOMString} birthday contact's birthday
41
+* @param {DOMString} note user notes about contact
42
+* @param {Array.<ContactField>} photos
43
+* @param {Array.<ContactField>} categories
44
+* @param {Array.<ContactField>} urls contact's web sites
45
+*/
46
+var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses,
47
+    ims, organizations, birthday, note, photos, categories, urls) {
48
+    this.id = id || null;
49
+    this.rawId = null;
50
+    this.displayName = displayName || null;
51
+    this.name = name || null; // ContactName
52
+    this.nickname = nickname || null;
53
+    this.phoneNumbers = phoneNumbers || null; // ContactField[]
54
+    this.emails = emails || null; // ContactField[]
55
+    this.addresses = addresses || null; // ContactAddress[]
56
+    this.ims = ims || null; // ContactField[]
57
+    this.organizations = organizations || null; // ContactOrganization[]
58
+    this.birthday = birthday || null;
59
+    this.note = note || null;
60
+    this.photos = photos || null; // ContactField[]
61
+    this.categories = categories || null; // ContactField[]
62
+    this.urls = urls || null; // ContactField[]
63
+};
64
+
65
+/**
66
+* Removes contact from device storage.
67
+* @param successCB success callback
68
+* @param errorCB error callback
69
+*/
70
+Contact.prototype.remove = function(successCB, errorCB) {
71
+    argscheck.checkArgs('FF', 'Contact.remove', arguments);
72
+    var fail = errorCB && function(code) {
73
+        errorCB(new ContactError(code));
74
+    };
75
+    if (this.id === null) {
76
+        fail(ContactError.UNKNOWN_ERROR);
77
+    }
78
+    else {
79
+        exec(successCB, fail, "Contacts", "remove", [this.id]);
80
+    }
81
+};
82
+
83
+/**
84
+* Creates a deep copy of this Contact.
85
+* With the contact ID set to null.
86
+* @return copy of this Contact
87
+*/
88
+Contact.prototype.clone = function() {
89
+    var clonedContact = utils.clone(this);
90
+    clonedContact.id = null;
91
+    clonedContact.rawId = null;
92
+
93
+    function nullIds(arr) {
94
+        if (arr) {
95
+            for (var i = 0; i < arr.length; ++i) {
96
+                arr[i].id = null;
97
+            }
98
+        }
99
+    }
100
+
101
+    // Loop through and clear out any id's in phones, emails, etc.
102
+    nullIds(clonedContact.phoneNumbers);
103
+    nullIds(clonedContact.emails);
104
+    nullIds(clonedContact.addresses);
105
+    nullIds(clonedContact.ims);
106
+    nullIds(clonedContact.organizations);
107
+    nullIds(clonedContact.categories);
108
+    nullIds(clonedContact.photos);
109
+    nullIds(clonedContact.urls);
110
+    return clonedContact;
111
+};
112
+
113
+/**
114
+* Persists contact to device storage.
115
+* @param successCB success callback
116
+* @param errorCB error callback
117
+*/
118
+Contact.prototype.save = function(successCB, errorCB) {
119
+    argscheck.checkArgs('FFO', 'Contact.save', arguments);
120
+    var fail = errorCB && function(code) {
121
+        errorCB(new ContactError(code));
122
+    };
123
+    var success = function(result) {
124
+        if (result) {
125
+            if (successCB) {
126
+                var fullContact = require('./contacts').create(result);
127
+                successCB(convertUtils.toCordovaFormat(fullContact));
128
+            }
129
+        }
130
+        else {
131
+            // no Entry object returned
132
+            fail(ContactError.UNKNOWN_ERROR);
133
+        }
134
+    };
135
+    var dupContact = convertUtils.toNativeFormat(utils.clone(this));
136
+    exec(success, fail, "Contacts", "save", [dupContact]);
137
+};
138
+
139
+
140
+module.exports = Contact;

+ 46
- 0
km0App/node_modules/cordova-plugin-contacts/www/ContactAddress.js Parādīt failu

@@ -0,0 +1,46 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+/**
23
+* Contact address.
24
+* @constructor
25
+* @param {DOMString} id unique identifier, should only be set by native code
26
+* @param formatted // NOTE: not a W3C standard
27
+* @param streetAddress
28
+* @param locality
29
+* @param region
30
+* @param postalCode
31
+* @param country
32
+*/
33
+
34
+var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) {
35
+    this.id = null;
36
+    this.pref = (typeof pref != 'undefined' ? pref : false);
37
+    this.type = type || null;
38
+    this.formatted = formatted || null;
39
+    this.streetAddress = streetAddress || null;
40
+    this.locality = locality || null;
41
+    this.region = region || null;
42
+    this.postalCode = postalCode || null;
43
+    this.country = country || null;
44
+};
45
+
46
+module.exports = ContactAddress;

+ 43
- 0
km0App/node_modules/cordova-plugin-contacts/www/ContactError.js Parādīt failu

@@ -0,0 +1,43 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+/**
23
+ *  ContactError.
24
+ *  An error code assigned by an implementation when an error has occurred
25
+ * @constructor
26
+ */
27
+var ContactError = function(err) {
28
+    this.code = (typeof err != 'undefined' ? err : null);
29
+};
30
+
31
+/**
32
+ * Error codes
33
+ */
34
+ContactError.UNKNOWN_ERROR = 0;
35
+ContactError.INVALID_ARGUMENT_ERROR = 1;
36
+ContactError.TIMEOUT_ERROR = 2;
37
+ContactError.PENDING_OPERATION_ERROR = 3;
38
+ContactError.IO_ERROR = 4;
39
+ContactError.NOT_SUPPORTED_ERROR = 5;
40
+ContactError.OPERATION_CANCELLED_ERROR = 6;
41
+ContactError.PERMISSION_DENIED_ERROR = 20;
42
+
43
+module.exports = ContactError;

+ 37
- 0
km0App/node_modules/cordova-plugin-contacts/www/ContactField.js Parādīt failu

@@ -0,0 +1,37 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+/**
23
+* Generic contact field.
24
+* @constructor
25
+* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard
26
+* @param type
27
+* @param value
28
+* @param pref
29
+*/
30
+var ContactField = function(type, value, pref) {
31
+    this.id = null;
32
+    this.type = (type && type.toString()) || null;
33
+    this.value = (value && value.toString()) || null;
34
+    this.pref = (typeof pref != 'undefined' ? pref : false);
35
+};
36
+
37
+module.exports = ContactField;

+ 55
- 0
km0App/node_modules/cordova-plugin-contacts/www/ContactFieldType.js Parādīt failu

@@ -0,0 +1,55 @@
1
+/*
2
+ *
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements.  See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership.  The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License.  You may obtain a copy of the License at
10
+ *
11
+ *   http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied.  See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ *
20
+*/
21
+
22
+    // Possible field names for various platforms.
23
+    // Some field names are platform specific
24
+
25
+    var fieldType = {
26
+        addresses:      "addresses",
27
+        birthday:       "birthday",
28
+        categories:     "categories",
29
+        country:        "country",
30
+        department:     "department",
31
+        displayName:    "displayName",
32
+        emails:         "emails",
33
+        familyName:     "familyName",
34
+        formatted:      "formatted",
35
+        givenName:      "givenName",
36
+        honorificPrefix: "honorificPrefix",
37
+        honorificSuffix: "honorificSuffix",
38
+        id:             "id",
39
+        ims:            "ims",
40
+        locality:       "locality",
41
+        middleName:     "middleName",
42
+        name:           "name",
43
+        nickname:       "nickname",
44
+        note:           "note",
45
+        organizations:  "organizations",
46
+        phoneNumbers:   "phoneNumbers",
47
+        photos:         "photos",
48
+        postalCode:     "postalCode",
49
+        region:         "region",
50
+        streetAddress:  "streetAddress",
51
+        title:          "title",
52
+        urls:           "urls"
53
+    };
54
+
55
+    module.exports = fieldType;

+ 0
- 0
km0App/node_modules/cordova-plugin-contacts/www/ContactFindOptions.js Parādīt failu


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels