Procházet zdrojové kódy

iphone fixes and events button

Christian Matos před 3 roky
rodič
revize
a34e056a6e
100 změnil soubory, kde provedl 5749 přidání a 137 odebrání
  1. 37
    0
      node_modules/cordova-plugin-device/CONTRIBUTING.md
  2. 202
    0
      node_modules/cordova-plugin-device/LICENSE
  3. 5
    0
      node_modules/cordova-plugin-device/NOTICE
  4. 264
    0
      node_modules/cordova-plugin-device/README.md
  5. 194
    0
      node_modules/cordova-plugin-device/RELEASENOTES.md
  6. 84
    0
      node_modules/cordova-plugin-device/package.json
  7. 93
    0
      node_modules/cordova-plugin-device/plugin.xml
  8. 174
    0
      node_modules/cordova-plugin-device/src/android/Device.java
  9. 84
    0
      node_modules/cordova-plugin-device/src/browser/DeviceProxy.js
  10. 30
    0
      node_modules/cordova-plugin-device/src/ios/CDVDevice.h
  11. 115
    0
      node_modules/cordova-plugin-device/src/ios/CDVDevice.m
  12. 28
    0
      node_modules/cordova-plugin-device/src/osx/CDVDevice.h
  13. 113
    0
      node_modules/cordova-plugin-device/src/osx/CDVDevice.m
  14. 96
    0
      node_modules/cordova-plugin-device/src/windows/DeviceProxy.js
  15. 14
    0
      node_modules/cordova-plugin-device/tests/package.json
  16. 31
    0
      node_modules/cordova-plugin-device/tests/plugin.xml
  17. 113
    0
      node_modules/cordova-plugin-device/tests/tests.js
  18. 35
    0
      node_modules/cordova-plugin-device/types/index.d.ts
  19. 83
    0
      node_modules/cordova-plugin-device/www/device.js
  20. 6
    0
      package-lock.json
  21. 4
    2
      package.json
  22. 19
    2
      platforms/android/android.json
  23. 12
    2
      platforms/android/app/src/main/assets/www/cordova_plugins.js
  24. 7
    2
      platforms/android/app/src/main/assets/www/index.html
  25. 4
    0
      platforms/android/app/src/main/assets/www/js/index.js
  26. 2
    2
      platforms/android/app/src/main/assets/www/lib/OnsenUI/css/onsenui.css
  27. 86
    0
      platforms/android/app/src/main/assets/www/plugins/cordova-plugin-device/www/device.js
  28. 36
    0
      platforms/android/app/src/main/assets/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js
  29. 116
    0
      platforms/android/app/src/main/assets/www/plugins/cordova-plugin-statusbar/www/statusbar.js
  30. 174
    0
      platforms/android/app/src/main/java/org/apache/cordova/device/Device.java
  31. 3
    0
      platforms/android/app/src/main/res/xml/config.xml
  32. 12
    2
      platforms/android/platform_www/cordova_plugins.js
  33. 86
    0
      platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js
  34. 36
    0
      platforms/android/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js
  35. 116
    0
      platforms/android/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js
  36. 27
    3
      platforms/browser/browser.json
  37. 18
    2
      platforms/browser/platform_www/cordova_plugins.js
  38. 86
    0
      platforms/browser/platform_www/plugins/cordova-plugin-device/src/browser/DeviceProxy.js
  39. 85
    0
      platforms/browser/platform_www/plugins/cordova-plugin-device/www/device.js
  40. 170
    0
      platforms/browser/platform_www/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js
  41. 35
    0
      platforms/browser/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js
  42. 52
    0
      platforms/browser/platform_www/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js
  43. 115
    0
      platforms/browser/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js
  44. 18
    2
      platforms/browser/www/cordova_plugins.js
  45. 8
    3
      platforms/browser/www/index.html
  46. 9
    0
      platforms/browser/www/js/index.js
  47. 2
    2
      platforms/browser/www/lib/OnsenUI/css/onsenui.css
  48. 86
    0
      platforms/browser/www/plugins/cordova-plugin-device/src/browser/DeviceProxy.js
  49. 85
    0
      platforms/browser/www/plugins/cordova-plugin-device/www/device.js
  50. 170
    0
      platforms/browser/www/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js
  51. 35
    0
      platforms/browser/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js
  52. 52
    0
      platforms/browser/www/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js
  53. 115
    0
      platforms/browser/www/plugins/cordova-plugin-statusbar/www/statusbar.js
  54. 6
    0
      platforms/ios/ArtesaníasICP.xcodeproj/project.pbxproj
  55. binární
      platforms/ios/ArtesaníasICP.xcworkspace/xcuserdata/christian.xcuserdatad/UserInterfaceState.xcuserstate
  56. 10
    10
      platforms/ios/ArtesaníasICP/Images.xcassets/BackgroundColor.colorset/Contents.json
  57. 30
    0
      platforms/ios/ArtesaníasICP/Plugins/cordova-plugin-device/CDVDevice.h
  58. 115
    0
      platforms/ios/ArtesaníasICP/Plugins/cordova-plugin-device/CDVDevice.m
  59. 27
    0
      platforms/ios/ArtesaníasICP/config.xml
  60. 27
    3
      platforms/ios/ios.json
  61. 12
    2
      platforms/ios/platform_www/cordova_plugins.js
  62. 86
    0
      platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js
  63. 12
    2
      platforms/ios/www/cordova_plugins.js
  64. 1
    1
      platforms/ios/www/css/index.css
  65. binární
      platforms/ios/www/img/BARRO.jpg
  66. binární
      platforms/ios/www/img/CRISTAL.jpg
  67. binární
      platforms/ios/www/img/CUERO.jpg
  68. binární
      platforms/ios/www/img/FIBRAS.jpg
  69. binární
      platforms/ios/www/img/INSTRUMENTOS TÍPICOS.jpg
  70. binární
      platforms/ios/www/img/JUGUETES TRADICIONALES.jpg
  71. binární
      platforms/ios/www/img/LABORES EN AGUJA.jpg
  72. binární
      platforms/ios/www/img/METAL.jpg
  73. binární
      platforms/ios/www/img/MÁSCARAS.jpg
  74. binární
      platforms/ios/www/img/PAPEL.jpg
  75. binární
      platforms/ios/www/img/PIEDRAS.jpg
  76. binární
      platforms/ios/www/img/TABACOS.jpg
  77. binární
      platforms/ios/www/img/culturalpr1800x3200-2-01.png
  78. binární
      platforms/ios/www/img/logo_cdcc.png
  79. 179
    83
      platforms/ios/www/index.html
  80. 10
    8
      platforms/ios/www/js/azar.js
  81. 9
    0
      platforms/ios/www/js/index.js
  82. 26
    2
      platforms/ios/www/js/searchfunctions.js
  83. 2
    2
      platforms/ios/www/lib/OnsenUI/css/onsenui.css
  84. 86
    0
      platforms/ios/www/plugins/cordova-plugin-device/www/device.js
  85. 3
    0
      plugins/android.json
  86. 3
    0
      plugins/browser.json
  87. 37
    0
      plugins/cordova-plugin-device/CONTRIBUTING.md
  88. 202
    0
      plugins/cordova-plugin-device/LICENSE
  89. 5
    0
      plugins/cordova-plugin-device/NOTICE
  90. 264
    0
      plugins/cordova-plugin-device/README.md
  91. 194
    0
      plugins/cordova-plugin-device/RELEASENOTES.md
  92. 84
    0
      plugins/cordova-plugin-device/package.json
  93. 93
    0
      plugins/cordova-plugin-device/plugin.xml
  94. 174
    0
      plugins/cordova-plugin-device/src/android/Device.java
  95. 84
    0
      plugins/cordova-plugin-device/src/browser/DeviceProxy.js
  96. 30
    0
      plugins/cordova-plugin-device/src/ios/CDVDevice.h
  97. 115
    0
      plugins/cordova-plugin-device/src/ios/CDVDevice.m
  98. 28
    0
      plugins/cordova-plugin-device/src/osx/CDVDevice.h
  99. 113
    0
      plugins/cordova-plugin-device/src/osx/CDVDevice.m
  100. 0
    0
      plugins/cordova-plugin-device/src/windows/DeviceProxy.js

+ 37
- 0
node_modules/cordova-plugin-device/CONTRIBUTING.md Zobrazit soubor

@@ -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
node_modules/cordova-plugin-device/LICENSE Zobrazit soubor

@@ -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.

+ 5
- 0
node_modules/cordova-plugin-device/NOTICE Zobrazit soubor

@@ -0,0 +1,5 @@
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/).

+ 264
- 0
node_modules/cordova-plugin-device/README.md Zobrazit soubor

@@ -0,0 +1,264 @@
1
+---
2
+title: Device
3
+description: Get device information.
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-device?branch=master)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-device)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device)|
27
+
28
+# cordova-plugin-device
29
+
30
+This plugin defines a global `device` object, which describes the device's hardware and software.
31
+Although the object is in the global scope, it is not available until after the `deviceready` event.
32
+
33
+```js
34
+document.addEventListener("deviceready", onDeviceReady, false);
35
+function onDeviceReady() {
36
+    console.log(device.cordova);
37
+}
38
+```
39
+
40
+## Installation
41
+
42
+    cordova plugin add cordova-plugin-device
43
+
44
+## Properties
45
+
46
+- device.cordova
47
+- device.model
48
+- device.platform
49
+- device.uuid
50
+- device.version
51
+- device.manufacturer
52
+- device.isVirtual
53
+- device.serial
54
+
55
+## device.cordova
56
+
57
+Get the version of Cordova running on the device.
58
+
59
+### Supported Platforms
60
+
61
+- Android
62
+- Browser
63
+- iOS
64
+- Windows
65
+- OSX
66
+
67
+## device.model
68
+
69
+The `device.model` returns the name of the device's model or
70
+product. The value is set by the device manufacturer and may be
71
+different across versions of the same product.
72
+
73
+### Supported Platforms
74
+
75
+- Android
76
+- Browser
77
+- iOS
78
+- Windows
79
+- OSX
80
+
81
+### Quick Example
82
+
83
+```js
84
+// Android:    Nexus One       returns "Passion" (Nexus One code name)
85
+//             Motorola Droid  returns "voles"
86
+// BlackBerry: Torch 9800      returns "9800"
87
+// Browser:    Google Chrome   returns "Chrome"
88
+//             Safari          returns "Safari"
89
+// iOS:     for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
90
+// OSX:                        returns "x86_64"
91
+//
92
+var model = device.model;
93
+```
94
+
95
+### Android Quirks
96
+
97
+- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`.
98
+
99
+## device.platform
100
+
101
+Get the device's operating system name.
102
+
103
+```js
104
+var string = device.platform;
105
+```
106
+### Supported Platforms
107
+
108
+- Android
109
+- Browser
110
+- iOS
111
+- Windows
112
+- OSX
113
+
114
+### Quick Example
115
+
116
+```js
117
+// Depending on the device, a few examples are:
118
+//   - "Android"
119
+//   - "BlackBerry 10"
120
+//   - "browser"
121
+//   - "iOS"
122
+//   - "WinCE"
123
+//   - "Tizen"
124
+//   - "Mac OS X"
125
+var devicePlatform = device.platform;
126
+```
127
+
128
+## device.uuid
129
+
130
+Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
131
+
132
+```js
133
+var string = device.uuid;
134
+```
135
+
136
+### Description
137
+
138
+The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model.
139
+
140
+### Supported Platforms
141
+
142
+- Android
143
+- iOS
144
+- Windows
145
+- OSX
146
+
147
+### Quick Example
148
+
149
+```js
150
+// Android: Returns a random 64-bit integer (as a string, again!)
151
+//          The integer is generated on the device's first boot
152
+//
153
+// BlackBerry: Returns the PIN number of the device
154
+//             This is a nine-digit unique integer (as a string, though!)
155
+//
156
+// iPhone: (Paraphrased from the UIDevice Class documentation)
157
+//         Returns the [UIDevice identifierForVendor] UUID which is unique and the same for all apps installed by the same vendor. However the UUID can be different if the user deletes all apps from the vendor and then reinstalls it.
158
+// Windows Phone 7 : Returns a hash of device+current user,
159
+// if the user is not defined, a guid is generated and will persist until the app is uninstalled
160
+// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
161
+// unique to every GSM and UMTS mobile phone.
162
+var deviceID = device.uuid;
163
+```
164
+
165
+### iOS Quirk
166
+
167
+The `uuid` on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled.
168
+Refer [here](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/#//apple_ref/occ/instp/UIDevice/identifierForVendor) for details.
169
+The UUID will be the same if app is restored from a backup or iCloud as it is saved in preferences. Users using older versions of this plugin will still receive the same previous UUID generated by another means as it will be retrieved from preferences.
170
+
171
+### OSX Quirk
172
+
173
+The `uuid` on OSX is generated automatically if it does not exist yet and is stored in the `standardUserDefaults` in the `CDVUUID` property.
174
+
175
+## device.version
176
+
177
+Get the operating system version.
178
+
179
+    var string = device.version;
180
+
181
+### Supported Platforms
182
+
183
+- Android 2.1+
184
+- Browser
185
+- iOS
186
+- Windows
187
+- OSX
188
+
189
+### Quick Example
190
+
191
+```js
192
+// Android:    Froyo OS would return "2.2"
193
+//             Eclair OS would return "2.1", "2.0.1", or "2.0"
194
+//             Version can also return update level "2.1-update1"
195
+//
196
+// BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
197
+//
198
+// Browser:    Returns version number for the browser
199
+//
200
+// iPhone:     iOS 3.2 returns "3.2"
201
+//
202
+// Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
203
+// Windows 8: return the current OS version, ex on Windows 8.1 returns 6.3.9600.16384
204
+// Tizen: returns "TIZEN_20120425_2"
205
+// OSX:        El Capitan would return "10.11.2"
206
+//
207
+var deviceVersion = device.version;
208
+```
209
+
210
+## device.manufacturer
211
+
212
+Get the device's manufacturer.
213
+
214
+    var string = device.manufacturer;
215
+
216
+### Supported Platforms
217
+
218
+- Android
219
+- iOS
220
+- Windows
221
+
222
+### Quick Example
223
+
224
+```js
225
+// Android:    Motorola XT1032 would return "motorola"
226
+// BlackBerry: returns "BlackBerry"
227
+// iPhone:     returns "Apple"
228
+//
229
+var deviceManufacturer = device.manufacturer;
230
+```
231
+
232
+## device.isVirtual
233
+
234
+whether the device is running on a simulator.
235
+
236
+```js
237
+var isSim = device.isVirtual;
238
+```
239
+
240
+### Supported Platforms
241
+
242
+- Android 2.1+
243
+- Browser
244
+- iOS
245
+- Windows
246
+- OSX
247
+
248
+### OSX and Browser Quirk
249
+
250
+The `isVirtual` property on OS X and Browser always returns false.
251
+
252
+## device.serial
253
+
254
+Get the device hardware serial number ([SERIAL](http://developer.android.com/reference/android/os/Build.html#SERIAL)).
255
+
256
+```js
257
+var string = device.serial;
258
+```
259
+
260
+### Supported Platforms
261
+
262
+- Android
263
+- OSX
264
+

+ 194
- 0
node_modules/cordova-plugin-device/RELEASENOTES.md Zobrazit soubor

@@ -0,0 +1,194 @@
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
+### 2.0.3 (Jun 14, 2019)
24
+
25
+-   build: add .gitattributes to force LF (instead of possible CRLF on Windows) ([`02ae405`](https://github.com/apache/cordova-plugin-device/commit/02ae405))
26
+-   build: add .npmignore to remove unneeded files from npm package ([`8dbe703`](https://github.com/apache/cordova-plugin-device/commit/8dbe703))
27
+-   docs: remove outdated translations ([`db4e1f1`](https://github.com/apache/cordova-plugin-device/commit/db4e1f1))
28
+-   ci(travis): Remove android 4.4 that SauceLabs removed ([`594fa61`](https://github.com/apache/cordova-plugin-device/commit/594fa61))
29
+-   ci(travis): Update Travis CI configuration for new paramedic ([#97](https://github.com/apache/cordova-plugin-device/issues/97)) ([`db0ad32`](https://github.com/apache/cordova-plugin-device/commit/db0ad32))
30
+-   feat: update typings ([#90](https://github.com/apache/cordova-plugin-device/issues/90)) ([`52a0655`](https://github.com/apache/cordova-plugin-device/commit/52a0655), [`61ad76c`](https://github.com/apache/cordova-plugin-device/commit/61ad76c))
31
+-   chore(github): Add or update GitHub pull request and issue template ([`e213286`](https://github.com/apache/cordova-plugin-device/commit/e213286))
32
+-   docs: remove JIRA link ([`2d12d55`](https://github.com/apache/cordova-plugin-device/commit/2d12d55))
33
+-   ci(travis): also accept terms for android sdk `android-27` ([`f870c9b`](https://github.com/apache/cordova-plugin-device/commit/f870c9b))
34
+-   fix: [CB-14106](https://issues.apache.org/jira/browse/CB-14106) - device.model is different on simulator and on real device ([#80](https://github.com/apache/cordova-plugin-device/issues/80)) ([`d65cdf6`](https://github.com/apache/cordova-plugin-device/commit/d65cdf6))
35
+
36
+### 2.0.2 (Apr 12, 2018)
37
+* [CB-13893](https://issues.apache.org/jira/browse/CB-13893) **iOS** delete `libz.tbd` from device plugin
38
+
39
+### 2.0.1 (Dec 27, 2017)
40
+* [CB-13702](https://issues.apache.org/jira/browse/CB-13702) Fix to allow 2.0.0 version install
41
+
42
+### 2.0.0 (Dec 15, 2017)
43
+* [CB-13670](https://issues.apache.org/jira/browse/CB-13670) Remove deprecated platforms
44
+
45
+### 1.1.7 (Nov 06, 2017)
46
+* [CB-13472](https://issues.apache.org/jira/browse/CB-13472) (CI) Fixed Travis **Android** builds again
47
+* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) setup `eslint` and removed `jshint`
48
+* [CB-13113](https://issues.apache.org/jira/browse/CB-13113) (browser) `device.isVirtual` is always false
49
+* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
50
+* [CB-13000](https://issues.apache.org/jira/browse/CB-13000) (CI) Speed up **Android** builds
51
+* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
52
+
53
+### 1.1.6 (Apr 27, 2017)
54
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
55
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
56
+* [CB-12105](https://issues.apache.org/jira/browse/CB-12105) (browser) Properly detect Edge
57
+
58
+### 1.1.5 (Feb 28, 2017)
59
+* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
60
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
61
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
62
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
63
+
64
+### 1.1.4 (Dec 07, 2016)
65
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 1.1.4
66
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
67
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
68
+
69
+### 1.1.3 (Sep 08, 2016)
70
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
71
+* Add badges for paramedic builds on Jenkins
72
+* Add pull request template.
73
+* Readme: Add fenced code blocks with langauage hints
74
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md`
75
+
76
+### 1.1.2 (Apr 15, 2016)
77
+* Use passed device, follow create policy forf `CFUUIDCreate`
78
+* [CB-10631](https://issues.apache.org/jira/browse/CB-10631) Fix for `device.uuid` in **iOS 5.1.1**
79
+* Updating the comment to exclude URL
80
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
81
+* Refactored `deviceInfo` on **iOS** for better readability.
82
+
83
+### 1.1.1 (Jan 15, 2016)
84
+* [CB-10238](https://issues.apache.org/jira/browse/CB-10238) **OSX** Move `device-plugin` out from `cordovalib` to the plugin repository
85
+* [CB-9923](https://issues.apache.org/jira/browse/CB-9923) Update `device.platform` documentation for **Browser** platform
86
+
87
+### 1.1.0 (Nov 18, 2015)
88
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
89
+* Add `isVirtual` for **Windows Phone 8.x**
90
+* Added basic **Android** support for hardware serial number
91
+* [CB-9865](https://issues.apache.org/jira/browse/CB-9865) Better simulator detection for **iOS**
92
+* Fixing contribute link.
93
+* Added **WP8** implementation
94
+* update to use `TARGET_OS_SIMULATOR` as `TARGET_IPHONE_SIMULATOR` is deprecated.
95
+* update code to use 'isVirtual'
96
+* create test to verify existence and type of new property 'isVirtual'
97
+* add `isSimulator` for **iOS** & **Android** device
98
+* Updated documentation to mention backwards compatibility
99
+* Updated **README** to reflect new behaviour and quirks on **iOS**
100
+* Check user defaults first to maintain backwards compatibility
101
+* Changed `UUID` to use `[UIDevice identifierForVendor]`
102
+
103
+### 1.0.1 (Jun 17, 2015)
104
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-device documentation translation: cordova-plugin-device
105
+* Attempts to corrent npm markdown issue
106
+
107
+### 1.0.0 (Apr 15, 2015)
108
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
109
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
110
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
111
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
112
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
113
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
114
+* remove defunct windows8 version
115
+* add travis badge
116
+* Add cross-plugin ios paramedic test running for TravisCI
117
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
118
+
119
+### 0.3.0 (Feb 04, 2015)
120
+* Added device.manufacturer property for Android, iOS, Blackberry, WP8
121
+* Support for Windows Phone 8 ANID2 ANID is only supported up to Windows Phone 7.5
122
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Use a local copy of uniqueAppInstanceIdentifier rather than CordovaLib's version
123
+* browser: Fixed a bug that caused an "cannot call method of undefined" error if the browser's user agent wasn't recognized
124
+
125
+### 0.2.13 (Dec 02, 2014)
126
+* Changing `device.platform` to always report the platform as "browser".
127
+* [CB-5892](https://issues.apache.org/jira/browse/CB-5892) - Remove deprecated `window.Settings`
128
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-device documentation translation: cordova-plugin-device
129
+* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
130
+
131
+### 0.2.12 (Sep 17, 2014)
132
+* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-device documentation translation
133
+* [CB-7552](https://issues.apache.org/jira/browse/CB-7552) device.name docs have not been removed
134
+* [fxos] Fix cordova version
135
+* added status box and documentation to manual tests
136
+* [fxos] Fix cordova version
137
+* added status box and documentation to manual tests
138
+* Added plugin support for the browser
139
+* [CB-7262](https://issues.apache.org/jira/browse/CB-7262) Adds support for universal windows apps.
140
+
141
+### 0.2.11 (Aug 06, 2014)
142
+* [FFOS] update DeviceProxy.js
143
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
144
+* Use Windows system calls to get better info
145
+
146
+### 0.2.10 (Jun 05, 2014)
147
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #12
148
+* Changing 1.5 to 2.0
149
+* added firefoxos version - conversion
150
+* added firefoxos version
151
+* [CB-6800](https://issues.apache.org/jira/browse/CB-6800) Add license
152
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
153
+
154
+### 0.2.9 (Apr 17, 2014)
155
+* [CB-5105](https://issues.apache.org/jira/browse/CB-5105): [Android, windows8, WP, BlackBerry10] Removed dead code for device.version
156
+* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
157
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
158
+* Add NOTICE file
159
+
160
+### 0.2.8 (Feb 05, 2014)
161
+* Tizen support added
162
+
163
+### 0.2.7 (Jan 07, 2014)
164
+* [CB-5737](https://issues.apache.org/jira/browse/CB-5737) Fix exception on close caused by left over telephony code from [CB-5504](https://issues.apache.org/jira/browse/CB-5504)
165
+
166
+### 0.2.6 (Jan 02, 2014)
167
+* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Device plugin
168
+* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Moving Telephony Logic out of Device
169
+
170
+### 0.2.5 (Dec 4, 2013)
171
+* [CB-5316](https://issues.apache.org/jira/browse/CB-5316) Spell Cordova as a brand unless it's a command or script
172
+* [ubuntu] use cordova/exec/proxy
173
+* add ubuntu platform
174
+* Modify Device.platform logic to use amazon-fireos as the platform for Amazon Devices
175
+* 1. Added amazon-fireos platform. 2. Change to use cordova-amazon-fireos as the platform if user agent contains 'cordova-amazon-fireos'
176
+
177
+### 0.2.4 (Oct 28, 2013)
178
+* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag in plugin.xml for device plugin
179
+* [CB-5085](https://issues.apache.org/jira/browse/CB-5085) device.cordova returning wrong value
180
+* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
181
+
182
+### 0.2.3 (Sept 25, 2013)
183
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
184
+* [windows8] commandProxy has moved
185
+* [BlackBerry10] removed uneeded permission tags in plugin.xml
186
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.device to org.apache.cordova.device
187
+* Rename CHANGELOG.md -> RELEASENOTES.md
188
+* updated to use commandProxy for ffos
189
+* add firefoxos support
190
+* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. 
191
+
192
+### 0.2.1 (Sept 5, 2013)
193
+* removed extraneous print statement
194
+* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change

+ 84
- 0
node_modules/cordova-plugin-device/package.json Zobrazit soubor

@@ -0,0 +1,84 @@
1
+{
2
+  "_from": "cordova-plugin-device",
3
+  "_id": "cordova-plugin-device@2.0.3",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-Jb3V72btxf3XHpkPQsGdyc8N6tVBYn1vsxSFj43fIz9vonJDUThYPCJJHqk6PX6N4dJw6I4FjxkpfCR4LDYMlw==",
6
+  "_location": "/cordova-plugin-device",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "tag",
10
+    "registry": true,
11
+    "raw": "cordova-plugin-device",
12
+    "name": "cordova-plugin-device",
13
+    "escapedName": "cordova-plugin-device",
14
+    "rawSpec": "",
15
+    "saveSpec": null,
16
+    "fetchSpec": "latest"
17
+  },
18
+  "_requiredBy": [
19
+    "#DEV:/",
20
+    "#USER"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
23
+  "_shasum": "c2b41b7efd0455dd097f89356d85bfdd5dadeb0f",
24
+  "_spec": "cordova-plugin-device",
25
+  "_where": "/Users/christian/Documents/artesanias",
26
+  "author": {
27
+    "name": "Apache Software Foundation"
28
+  },
29
+  "bugs": {
30
+    "url": "https://issues.apache.org/jira/browse/CB"
31
+  },
32
+  "bundleDependencies": false,
33
+  "cordova": {
34
+    "id": "cordova-plugin-device",
35
+    "platforms": [
36
+      "android",
37
+      "ios",
38
+      "windows",
39
+      "browser",
40
+      "osx"
41
+    ]
42
+  },
43
+  "deprecated": false,
44
+  "description": "Cordova Device Plugin",
45
+  "devDependencies": {
46
+    "eslint": "^3.19.0",
47
+    "eslint-config-semistandard": "^11.0.0",
48
+    "eslint-config-standard": "^10.2.1",
49
+    "eslint-plugin-import": "^2.3.0",
50
+    "eslint-plugin-node": "^5.0.0",
51
+    "eslint-plugin-promise": "^3.5.0",
52
+    "eslint-plugin-standard": "^3.0.1"
53
+  },
54
+  "engines": {
55
+    "cordovaDependencies": {
56
+      "3.0.0": {
57
+        "cordova": ">100"
58
+      }
59
+    }
60
+  },
61
+  "homepage": "https://github.com/apache/cordova-plugin-device#readme",
62
+  "keywords": [
63
+    "cordova",
64
+    "device",
65
+    "ecosystem:cordova",
66
+    "cordova-android",
67
+    "cordova-ios",
68
+    "cordova-windows",
69
+    "cordova-browser",
70
+    "cordova-osx"
71
+  ],
72
+  "license": "Apache-2.0",
73
+  "name": "cordova-plugin-device",
74
+  "repository": {
75
+    "type": "git",
76
+    "url": "git+https://github.com/apache/cordova-plugin-device.git"
77
+  },
78
+  "scripts": {
79
+    "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests",
80
+    "test": "npm run eslint"
81
+  },
82
+  "types": "./types/index.d.ts",
83
+  "version": "2.0.3"
84
+}

+ 93
- 0
node_modules/cordova-plugin-device/plugin.xml Zobrazit soubor

@@ -0,0 +1,93 @@
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-device"
25
+    version="2.0.3">
26
+    <name>Device</name>
27
+    <description>Cordova Device Plugin</description>
28
+    <license>Apache 2.0</license>
29
+    <keywords>cordova,device</keywords>
30
+    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git</repo>
31
+    <issue>https://issues.apache.org/jira/browse/CB/component/12320648</issue>
32
+
33
+    <js-module src="www/device.js" name="device">
34
+        <clobbers target="device" />
35
+    </js-module>
36
+
37
+    <!-- android -->
38
+    <platform name="android">
39
+        <config-file target="res/xml/config.xml" parent="/*">
40
+            <feature name="Device" >
41
+                <param name="android-package" value="org.apache.cordova.device.Device"/>
42
+            </feature>
43
+        </config-file>
44
+
45
+        <source-file src="src/android/Device.java" target-dir="src/org/apache/cordova/device" />
46
+    </platform>
47
+
48
+    <!-- ios -->
49
+    <platform name="ios">
50
+        <config-file target="config.xml" parent="/*">
51
+            <feature name="Device">
52
+                <param name="ios-package" value="CDVDevice"/>
53
+            </feature>
54
+        </config-file>
55
+
56
+        <header-file src="src/ios/CDVDevice.h" />
57
+        <source-file src="src/ios/CDVDevice.m" />
58
+    </platform>
59
+
60
+    <!-- windows -->
61
+    <platform name="windows">
62
+        <js-module src="src/windows/DeviceProxy.js" name="DeviceProxy">
63
+            <runs />
64
+        </js-module>
65
+    </platform>
66
+
67
+    <!-- browser -->
68
+    <platform name="browser">
69
+        <config-file target="config.xml" parent="/*">
70
+            <feature name="Device">
71
+                <param name="browser-package" value="Device" />
72
+            </feature>
73
+        </config-file>
74
+
75
+        <js-module src="src/browser/DeviceProxy.js" name="DeviceProxy">
76
+            <runs />
77
+        </js-module>
78
+    </platform>
79
+
80
+    <!-- osx -->
81
+    <platform name="osx">
82
+        <config-file target="config.xml" parent="/*">
83
+            <feature name="Device">
84
+                <param name="ios-package" value="CDVDevice"/>
85
+            </feature>
86
+        </config-file>
87
+
88
+        <header-file src="src/osx/CDVDevice.h" />
89
+        <source-file src="src/osx/CDVDevice.m" />
90
+    </platform>
91
+
92
+
93
+</plugin>

+ 174
- 0
node_modules/cordova-plugin-device/src/android/Device.java Zobrazit soubor

@@ -0,0 +1,174 @@
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.device;
20
+
21
+import java.util.TimeZone;
22
+
23
+import org.apache.cordova.CordovaWebView;
24
+import org.apache.cordova.CallbackContext;
25
+import org.apache.cordova.CordovaPlugin;
26
+import org.apache.cordova.CordovaInterface;
27
+import org.json.JSONArray;
28
+import org.json.JSONException;
29
+import org.json.JSONObject;
30
+
31
+import android.provider.Settings;
32
+
33
+public class Device extends CordovaPlugin {
34
+    public static final String TAG = "Device";
35
+
36
+    public static String platform;                            // Device OS
37
+    public static String uuid;                                // Device UUID
38
+
39
+    private static final String ANDROID_PLATFORM = "Android";
40
+    private static final String AMAZON_PLATFORM = "amazon-fireos";
41
+    private static final String AMAZON_DEVICE = "Amazon";
42
+
43
+    /**
44
+     * Constructor.
45
+     */
46
+    public Device() {
47
+    }
48
+
49
+    /**
50
+     * Sets the context of the Command. This can then be used to do things like
51
+     * get file paths associated with the Activity.
52
+     *
53
+     * @param cordova The context of the main Activity.
54
+     * @param webView The CordovaWebView Cordova is running in.
55
+     */
56
+    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
57
+        super.initialize(cordova, webView);
58
+        Device.uuid = getUuid();
59
+    }
60
+
61
+    /**
62
+     * Executes the request and returns PluginResult.
63
+     *
64
+     * @param action            The action to execute.
65
+     * @param args              JSONArry of arguments for the plugin.
66
+     * @param callbackContext   The callback id used when calling back into JavaScript.
67
+     * @return                  True if the action was valid, false if not.
68
+     */
69
+    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
70
+        if ("getDeviceInfo".equals(action)) {
71
+            JSONObject r = new JSONObject();
72
+            r.put("uuid", Device.uuid);
73
+            r.put("version", this.getOSVersion());
74
+            r.put("platform", this.getPlatform());
75
+            r.put("model", this.getModel());
76
+            r.put("manufacturer", this.getManufacturer());
77
+	        r.put("isVirtual", this.isVirtual());
78
+            r.put("serial", this.getSerialNumber());
79
+            callbackContext.success(r);
80
+        }
81
+        else {
82
+            return false;
83
+        }
84
+        return true;
85
+    }
86
+
87
+    //--------------------------------------------------------------------------
88
+    // LOCAL METHODS
89
+    //--------------------------------------------------------------------------
90
+
91
+    /**
92
+     * Get the OS name.
93
+     *
94
+     * @return
95
+     */
96
+    public String getPlatform() {
97
+        String platform;
98
+        if (isAmazonDevice()) {
99
+            platform = AMAZON_PLATFORM;
100
+        } else {
101
+            platform = ANDROID_PLATFORM;
102
+        }
103
+        return platform;
104
+    }
105
+
106
+    /**
107
+     * Get the device's Universally Unique Identifier (UUID).
108
+     *
109
+     * @return
110
+     */
111
+    public String getUuid() {
112
+        String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
113
+        return uuid;
114
+    }
115
+
116
+    public String getModel() {
117
+        String model = android.os.Build.MODEL;
118
+        return model;
119
+    }
120
+
121
+    public String getProductName() {
122
+        String productname = android.os.Build.PRODUCT;
123
+        return productname;
124
+    }
125
+
126
+    public String getManufacturer() {
127
+        String manufacturer = android.os.Build.MANUFACTURER;
128
+        return manufacturer;
129
+    }
130
+
131
+    public String getSerialNumber() {
132
+        String serial = android.os.Build.SERIAL;
133
+        return serial;
134
+    }
135
+
136
+    /**
137
+     * Get the OS version.
138
+     *
139
+     * @return
140
+     */
141
+    public String getOSVersion() {
142
+        String osversion = android.os.Build.VERSION.RELEASE;
143
+        return osversion;
144
+    }
145
+
146
+    public String getSDKVersion() {
147
+        @SuppressWarnings("deprecation")
148
+        String sdkversion = android.os.Build.VERSION.SDK;
149
+        return sdkversion;
150
+    }
151
+
152
+    public String getTimeZoneID() {
153
+        TimeZone tz = TimeZone.getDefault();
154
+        return (tz.getID());
155
+    }
156
+
157
+    /**
158
+     * Function to check if the device is manufactured by Amazon
159
+     *
160
+     * @return
161
+     */
162
+    public boolean isAmazonDevice() {
163
+        if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) {
164
+            return true;
165
+        }
166
+        return false;
167
+    }
168
+
169
+    public boolean isVirtual() {
170
+	return android.os.Build.FINGERPRINT.contains("generic") ||
171
+	    android.os.Build.PRODUCT.contains("sdk");
172
+    }
173
+
174
+}

+ 84
- 0
node_modules/cordova-plugin-device/src/browser/DeviceProxy.js Zobrazit soubor

@@ -0,0 +1,84 @@
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 browser = require('cordova/platform');
22
+
23
+function getPlatform () {
24
+    return 'browser';
25
+}
26
+
27
+function getModel () {
28
+    return getBrowserInfo(true);
29
+}
30
+
31
+function getVersion () {
32
+    return getBrowserInfo(false);
33
+}
34
+
35
+function getBrowserInfo (getModel) {
36
+    var userAgent = navigator.userAgent;
37
+    var returnVal = '';
38
+    var offset;
39
+
40
+    if ((offset = userAgent.indexOf('Edge')) !== -1) {
41
+        returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
42
+    } else if ((offset = userAgent.indexOf('Chrome')) !== -1) {
43
+        returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7);
44
+    } else if ((offset = userAgent.indexOf('Safari')) !== -1) {
45
+        if (getModel) {
46
+            returnVal = 'Safari';
47
+        } else {
48
+            returnVal = userAgent.substring(offset + 7);
49
+
50
+            if ((offset = userAgent.indexOf('Version')) !== -1) {
51
+                returnVal = userAgent.substring(offset + 8);
52
+            }
53
+        }
54
+    } else if ((offset = userAgent.indexOf('Firefox')) !== -1) {
55
+        returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8);
56
+    } else if ((offset = userAgent.indexOf('MSIE')) !== -1) {
57
+        returnVal = (getModel) ? 'MSIE' : userAgent.substring(offset + 5);
58
+    } else if ((offset = userAgent.indexOf('Trident')) !== -1) {
59
+        returnVal = (getModel) ? 'MSIE' : '11';
60
+    }
61
+
62
+    if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) {
63
+        returnVal = returnVal.substring(0, offset);
64
+    }
65
+
66
+    return returnVal;
67
+}
68
+
69
+module.exports = {
70
+    getDeviceInfo: function (success, error) {
71
+        setTimeout(function () {
72
+            success({
73
+                cordova: browser.cordovaVersion,
74
+                platform: getPlatform(),
75
+                model: getModel(),
76
+                version: getVersion(),
77
+                uuid: null,
78
+                isVirtual: false
79
+            });
80
+        }, 0);
81
+    }
82
+};
83
+
84
+require('cordova/exec/proxy').add('Device', module.exports);

+ 30
- 0
node_modules/cordova-plugin-device/src/ios/CDVDevice.h Zobrazit soubor

@@ -0,0 +1,30 @@
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 <UIKit/UIKit.h>
21
+#import <Cordova/CDVPlugin.h>
22
+
23
+@interface CDVDevice : CDVPlugin
24
+{}
25
+
26
++ (NSString*)cordovaVersion;
27
+
28
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
29
+
30
+@end

+ 115
- 0
node_modules/cordova-plugin-device/src/ios/CDVDevice.m Zobrazit soubor

@@ -0,0 +1,115 @@
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
+#include <sys/types.h>
21
+#include <sys/sysctl.h>
22
+#include "TargetConditionals.h"
23
+
24
+#import <Cordova/CDV.h>
25
+#import "CDVDevice.h"
26
+
27
+@implementation UIDevice (ModelVersion)
28
+
29
+- (NSString*)modelVersion
30
+{
31
+#if TARGET_IPHONE_SIMULATOR
32
+    NSString* platform = NSProcessInfo.processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"];
33
+#else
34
+    size_t size;
35
+
36
+    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
37
+    char* machine = malloc(size);
38
+    sysctlbyname("hw.machine", machine, &size, NULL, 0);
39
+    NSString* platform = [NSString stringWithUTF8String:machine];
40
+    free(machine);
41
+#endif
42
+    return platform;
43
+}
44
+
45
+@end
46
+
47
+@interface CDVDevice () {}
48
+@end
49
+
50
+@implementation CDVDevice
51
+
52
+- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
53
+{
54
+    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
55
+    static NSString* UUID_KEY = @"CDVUUID";
56
+    
57
+    // Check user defaults first to maintain backwards compaitibility with previous versions
58
+    // which didn't user identifierForVendor
59
+    NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
60
+    if (app_uuid == nil) {
61
+        if ([device respondsToSelector:@selector(identifierForVendor)]) {
62
+            app_uuid = [[device identifierForVendor] UUIDString];
63
+        } else {
64
+            CFUUIDRef uuid = CFUUIDCreate(NULL);
65
+            app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
66
+            CFRelease(uuid);
67
+        }
68
+
69
+        [userDefaults setObject:app_uuid forKey:UUID_KEY];
70
+        [userDefaults synchronize];
71
+    }
72
+    
73
+    return app_uuid;
74
+}
75
+
76
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
77
+{
78
+    NSDictionary* deviceProperties = [self deviceProperties];
79
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
80
+
81
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
82
+}
83
+
84
+- (NSDictionary*)deviceProperties
85
+{
86
+    UIDevice* device = [UIDevice currentDevice];
87
+
88
+    return @{
89
+             @"manufacturer": @"Apple",
90
+             @"model": [device modelVersion],
91
+             @"platform": @"iOS",
92
+             @"version": [device systemVersion],
93
+             @"uuid": [self uniqueAppInstanceIdentifier:device],
94
+             @"cordova": [[self class] cordovaVersion],
95
+             @"isVirtual": @([self isVirtual])
96
+             };
97
+}
98
+
99
++ (NSString*)cordovaVersion
100
+{
101
+    return CDV_VERSION;
102
+}
103
+
104
+- (BOOL)isVirtual
105
+{
106
+    #if TARGET_OS_SIMULATOR
107
+        return true;
108
+    #elif TARGET_IPHONE_SIMULATOR
109
+        return true;
110
+    #else
111
+        return false;
112
+    #endif
113
+}
114
+
115
+@end

+ 28
- 0
node_modules/cordova-plugin-device/src/osx/CDVDevice.h Zobrazit soubor

@@ -0,0 +1,28 @@
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 <Cordova/CDVPlugin.h>
21
+
22
+@interface CDVDevice : CDVPlugin
23
+
24
++ (NSString*) cordovaVersion;
25
+
26
+- (void) getDeviceInfo:(CDVInvokedUrlCommand*)command;
27
+
28
+@end

+ 113
- 0
node_modules/cordova-plugin-device/src/osx/CDVDevice.m Zobrazit soubor

@@ -0,0 +1,113 @@
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
+#include <sys/sysctl.h>
21
+
22
+#import "CDVDevice.h"
23
+
24
+#define SYSTEM_VERSION_PLIST    @"/System/Library/CoreServices/SystemVersion.plist"
25
+
26
+@implementation CDVDevice
27
+
28
+- (NSString*) modelVersion {
29
+    size_t size;
30
+
31
+    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
32
+    char* machine = malloc(size);
33
+    sysctlbyname("hw.machine", machine, &size, NULL, 0);
34
+    NSString* modelVersion = [NSString stringWithUTF8String:machine];
35
+    free(machine);
36
+
37
+    return modelVersion;
38
+}
39
+
40
+
41
+- (NSString*) getSerialNr {
42
+    NSString* serialNr;
43
+    io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
44
+    if (platformExpert) {
45
+        CFTypeRef serialNumberAsCFString =
46
+                IORegistryEntryCreateCFProperty(platformExpert,
47
+                        CFSTR(kIOPlatformSerialNumberKey),
48
+                        kCFAllocatorDefault, 0);
49
+        if (serialNumberAsCFString) {
50
+            serialNr = (__bridge NSString*) serialNumberAsCFString;
51
+        }
52
+        IOObjectRelease(platformExpert);
53
+    }
54
+    return serialNr;
55
+}
56
+
57
+- (NSString*) uniqueAppInstanceIdentifier {
58
+    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
59
+    static NSString* UUID_KEY = @"CDVUUID";
60
+
61
+    NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
62
+
63
+    if (app_uuid == nil) {
64
+        CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
65
+        CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
66
+
67
+        app_uuid = [NSString stringWithString:(__bridge NSString*) uuidString];
68
+        [userDefaults setObject:app_uuid forKey:UUID_KEY];
69
+        [userDefaults synchronize];
70
+
71
+        CFRelease(uuidString);
72
+        CFRelease(uuidRef);
73
+    }
74
+
75
+    return app_uuid;
76
+}
77
+
78
+- (NSString*) platform {
79
+    return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductName"];
80
+}
81
+
82
+- (NSString*) systemVersion {
83
+    return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductVersion"];
84
+}
85
+
86
+- (void) getDeviceInfo:(CDVInvokedUrlCommand*) command {
87
+    NSDictionary* deviceProperties = [self deviceProperties];
88
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
89
+
90
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
91
+}
92
+
93
+- (NSDictionary*) deviceProperties {
94
+    NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4];
95
+
96
+    devProps[@"manufacturer"] = @"Apple";
97
+    devProps[@"model"] = [self modelVersion];
98
+    devProps[@"platform"] = [self platform];
99
+    devProps[@"version"] = [self systemVersion];
100
+    devProps[@"uuid"] = [self uniqueAppInstanceIdentifier];
101
+    devProps[@"cordova"] = [[self class] cordovaVersion];
102
+    devProps[@"serial"] = [self getSerialNr];
103
+    devProps[@"isVirtual"] = @NO;
104
+
105
+    NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps];
106
+    return devReturn;
107
+}
108
+
109
++ (NSString*) cordovaVersion {
110
+    return CDV_VERSION;
111
+}
112
+
113
+@end

+ 96
- 0
node_modules/cordova-plugin-device/src/windows/DeviceProxy.js Zobrazit soubor

@@ -0,0 +1,96 @@
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, createUUID */
23
+
24
+var ROOT_CONTAINER = '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}';
25
+var DEVICE_CLASS_KEY = '{A45C254E-DF1C-4EFD-8020-67D146A850E0},10';
26
+var DEVICE_CLASS_KEY_NO_SEMICOLON = '{A45C254E-DF1C-4EFD-8020-67D146A850E0}10';
27
+var ROOT_CONTAINER_QUERY = 'System.Devices.ContainerId:="' + ROOT_CONTAINER + '"';
28
+var HAL_DEVICE_CLASS = '4d36e966-e325-11ce-bfc1-08002be10318';
29
+var DEVICE_DRIVER_VERSION_KEY = '{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3';
30
+
31
+module.exports = {
32
+
33
+    getDeviceInfo: function (win, fail, args) {
34
+
35
+        // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId
36
+        var deviceId;
37
+        // get deviceId, or create and store one
38
+        var localSettings = Windows.Storage.ApplicationData.current.localSettings;
39
+        if (localSettings.values.deviceId) {
40
+            deviceId = localSettings.values.deviceId;
41
+        } else {
42
+            // App-specific hardware id could be used as uuid, but it changes if the hardware changes...
43
+            try {
44
+                var ASHWID = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null).id;
45
+                deviceId = Windows.Storage.Streams.DataReader.fromBuffer(ASHWID).readGuid();
46
+            } catch (e) {
47
+                // Couldn't get the hardware UUID
48
+                deviceId = createUUID();
49
+            }
50
+            // ...so cache it per-install
51
+            localSettings.values.deviceId = deviceId;
52
+        }
53
+
54
+        var userAgent = window.clientInformation.userAgent;
55
+        // this will report "windows" in windows8.1 and windows phone 8.1 apps
56
+        // and "windows8" in windows 8.0 apps similar to cordova.js
57
+        // See https://github.com/apache/cordova-js/blob/master/src/windows/platform.js#L25
58
+        var devicePlatform = userAgent.indexOf('MSAppHost/1.0') === -1 ? 'windows' : 'windows8';
59
+        var versionString = userAgent.match(/Windows (?:Phone |NT )?([0-9.]+)/)[1];
60
+
61
+        var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();
62
+        // Running in the Windows Simulator is a remote session.
63
+        // Running in the Windows Phone Emulator has the systemProductName set to "Virtual"
64
+        var isVirtual = Windows.System.RemoteDesktop.InteractiveSession.isRemote || deviceInfo.systemProductName === 'Virtual';
65
+        var manufacturer = deviceInfo.systemManufacturer;
66
+        var model = deviceInfo.systemProductName;
67
+
68
+        var Pnp = Windows.Devices.Enumeration.Pnp;
69
+
70
+        Pnp.PnpObject.findAllAsync(Pnp.PnpObjectType.device,
71
+                                [DEVICE_DRIVER_VERSION_KEY, DEVICE_CLASS_KEY],
72
+                                ROOT_CONTAINER_QUERY)
73
+        .then(function (rootDevices) {
74
+            for (var i = 0; i < rootDevices.length; i++) {
75
+                var rootDevice = rootDevices[i];
76
+                if (!rootDevice.properties) continue;
77
+                if (rootDevice.properties[DEVICE_CLASS_KEY_NO_SEMICOLON] === HAL_DEVICE_CLASS) {
78
+                    versionString = rootDevice.properties[DEVICE_DRIVER_VERSION_KEY];
79
+                    break;
80
+                }
81
+            }
82
+
83
+            setTimeout(function () {
84
+                win({ platform: devicePlatform,
85
+                    version: versionString,
86
+                    uuid: deviceId,
87
+                    isVirtual: isVirtual,
88
+                    model: model,
89
+                    manufacturer: manufacturer});
90
+            }, 0);
91
+        });
92
+    }
93
+
94
+}; // exports
95
+
96
+require('cordova/exec/proxy').add('Device', module.exports);

+ 14
- 0
node_modules/cordova-plugin-device/tests/package.json Zobrazit soubor

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

+ 31
- 0
node_modules/cordova-plugin-device/tests/plugin.xml Zobrazit soubor

@@ -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-device-tests"
25
+    version="2.0.3">
26
+    <name>Cordova Device Plugin Tests</name>
27
+    <license>Apache 2.0</license>
28
+
29
+    <js-module src="tests.js" name="tests">
30
+    </js-module>
31
+</plugin>

+ 113
- 0
node_modules/cordova-plugin-device/tests/tests.js Zobrazit soubor

@@ -0,0 +1,113 @@
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
+/* eslint-env jasmine */
23
+
24
+exports.defineAutoTests = function () {
25
+    describe('Device Information (window.device)', function () {
26
+        it('should exist', function () {
27
+            expect(window.device).toBeDefined();
28
+        });
29
+
30
+        it('should contain a platform specification that is a string', function () {
31
+            expect(window.device.platform).toBeDefined();
32
+            expect((String(window.device.platform)).length > 0).toBe(true);
33
+        });
34
+
35
+        it('should contain a version specification that is a string', function () {
36
+            expect(window.device.version).toBeDefined();
37
+            expect((String(window.device.version)).length > 0).toBe(true);
38
+        });
39
+
40
+        it('should contain a UUID specification that is a string or a number', function () {
41
+            expect(window.device.uuid).toBeDefined();
42
+            if (typeof window.device.uuid === 'string' || typeof window.device.uuid === 'object') {
43
+                expect((String(window.device.uuid)).length > 0).toBe(true);
44
+            } else {
45
+                expect(window.device.uuid > 0).toBe(true);
46
+            }
47
+        });
48
+
49
+        it('should contain a cordova specification that is a string', function () {
50
+            expect(window.device.cordova).toBeDefined();
51
+            expect((String(window.device.cordova)).length > 0).toBe(true);
52
+        });
53
+
54
+        it('should depend on the presence of cordova.version string', function () {
55
+            expect(window.cordova.version).toBeDefined();
56
+            expect((String(window.cordova.version)).length > 0).toBe(true);
57
+        });
58
+
59
+        it('should contain device.cordova equal to cordova.version', function () {
60
+            expect(window.device.cordova).toBe(window.cordova.version);
61
+        });
62
+
63
+        it('should contain a model specification that is a string', function () {
64
+            expect(window.device.model).toBeDefined();
65
+            expect((String(window.device.model)).length > 0).toBe(true);
66
+        });
67
+
68
+        it('should contain a manufacturer property that is a string', function () {
69
+            expect(window.device.manufacturer).toBeDefined();
70
+            expect((String(window.device.manufacturer)).length > 0).toBe(true);
71
+        });
72
+
73
+        it('should contain an isVirtual property that is a boolean', function () {
74
+            expect(window.device.isVirtual).toBeDefined();
75
+            expect(typeof window.device.isVirtual).toBe('boolean');
76
+        });
77
+
78
+        it('should contain a serial number specification that is a string', function () {
79
+            expect(window.device.serial).toBeDefined();
80
+            expect((String(window.device.serial)).length > 0).toBe(true);
81
+
82
+        });
83
+
84
+    });
85
+};
86
+
87
+exports.defineManualTests = function (contentEl, createActionButton) {
88
+    var logMessage = function (message, color) {
89
+        var log = document.getElementById('info');
90
+        var logLine = document.createElement('div');
91
+        if (color) {
92
+            logLine.style.color = color;
93
+        }
94
+        logLine.innerHTML = message;
95
+        log.appendChild(logLine);
96
+    };
97
+
98
+    var clearLog = function () {
99
+        var log = document.getElementById('info');
100
+        log.innerHTML = '';
101
+    };
102
+
103
+    var device_tests = '<h3>Press Dump Device button to get device information</h3>' +
104
+        '<div id="dump_device"></div>' +
105
+        'Expected result: Status box will get updated with device info. (i.e. platform, version, uuid, model, etc)';
106
+
107
+    contentEl.innerHTML = '<div id="info"></div>' + device_tests;
108
+
109
+    createActionButton('Dump device', function () {
110
+        clearLog();
111
+        logMessage(JSON.stringify(window.device, null, '\t'));
112
+    }, 'dump_device');
113
+};

+ 35
- 0
node_modules/cordova-plugin-device/types/index.d.ts Zobrazit soubor

@@ -0,0 +1,35 @@
1
+// Type definitions for cordova-plugin-device 2.0
2
+// Project: https://github.com/apache/cordova-plugin-device
3
+// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
4
+//                 Tim Brust <https://github.com/timbru31>
5
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
+
7
+/**
8
+ * This plugin defines a global device object, which describes the device's hardware and software.
9
+ * Although the object is in the global scope, it is not available until after the deviceready event.
10
+ */
11
+interface Device {
12
+    /** Get the version of Cordova running on the device. */
13
+    cordova: string;
14
+    /** Indicates that Cordova initialize successfully. */
15
+    available: boolean;
16
+    /**
17
+     * The device.model returns the name of the device's model or product. The value is set
18
+     * by the device manufacturer and may be different across versions of the same product.
19
+     */
20
+    model: string;
21
+    /** Get the device's operating system name. */
22
+    platform: string;
23
+    /** Get the device's Universally Unique Identifier (UUID). */
24
+    uuid: string;
25
+    /** Get the operating system version. */
26
+    version: string;
27
+    /** Get the device's manufacturer. */
28
+    manufacturer: string;
29
+    /** Whether the device is running on a simulator. */
30
+    isVirtual: boolean;
31
+    /** Get the device hardware serial number. */
32
+    serial: string;
33
+}
34
+
35
+declare var device: Device;

+ 83
- 0
node_modules/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,83 @@
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
+var channel = require('cordova/channel');
24
+var utils = require('cordova/utils');
25
+var exec = require('cordova/exec');
26
+var cordova = require('cordova');
27
+
28
+channel.createSticky('onCordovaInfoReady');
29
+// Tell cordova channel to wait on the CordovaInfoReady event
30
+channel.waitForInitialization('onCordovaInfoReady');
31
+
32
+/**
33
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
34
+ * phone, etc.
35
+ * @constructor
36
+ */
37
+function Device () {
38
+    this.available = false;
39
+    this.platform = null;
40
+    this.version = null;
41
+    this.uuid = null;
42
+    this.cordova = null;
43
+    this.model = null;
44
+    this.manufacturer = null;
45
+    this.isVirtual = null;
46
+    this.serial = null;
47
+
48
+    var me = this;
49
+
50
+    channel.onCordovaReady.subscribe(function () {
51
+        me.getInfo(function (info) {
52
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
53
+            // TODO: CB-5105 native implementations should not return info.cordova
54
+            var buildLabel = cordova.version;
55
+            me.available = true;
56
+            me.platform = info.platform;
57
+            me.version = info.version;
58
+            me.uuid = info.uuid;
59
+            me.cordova = buildLabel;
60
+            me.model = info.model;
61
+            me.isVirtual = info.isVirtual;
62
+            me.manufacturer = info.manufacturer || 'unknown';
63
+            me.serial = info.serial || 'unknown';
64
+            channel.onCordovaInfoReady.fire();
65
+        }, function (e) {
66
+            me.available = false;
67
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
68
+        });
69
+    });
70
+}
71
+
72
+/**
73
+ * Get device info
74
+ *
75
+ * @param {Function} successCallback The function to call when the heading data is available
76
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
77
+ */
78
+Device.prototype.getInfo = function (successCallback, errorCallback) {
79
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
80
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
81
+};
82
+
83
+module.exports = new Device();

+ 6
- 0
package-lock.json Zobrazit soubor

@@ -1576,6 +1576,12 @@
1576 1576
                 }
1577 1577
             }
1578 1578
         },
1579
+        "cordova-plugin-device": {
1580
+            "version": "2.0.3",
1581
+            "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
1582
+            "integrity": "sha512-Jb3V72btxf3XHpkPQsGdyc8N6tVBYn1vsxSFj43fIz9vonJDUThYPCJJHqk6PX6N4dJw6I4FjxkpfCR4LDYMlw==",
1583
+            "dev": true
1584
+        },
1579 1585
         "cordova-plugin-whitelist": {
1580 1586
             "version": "1.3.4",
1581 1587
             "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz",

+ 4
- 2
package.json Zobrazit soubor

@@ -20,11 +20,13 @@
20 20
     "localforage": "^1.9.0"
21 21
   },
22 22
   "devDependencies": {
23
-    "cordova-ios": "^6.1.1"
23
+    "cordova-ios": "^6.1.1",
24
+    "cordova-plugin-device": "^2.0.3"
24 25
   },
25 26
   "cordova": {
26 27
     "plugins": {
27
-      "cordova-plugin-whitelist": {}
28
+      "cordova-plugin-whitelist": {},
29
+      "cordova-plugin-device": {}
28 30
     },
29 31
     "platforms": [
30 32
       "browser",

+ 19
- 2
platforms/android/android.json Zobrazit soubor

@@ -11,6 +11,10 @@
11 11
             {
12 12
               "xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
13 13
               "count": 1
14
+            },
15
+            {
16
+              "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
17
+              "count": 1
14 18
             }
15 19
           ]
16 20
         }
@@ -20,11 +24,24 @@
20 24
   "installed_plugins": {
21 25
     "cordova-plugin-whitelist": {
22 26
       "PACKAGE_NAME": "io.cordova.hellocordova"
27
+    },
28
+    "cordova-plugin-device": {
29
+      "PACKAGE_NAME": "io.cordova.hellocordova"
23 30
     }
24 31
   },
25 32
   "dependent_plugins": {},
26
-  "modules": [],
33
+  "modules": [
34
+    {
35
+      "id": "cordova-plugin-device.device",
36
+      "file": "plugins/cordova-plugin-device/www/device.js",
37
+      "pluginId": "cordova-plugin-device",
38
+      "clobbers": [
39
+        "device"
40
+      ]
41
+    }
42
+  ],
27 43
   "plugin_metadata": {
28
-    "cordova-plugin-whitelist": "1.3.4"
44
+    "cordova-plugin-whitelist": "1.3.4",
45
+    "cordova-plugin-device": "2.0.3"
29 46
   }
30 47
 }

+ 12
- 2
platforms/android/app/src/main/assets/www/cordova_plugins.js Zobrazit soubor

@@ -1,6 +1,16 @@
1 1
 cordova.define('cordova/plugin_list', function(require, exports, module) {
2
-  module.exports = [];
2
+  module.exports = [
3
+    {
4
+      "id": "cordova-plugin-device.device",
5
+      "file": "plugins/cordova-plugin-device/www/device.js",
6
+      "pluginId": "cordova-plugin-device",
7
+      "clobbers": [
8
+        "device"
9
+      ]
10
+    }
11
+  ];
3 12
   module.exports.metadata = {
4
-    "cordova-plugin-whitelist": "1.3.4"
13
+    "cordova-plugin-whitelist": "1.3.4",
14
+    "cordova-plugin-device": "2.0.3"
5 15
   };
6 16
 });

+ 7
- 2
platforms/android/app/src/main/assets/www/index.html Zobrazit soubor

@@ -37,10 +37,9 @@
37 37
         <link rel="stylesheet" href="calendar_files/css/theme1.css"/>
38 38
         <!--this is for the search bar-->
39 39
         <link rel = "stylesheet" href = "css/searchbar1.css">
40
-
40
+        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
41 41
         <meta name="format-detection" content="telephone=no">
42 42
         <meta name="msapplication-tap-highlight" content="no">
43
-        <meta name="viewport" content="initial-scale=1, width=device-width, height=device-height, viewport-fit=cover">
44 43
         <meta charset="UTF-8">
45 44
         <link rel="stylesheet" type="text/css" href="css/index.css">
46 45
         <link rel="stylesheet" href="lib/OnsenUI/css/onsenui.css">
@@ -598,6 +597,12 @@
598 597
                         //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
599 598
                         //but if theres only one then you just write it into the page
600 599
                         if(esp.trim() != ""){
600
+
601
+                            //Fixes phrase error in json
602
+                            if(esp.includes("Figuras y simbolos indigenas")) {
603
+                                esp = esp.replace("Figuras y simbolos indigenas", "Figuras y símbolos indígenas")
604
+                            }
605
+
601 606
                             if(esp.includes(";", 0)){
602 607
                                 esp=esp.replace(/;/g,", ");
603 608
                                 data+='Tipos de artesanías: '+esp+'<br>';

+ 4
- 0
platforms/android/app/src/main/assets/www/js/index.js Zobrazit soubor

@@ -28,6 +28,10 @@ var app = {
28 28
     // 'pause', 'resume', etc.
29 29
     onDeviceReady: function() {
30 30
 
31
+        if (ons.platform.isIPhone()) { 
32
+            document.documentElement.setAttribute('onsflag-iphonex-portrait', '');
33
+            document.documentElement.setAttribute('onsflag-iphonex-landscape', '');
34
+        }
31 35
 
32 36
     },
33 37
 

+ 2
- 2
platforms/android/app/src/main/assets/www/lib/OnsenUI/css/onsenui.css Zobrazit soubor

@@ -36,7 +36,7 @@ ons-toast .toast {
36 36
 }
37 37
 
38 38
 ons-tab {
39
-    background: #e6e6e6;/*#5fe1af;*/
39
+    background: #fafafa;/*#5fe1af;*/
40 40
   -webkit-transform: translate3d(0, 0, 0);
41 41
           transform: translate3d(0, 0, 0);
42 42
 }
@@ -53,7 +53,7 @@ ons-toolbar:not([inline]), ons-bottom-toolbar {
53 53
   position: absolute;
54 54
   left: 0;
55 55
   right: 0;
56
-    background: #e6e6e6;/*#5fe1af;*/
56
+    background: #fafafa;/*#5fe1af;*/
57 57
   z-index: 10000;
58 58
 }
59 59
 

+ 86
- 0
platforms/android/app/src/main/assets/www/plugins/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,86 @@
1
+cordova.define("cordova-plugin-device.device", function(require, exports, module) {
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
+var argscheck = require('cordova/argscheck');
24
+var channel = require('cordova/channel');
25
+var utils = require('cordova/utils');
26
+var exec = require('cordova/exec');
27
+var cordova = require('cordova');
28
+
29
+channel.createSticky('onCordovaInfoReady');
30
+// Tell cordova channel to wait on the CordovaInfoReady event
31
+channel.waitForInitialization('onCordovaInfoReady');
32
+
33
+/**
34
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
35
+ * phone, etc.
36
+ * @constructor
37
+ */
38
+function Device () {
39
+    this.available = false;
40
+    this.platform = null;
41
+    this.version = null;
42
+    this.uuid = null;
43
+    this.cordova = null;
44
+    this.model = null;
45
+    this.manufacturer = null;
46
+    this.isVirtual = null;
47
+    this.serial = null;
48
+
49
+    var me = this;
50
+
51
+    channel.onCordovaReady.subscribe(function () {
52
+        me.getInfo(function (info) {
53
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
54
+            // TODO: CB-5105 native implementations should not return info.cordova
55
+            var buildLabel = cordova.version;
56
+            me.available = true;
57
+            me.platform = info.platform;
58
+            me.version = info.version;
59
+            me.uuid = info.uuid;
60
+            me.cordova = buildLabel;
61
+            me.model = info.model;
62
+            me.isVirtual = info.isVirtual;
63
+            me.manufacturer = info.manufacturer || 'unknown';
64
+            me.serial = info.serial || 'unknown';
65
+            channel.onCordovaInfoReady.fire();
66
+        }, function (e) {
67
+            me.available = false;
68
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
69
+        });
70
+    });
71
+}
72
+
73
+/**
74
+ * Get device info
75
+ *
76
+ * @param {Function} successCallback The function to call when the heading data is available
77
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
78
+ */
79
+Device.prototype.getInfo = function (successCallback, errorCallback) {
80
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
81
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
82
+};
83
+
84
+module.exports = new Device();
85
+
86
+});

+ 36
- 0
platforms/android/app/src/main/assets/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js Zobrazit soubor

@@ -0,0 +1,36 @@
1
+cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exports, module) {
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
+var exec = require('cordova/exec');
24
+
25
+var splashscreen = {
26
+    show: function () {
27
+        exec(null, null, 'SplashScreen', 'show', []);
28
+    },
29
+    hide: function () {
30
+        exec(null, null, 'SplashScreen', 'hide', []);
31
+    }
32
+};
33
+
34
+module.exports = splashscreen;
35
+
36
+});

+ 116
- 0
platforms/android/app/src/main/assets/www/plugins/cordova-plugin-statusbar/www/statusbar.js Zobrazit soubor

@@ -0,0 +1,116 @@
1
+cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) {
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
+/* global cordova */
24
+
25
+var exec = require('cordova/exec');
26
+
27
+var namedColors = {
28
+    "black": "#000000",
29
+    "darkGray": "#A9A9A9",
30
+    "lightGray": "#D3D3D3",
31
+    "white": "#FFFFFF",
32
+    "gray": "#808080",
33
+    "red": "#FF0000",
34
+    "green": "#00FF00",
35
+    "blue": "#0000FF",
36
+    "cyan": "#00FFFF",
37
+    "yellow": "#FFFF00",
38
+    "magenta": "#FF00FF",
39
+    "orange": "#FFA500",
40
+    "purple": "#800080",
41
+    "brown": "#A52A2A"
42
+};
43
+
44
+var StatusBar = {
45
+
46
+    isVisible: true,
47
+
48
+    overlaysWebView: function (doOverlay) {
49
+        exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
50
+    },
51
+
52
+    styleDefault: function () {
53
+        // dark text ( to be used on a light background )
54
+        exec(null, null, "StatusBar", "styleDefault", []);
55
+    },
56
+
57
+    styleLightContent: function () {
58
+        // light text ( to be used on a dark background )
59
+        exec(null, null, "StatusBar", "styleLightContent", []);
60
+    },
61
+
62
+    styleBlackTranslucent: function () {
63
+        // #88000000 ? Apple says to use lightContent instead
64
+        exec(null, null, "StatusBar", "styleBlackTranslucent", []);
65
+    },
66
+
67
+    styleBlackOpaque: function () {
68
+        // #FF000000 ? Apple says to use lightContent instead
69
+        exec(null, null, "StatusBar", "styleBlackOpaque", []);
70
+    },
71
+
72
+    backgroundColorByName: function (colorname) {
73
+        return StatusBar.backgroundColorByHexString(namedColors[colorname]);
74
+    },
75
+
76
+    backgroundColorByHexString: function (hexString) {
77
+        if (hexString.charAt(0) !== "#") {
78
+            hexString = "#" + hexString;
79
+        }
80
+
81
+        if (hexString.length === 4) {
82
+            var split = hexString.split("");
83
+            hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3];
84
+        }
85
+
86
+        exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
87
+    },
88
+
89
+    hide: function () {
90
+        exec(null, null, "StatusBar", "hide", []);
91
+        StatusBar.isVisible = false;
92
+    },
93
+
94
+    show: function () {
95
+        exec(null, null, "StatusBar", "show", []);
96
+        StatusBar.isVisible = true;
97
+    }
98
+
99
+};
100
+
101
+// prime it. setTimeout so that proxy gets time to init
102
+window.setTimeout(function () {
103
+    exec(function (res) {
104
+        if (typeof res == 'object') {
105
+            if (res.type == 'tap') {
106
+                cordova.fireWindowEvent('statusTap');
107
+            }
108
+        } else {
109
+            StatusBar.isVisible = res;
110
+        }
111
+    }, null, "StatusBar", "_ready", []);
112
+}, 0);
113
+
114
+module.exports = StatusBar;
115
+
116
+});

+ 174
- 0
platforms/android/app/src/main/java/org/apache/cordova/device/Device.java Zobrazit soubor

@@ -0,0 +1,174 @@
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.device;
20
+
21
+import java.util.TimeZone;
22
+
23
+import org.apache.cordova.CordovaWebView;
24
+import org.apache.cordova.CallbackContext;
25
+import org.apache.cordova.CordovaPlugin;
26
+import org.apache.cordova.CordovaInterface;
27
+import org.json.JSONArray;
28
+import org.json.JSONException;
29
+import org.json.JSONObject;
30
+
31
+import android.provider.Settings;
32
+
33
+public class Device extends CordovaPlugin {
34
+    public static final String TAG = "Device";
35
+
36
+    public static String platform;                            // Device OS
37
+    public static String uuid;                                // Device UUID
38
+
39
+    private static final String ANDROID_PLATFORM = "Android";
40
+    private static final String AMAZON_PLATFORM = "amazon-fireos";
41
+    private static final String AMAZON_DEVICE = "Amazon";
42
+
43
+    /**
44
+     * Constructor.
45
+     */
46
+    public Device() {
47
+    }
48
+
49
+    /**
50
+     * Sets the context of the Command. This can then be used to do things like
51
+     * get file paths associated with the Activity.
52
+     *
53
+     * @param cordova The context of the main Activity.
54
+     * @param webView The CordovaWebView Cordova is running in.
55
+     */
56
+    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
57
+        super.initialize(cordova, webView);
58
+        Device.uuid = getUuid();
59
+    }
60
+
61
+    /**
62
+     * Executes the request and returns PluginResult.
63
+     *
64
+     * @param action            The action to execute.
65
+     * @param args              JSONArry of arguments for the plugin.
66
+     * @param callbackContext   The callback id used when calling back into JavaScript.
67
+     * @return                  True if the action was valid, false if not.
68
+     */
69
+    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
70
+        if ("getDeviceInfo".equals(action)) {
71
+            JSONObject r = new JSONObject();
72
+            r.put("uuid", Device.uuid);
73
+            r.put("version", this.getOSVersion());
74
+            r.put("platform", this.getPlatform());
75
+            r.put("model", this.getModel());
76
+            r.put("manufacturer", this.getManufacturer());
77
+	        r.put("isVirtual", this.isVirtual());
78
+            r.put("serial", this.getSerialNumber());
79
+            callbackContext.success(r);
80
+        }
81
+        else {
82
+            return false;
83
+        }
84
+        return true;
85
+    }
86
+
87
+    //--------------------------------------------------------------------------
88
+    // LOCAL METHODS
89
+    //--------------------------------------------------------------------------
90
+
91
+    /**
92
+     * Get the OS name.
93
+     *
94
+     * @return
95
+     */
96
+    public String getPlatform() {
97
+        String platform;
98
+        if (isAmazonDevice()) {
99
+            platform = AMAZON_PLATFORM;
100
+        } else {
101
+            platform = ANDROID_PLATFORM;
102
+        }
103
+        return platform;
104
+    }
105
+
106
+    /**
107
+     * Get the device's Universally Unique Identifier (UUID).
108
+     *
109
+     * @return
110
+     */
111
+    public String getUuid() {
112
+        String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
113
+        return uuid;
114
+    }
115
+
116
+    public String getModel() {
117
+        String model = android.os.Build.MODEL;
118
+        return model;
119
+    }
120
+
121
+    public String getProductName() {
122
+        String productname = android.os.Build.PRODUCT;
123
+        return productname;
124
+    }
125
+
126
+    public String getManufacturer() {
127
+        String manufacturer = android.os.Build.MANUFACTURER;
128
+        return manufacturer;
129
+    }
130
+
131
+    public String getSerialNumber() {
132
+        String serial = android.os.Build.SERIAL;
133
+        return serial;
134
+    }
135
+
136
+    /**
137
+     * Get the OS version.
138
+     *
139
+     * @return
140
+     */
141
+    public String getOSVersion() {
142
+        String osversion = android.os.Build.VERSION.RELEASE;
143
+        return osversion;
144
+    }
145
+
146
+    public String getSDKVersion() {
147
+        @SuppressWarnings("deprecation")
148
+        String sdkversion = android.os.Build.VERSION.SDK;
149
+        return sdkversion;
150
+    }
151
+
152
+    public String getTimeZoneID() {
153
+        TimeZone tz = TimeZone.getDefault();
154
+        return (tz.getID());
155
+    }
156
+
157
+    /**
158
+     * Function to check if the device is manufactured by Amazon
159
+     *
160
+     * @return
161
+     */
162
+    public boolean isAmazonDevice() {
163
+        if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) {
164
+            return true;
165
+        }
166
+        return false;
167
+    }
168
+
169
+    public boolean isVirtual() {
170
+	return android.os.Build.FINGERPRINT.contains("generic") ||
171
+	    android.os.Build.PRODUCT.contains("sdk");
172
+    }
173
+
174
+}

+ 3
- 0
platforms/android/app/src/main/res/xml/config.xml Zobrazit soubor

@@ -4,6 +4,9 @@
4 4
         <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
5 5
         <param name="onload" value="true" />
6 6
     </feature>
7
+    <feature name="Device">
8
+        <param name="android-package" value="org.apache.cordova.device.Device" />
9
+    </feature>
7 10
     <name>ArtesaníasICP</name>
8 11
     <description>
9 12
         A sample Apache Cordova application that responds to the deviceready event.

+ 12
- 2
platforms/android/platform_www/cordova_plugins.js Zobrazit soubor

@@ -1,6 +1,16 @@
1 1
 cordova.define('cordova/plugin_list', function(require, exports, module) {
2
-  module.exports = [];
2
+  module.exports = [
3
+    {
4
+      "id": "cordova-plugin-device.device",
5
+      "file": "plugins/cordova-plugin-device/www/device.js",
6
+      "pluginId": "cordova-plugin-device",
7
+      "clobbers": [
8
+        "device"
9
+      ]
10
+    }
11
+  ];
3 12
   module.exports.metadata = {
4
-    "cordova-plugin-whitelist": "1.3.4"
13
+    "cordova-plugin-whitelist": "1.3.4",
14
+    "cordova-plugin-device": "2.0.3"
5 15
   };
6 16
 });

+ 86
- 0
platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,86 @@
1
+cordova.define("cordova-plugin-device.device", function(require, exports, module) {
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
+var argscheck = require('cordova/argscheck');
24
+var channel = require('cordova/channel');
25
+var utils = require('cordova/utils');
26
+var exec = require('cordova/exec');
27
+var cordova = require('cordova');
28
+
29
+channel.createSticky('onCordovaInfoReady');
30
+// Tell cordova channel to wait on the CordovaInfoReady event
31
+channel.waitForInitialization('onCordovaInfoReady');
32
+
33
+/**
34
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
35
+ * phone, etc.
36
+ * @constructor
37
+ */
38
+function Device () {
39
+    this.available = false;
40
+    this.platform = null;
41
+    this.version = null;
42
+    this.uuid = null;
43
+    this.cordova = null;
44
+    this.model = null;
45
+    this.manufacturer = null;
46
+    this.isVirtual = null;
47
+    this.serial = null;
48
+
49
+    var me = this;
50
+
51
+    channel.onCordovaReady.subscribe(function () {
52
+        me.getInfo(function (info) {
53
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
54
+            // TODO: CB-5105 native implementations should not return info.cordova
55
+            var buildLabel = cordova.version;
56
+            me.available = true;
57
+            me.platform = info.platform;
58
+            me.version = info.version;
59
+            me.uuid = info.uuid;
60
+            me.cordova = buildLabel;
61
+            me.model = info.model;
62
+            me.isVirtual = info.isVirtual;
63
+            me.manufacturer = info.manufacturer || 'unknown';
64
+            me.serial = info.serial || 'unknown';
65
+            channel.onCordovaInfoReady.fire();
66
+        }, function (e) {
67
+            me.available = false;
68
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
69
+        });
70
+    });
71
+}
72
+
73
+/**
74
+ * Get device info
75
+ *
76
+ * @param {Function} successCallback The function to call when the heading data is available
77
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
78
+ */
79
+Device.prototype.getInfo = function (successCallback, errorCallback) {
80
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
81
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
82
+};
83
+
84
+module.exports = new Device();
85
+
86
+});

+ 36
- 0
platforms/android/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js Zobrazit soubor

@@ -0,0 +1,36 @@
1
+cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exports, module) {
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
+var exec = require('cordova/exec');
24
+
25
+var splashscreen = {
26
+    show: function () {
27
+        exec(null, null, 'SplashScreen', 'show', []);
28
+    },
29
+    hide: function () {
30
+        exec(null, null, 'SplashScreen', 'hide', []);
31
+    }
32
+};
33
+
34
+module.exports = splashscreen;
35
+
36
+});

+ 116
- 0
platforms/android/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js Zobrazit soubor

@@ -0,0 +1,116 @@
1
+cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) {
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
+/* global cordova */
24
+
25
+var exec = require('cordova/exec');
26
+
27
+var namedColors = {
28
+    "black": "#000000",
29
+    "darkGray": "#A9A9A9",
30
+    "lightGray": "#D3D3D3",
31
+    "white": "#FFFFFF",
32
+    "gray": "#808080",
33
+    "red": "#FF0000",
34
+    "green": "#00FF00",
35
+    "blue": "#0000FF",
36
+    "cyan": "#00FFFF",
37
+    "yellow": "#FFFF00",
38
+    "magenta": "#FF00FF",
39
+    "orange": "#FFA500",
40
+    "purple": "#800080",
41
+    "brown": "#A52A2A"
42
+};
43
+
44
+var StatusBar = {
45
+
46
+    isVisible: true,
47
+
48
+    overlaysWebView: function (doOverlay) {
49
+        exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
50
+    },
51
+
52
+    styleDefault: function () {
53
+        // dark text ( to be used on a light background )
54
+        exec(null, null, "StatusBar", "styleDefault", []);
55
+    },
56
+
57
+    styleLightContent: function () {
58
+        // light text ( to be used on a dark background )
59
+        exec(null, null, "StatusBar", "styleLightContent", []);
60
+    },
61
+
62
+    styleBlackTranslucent: function () {
63
+        // #88000000 ? Apple says to use lightContent instead
64
+        exec(null, null, "StatusBar", "styleBlackTranslucent", []);
65
+    },
66
+
67
+    styleBlackOpaque: function () {
68
+        // #FF000000 ? Apple says to use lightContent instead
69
+        exec(null, null, "StatusBar", "styleBlackOpaque", []);
70
+    },
71
+
72
+    backgroundColorByName: function (colorname) {
73
+        return StatusBar.backgroundColorByHexString(namedColors[colorname]);
74
+    },
75
+
76
+    backgroundColorByHexString: function (hexString) {
77
+        if (hexString.charAt(0) !== "#") {
78
+            hexString = "#" + hexString;
79
+        }
80
+
81
+        if (hexString.length === 4) {
82
+            var split = hexString.split("");
83
+            hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3];
84
+        }
85
+
86
+        exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
87
+    },
88
+
89
+    hide: function () {
90
+        exec(null, null, "StatusBar", "hide", []);
91
+        StatusBar.isVisible = false;
92
+    },
93
+
94
+    show: function () {
95
+        exec(null, null, "StatusBar", "show", []);
96
+        StatusBar.isVisible = true;
97
+    }
98
+
99
+};
100
+
101
+// prime it. setTimeout so that proxy gets time to init
102
+window.setTimeout(function () {
103
+    exec(function (res) {
104
+        if (typeof res == 'object') {
105
+            if (res.type == 'tap') {
106
+                cordova.fireWindowEvent('statusTap');
107
+            }
108
+        } else {
109
+            StatusBar.isVisible = res;
110
+        }
111
+    }, null, "StatusBar", "_ready", []);
112
+}, 0);
113
+
114
+module.exports = StatusBar;
115
+
116
+});

+ 27
- 3
platforms/browser/browser.json Zobrazit soubor

@@ -7,7 +7,12 @@
7 7
     "files": {
8 8
       "config.xml": {
9 9
         "parents": {
10
-          "/*": []
10
+          "/*": [
11
+            {
12
+              "xml": "<feature name=\"Device\"><param name=\"browser-package\" value=\"Device\" /></feature>",
13
+              "count": 1
14
+            }
15
+          ]
11 16
         }
12 17
       }
13 18
     }
@@ -15,11 +20,30 @@
15 20
   "installed_plugins": {
16 21
     "cordova-plugin-whitelist": {
17 22
       "PACKAGE_NAME": "io.cordova.hellocordova"
23
+    },
24
+    "cordova-plugin-device": {
25
+      "PACKAGE_NAME": "io.cordova.hellocordova"
18 26
     }
19 27
   },
20 28
   "dependent_plugins": {},
21
-  "modules": [],
29
+  "modules": [
30
+    {
31
+      "file": "plugins/cordova-plugin-device/www/device.js",
32
+      "id": "cordova-plugin-device.device",
33
+      "pluginId": "cordova-plugin-device",
34
+      "clobbers": [
35
+        "device"
36
+      ]
37
+    },
38
+    {
39
+      "file": "plugins/cordova-plugin-device/src/browser/DeviceProxy.js",
40
+      "id": "cordova-plugin-device.DeviceProxy",
41
+      "pluginId": "cordova-plugin-device",
42
+      "runs": true
43
+    }
44
+  ],
22 45
   "plugin_metadata": {
23
-    "cordova-plugin-whitelist": "1.3.4"
46
+    "cordova-plugin-whitelist": "1.3.4",
47
+    "cordova-plugin-device": "2.0.3"
24 48
   }
25 49
 }

+ 18
- 2
platforms/browser/platform_www/cordova_plugins.js Zobrazit soubor

@@ -1,9 +1,25 @@
1 1
 cordova.define('cordova/plugin_list', function(require, exports, module) {
2
-module.exports = [];
2
+module.exports = [
3
+    {
4
+        "file": "plugins/cordova-plugin-device/www/device.js",
5
+        "id": "cordova-plugin-device.device",
6
+        "pluginId": "cordova-plugin-device",
7
+        "clobbers": [
8
+            "device"
9
+        ]
10
+    },
11
+    {
12
+        "file": "plugins/cordova-plugin-device/src/browser/DeviceProxy.js",
13
+        "id": "cordova-plugin-device.DeviceProxy",
14
+        "pluginId": "cordova-plugin-device",
15
+        "runs": true
16
+    }
17
+];
3 18
 module.exports.metadata = 
4 19
 // TOP OF METADATA
5 20
 {
6
-    "cordova-plugin-whitelist": "1.3.4"
21
+    "cordova-plugin-whitelist": "1.3.4",
22
+    "cordova-plugin-device": "2.0.3"
7 23
 }
8 24
 // BOTTOM OF METADATA
9 25
 });

+ 86
- 0
platforms/browser/platform_www/plugins/cordova-plugin-device/src/browser/DeviceProxy.js Zobrazit soubor

@@ -0,0 +1,86 @@
1
+cordova.define("cordova-plugin-device.DeviceProxy", function(require, exports, module) { /*
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 browser = require('cordova/platform');
22
+
23
+function getPlatform () {
24
+    return 'browser';
25
+}
26
+
27
+function getModel () {
28
+    return getBrowserInfo(true);
29
+}
30
+
31
+function getVersion () {
32
+    return getBrowserInfo(false);
33
+}
34
+
35
+function getBrowserInfo (getModel) {
36
+    var userAgent = navigator.userAgent;
37
+    var returnVal = '';
38
+    var offset;
39
+
40
+    if ((offset = userAgent.indexOf('Edge')) !== -1) {
41
+        returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
42
+    } else if ((offset = userAgent.indexOf('Chrome')) !== -1) {
43
+        returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7);
44
+    } else if ((offset = userAgent.indexOf('Safari')) !== -1) {
45
+        if (getModel) {
46
+            returnVal = 'Safari';
47
+        } else {
48
+            returnVal = userAgent.substring(offset + 7);
49
+
50
+            if ((offset = userAgent.indexOf('Version')) !== -1) {
51
+                returnVal = userAgent.substring(offset + 8);
52
+            }
53
+        }
54
+    } else if ((offset = userAgent.indexOf('Firefox')) !== -1) {
55
+        returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8);
56
+    } else if ((offset = userAgent.indexOf('MSIE')) !== -1) {
57
+        returnVal = (getModel) ? 'MSIE' : userAgent.substring(offset + 5);
58
+    } else if ((offset = userAgent.indexOf('Trident')) !== -1) {
59
+        returnVal = (getModel) ? 'MSIE' : '11';
60
+    }
61
+
62
+    if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) {
63
+        returnVal = returnVal.substring(0, offset);
64
+    }
65
+
66
+    return returnVal;
67
+}
68
+
69
+module.exports = {
70
+    getDeviceInfo: function (success, error) {
71
+        setTimeout(function () {
72
+            success({
73
+                cordova: browser.cordovaVersion,
74
+                platform: getPlatform(),
75
+                model: getModel(),
76
+                version: getVersion(),
77
+                uuid: null,
78
+                isVirtual: false
79
+            });
80
+        }, 0);
81
+    }
82
+};
83
+
84
+require('cordova/exec/proxy').add('Device', module.exports);
85
+
86
+});

+ 85
- 0
platforms/browser/platform_www/plugins/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,85 @@
1
+cordova.define("cordova-plugin-device.device", function(require, exports, module) { /*
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
+var channel = require('cordova/channel');
24
+var utils = require('cordova/utils');
25
+var exec = require('cordova/exec');
26
+var cordova = require('cordova');
27
+
28
+channel.createSticky('onCordovaInfoReady');
29
+// Tell cordova channel to wait on the CordovaInfoReady event
30
+channel.waitForInitialization('onCordovaInfoReady');
31
+
32
+/**
33
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
34
+ * phone, etc.
35
+ * @constructor
36
+ */
37
+function Device () {
38
+    this.available = false;
39
+    this.platform = null;
40
+    this.version = null;
41
+    this.uuid = null;
42
+    this.cordova = null;
43
+    this.model = null;
44
+    this.manufacturer = null;
45
+    this.isVirtual = null;
46
+    this.serial = null;
47
+
48
+    var me = this;
49
+
50
+    channel.onCordovaReady.subscribe(function () {
51
+        me.getInfo(function (info) {
52
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
53
+            // TODO: CB-5105 native implementations should not return info.cordova
54
+            var buildLabel = cordova.version;
55
+            me.available = true;
56
+            me.platform = info.platform;
57
+            me.version = info.version;
58
+            me.uuid = info.uuid;
59
+            me.cordova = buildLabel;
60
+            me.model = info.model;
61
+            me.isVirtual = info.isVirtual;
62
+            me.manufacturer = info.manufacturer || 'unknown';
63
+            me.serial = info.serial || 'unknown';
64
+            channel.onCordovaInfoReady.fire();
65
+        }, function (e) {
66
+            me.available = false;
67
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
68
+        });
69
+    });
70
+}
71
+
72
+/**
73
+ * Get device info
74
+ *
75
+ * @param {Function} successCallback The function to call when the heading data is available
76
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
77
+ */
78
+Device.prototype.getInfo = function (successCallback, errorCallback) {
79
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
80
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
81
+};
82
+
83
+module.exports = new Device();
84
+
85
+});

+ 170
- 0
platforms/browser/platform_www/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js Zobrazit soubor

@@ -0,0 +1,170 @@
1
+cordova.define("cordova-plugin-splashscreen.SplashScreenProxy", function(require, exports, module) { /*
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
+// Default parameter values including image size can be changed in `config.xml`
23
+var splashImageWidth = 170;
24
+var splashImageHeight = 200;
25
+var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
26
+var localSplash; // the image to display
27
+var localSplashImage;
28
+var bgColor = '#464646';
29
+var imageSrc = '/img/logo.png';
30
+var splashScreenDelay = 3000; // in milliseconds
31
+var showSplashScreen = true; // show splashcreen by default
32
+var cordova = require('cordova');
33
+var configHelper = cordova.require('cordova/confighelper');
34
+var autoHideSplashScreen = true;
35
+
36
+function updateImageLocation () {
37
+    position.width = Math.min(splashImageWidth, window.innerWidth);
38
+    position.height = position.width * (splashImageHeight / splashImageWidth);
39
+
40
+    localSplash.style.width = window.innerWidth + 'px';
41
+    localSplash.style.height = window.innerHeight + 'px';
42
+    localSplash.style.top = '0px';
43
+    localSplash.style.left = '0px';
44
+
45
+    localSplashImage.style.top = '50%';
46
+    localSplashImage.style.left = '50%';
47
+    localSplashImage.style.height = position.height + 'px';
48
+    localSplashImage.style.width = position.width + 'px';
49
+    localSplashImage.style.marginTop = (-position.height / 2) + 'px';
50
+    localSplashImage.style.marginLeft = (-position.width / 2) + 'px';
51
+}
52
+
53
+function onResize () {
54
+    updateImageLocation();
55
+}
56
+
57
+var SplashScreen = {
58
+    setBGColor: function (cssBGColor) {
59
+        bgColor = cssBGColor;
60
+        if (localSplash) {
61
+            localSplash.style.backgroundColor = bgColor;
62
+        }
63
+    },
64
+    show: function () {
65
+        if (!localSplash) {
66
+            window.addEventListener('resize', onResize, false);
67
+            localSplash = document.createElement('div');
68
+            localSplash.style.backgroundColor = bgColor;
69
+            localSplash.style.position = 'absolute';
70
+            localSplash.style['z-index'] = '99999';
71
+
72
+            localSplashImage = document.createElement('img');
73
+            localSplashImage.src = imageSrc;
74
+            localSplashImage.style.position = 'absolute';
75
+
76
+            updateImageLocation();
77
+
78
+            localSplash.appendChild(localSplashImage);
79
+            document.body.appendChild(localSplash);
80
+
81
+            // deviceready fires earlier than the plugin init on cold-start
82
+            if (SplashScreen.shouldHideImmediately) {
83
+                SplashScreen.shouldHideImmediately = false;
84
+                window.setTimeout(function () {
85
+                    SplashScreen.hide();
86
+                }, 1000);
87
+            }
88
+        }
89
+    },
90
+    hide: function () {
91
+        if (localSplash) {
92
+            var innerLocalSplash = localSplash;
93
+            localSplash = null;
94
+            window.removeEventListener('resize', onResize, false);
95
+
96
+            innerLocalSplash.style.opacity = '0';
97
+            innerLocalSplash.style['-webkit-transition'] = 'opacity 1s ease-in-out';
98
+            innerLocalSplash.style['-moz-transition'] = 'opacity 1s ease-in-out';
99
+            innerLocalSplash.style['-ms-transition'] = 'opacity 1s ease-in-out';
100
+            innerLocalSplash.style['-o-transition'] = 'opacity 1s ease-in-out';
101
+
102
+            window.setTimeout(function () {
103
+                document.body.removeChild(innerLocalSplash);
104
+                innerLocalSplash = null;
105
+            }, 1000);
106
+        } else {
107
+            SplashScreen.shouldHideImmediately = true;
108
+        }
109
+    }
110
+};
111
+
112
+/**
113
+ * Reads preferences via ConfigHelper and substitutes default parameters.
114
+ */
115
+function readPreferencesFromCfg (cfg) {
116
+    try {
117
+        var value = cfg.getPreferenceValue('ShowSplashScreen');
118
+        if (typeof value !== 'undefined') {
119
+            showSplashScreen = value === 'true';
120
+        }
121
+
122
+        splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
123
+        splashScreenDelay = parseInt(splashScreenDelay, 10);
124
+
125
+        imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc;
126
+        bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
127
+        splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
128
+        splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
129
+        autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
130
+        autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
131
+    } catch (e) {
132
+        var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
133
+        console.error(msg);
134
+    }
135
+}
136
+
137
+/**
138
+ * Shows and hides splashscreen if it is enabled, with a delay according the current preferences.
139
+ */
140
+function showAndHide () {
141
+    if (showSplashScreen) {
142
+        SplashScreen.show();
143
+
144
+        window.setTimeout(function () {
145
+            SplashScreen.hide();
146
+        }, splashScreenDelay);
147
+    }
148
+}
149
+
150
+/**
151
+ * Tries to read config.xml and override default properties and then shows and hides splashscreen if it is enabled.
152
+ */
153
+(function initAndShow () {
154
+    configHelper.readConfig(function (config) {
155
+        readPreferencesFromCfg(config);
156
+        if (autoHideSplashScreen) {
157
+            showAndHide();
158
+        } else {
159
+            SplashScreen.show();
160
+        }
161
+    }, function (err) {
162
+        console.error(err);
163
+    });
164
+})();
165
+
166
+module.exports = SplashScreen;
167
+
168
+require('cordova/exec/proxy').add('SplashScreen', SplashScreen);
169
+
170
+});

+ 35
- 0
platforms/browser/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js Zobrazit soubor

@@ -0,0 +1,35 @@
1
+cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exports, module) { /*
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 exec = require('cordova/exec');
23
+
24
+var splashscreen = {
25
+    show: function () {
26
+        exec(null, null, 'SplashScreen', 'show', []);
27
+    },
28
+    hide: function () {
29
+        exec(null, null, 'SplashScreen', 'hide', []);
30
+    }
31
+};
32
+
33
+module.exports = splashscreen;
34
+
35
+});

+ 52
- 0
platforms/browser/platform_www/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js Zobrazit soubor

@@ -0,0 +1,52 @@
1
+cordova.define("cordova-plugin-statusbar.StatusBarProxy", function(require, exports, module) { /*
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
+
21
+function notSupported(win,fail) {
22
+    //
23
+    console.log('StatusBar is not supported');
24
+    setTimeout(function(){
25
+        if (win) {
26
+            win();
27
+        }
28
+        // note that while it is not explicitly supported, it does not fail
29
+        // this is really just here to allow developers to test their code in the browser
30
+        // and if we fail, then their app might as well. -jm
31
+    },0);
32
+}
33
+
34
+module.exports = {
35
+    isVisible: false,
36
+    styleBlackTranslucent:notSupported,
37
+    styleDefault:notSupported,
38
+    styleLightContent:notSupported,
39
+    styleBlackOpaque:notSupported,
40
+    overlaysWebView:notSupported,
41
+    styleLightContect: notSupported,
42
+    backgroundColorByName: notSupported,
43
+    backgroundColorByHexString: notSupported,
44
+    hide: notSupported,
45
+    show: notSupported,
46
+    _ready:notSupported
47
+};
48
+
49
+require("cordova/exec/proxy").add("StatusBar", module.exports);
50
+
51
+
52
+});

+ 115
- 0
platforms/browser/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js Zobrazit soubor

@@ -0,0 +1,115 @@
1
+cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) { /*
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 cordova */
23
+
24
+var exec = require('cordova/exec');
25
+
26
+var namedColors = {
27
+    "black": "#000000",
28
+    "darkGray": "#A9A9A9",
29
+    "lightGray": "#D3D3D3",
30
+    "white": "#FFFFFF",
31
+    "gray": "#808080",
32
+    "red": "#FF0000",
33
+    "green": "#00FF00",
34
+    "blue": "#0000FF",
35
+    "cyan": "#00FFFF",
36
+    "yellow": "#FFFF00",
37
+    "magenta": "#FF00FF",
38
+    "orange": "#FFA500",
39
+    "purple": "#800080",
40
+    "brown": "#A52A2A"
41
+};
42
+
43
+var StatusBar = {
44
+
45
+    isVisible: true,
46
+
47
+    overlaysWebView: function (doOverlay) {
48
+        exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
49
+    },
50
+
51
+    styleDefault: function () {
52
+        // dark text ( to be used on a light background )
53
+        exec(null, null, "StatusBar", "styleDefault", []);
54
+    },
55
+
56
+    styleLightContent: function () {
57
+        // light text ( to be used on a dark background )
58
+        exec(null, null, "StatusBar", "styleLightContent", []);
59
+    },
60
+
61
+    styleBlackTranslucent: function () {
62
+        // #88000000 ? Apple says to use lightContent instead
63
+        exec(null, null, "StatusBar", "styleBlackTranslucent", []);
64
+    },
65
+
66
+    styleBlackOpaque: function () {
67
+        // #FF000000 ? Apple says to use lightContent instead
68
+        exec(null, null, "StatusBar", "styleBlackOpaque", []);
69
+    },
70
+
71
+    backgroundColorByName: function (colorname) {
72
+        return StatusBar.backgroundColorByHexString(namedColors[colorname]);
73
+    },
74
+
75
+    backgroundColorByHexString: function (hexString) {
76
+        if (hexString.charAt(0) !== "#") {
77
+            hexString = "#" + hexString;
78
+        }
79
+
80
+        if (hexString.length === 4) {
81
+            var split = hexString.split("");
82
+            hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3];
83
+        }
84
+
85
+        exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
86
+    },
87
+
88
+    hide: function () {
89
+        exec(null, null, "StatusBar", "hide", []);
90
+        StatusBar.isVisible = false;
91
+    },
92
+
93
+    show: function () {
94
+        exec(null, null, "StatusBar", "show", []);
95
+        StatusBar.isVisible = true;
96
+    }
97
+
98
+};
99
+
100
+// prime it. setTimeout so that proxy gets time to init
101
+window.setTimeout(function () {
102
+    exec(function (res) {
103
+        if (typeof res == 'object') {
104
+            if (res.type == 'tap') {
105
+                cordova.fireWindowEvent('statusTap');
106
+            }
107
+        } else {
108
+            StatusBar.isVisible = res;
109
+        }
110
+    }, null, "StatusBar", "_ready", []);
111
+}, 0);
112
+
113
+module.exports = StatusBar;
114
+
115
+});

+ 18
- 2
platforms/browser/www/cordova_plugins.js Zobrazit soubor

@@ -1,9 +1,25 @@
1 1
 cordova.define('cordova/plugin_list', function(require, exports, module) {
2
-module.exports = [];
2
+module.exports = [
3
+    {
4
+        "file": "plugins/cordova-plugin-device/www/device.js",
5
+        "id": "cordova-plugin-device.device",
6
+        "pluginId": "cordova-plugin-device",
7
+        "clobbers": [
8
+            "device"
9
+        ]
10
+    },
11
+    {
12
+        "file": "plugins/cordova-plugin-device/src/browser/DeviceProxy.js",
13
+        "id": "cordova-plugin-device.DeviceProxy",
14
+        "pluginId": "cordova-plugin-device",
15
+        "runs": true
16
+    }
17
+];
3 18
 module.exports.metadata = 
4 19
 // TOP OF METADATA
5 20
 {
6
-    "cordova-plugin-whitelist": "1.3.4"
21
+    "cordova-plugin-whitelist": "1.3.4",
22
+    "cordova-plugin-device": "2.0.3"
7 23
 }
8 24
 // BOTTOM OF METADATA
9 25
 });

+ 8
- 3
platforms/browser/www/index.html Zobrazit soubor

@@ -37,10 +37,9 @@
37 37
         <link rel="stylesheet" href="calendar_files/css/theme1.css"/>
38 38
         <!--this is for the search bar-->
39 39
         <link rel = "stylesheet" href = "css/searchbar1.css">
40
-
40
+        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
41 41
         <meta name="format-detection" content="telephone=no">
42 42
         <meta name="msapplication-tap-highlight" content="no">
43
-        <meta name="viewport" content="initial-scale=1, width=device-width, height=device-height, viewport-fit=cover">
44 43
         <meta charset="UTF-8">
45 44
         <link rel="stylesheet" type="text/css" href="css/index.css">
46 45
         <link rel="stylesheet" href="lib/OnsenUI/css/onsenui.css">
@@ -598,6 +597,12 @@
598 597
                         //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
599 598
                         //but if theres only one then you just write it into the page
600 599
                         if(esp.trim() != ""){
600
+
601
+                            //Fixes phrase error in json
602
+                            if(esp.includes("Figuras y simbolos indigenas")) {
603
+                                esp = esp.replace("Figuras y simbolos indigenas", "Figuras y símbolos indígenas")
604
+                            }
605
+
601 606
                             if(esp.includes(";", 0)){
602 607
                                 esp=esp.replace(/;/g,", ");
603 608
                                 data+='Tipos de artesanías: '+esp+'<br>';
@@ -835,7 +840,7 @@
835 840
                 </div>
836 841
                 <br><br>
837 842
                 <div id="button" style="text-align: center">
838
-                <button onclick="redirect()">Pasar a la página de eventos</button>
843
+                <ons-button onclick="redirect()" modifier="large" style="background-color: #00abc1;"> Pasar a la página de eventos </ons-button>
839 844
                 </div>
840 845
                 <br><br>
841 846
                 <div id="Mensaje">

+ 9
- 0
platforms/browser/www/js/index.js Zobrazit soubor

@@ -28,6 +28,15 @@ var app = {
28 28
     // 'pause', 'resume', etc.
29 29
     onDeviceReady: function() {
30 30
 
31
+        //A list of device models that have notches that interfere with page content.
32
+        //OnsenUi has the isIPhoneX boolean value, however, it does not detect IPhone 11 or 12 types. 
33
+        var notchDevices = ["iPhone12,1", "iPhone12,3", "iPhone12,5", "iPhone13,1", "iPhone13,2", "iPhone13,3", "iPhone13,4"]
34
+
35
+
36
+        if (ons.platform.isIPhoneX() || notchDevices.includes(device.model)) { 
37
+            document.documentElement.setAttribute('onsflag-iphonex-portrait', '');
38
+            document.documentElement.setAttribute('onsflag-iphonex-landscape', '');
39
+        }
31 40
 
32 41
     },
33 42
 

+ 2
- 2
platforms/browser/www/lib/OnsenUI/css/onsenui.css Zobrazit soubor

@@ -36,7 +36,7 @@ ons-toast .toast {
36 36
 }
37 37
 
38 38
 ons-tab {
39
-    background: #e6e6e6;/*#5fe1af;*/
39
+    background: #fafafa;/*#5fe1af;*/
40 40
   -webkit-transform: translate3d(0, 0, 0);
41 41
           transform: translate3d(0, 0, 0);
42 42
 }
@@ -53,7 +53,7 @@ ons-toolbar:not([inline]), ons-bottom-toolbar {
53 53
   position: absolute;
54 54
   left: 0;
55 55
   right: 0;
56
-    background: #e6e6e6;/*#5fe1af;*/
56
+    background: #fafafa;/*#5fe1af;*/
57 57
   z-index: 10000;
58 58
 }
59 59
 

+ 86
- 0
platforms/browser/www/plugins/cordova-plugin-device/src/browser/DeviceProxy.js Zobrazit soubor

@@ -0,0 +1,86 @@
1
+cordova.define("cordova-plugin-device.DeviceProxy", function(require, exports, module) { /*
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 browser = require('cordova/platform');
22
+
23
+function getPlatform () {
24
+    return 'browser';
25
+}
26
+
27
+function getModel () {
28
+    return getBrowserInfo(true);
29
+}
30
+
31
+function getVersion () {
32
+    return getBrowserInfo(false);
33
+}
34
+
35
+function getBrowserInfo (getModel) {
36
+    var userAgent = navigator.userAgent;
37
+    var returnVal = '';
38
+    var offset;
39
+
40
+    if ((offset = userAgent.indexOf('Edge')) !== -1) {
41
+        returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
42
+    } else if ((offset = userAgent.indexOf('Chrome')) !== -1) {
43
+        returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7);
44
+    } else if ((offset = userAgent.indexOf('Safari')) !== -1) {
45
+        if (getModel) {
46
+            returnVal = 'Safari';
47
+        } else {
48
+            returnVal = userAgent.substring(offset + 7);
49
+
50
+            if ((offset = userAgent.indexOf('Version')) !== -1) {
51
+                returnVal = userAgent.substring(offset + 8);
52
+            }
53
+        }
54
+    } else if ((offset = userAgent.indexOf('Firefox')) !== -1) {
55
+        returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8);
56
+    } else if ((offset = userAgent.indexOf('MSIE')) !== -1) {
57
+        returnVal = (getModel) ? 'MSIE' : userAgent.substring(offset + 5);
58
+    } else if ((offset = userAgent.indexOf('Trident')) !== -1) {
59
+        returnVal = (getModel) ? 'MSIE' : '11';
60
+    }
61
+
62
+    if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) {
63
+        returnVal = returnVal.substring(0, offset);
64
+    }
65
+
66
+    return returnVal;
67
+}
68
+
69
+module.exports = {
70
+    getDeviceInfo: function (success, error) {
71
+        setTimeout(function () {
72
+            success({
73
+                cordova: browser.cordovaVersion,
74
+                platform: getPlatform(),
75
+                model: getModel(),
76
+                version: getVersion(),
77
+                uuid: null,
78
+                isVirtual: false
79
+            });
80
+        }, 0);
81
+    }
82
+};
83
+
84
+require('cordova/exec/proxy').add('Device', module.exports);
85
+
86
+});

+ 85
- 0
platforms/browser/www/plugins/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,85 @@
1
+cordova.define("cordova-plugin-device.device", function(require, exports, module) { /*
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
+var channel = require('cordova/channel');
24
+var utils = require('cordova/utils');
25
+var exec = require('cordova/exec');
26
+var cordova = require('cordova');
27
+
28
+channel.createSticky('onCordovaInfoReady');
29
+// Tell cordova channel to wait on the CordovaInfoReady event
30
+channel.waitForInitialization('onCordovaInfoReady');
31
+
32
+/**
33
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
34
+ * phone, etc.
35
+ * @constructor
36
+ */
37
+function Device () {
38
+    this.available = false;
39
+    this.platform = null;
40
+    this.version = null;
41
+    this.uuid = null;
42
+    this.cordova = null;
43
+    this.model = null;
44
+    this.manufacturer = null;
45
+    this.isVirtual = null;
46
+    this.serial = null;
47
+
48
+    var me = this;
49
+
50
+    channel.onCordovaReady.subscribe(function () {
51
+        me.getInfo(function (info) {
52
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
53
+            // TODO: CB-5105 native implementations should not return info.cordova
54
+            var buildLabel = cordova.version;
55
+            me.available = true;
56
+            me.platform = info.platform;
57
+            me.version = info.version;
58
+            me.uuid = info.uuid;
59
+            me.cordova = buildLabel;
60
+            me.model = info.model;
61
+            me.isVirtual = info.isVirtual;
62
+            me.manufacturer = info.manufacturer || 'unknown';
63
+            me.serial = info.serial || 'unknown';
64
+            channel.onCordovaInfoReady.fire();
65
+        }, function (e) {
66
+            me.available = false;
67
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
68
+        });
69
+    });
70
+}
71
+
72
+/**
73
+ * Get device info
74
+ *
75
+ * @param {Function} successCallback The function to call when the heading data is available
76
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
77
+ */
78
+Device.prototype.getInfo = function (successCallback, errorCallback) {
79
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
80
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
81
+};
82
+
83
+module.exports = new Device();
84
+
85
+});

+ 170
- 0
platforms/browser/www/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js Zobrazit soubor

@@ -0,0 +1,170 @@
1
+cordova.define("cordova-plugin-splashscreen.SplashScreenProxy", function(require, exports, module) { /*
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
+// Default parameter values including image size can be changed in `config.xml`
23
+var splashImageWidth = 170;
24
+var splashImageHeight = 200;
25
+var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
26
+var localSplash; // the image to display
27
+var localSplashImage;
28
+var bgColor = '#464646';
29
+var imageSrc = '/img/logo.png';
30
+var splashScreenDelay = 3000; // in milliseconds
31
+var showSplashScreen = true; // show splashcreen by default
32
+var cordova = require('cordova');
33
+var configHelper = cordova.require('cordova/confighelper');
34
+var autoHideSplashScreen = true;
35
+
36
+function updateImageLocation () {
37
+    position.width = Math.min(splashImageWidth, window.innerWidth);
38
+    position.height = position.width * (splashImageHeight / splashImageWidth);
39
+
40
+    localSplash.style.width = window.innerWidth + 'px';
41
+    localSplash.style.height = window.innerHeight + 'px';
42
+    localSplash.style.top = '0px';
43
+    localSplash.style.left = '0px';
44
+
45
+    localSplashImage.style.top = '50%';
46
+    localSplashImage.style.left = '50%';
47
+    localSplashImage.style.height = position.height + 'px';
48
+    localSplashImage.style.width = position.width + 'px';
49
+    localSplashImage.style.marginTop = (-position.height / 2) + 'px';
50
+    localSplashImage.style.marginLeft = (-position.width / 2) + 'px';
51
+}
52
+
53
+function onResize () {
54
+    updateImageLocation();
55
+}
56
+
57
+var SplashScreen = {
58
+    setBGColor: function (cssBGColor) {
59
+        bgColor = cssBGColor;
60
+        if (localSplash) {
61
+            localSplash.style.backgroundColor = bgColor;
62
+        }
63
+    },
64
+    show: function () {
65
+        if (!localSplash) {
66
+            window.addEventListener('resize', onResize, false);
67
+            localSplash = document.createElement('div');
68
+            localSplash.style.backgroundColor = bgColor;
69
+            localSplash.style.position = 'absolute';
70
+            localSplash.style['z-index'] = '99999';
71
+
72
+            localSplashImage = document.createElement('img');
73
+            localSplashImage.src = imageSrc;
74
+            localSplashImage.style.position = 'absolute';
75
+
76
+            updateImageLocation();
77
+
78
+            localSplash.appendChild(localSplashImage);
79
+            document.body.appendChild(localSplash);
80
+
81
+            // deviceready fires earlier than the plugin init on cold-start
82
+            if (SplashScreen.shouldHideImmediately) {
83
+                SplashScreen.shouldHideImmediately = false;
84
+                window.setTimeout(function () {
85
+                    SplashScreen.hide();
86
+                }, 1000);
87
+            }
88
+        }
89
+    },
90
+    hide: function () {
91
+        if (localSplash) {
92
+            var innerLocalSplash = localSplash;
93
+            localSplash = null;
94
+            window.removeEventListener('resize', onResize, false);
95
+
96
+            innerLocalSplash.style.opacity = '0';
97
+            innerLocalSplash.style['-webkit-transition'] = 'opacity 1s ease-in-out';
98
+            innerLocalSplash.style['-moz-transition'] = 'opacity 1s ease-in-out';
99
+            innerLocalSplash.style['-ms-transition'] = 'opacity 1s ease-in-out';
100
+            innerLocalSplash.style['-o-transition'] = 'opacity 1s ease-in-out';
101
+
102
+            window.setTimeout(function () {
103
+                document.body.removeChild(innerLocalSplash);
104
+                innerLocalSplash = null;
105
+            }, 1000);
106
+        } else {
107
+            SplashScreen.shouldHideImmediately = true;
108
+        }
109
+    }
110
+};
111
+
112
+/**
113
+ * Reads preferences via ConfigHelper and substitutes default parameters.
114
+ */
115
+function readPreferencesFromCfg (cfg) {
116
+    try {
117
+        var value = cfg.getPreferenceValue('ShowSplashScreen');
118
+        if (typeof value !== 'undefined') {
119
+            showSplashScreen = value === 'true';
120
+        }
121
+
122
+        splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
123
+        splashScreenDelay = parseInt(splashScreenDelay, 10);
124
+
125
+        imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc;
126
+        bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
127
+        splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
128
+        splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
129
+        autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
130
+        autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
131
+    } catch (e) {
132
+        var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
133
+        console.error(msg);
134
+    }
135
+}
136
+
137
+/**
138
+ * Shows and hides splashscreen if it is enabled, with a delay according the current preferences.
139
+ */
140
+function showAndHide () {
141
+    if (showSplashScreen) {
142
+        SplashScreen.show();
143
+
144
+        window.setTimeout(function () {
145
+            SplashScreen.hide();
146
+        }, splashScreenDelay);
147
+    }
148
+}
149
+
150
+/**
151
+ * Tries to read config.xml and override default properties and then shows and hides splashscreen if it is enabled.
152
+ */
153
+(function initAndShow () {
154
+    configHelper.readConfig(function (config) {
155
+        readPreferencesFromCfg(config);
156
+        if (autoHideSplashScreen) {
157
+            showAndHide();
158
+        } else {
159
+            SplashScreen.show();
160
+        }
161
+    }, function (err) {
162
+        console.error(err);
163
+    });
164
+})();
165
+
166
+module.exports = SplashScreen;
167
+
168
+require('cordova/exec/proxy').add('SplashScreen', SplashScreen);
169
+
170
+});

+ 35
- 0
platforms/browser/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js Zobrazit soubor

@@ -0,0 +1,35 @@
1
+cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exports, module) { /*
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 exec = require('cordova/exec');
23
+
24
+var splashscreen = {
25
+    show: function () {
26
+        exec(null, null, 'SplashScreen', 'show', []);
27
+    },
28
+    hide: function () {
29
+        exec(null, null, 'SplashScreen', 'hide', []);
30
+    }
31
+};
32
+
33
+module.exports = splashscreen;
34
+
35
+});

+ 52
- 0
platforms/browser/www/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js Zobrazit soubor

@@ -0,0 +1,52 @@
1
+cordova.define("cordova-plugin-statusbar.StatusBarProxy", function(require, exports, module) { /*
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
+
21
+function notSupported(win,fail) {
22
+    //
23
+    console.log('StatusBar is not supported');
24
+    setTimeout(function(){
25
+        if (win) {
26
+            win();
27
+        }
28
+        // note that while it is not explicitly supported, it does not fail
29
+        // this is really just here to allow developers to test their code in the browser
30
+        // and if we fail, then their app might as well. -jm
31
+    },0);
32
+}
33
+
34
+module.exports = {
35
+    isVisible: false,
36
+    styleBlackTranslucent:notSupported,
37
+    styleDefault:notSupported,
38
+    styleLightContent:notSupported,
39
+    styleBlackOpaque:notSupported,
40
+    overlaysWebView:notSupported,
41
+    styleLightContect: notSupported,
42
+    backgroundColorByName: notSupported,
43
+    backgroundColorByHexString: notSupported,
44
+    hide: notSupported,
45
+    show: notSupported,
46
+    _ready:notSupported
47
+};
48
+
49
+require("cordova/exec/proxy").add("StatusBar", module.exports);
50
+
51
+
52
+});

+ 115
- 0
platforms/browser/www/plugins/cordova-plugin-statusbar/www/statusbar.js Zobrazit soubor

@@ -0,0 +1,115 @@
1
+cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) { /*
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 cordova */
23
+
24
+var exec = require('cordova/exec');
25
+
26
+var namedColors = {
27
+    "black": "#000000",
28
+    "darkGray": "#A9A9A9",
29
+    "lightGray": "#D3D3D3",
30
+    "white": "#FFFFFF",
31
+    "gray": "#808080",
32
+    "red": "#FF0000",
33
+    "green": "#00FF00",
34
+    "blue": "#0000FF",
35
+    "cyan": "#00FFFF",
36
+    "yellow": "#FFFF00",
37
+    "magenta": "#FF00FF",
38
+    "orange": "#FFA500",
39
+    "purple": "#800080",
40
+    "brown": "#A52A2A"
41
+};
42
+
43
+var StatusBar = {
44
+
45
+    isVisible: true,
46
+
47
+    overlaysWebView: function (doOverlay) {
48
+        exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
49
+    },
50
+
51
+    styleDefault: function () {
52
+        // dark text ( to be used on a light background )
53
+        exec(null, null, "StatusBar", "styleDefault", []);
54
+    },
55
+
56
+    styleLightContent: function () {
57
+        // light text ( to be used on a dark background )
58
+        exec(null, null, "StatusBar", "styleLightContent", []);
59
+    },
60
+
61
+    styleBlackTranslucent: function () {
62
+        // #88000000 ? Apple says to use lightContent instead
63
+        exec(null, null, "StatusBar", "styleBlackTranslucent", []);
64
+    },
65
+
66
+    styleBlackOpaque: function () {
67
+        // #FF000000 ? Apple says to use lightContent instead
68
+        exec(null, null, "StatusBar", "styleBlackOpaque", []);
69
+    },
70
+
71
+    backgroundColorByName: function (colorname) {
72
+        return StatusBar.backgroundColorByHexString(namedColors[colorname]);
73
+    },
74
+
75
+    backgroundColorByHexString: function (hexString) {
76
+        if (hexString.charAt(0) !== "#") {
77
+            hexString = "#" + hexString;
78
+        }
79
+
80
+        if (hexString.length === 4) {
81
+            var split = hexString.split("");
82
+            hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3];
83
+        }
84
+
85
+        exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
86
+    },
87
+
88
+    hide: function () {
89
+        exec(null, null, "StatusBar", "hide", []);
90
+        StatusBar.isVisible = false;
91
+    },
92
+
93
+    show: function () {
94
+        exec(null, null, "StatusBar", "show", []);
95
+        StatusBar.isVisible = true;
96
+    }
97
+
98
+};
99
+
100
+// prime it. setTimeout so that proxy gets time to init
101
+window.setTimeout(function () {
102
+    exec(function (res) {
103
+        if (typeof res == 'object') {
104
+            if (res.type == 'tap') {
105
+                cordova.fireWindowEvent('statusTap');
106
+            }
107
+        } else {
108
+            StatusBar.isVisible = res;
109
+        }
110
+    }, null, "StatusBar", "_ready", []);
111
+}, 0);
112
+
113
+module.exports = StatusBar;
114
+
115
+});

+ 6
- 0
platforms/ios/ArtesaníasICP.xcodeproj/project.pbxproj Zobrazit soubor

@@ -14,6 +14,7 @@
14 14
 		302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
15 15
 		302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
16 16
 		6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; };
17
+		ADA04CF060084AB79470BC10 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 41757C63B0214F72B885F8C7 /* CDVDevice.m */; };
17 18
 /* End PBXBuildFile section */
18 19
 
19 20
 /* Begin PBXContainerItemProxy section */
@@ -61,6 +62,8 @@
61 62
 		EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
62 63
 		ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
63 64
 		F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "ArtesaníasICP/config.xml"; sourceTree = "<group>"; };
65
+		41757C63B0214F72B885F8C7 /* CDVDevice.m */ = {isa = PBXFileReference; name = "CDVDevice.m"; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
66
+		9FAEB57ED7114476814D1D74 /* CDVDevice.h */ = {isa = PBXFileReference; name = "CDVDevice.h"; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
64 67
 /* End PBXFileReference section */
65 68
 
66 69
 /* Begin PBXFrameworksBuildPhase section */
@@ -165,6 +168,8 @@
165 168
 		307C750510C5A3420062BCA9 /* Plugins */ = {
166 169
 			isa = PBXGroup;
167 170
 			children = (
171
+				41757C63B0214F72B885F8C7 /* CDVDevice.m */,
172
+				9FAEB57ED7114476814D1D74 /* CDVDevice.h */,
168 173
 			);
169 174
 			name = Plugins;
170 175
 			path = "ArtesaníasICP/Plugins";
@@ -293,6 +298,7 @@
293 298
 				1D60589B0D05DD56006BFB54 /* main.m in Sources */,
294 299
 				1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
295 300
 				302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
301
+				ADA04CF060084AB79470BC10 /* CDVDevice.m in Sources */,
296 302
 			);
297 303
 			runOnlyForDeploymentPostprocessing = 0;
298 304
 		};

binární
platforms/ios/ArtesaníasICP.xcworkspace/xcuserdata/christian.xcuserdatad/UserInterfaceState.xcuserstate Zobrazit soubor


+ 10
- 10
platforms/ios/ArtesaníasICP/Images.xcassets/BackgroundColor.colorset/Contents.json Zobrazit soubor

@@ -1,15 +1,15 @@
1 1
 {
2
-  "colors" : [
2
+  "colors": [
3 3
     {
4
-      "color" : {
5
-        "platform" : "ios",
6
-        "reference" : "systemBackgroundColor"
7
-      },
8
-      "idiom" : "universal"
4
+      "idiom": "universal",
5
+      "color": {
6
+        "platform": "ios",
7
+        "reference": "systemBackgroundColor"
8
+      }
9 9
     }
10 10
   ],
11
-  "info" : {
12
-    "author" : "xcode",
13
-    "version" : 1
11
+  "info": {
12
+    "author": "Xcode",
13
+    "version": 1
14 14
   }
15
-}
15
+}

+ 30
- 0
platforms/ios/ArtesaníasICP/Plugins/cordova-plugin-device/CDVDevice.h Zobrazit soubor

@@ -0,0 +1,30 @@
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 <UIKit/UIKit.h>
21
+#import <Cordova/CDVPlugin.h>
22
+
23
+@interface CDVDevice : CDVPlugin
24
+{}
25
+
26
++ (NSString*)cordovaVersion;
27
+
28
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
29
+
30
+@end

+ 115
- 0
platforms/ios/ArtesaníasICP/Plugins/cordova-plugin-device/CDVDevice.m Zobrazit soubor

@@ -0,0 +1,115 @@
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
+#include <sys/types.h>
21
+#include <sys/sysctl.h>
22
+#include "TargetConditionals.h"
23
+
24
+#import <Cordova/CDV.h>
25
+#import "CDVDevice.h"
26
+
27
+@implementation UIDevice (ModelVersion)
28
+
29
+- (NSString*)modelVersion
30
+{
31
+#if TARGET_IPHONE_SIMULATOR
32
+    NSString* platform = NSProcessInfo.processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"];
33
+#else
34
+    size_t size;
35
+
36
+    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
37
+    char* machine = malloc(size);
38
+    sysctlbyname("hw.machine", machine, &size, NULL, 0);
39
+    NSString* platform = [NSString stringWithUTF8String:machine];
40
+    free(machine);
41
+#endif
42
+    return platform;
43
+}
44
+
45
+@end
46
+
47
+@interface CDVDevice () {}
48
+@end
49
+
50
+@implementation CDVDevice
51
+
52
+- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
53
+{
54
+    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
55
+    static NSString* UUID_KEY = @"CDVUUID";
56
+    
57
+    // Check user defaults first to maintain backwards compaitibility with previous versions
58
+    // which didn't user identifierForVendor
59
+    NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
60
+    if (app_uuid == nil) {
61
+        if ([device respondsToSelector:@selector(identifierForVendor)]) {
62
+            app_uuid = [[device identifierForVendor] UUIDString];
63
+        } else {
64
+            CFUUIDRef uuid = CFUUIDCreate(NULL);
65
+            app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
66
+            CFRelease(uuid);
67
+        }
68
+
69
+        [userDefaults setObject:app_uuid forKey:UUID_KEY];
70
+        [userDefaults synchronize];
71
+    }
72
+    
73
+    return app_uuid;
74
+}
75
+
76
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
77
+{
78
+    NSDictionary* deviceProperties = [self deviceProperties];
79
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
80
+
81
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
82
+}
83
+
84
+- (NSDictionary*)deviceProperties
85
+{
86
+    UIDevice* device = [UIDevice currentDevice];
87
+
88
+    return @{
89
+             @"manufacturer": @"Apple",
90
+             @"model": [device modelVersion],
91
+             @"platform": @"iOS",
92
+             @"version": [device systemVersion],
93
+             @"uuid": [self uniqueAppInstanceIdentifier:device],
94
+             @"cordova": [[self class] cordovaVersion],
95
+             @"isVirtual": @([self isVirtual])
96
+             };
97
+}
98
+
99
++ (NSString*)cordovaVersion
100
+{
101
+    return CDV_VERSION;
102
+}
103
+
104
+- (BOOL)isVirtual
105
+{
106
+    #if TARGET_OS_SIMULATOR
107
+        return true;
108
+    #elif TARGET_IPHONE_SIMULATOR
109
+        return true;
110
+    #else
111
+        return false;
112
+    #endif
113
+}
114
+
115
+@end

+ 27
- 0
platforms/ios/ArtesaníasICP/config.xml Zobrazit soubor

@@ -25,6 +25,9 @@
25 25
         <param name="ios-package" value="CDVGestureHandler" />
26 26
         <param name="onload" value="true" />
27 27
     </feature>
28
+    <feature name="Device">
29
+        <param name="ios-package" value="CDVDevice" />
30
+    </feature>
28 31
     <name>ArtesaníasICP</name>
29 32
     <description>
30 33
         A sample Apache Cordova application that responds to the deviceready event.
@@ -42,6 +45,30 @@
42 45
     <allow-intent href="file://*" />
43 46
     <allow-intent href="mailto:*" />
44 47
     <allow-intent href="geo:*" />
48
+    <icon height="57" src="icon/iOS/AppIcon.appiconset/icon.png" width="57" />
49
+    <icon height="114" src="icon/iOS/AppIcon.appiconset/icon@2x.png" width="114" />
50
+    <icon height="20" src="icon/iOS/AppIcon.appiconset/icon-20.png" width="20" />
51
+    <icon height="48" src="icon/iOS/AppIcon.appiconset/icon-24@2x.png" width="48" />
52
+    <icon height="60" src="icon/iOS/AppIcon.appiconset/icon-20@3x.png" width="60" />
53
+    <icon height="55" src="icon/iOS/AppIcon.appiconset/icon-27.5@2x.png" width="55" />
54
+    <icon height="29" src="icon/iOS/AppIcon.appiconset/icon-29.png" width="29" />
55
+    <icon height="58" src="icon/iOS/AppIcon.appiconset/icon-29@2x.png" width="58" />
56
+    <icon height="88" src="icon/iOS/AppIcon.appiconset/icon-29@3x.png" width="88" />
57
+    <icon height="40" src="icon/iOS/AppIcon.appiconset/icon-40.png" width="40" />
58
+    <icon height="80" src="icon/iOS/AppIcon.appiconset/icon-40@2x.png" width="80" />
59
+    <icon height="88" src="icon/iOS/AppIcon.appiconset/icon-44@2x.png" width="88" />
60
+    <icon height="50" src="icon/iOS/AppIcon.appiconset/icon-50.png" width="50" />
61
+    <icon height="100" src="icon/iOS/AppIcon.appiconset/icon-50@2x.png" width="100" />
62
+    <icon height="120" src="icon/iOS/AppIcon.appiconset/icon-60@2x.png" width="120" />
63
+    <icon height="180" src="icon/iOS/AppIcon.appiconset/icon-60@3x.png" width="180" />
64
+    <icon height="72" src="icon/iOS/AppIcon.appiconset/icon-72.png" width="72" />
65
+    <icon height="144" src="icon/iOS/AppIcon.appiconset/icon-72@2x.png" width="144" />
66
+    <icon height="76" src="icon/iOS/AppIcon.appiconset/icon-76.png" width="76" />
67
+    <icon height="152" src="icon/iOS/AppIcon.appiconset/icon-76@2x.png" width="152" />
68
+    <icon height="167" src="icon/iOS/AppIcon.appiconset/icon-83.5@2x.png" width="167" />
69
+    <icon height="172" src="icon/iOS/AppIcon.appiconset/icon-86@2x.png" width="172" />
70
+    <icon height="196" src="icon/iOS/AppIcon.appiconset/icon-98@2x.png" width="196" />
71
+    <icon height="1024" src="icon/iOS/AppIcon.appiconset/icon-1024.png" width="1024" />
45 72
     <preference name="AllowInlineMediaPlayback" value="false" />
46 73
     <preference name="BackupWebStorage" value="cloud" />
47 74
     <preference name="DisallowOverscroll" value="false" />

+ 27
- 3
platforms/ios/ios.json Zobrazit soubor

@@ -4,16 +4,40 @@
4 4
     "uninstalled": []
5 5
   },
6 6
   "config_munge": {
7
-    "files": {}
7
+    "files": {
8
+      "config.xml": {
9
+        "parents": {
10
+          "/*": [
11
+            {
12
+              "xml": "<feature name=\"Device\"><param name=\"ios-package\" value=\"CDVDevice\" /></feature>",
13
+              "count": 1
14
+            }
15
+          ]
16
+        }
17
+      }
18
+    }
8 19
   },
9 20
   "installed_plugins": {
10 21
     "cordova-plugin-whitelist": {
11 22
       "PACKAGE_NAME": "io.cordova.hellocordova"
23
+    },
24
+    "cordova-plugin-device": {
25
+      "PACKAGE_NAME": "io.cordova.hellocordova"
12 26
     }
13 27
   },
14 28
   "dependent_plugins": {},
15
-  "modules": [],
29
+  "modules": [
30
+    {
31
+      "id": "cordova-plugin-device.device",
32
+      "file": "plugins/cordova-plugin-device/www/device.js",
33
+      "pluginId": "cordova-plugin-device",
34
+      "clobbers": [
35
+        "device"
36
+      ]
37
+    }
38
+  ],
16 39
   "plugin_metadata": {
17
-    "cordova-plugin-whitelist": "1.3.4"
40
+    "cordova-plugin-whitelist": "1.3.4",
41
+    "cordova-plugin-device": "2.0.3"
18 42
   }
19 43
 }

+ 12
- 2
platforms/ios/platform_www/cordova_plugins.js Zobrazit soubor

@@ -1,6 +1,16 @@
1 1
 cordova.define('cordova/plugin_list', function(require, exports, module) {
2
-  module.exports = [];
2
+  module.exports = [
3
+    {
4
+      "id": "cordova-plugin-device.device",
5
+      "file": "plugins/cordova-plugin-device/www/device.js",
6
+      "pluginId": "cordova-plugin-device",
7
+      "clobbers": [
8
+        "device"
9
+      ]
10
+    }
11
+  ];
3 12
   module.exports.metadata = {
4
-    "cordova-plugin-whitelist": "1.3.4"
13
+    "cordova-plugin-whitelist": "1.3.4",
14
+    "cordova-plugin-device": "2.0.3"
5 15
   };
6 16
 });

+ 86
- 0
platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,86 @@
1
+cordova.define("cordova-plugin-device.device", function(require, exports, module) {
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
+var argscheck = require('cordova/argscheck');
24
+var channel = require('cordova/channel');
25
+var utils = require('cordova/utils');
26
+var exec = require('cordova/exec');
27
+var cordova = require('cordova');
28
+
29
+channel.createSticky('onCordovaInfoReady');
30
+// Tell cordova channel to wait on the CordovaInfoReady event
31
+channel.waitForInitialization('onCordovaInfoReady');
32
+
33
+/**
34
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
35
+ * phone, etc.
36
+ * @constructor
37
+ */
38
+function Device () {
39
+    this.available = false;
40
+    this.platform = null;
41
+    this.version = null;
42
+    this.uuid = null;
43
+    this.cordova = null;
44
+    this.model = null;
45
+    this.manufacturer = null;
46
+    this.isVirtual = null;
47
+    this.serial = null;
48
+
49
+    var me = this;
50
+
51
+    channel.onCordovaReady.subscribe(function () {
52
+        me.getInfo(function (info) {
53
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
54
+            // TODO: CB-5105 native implementations should not return info.cordova
55
+            var buildLabel = cordova.version;
56
+            me.available = true;
57
+            me.platform = info.platform;
58
+            me.version = info.version;
59
+            me.uuid = info.uuid;
60
+            me.cordova = buildLabel;
61
+            me.model = info.model;
62
+            me.isVirtual = info.isVirtual;
63
+            me.manufacturer = info.manufacturer || 'unknown';
64
+            me.serial = info.serial || 'unknown';
65
+            channel.onCordovaInfoReady.fire();
66
+        }, function (e) {
67
+            me.available = false;
68
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
69
+        });
70
+    });
71
+}
72
+
73
+/**
74
+ * Get device info
75
+ *
76
+ * @param {Function} successCallback The function to call when the heading data is available
77
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
78
+ */
79
+Device.prototype.getInfo = function (successCallback, errorCallback) {
80
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
81
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
82
+};
83
+
84
+module.exports = new Device();
85
+
86
+});

+ 12
- 2
platforms/ios/www/cordova_plugins.js Zobrazit soubor

@@ -1,6 +1,16 @@
1 1
 cordova.define('cordova/plugin_list', function(require, exports, module) {
2
-  module.exports = [];
2
+  module.exports = [
3
+    {
4
+      "id": "cordova-plugin-device.device",
5
+      "file": "plugins/cordova-plugin-device/www/device.js",
6
+      "pluginId": "cordova-plugin-device",
7
+      "clobbers": [
8
+        "device"
9
+      ]
10
+    }
11
+  ];
3 12
   module.exports.metadata = {
4
-    "cordova-plugin-whitelist": "1.3.4"
13
+    "cordova-plugin-whitelist": "1.3.4",
14
+    "cordova-plugin-device": "2.0.3"
5 15
   };
6 16
 });

+ 1
- 1
platforms/ios/www/css/index.css Zobrazit soubor

@@ -32,7 +32,7 @@ body {
32 32
     margin:0px;
33 33
     padding:0px;
34 34
     /* Padding to avoid the "unsafe" areas behind notches in the screen */
35
-    padding: env(safe-area-inset-top, 10px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 10px) env(safe-area-inset-right, 0px);
35
+    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-right, 0px);
36 36
     text-transform:none;
37 37
     width:100%;
38 38
 }

binární
platforms/ios/www/img/BARRO.jpg Zobrazit soubor


binární
platforms/ios/www/img/CRISTAL.jpg Zobrazit soubor


binární
platforms/ios/www/img/CUERO.jpg Zobrazit soubor


binární
platforms/ios/www/img/FIBRAS.jpg Zobrazit soubor


binární
platforms/ios/www/img/INSTRUMENTOS TÍPICOS.jpg Zobrazit soubor


binární
platforms/ios/www/img/JUGUETES TRADICIONALES.jpg Zobrazit soubor


binární
platforms/ios/www/img/LABORES EN AGUJA.jpg Zobrazit soubor


binární
platforms/ios/www/img/METAL.jpg Zobrazit soubor


binární
platforms/ios/www/img/MÁSCARAS.jpg Zobrazit soubor


binární
platforms/ios/www/img/PAPEL.jpg Zobrazit soubor


binární
platforms/ios/www/img/PIEDRAS.jpg Zobrazit soubor


binární
platforms/ios/www/img/TABACOS.jpg Zobrazit soubor


binární
platforms/ios/www/img/culturalpr1800x3200-2-01.png Zobrazit soubor


binární
platforms/ios/www/img/logo_cdcc.png Zobrazit soubor


+ 179
- 83
platforms/ios/www/index.html Zobrazit soubor

@@ -37,10 +37,9 @@
37 37
         <link rel="stylesheet" href="calendar_files/css/theme1.css"/>
38 38
         <!--this is for the search bar-->
39 39
         <link rel = "stylesheet" href = "css/searchbar1.css">
40
-
40
+        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
41 41
         <meta name="format-detection" content="telephone=no">
42 42
         <meta name="msapplication-tap-highlight" content="no">
43
-        <meta name="viewport" content="initial-scale=1, width=device-width, height=device-height, viewport-fit=cover">
44 43
         <meta charset="UTF-8">
45 44
         <link rel="stylesheet" type="text/css" href="css/index.css">
46 45
         <link rel="stylesheet" href="lib/OnsenUI/css/onsenui.css">
@@ -86,7 +85,7 @@
86 85
                 <ons-card id="azar"><!--style="height: 100%"-->
87 86
 
88 87
                     <!--<div class="title" id="Title"></div>-->
89
-                    <div id="image"></div><br>
88
+                    <div id="image" style= "max-height:450px"></div><br>
90 89
                     <div class="content" id="Content"></div>
91 90
                     <!--This javascript will randomly choose an image and information of a certain type of artesania used by a certain artists-->
92 91
                     <!--For now all this information is stored inside a .csv file-->
@@ -224,7 +223,7 @@
224 223
                 <div class="center" >${Artesano.Nombre}</div>
225 224
                 <div class="expandable-content"> Municipio: ${Artesano.Municipio}<br>
226 225
                                                  Tel\u00e9fono: ${Artesano["Telefono 1"]}<br>
227
-                                                 Correo Electr\u00f3nico: ${Artesano["E-mail"]}<br>
226
+                                                 Correo Electr\u00f3nico: ${Artesano["Email"]}<br>
228 227
                                                  </div>
229 228
               </ons-list-item>`
230 229
                                                     );
@@ -247,19 +246,20 @@
247 246
                             if (Artesano["Telefono 1"].trim().length != 0) {
248 247
                                 cont ++;
249 248
                             }
250
-                            if (Artesano["E-mail"].trim().length != 0 & Artesano["E-mail"].toUpperCase().trim() != "NO TIENE") {
249
+                            if (Artesano["Email"].trim().length != 0 & Artesano["Email"].toUpperCase().trim() != "NO TIENE") {
251 250
                                 cont ++;
252 251
                             }
253 252
                             if (Artesano.Especificacion.trim().length != 0) {
254 253
                                 cont ++;
255 254
                             }
256
-
255
+                            
256
+                            Artesano.Nombre = Artesano.Nombre + " " + Artesano["Apellido Paterno"] + " " + Artesano["Apellido Materno"];
257 257
 
258 258
                             //info a pasar
259 259
                             //'title':'${Artesano.Nombre}','esp': '${info}'
260 260
                             //Tries to pass all the info of each artesano into a new page, the page that display this information is 'artesano.html', not to be confused with 'artesanias.html' or 'artesanos.html'(current page)
261 261
                             //And puts this into the 'item' variable
262
-                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["E-mail"]}', esp: '${Artesano.Especificacion}', redes: '${Artesano["E-Commerce 1"]}' } })" tappable>
262
+                            var item = ons.createElement(`<ons-list-item onclick="myNavigator.pushPage('artesano.html', { data: { title: '${Artesano.Nombre.replace(/"/g, " ")}', mun: '${Artesano.Municipio}', tel: '${Artesano["Telefono 1"]}', email: '${Artesano["Email"]}', esp: '${Artesano.Especificacion}', redes: '${Artesano["E-Commerce 1"]}', tecnicas: '${Artesano["Tecnica"]}' } })" tappable>
263 263
                         <div class="title">${Artesano.Nombre}</div>
264 264
                     </ons-list-item>`);
265 265
 
@@ -366,8 +366,10 @@
366 366
                              for(var i=0; i<results.length; i++) {
367 367
 
368 368
                                  //if(Esp[num] in artesanos_json.) {}
369
-                                 Artesanos+=`${results[i].Nombre}|`
370
-                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Telefono 1"]}|${results[i]["E-mail"]}|${results[i].Especificacion}&&`
369
+                                 //results[i].Nombre = results[i].Nombre + " " + results[i]["Apellido Paterno"] + " " + results[i]["Apellido Materno"]
370
+                                 ANombre = results[i].Nombre + " " + results[i]["Apellido Paterno"] + " " + results[i]["Apellido Materno"]
371
+                                 Artesanos+=`${ANombre}|`
372
+                                 ArtesanosInfo+=`${results[i].Municipio}|${results[i]["Telefono 1"]}|${results[i]["Email"]}|${results[i].Especificacion}|${results[i]["Tecnica"]}&&`
371 373
                                  //`<a id='home.html'>${Artesania.artesano} | ${Artesania.municipio}</a> `
372 374
                              }
373 375
 
@@ -398,11 +400,17 @@
398 400
                                      tel = lot[1],
399 401
                                      email = lot[2],
400 402
                                      esp = lot[3],
401
-                                     redes = lot[4];
403
+                                     redes = lot[4],
404
+                                     tecnicas = lot[5];
402 405
 
403
-                                 listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}'}} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
406
+                                 listaArt += `<ons-item tappable onclick="myNavigator.pushPage('artesano.html', {data: {title:'${arts[i]}', mun: '${mun}', tel: '${tel}', email: '${email}', esp: '${esp}', redes: '${redes}', tecnicas: '${tecnicas}' }} )" ><div class="center">`+ arts[i] +`</div></ons-item><br>`;
404 407
                              }
405 408
 
409
+                             if (Artesania.name == "Figuras y simbolos indigenas") {
410
+                                 Artesania.name = "Figuras y símbolos indígenas";
411
+                             } 
412
+
413
+                             console.log(Artesania.name);
406 414
 
407 415
                              return ons.createElement(`
408 416
               <ons-list-item expandable tappable>
@@ -526,12 +534,12 @@
526 534
                     The third searchbar is to find by the municipio where the artists works or lives
527 535
                 -->
528 536
                 <p style="text-align: center; margin-top: 10px;">
529
-                    <ons-search-input placeholder="Busqueda en cualquiera" id = "searchbar"
530
-                        onkeyup = "filter()"></ons-search-input>
531
-                    <ons-search-input placeholder="Busqueda por artesanias" id = "searchartesania"
532
-                        onkeyup = "filter()"></ons-search-input>
533
-                    <ons-search-input placeholder = "Busqueda por municipio" id = "searchbarmunicipio"
534
-                        onkeyup = "filter()"></ons-search-input>
537
+                    <ons-search-input placeholder="Búsqueda con cualquier término" id = "searchbar"
538
+                        onkeyup = "filter()" style = "width: 300px;" ></ons-search-input>
539
+                    <ons-search-input placeholder="Búsqueda por artesanias" id = "searchartesania"
540
+                        onkeyup = "filter()" style = "width: 300px;"></ons-search-input>
541
+                    <ons-search-input placeholder = "Búsqueda por municipio" id = "searchbarmunicipio"
542
+                        onkeyup = "filter()" style = "width: 300px;"></ons-search-input>
535 543
                 </p>
536 544
 
537 545
                 <ons-list id="results" src="">
@@ -541,8 +549,9 @@
541 549
                     //This is basically declaring what we refer to as informacion in the filter() function
542 550
                     //It iterates though each artists in the all_artesanos json file from before, it displays their name in the "Buscar" page, and it gets prepared so that when its clicked it redirects to the "artesano.html" page with the other aditional information that we have other than the name.
543 551
                     for (i = 0; i < all_artesanos.length;i++){
552
+                        all_artesanos[i].Nombre = all_artesanos[i].Nombre +  " " + all_artesanos[i]["Apellido Paterno"] + " " + all_artesanos[i]["Apellido Materno"];
544 553
                         var artesano = ons.createElement(`<ons-list-item class = "artists"
545
-                        onclick="SNavigator.pushPage('artesano.html', { data: {title: '${all_artesanos[i].Nombre}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["E-mail"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}' } })" tappable>
554
+                        onclick="SNavigator.pushPage('artesano_s.html', { data: {title: '${all_artesanos[i].Nombre.replace(/"/g, " ")}', mun: '${all_artesanos[i].Municipio}', tel: '${all_artesanos[i]["Telefono 1"]}', email: '${all_artesanos[i]["Email"]}', esp: '${all_artesanos[i].Especificacion}', redes: '${all_artesanos[i]["E-Commerce 1"]}', tecnicas: '${all_artesanos[i]["Tecnica"]}' } })" tappable>
546 555
                         <div>${all_artesanos[i].Nombre}</div>
547 556
                     </ons-list-item>`);
548 557
                         document.getElementById('results').appendChild(artesano);
@@ -563,8 +572,10 @@
563 572
                     <div class = "center"></div>
564 573
                 </ons-toolbar>
565 574
                 <body>
566
-                    <!-- This is where we'll put all the information of that artsts -->
567
-                    <ons-card id="all"></ons-card>
575
+                	<font size="+1">
576
+                    	<!-- This is where we'll put all the information of that artsts -->
577
+                    	<ons-card id="all"></ons-card>
578
+                    </font>
568 579
                 </body>
569 580
                 <script>
570 581
                     //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
@@ -576,24 +587,40 @@
576 587
                             tel = this.data.tel,
577 588
                             em = this.data.email,
578 589
                             esp = this.data.esp,
579
-                            redes = this.data.redes;
590
+                            redes = this.data.redes,
591
+                            tecnicas = this.data.tecnicas;
580 592
 
581 593
                         //here the email is the string made from the start to where the '#' is.
582
-                        email = em.slice(0, em.search("#"));
594
+                        
583 595
 
584 596
                         //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
585 597
                         //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
586 598
                         //but if theres only one then you just write it into the page
587 599
                         if(esp.trim() != ""){
600
+
601
+                            //Fixes phrase error in json
602
+                            if(esp.includes("Figuras y simbolos indigenas")) {
603
+                                esp = esp.replace("Figuras y simbolos indigenas", "Figuras y símbolos indígenas")
604
+                            }
605
+
588 606
                             if(esp.includes(";", 0)){
589 607
                                 esp=esp.replace(/;/g,", ");
590
-                                data+='Tipos de artesanias: '+esp+'<br>';
608
+                                data+='Tipos de artesanías: '+esp+'<br>';
591 609
                             }
592 610
                             else {
593
-                                data+='Tipo de artesania: '+esp+'<br>';
611
+                                data+='Tipo de artesanía: '+esp+'<br>';
594 612
                             }
595 613
                         }
596 614
 
615
+                        if(tecnicas.trim() != ''){
616
+                            if(tecnicas.includes(";", 0)){
617
+                                tecnicas = tecnicas.replace(/;/g,", ");
618
+                                data+='Técnicas que usan: '+tecnicas+'<br>';
619
+                            }
620
+                            else {
621
+                                data+='Técnicas que usan: '+tecnicas+'<br>';
622
+                            }
623
+                        }
597 624
                         //console.log("Las redes son..."+this.data.redes);
598 625
                         //Here it's making sure theres something in municipio and writing their municipio into the page
599 626
                         if(mun.trim() != ""){
@@ -602,8 +629,8 @@
602 629
 
603 630
                         //Here it's writing their email, in blue color and its used as a link to send one when it's clicked, then it goes to the next line
604 631
                         //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
605
-                        if(email.trim() != "" & email.toUpperCase().trim() != "NO TIENE"){
606
-                            data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+email+'"><u>'+email+'</u></a><br>';
632
+                        if(em.trim() != "" & em.toUpperCase().trim() != "NO TIENE"){
633
+                            data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+em+'"><u>'+em+'</u></a><br>';
607 634
                         }
608 635
 
609 636
                         //Here it's writing their phone number into the page,its in blue and whenever its clicked the app will redirect the user to call them, then it goes to the next line
@@ -650,20 +677,120 @@
650 677
                 </script>
651 678
             </ons-page>
652 679
         </template>
680
+        
681
+         <template id= "artesano_s.html">
682
+            <ons-page id = "artesano_s">
683
+                <ons-toolbar>
684
+                    <!-- Pretty self explanatory, its a button that goes back to the previous page -->
685
+                    <div class = "left"> <ons-back-button> Atras </ons-back-button></div>
686
+                    <div class = "center"></div>
687
+                </ons-toolbar>
688
+                <body>
689
+                    <!-- This is where we'll put all the information of that artsts -->
690
+                    <font size="+1">
691
+                        <ons-card id="all2"></ons-card>
692
+                    </font>
693
+                </body>
694
+                <script>
695
+                    //when it opens this page this function starts to run, it first recieves the information that was sent to "artesano.html"
696
+                    ons.getScriptPage().onInit = function () {
697
+                        this.querySelector('ons-toolbar div.center').textContent = this.data.title;
698
+
699
+                        var data = '',
700
+                            mun = this.data.mun,
701
+                            tel = this.data.tel,
702
+                            em = this.data.email,
703
+                            esp = this.data.esp,
704
+                            redes = this.data.redes,
705
+                            tecnicas = this.data.tecnicas;
706
+
707
+                        //here the email is the string made from the start to where the '#' is.
708
+                        
709
+
710
+                        //Here it's dividing all the especificaciones and writing them into the page (data) and then goes to the next line
711
+                        //if it has many especificaciones then it will replace all the ';' in it with ',' and writes it into the page
712
+                        //but if theres only one then you just write it into the page
713
+                        if(esp.trim() != ""){
714
+                            if(esp.includes(";", 0)){
715
+                                esp=esp.replace(/;/g,", ");
716
+                                data+='Tipos de artesanías: '+esp+'<br>';
717
+                            }
718
+                            else {
719
+                                data+='Tipo de artesanía: '+esp+'<br>';
720
+                            }
721
+                        }
722
+
723
+                        if(tecnicas.trim() != ''){
724
+                            if(tecnicas.includes(";", 0)){
725
+                                tecnicas = tecnicas.replace(/;/g,", ");
726
+                                data+='Técnicas que usan: '+tecnicas+'<br>';
727
+                            }
728
+                            else {
729
+                                data+='Técnicas que usan: '+tecnicas+'<br>';
730
+                            }
731
+                        }
732
+                        //console.log("Las redes son..."+this.data.redes);
733
+                        //Here it's making sure theres something in municipio and writing their municipio into the page
734
+                        if(mun.trim() != ""){
735
+                            data+='Municipio: '+ mun +'<br>';
736
+                        }
737
+
738
+                        //Here it's writing their email, in blue color and its used as a link to send one when it's clicked, then it goes to the next line
739
+                        //Whenever the variable is empty or if it has "NO TIENE" then it doesnt write anything
740
+                        if(em.trim() != "" & em.toUpperCase().trim() != "NO TIENE"){
741
+                            data+='Correo Electr\u00f3nico: <a style="color:blue" href="mailto: '+em+'"><u>'+em+'</u></a><br>';
742
+                        }
743
+
744
+                        //Here it's writing their phone number into the page,its in blue and whenever its clicked the app will redirect the user to call them, then it goes to the next line
745
+                        if(tel.trim() != "" ){
746
+                            data+='Tel\u00e9fono: <a style="color:blue" href="tel: '+ tel +'"><u>'+ tel +'</u></a><br>';
747
+                        }
748
+
749
+                        console.log("Redes: "+redes);
750
+
751
+                        //Here it has to decide what to do depending on the links they give to their social media pages
752
+                        //if the link is to a facebook, instagram or myspace account then it will show the picture of the social media site, and when you click the picture then the app redirects you to their social media.
753
+                        //The alt attribute is required for images, it's in case theres no internet connection, then it will display that tet instead, I think screen readers can also read that text
754
+                        //If the link is to another website (but isn't a mailto link) then it will display a default picture we chose to display a default web browser, like the other ones clikcing on it will take you to the link.
755
+                        //If it's none of them then it will not display anything
756
+                        if(redes.includes("facebook")){
757
+
758
+                            console.log(redes.substring(1,redes.length-2));
759
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/facebook.png" alt="Facebook"style="width:35px;height:35px;border:0;"><br>';
760
+                        }
761
+                        else if(redes.includes("instagram")){
762
+                            console.log(redes.substring(1,redes.length-2));
763
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/instagram.png" alt="Instagram"style="width:35px;height:35px;border:0;"><br>';
764
+                        }
765
+                        else if(redes.includes("myspace")){
766
+                            console.log(redes.substring(1,redes.length-2));
767
+                            data+='<br><a href="'+ redes.substring(1,redes.length-2) + '"><img src="img/MySpace.png" alt="MySpace"style="width:35px;height:35px;border:0;"><br>';
768
+                        }
769
+                        else if((redes.includes(".org") || redes.includes(".com")) && !redes.includes("mailto")){
770
+                            redes = redes.substr(redes.indexOf("#")+1,redes.length);
771
+                            redes = redes.substr(0, redes.length-1);
772
+                            console.log(redes);
773
+                            data+='<br><a href="'+ redes + '"><img src="img/internet.jpg" style="width:35px;height:35px;border:0;"><br>';
774
+                        }
775
+                        else if(redes.includes("#") || redes.includes("mailto")){
776
+                            console.log("tiene un disparate");
777
+                        } else {
778
+                            console.log("no tiene nada");
779
+                        }
653 780
 
781
+                        //This is the part that allows eveything (data) to be displayed
782
+                        document.getElementById("all2").innerHTML = `${data}`;
783
+
784
+                    }
785
+                </script>
786
+            </ons-page>
787
+        </template>
654 788
 <!-- ------------------------------------------------------------------------------------------------------------------------------------------------------- -->
655 789
 
656 790
         <template id="renglones.html">
657 791
           <ons-navigator swipeable animation="slide" id="myNavigator">
658 792
             <ons-page id="renglones">
659 793
 
660
-            <!--div class="search-bar">
661
-                 <p style="text-align: center; margin-top: 10px;">
662
-                    <ons-search-input placeholder="Search" onchange="ons.notification.alert('Searched for: ' + this.value)"
663
-           style="width: 96%; margin: 6px auto 6px auto;"></ons-search-input>
664
-                </p>
665
-            </div-->
666
-
667 794
             <ons-card id="list">
668 795
               <script type="text/javascript" src="js/renglones.js"></script>
669 796
             </ons-card>
@@ -706,16 +833,20 @@
706 833
 
707 834
         <template id="ferias.html">
708 835
             <ons-page id="ferias">
709
-                <!--<ons-card>
710
-
711
-                <div id = "caleandar" class = "calendar" style="margin-top: 20px;">
712
-                    <script type="text/javascript" src="calendar_files/js/caleandar.js"></script>
713
-                    <script type="text/javascript" src="calendar_files/js/events.js"></script>
836
+                
837
+                <ons-card>
838
+                <div id="logo" style="text-align: center">
839
+                    <img src="img/culturalpr1800x3200-2-01.png" style="width:150px;height:100px">
714 840
                 </div>
715
-
716
-                </ons-card>-->
717
-                <br><br><br>
718
-                <button onclick="redirect()">Pasar a la pagina de eventos</button>
841
+                <br><br>
842
+                <div id="button" style="text-align: center">
843
+                <ons-button onclick="redirect()" modifier="large" style="background-color: #00abc1;"> Pasar a la página de eventos </ons-button>
844
+                </div>
845
+                <br><br>
846
+                <div id="Mensaje">
847
+                    El Instituto de Cultura Puertorriqueña, el Gobierno de Puerto Rico, los Colaboradores de esta aplicación, así como los funcionarios, empleados y contratistas de los anteriores, no se hacen responsables de los mensajes, imágenes, opiniones, servicios, declaraciones, representaciones o cualquier forma de contenido incluido en cualquiera de los enlaces accesibles, vinculados o referidos a través de ArtesaníasICP.
848
+                </div>
849
+                </ons-card>
719 850
 
720 851
               <script>
721 852
               function redirect() {
@@ -732,46 +863,7 @@
732 863
                 <ons-card>
733 864
 
734 865
                     <h1>Colaboradores</h1>
735
-                    <h2>Instituto de Cultura Puertorriqueña</h2>
736
-                    <h3>Ven, descubre lo que nuestra riqueza cultural puertorriqueña tiene para tí.<br> Disfrútala, es tu identidad.
737
-                    </h3>
738
-
739
-
740
-                    <body>
741
-                        <br>
742
-                        El Instituto de Cultura Puertorriqueña (ICP) tiene como misión investigar, conservar, promover y divulgar la cultura puertorriqueña en su diversidad y complejidad. Con la memoria y la promesa de la cultura, los distintos niveles, sectores, edades e intereses de la comunidad crean el conjunto de modos de vida, costumbres y manifestaciones artísticas que nos identifica como país. El ICP existe para preservar y divulgar estos saberes, difundir internacionalmente nuestro talento y enriquecer el amor a lo propio.
743
-                        <br><br>
744
-                        Nuestras tradiciones no son rígidos objetos de museo, sino actividades vivas en constante renovación y reapropiación, según van también desarrollándose nuevas tradiciones. El respeto a la diversidad, a lo híbrido, a lo apropiado y a lo replanteado también son parte esencial de esta institución que busca activamente la colaboración de todos en un quehacer que debe ser siempre compartido de la mano con su ingente diversidad.
745
-                        <br><br>
746
-                        Prof. Carlos R. Ruiz Cortés<br>
747
-                        Director Ejecutivo<br>
748
-                        Instituto de Cultura Puertorriqueña<br>
749
-                        Directorio Artesanal Cultural PR <img src="img/gobierno.png" style="width:35px;height:35px;border:0;">
750
-                        <br><br>
751
-                    </body>
752
-                    
753
-
754
-
755
-                    Visita nuestra <a href="https://www.icp.pr.gov/">Página Web</a> o síguenos en nuestras redes sociales: <br> <br> 
756
-                    <a href="https://twitter.com/icppr"><img src="img/twitter.png" alt="Twitter" style="width:35px;height:35px;border:0;">
757
-                    </a> 
758
-                    <a href="https://facebook.com/icppr"><img src="img/facebook.png" alt="Facebook" style="width:35px;height:35px;border:0;">
759
-                    </a>
760
-                    <a href="https://youtube.com/user/icppr"><img src="img/youtube.png" alt="Youtube" style="width:35px;height:35px;border:0;">
761
-                    </a>
762
-                    <a href="https://instagram.com/icppr"><img src="img/instagram.png" alt="Instagram" style="width:35px;height:35px;border:0;">
763
-                    </a>
764 866
                     
765
-                    <br><br><br>
766
-                    <button onclick="redirect()">Pasar a la pagina de eventos</button>
767
-
768
-                    <script>
769
-                        function redirect() {
770
-                            location.replace("https://facebook.com/icppr")
771
-                        }
772
-                    </script>
773
-                    
774
-                    <br><br>
775 867
                     <style>
776 868
                         .column {
777 869
                             float: left;
@@ -804,10 +896,14 @@
804 896
                     <a href="https://www.instagram.com/sinfinespr/"><img src="img/instagram.png" alt="Instagram" style="width:35px;height:35px;border:0;">
805 897
                     </a>
806 898
                     <br><br>
807
-                    <h2>Centro de Desarrollo y Consultoria Computacional</h2>
899
+                    <h2>Centro de Desarrollo y Consultoría Computacional</h2>
808 900
                     El Centro de Desarrollo y Consultoría Computacional está compuesto por profesores y estudiantes del departamento de Ciencia de Cómputos de la Universidad de Puerto Rico Recinto de Río Piedras. Nuestra meta es aportar al desarrollo computacional de la Universidad y de Puerto Rico al proveer servicios al día, de calidad y con precios accesibles, a la misma vez que se le ofrece experiencias prácticas a los estudiantes del departamento de Ciencia de Cómputos.
809 901
                     <br><br>
810
-                    Si tiene alguna duda nos puede conactar por:
902
+                    
903
+                    <img src="img/logo_cdcc.png" style="width: 150px; height: 100px">
904
+                    
905
+                    <br><br>
906
+                    Si tiene alguna duda nos puede contactar por:
811 907
                     <br>
812 908
                     Teléfono: 787-764-0000 Ext. 88341, 88349
813 909
                     <br>

+ 10
- 8
platforms/ios/www/js/azar.js Zobrazit soubor

@@ -3,22 +3,24 @@
3 3
 // begin accessing JSON data here
4 4
 var data = JSON.parse(localStorage.getItem("AZAR"));
5 5
 
6
+// grabs the page with home id
6 7
 var page = document.getElementById("home");
7 8
 
9
+// assigns a random number to randomly determine which image and information to display in the home page.
10
+// Then it grabs the image container of the card, and inserts the random image. It also garbs the content container
11
+// and puts the corresponding title and description. This section activates on application startup.
8 12
 var aleatorio = Math.floor(Math.random()*52);
9
-document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="300">`;
10
-document.getElementById("Content").innerHTML = "<h4>" + data[aleatorio].titulo + "</h4>" + data[aleatorio].texto; 
13
+document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="350px">`;
14
+document.getElementById("Content").innerHTML = "<br><h4>" + data[aleatorio].titulo + "</h4>" + data[aleatorio].texto; 
11 15
 
16
+// This section activates every time you switch back to the home tab. It first empties the content on the card
17
+// and then it newly assigns a new random number to fetch a new random image and description to display on home.
12 18
 page.addEventListener("show", function(event){
13 19
     document.getElementById("image").innerHTML='';
14 20
     document.getElementById("Content").innerHTML='';
15 21
     var aleatorio = Math.floor(Math.random()*32);
16
-    //var azar = document.getElementById("azar");
17
-    //var img = ons.createElement(`<img src="img/${aleatorio}.png">`);
18
-    document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="300">`;
19
-    //document.getElementById("Title").innerHTML = data[aleatorio].Renglones;
20
-    document.getElementById("Content").innerHTML = "<h4>" + data[aleatorio].titulo + "</h4>" + data[aleatorio].texto;
21
-    //azar.appendChild(img);
22
+    document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="350px">`;
23
+    document.getElementById("Content").innerHTML = "<br><h4>" + data[aleatorio].titulo + "</h4>" + data[aleatorio].texto;
22 24
     });
23 25
 
24 26
                            

+ 9
- 0
platforms/ios/www/js/index.js Zobrazit soubor

@@ -28,6 +28,15 @@ var app = {
28 28
     // 'pause', 'resume', etc.
29 29
     onDeviceReady: function() {
30 30
 
31
+        //A list of device models that have notches that interfere with page content.
32
+        //OnsenUi has the isIPhoneX boolean value, however, it does not detect IPhone 11 or 12 types. 
33
+        var notchDevices = ["iPhone12,1", "iPhone12,3", "iPhone12,5", "iPhone13,1", "iPhone13,2", "iPhone13,3", "iPhone13,4"]
34
+
35
+
36
+        if (ons.platform.isIPhoneX() || notchDevices.includes(device.model)) { 
37
+            document.documentElement.setAttribute('onsflag-iphonex-portrait', '');
38
+            document.documentElement.setAttribute('onsflag-iphonex-landscape', '');
39
+        }
31 40
 
32 41
     },
33 42
 

+ 26
- 2
platforms/ios/www/js/searchfunctions.js Zobrazit soubor

@@ -53,6 +53,10 @@ function filter_any(input){
53 53
             x[i].style.display = "list-item";
54 54
             continue;
55 55
         }
56
+        else if (find_tecnicas(i,input)){
57
+            x[i].style.display = "list-item";
58
+            continue;
59
+        }
56 60
         else if (find_artesania(i,input)){
57 61
             x[i].style.display = "list-item";
58 62
             continue;
@@ -76,7 +80,7 @@ function filter_any(input){
76 80
 //Te trata de buscar si cualquiera de ellos tienen el input que se dio aplica a ese artista especifico (i)
77 81
 function find_any(i,input){
78 82
     //if you find any of these in that space then return 1 if you didnt find that anything matched with the input then return 0
79
-    if (find_name(i,input) || find_telefono(i,input) || find_email(i,input) || find_artesania(i,input) || find_municipio(i,input)){
83
+    if (find_tecnicas(i,input) || find_name(i,input) || find_telefono(i,input) || find_email(i,input) || find_artesania(i,input) || find_municipio(i,input)){
80 84
         return 1;
81 85
     }
82 86
     else{
@@ -117,6 +121,26 @@ function find_artesania(i,input){
117 121
     return 0;
118 122
 }
119 123
 
124
+
125
+function find_tecnicas(i,input){
126
+    var tecnicas = all_artesanos[i]["Tecnica"];
127
+    tecnicas = tecnicas.trim().toLowerCase();
128
+    tecnicas = acento_replace(tecnicas);
129
+    if(tecnicas.search(input) != -1){
130
+        return 1;
131
+    }
132
+    //artesanias = artesanias.split(',');
133
+    //for (var j = 0; j < artesanias.length; j++){
134
+        //var artesania = artesanias[j];
135
+        //artesania = artesania.trim().toLowerCase();
136
+        //artesania = acento_replace(artesania);
137
+        //if (artesania.search(input) != -1){
138
+            //return 1;
139
+        //}
140
+    //}
141
+    return 0;
142
+}
143
+
120 144
 //trata de ver si el input es parte del municipio del artista i
121 145
 //Mayuscula y acento proof
122 146
 function find_municipio(i,input){
@@ -146,7 +170,7 @@ function find_telefono(i,input){
146 170
 //trata de ver si el input es parte del email del artista i
147 171
 //Mayuscula and acento proof
148 172
 function find_email(i,input){
149
-    var email = all_artesanos[i]["E-mail"];
173
+    var email = all_artesanos[i]["Email"];
150 174
     email = email.trim().toLowerCase();
151 175
     email = acento_replace(email);
152 176
     if(email.search(input) != -1){

+ 2
- 2
platforms/ios/www/lib/OnsenUI/css/onsenui.css Zobrazit soubor

@@ -36,7 +36,7 @@ ons-toast .toast {
36 36
 }
37 37
 
38 38
 ons-tab {
39
-    background: #e6e6e6;/*#5fe1af;*/
39
+    background: #fafafa;/*#5fe1af;*/
40 40
   -webkit-transform: translate3d(0, 0, 0);
41 41
           transform: translate3d(0, 0, 0);
42 42
 }
@@ -53,7 +53,7 @@ ons-toolbar:not([inline]), ons-bottom-toolbar {
53 53
   position: absolute;
54 54
   left: 0;
55 55
   right: 0;
56
-    background: #e6e6e6;/*#5fe1af;*/
56
+    background: #fafafa;/*#5fe1af;*/
57 57
   z-index: 10000;
58 58
 }
59 59
 

+ 86
- 0
platforms/ios/www/plugins/cordova-plugin-device/www/device.js Zobrazit soubor

@@ -0,0 +1,86 @@
1
+cordova.define("cordova-plugin-device.device", function(require, exports, module) {
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
+var argscheck = require('cordova/argscheck');
24
+var channel = require('cordova/channel');
25
+var utils = require('cordova/utils');
26
+var exec = require('cordova/exec');
27
+var cordova = require('cordova');
28
+
29
+channel.createSticky('onCordovaInfoReady');
30
+// Tell cordova channel to wait on the CordovaInfoReady event
31
+channel.waitForInitialization('onCordovaInfoReady');
32
+
33
+/**
34
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
35
+ * phone, etc.
36
+ * @constructor
37
+ */
38
+function Device () {
39
+    this.available = false;
40
+    this.platform = null;
41
+    this.version = null;
42
+    this.uuid = null;
43
+    this.cordova = null;
44
+    this.model = null;
45
+    this.manufacturer = null;
46
+    this.isVirtual = null;
47
+    this.serial = null;
48
+
49
+    var me = this;
50
+
51
+    channel.onCordovaReady.subscribe(function () {
52
+        me.getInfo(function (info) {
53
+            // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
54
+            // TODO: CB-5105 native implementations should not return info.cordova
55
+            var buildLabel = cordova.version;
56
+            me.available = true;
57
+            me.platform = info.platform;
58
+            me.version = info.version;
59
+            me.uuid = info.uuid;
60
+            me.cordova = buildLabel;
61
+            me.model = info.model;
62
+            me.isVirtual = info.isVirtual;
63
+            me.manufacturer = info.manufacturer || 'unknown';
64
+            me.serial = info.serial || 'unknown';
65
+            channel.onCordovaInfoReady.fire();
66
+        }, function (e) {
67
+            me.available = false;
68
+            utils.alert('[ERROR] Error initializing Cordova: ' + e);
69
+        });
70
+    });
71
+}
72
+
73
+/**
74
+ * Get device info
75
+ *
76
+ * @param {Function} successCallback The function to call when the heading data is available
77
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
78
+ */
79
+Device.prototype.getInfo = function (successCallback, errorCallback) {
80
+    argscheck.checkArgs('fF', 'Device.getInfo', arguments);
81
+    exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
82
+};
83
+
84
+module.exports = new Device();
85
+
86
+});

+ 3
- 0
plugins/android.json Zobrazit soubor

@@ -9,6 +9,9 @@
9 9
   "installed_plugins": {
10 10
     "cordova-plugin-whitelist": {
11 11
       "PACKAGE_NAME": "io.cordova.hellocordova"
12
+    },
13
+    "cordova-plugin-device": {
14
+      "PACKAGE_NAME": "io.cordova.hellocordova"
12 15
     }
13 16
   },
14 17
   "dependent_plugins": {}

+ 3
- 0
plugins/browser.json Zobrazit soubor

@@ -9,6 +9,9 @@
9 9
   "installed_plugins": {
10 10
     "cordova-plugin-whitelist": {
11 11
       "PACKAGE_NAME": "io.cordova.hellocordova"
12
+    },
13
+    "cordova-plugin-device": {
14
+      "PACKAGE_NAME": "io.cordova.hellocordova"
12 15
     }
13 16
   },
14 17
   "dependent_plugins": {}

+ 37
- 0
plugins/cordova-plugin-device/CONTRIBUTING.md Zobrazit soubor

@@ -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
plugins/cordova-plugin-device/LICENSE Zobrazit soubor

@@ -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.

+ 5
- 0
plugins/cordova-plugin-device/NOTICE Zobrazit soubor

@@ -0,0 +1,5 @@
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/).

+ 264
- 0
plugins/cordova-plugin-device/README.md Zobrazit soubor

@@ -0,0 +1,264 @@
1
+---
2
+title: Device
3
+description: Get device information.
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-device?branch=master)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-device)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-device.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-device)|
27
+
28
+# cordova-plugin-device
29
+
30
+This plugin defines a global `device` object, which describes the device's hardware and software.
31
+Although the object is in the global scope, it is not available until after the `deviceready` event.
32
+
33
+```js
34
+document.addEventListener("deviceready", onDeviceReady, false);
35
+function onDeviceReady() {
36
+    console.log(device.cordova);
37
+}
38
+```
39
+
40
+## Installation
41
+
42
+    cordova plugin add cordova-plugin-device
43
+
44
+## Properties
45
+
46
+- device.cordova
47
+- device.model
48
+- device.platform
49
+- device.uuid
50
+- device.version
51
+- device.manufacturer
52
+- device.isVirtual
53
+- device.serial
54
+
55
+## device.cordova
56
+
57
+Get the version of Cordova running on the device.
58
+
59
+### Supported Platforms
60
+
61
+- Android
62
+- Browser
63
+- iOS
64
+- Windows
65
+- OSX
66
+
67
+## device.model
68
+
69
+The `device.model` returns the name of the device's model or
70
+product. The value is set by the device manufacturer and may be
71
+different across versions of the same product.
72
+
73
+### Supported Platforms
74
+
75
+- Android
76
+- Browser
77
+- iOS
78
+- Windows
79
+- OSX
80
+
81
+### Quick Example
82
+
83
+```js
84
+// Android:    Nexus One       returns "Passion" (Nexus One code name)
85
+//             Motorola Droid  returns "voles"
86
+// BlackBerry: Torch 9800      returns "9800"
87
+// Browser:    Google Chrome   returns "Chrome"
88
+//             Safari          returns "Safari"
89
+// iOS:     for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
90
+// OSX:                        returns "x86_64"
91
+//
92
+var model = device.model;
93
+```
94
+
95
+### Android Quirks
96
+
97
+- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`.
98
+
99
+## device.platform
100
+
101
+Get the device's operating system name.
102
+
103
+```js
104
+var string = device.platform;
105
+```
106
+### Supported Platforms
107
+
108
+- Android
109
+- Browser
110
+- iOS
111
+- Windows
112
+- OSX
113
+
114
+### Quick Example
115
+
116
+```js
117
+// Depending on the device, a few examples are:
118
+//   - "Android"
119
+//   - "BlackBerry 10"
120
+//   - "browser"
121
+//   - "iOS"
122
+//   - "WinCE"
123
+//   - "Tizen"
124
+//   - "Mac OS X"
125
+var devicePlatform = device.platform;
126
+```
127
+
128
+## device.uuid
129
+
130
+Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
131
+
132
+```js
133
+var string = device.uuid;
134
+```
135
+
136
+### Description
137
+
138
+The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model.
139
+
140
+### Supported Platforms
141
+
142
+- Android
143
+- iOS
144
+- Windows
145
+- OSX
146
+
147
+### Quick Example
148
+
149
+```js
150
+// Android: Returns a random 64-bit integer (as a string, again!)
151
+//          The integer is generated on the device's first boot
152
+//
153
+// BlackBerry: Returns the PIN number of the device
154
+//             This is a nine-digit unique integer (as a string, though!)
155
+//
156
+// iPhone: (Paraphrased from the UIDevice Class documentation)
157
+//         Returns the [UIDevice identifierForVendor] UUID which is unique and the same for all apps installed by the same vendor. However the UUID can be different if the user deletes all apps from the vendor and then reinstalls it.
158
+// Windows Phone 7 : Returns a hash of device+current user,
159
+// if the user is not defined, a guid is generated and will persist until the app is uninstalled
160
+// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
161
+// unique to every GSM and UMTS mobile phone.
162
+var deviceID = device.uuid;
163
+```
164
+
165
+### iOS Quirk
166
+
167
+The `uuid` on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled.
168
+Refer [here](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/#//apple_ref/occ/instp/UIDevice/identifierForVendor) for details.
169
+The UUID will be the same if app is restored from a backup or iCloud as it is saved in preferences. Users using older versions of this plugin will still receive the same previous UUID generated by another means as it will be retrieved from preferences.
170
+
171
+### OSX Quirk
172
+
173
+The `uuid` on OSX is generated automatically if it does not exist yet and is stored in the `standardUserDefaults` in the `CDVUUID` property.
174
+
175
+## device.version
176
+
177
+Get the operating system version.
178
+
179
+    var string = device.version;
180
+
181
+### Supported Platforms
182
+
183
+- Android 2.1+
184
+- Browser
185
+- iOS
186
+- Windows
187
+- OSX
188
+
189
+### Quick Example
190
+
191
+```js
192
+// Android:    Froyo OS would return "2.2"
193
+//             Eclair OS would return "2.1", "2.0.1", or "2.0"
194
+//             Version can also return update level "2.1-update1"
195
+//
196
+// BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
197
+//
198
+// Browser:    Returns version number for the browser
199
+//
200
+// iPhone:     iOS 3.2 returns "3.2"
201
+//
202
+// Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
203
+// Windows 8: return the current OS version, ex on Windows 8.1 returns 6.3.9600.16384
204
+// Tizen: returns "TIZEN_20120425_2"
205
+// OSX:        El Capitan would return "10.11.2"
206
+//
207
+var deviceVersion = device.version;
208
+```
209
+
210
+## device.manufacturer
211
+
212
+Get the device's manufacturer.
213
+
214
+    var string = device.manufacturer;
215
+
216
+### Supported Platforms
217
+
218
+- Android
219
+- iOS
220
+- Windows
221
+
222
+### Quick Example
223
+
224
+```js
225
+// Android:    Motorola XT1032 would return "motorola"
226
+// BlackBerry: returns "BlackBerry"
227
+// iPhone:     returns "Apple"
228
+//
229
+var deviceManufacturer = device.manufacturer;
230
+```
231
+
232
+## device.isVirtual
233
+
234
+whether the device is running on a simulator.
235
+
236
+```js
237
+var isSim = device.isVirtual;
238
+```
239
+
240
+### Supported Platforms
241
+
242
+- Android 2.1+
243
+- Browser
244
+- iOS
245
+- Windows
246
+- OSX
247
+
248
+### OSX and Browser Quirk
249
+
250
+The `isVirtual` property on OS X and Browser always returns false.
251
+
252
+## device.serial
253
+
254
+Get the device hardware serial number ([SERIAL](http://developer.android.com/reference/android/os/Build.html#SERIAL)).
255
+
256
+```js
257
+var string = device.serial;
258
+```
259
+
260
+### Supported Platforms
261
+
262
+- Android
263
+- OSX
264
+

+ 194
- 0
plugins/cordova-plugin-device/RELEASENOTES.md Zobrazit soubor

@@ -0,0 +1,194 @@
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
+### 2.0.3 (Jun 14, 2019)
24
+
25
+-   build: add .gitattributes to force LF (instead of possible CRLF on Windows) ([`02ae405`](https://github.com/apache/cordova-plugin-device/commit/02ae405))
26
+-   build: add .npmignore to remove unneeded files from npm package ([`8dbe703`](https://github.com/apache/cordova-plugin-device/commit/8dbe703))
27
+-   docs: remove outdated translations ([`db4e1f1`](https://github.com/apache/cordova-plugin-device/commit/db4e1f1))
28
+-   ci(travis): Remove android 4.4 that SauceLabs removed ([`594fa61`](https://github.com/apache/cordova-plugin-device/commit/594fa61))
29
+-   ci(travis): Update Travis CI configuration for new paramedic ([#97](https://github.com/apache/cordova-plugin-device/issues/97)) ([`db0ad32`](https://github.com/apache/cordova-plugin-device/commit/db0ad32))
30
+-   feat: update typings ([#90](https://github.com/apache/cordova-plugin-device/issues/90)) ([`52a0655`](https://github.com/apache/cordova-plugin-device/commit/52a0655), [`61ad76c`](https://github.com/apache/cordova-plugin-device/commit/61ad76c))
31
+-   chore(github): Add or update GitHub pull request and issue template ([`e213286`](https://github.com/apache/cordova-plugin-device/commit/e213286))
32
+-   docs: remove JIRA link ([`2d12d55`](https://github.com/apache/cordova-plugin-device/commit/2d12d55))
33
+-   ci(travis): also accept terms for android sdk `android-27` ([`f870c9b`](https://github.com/apache/cordova-plugin-device/commit/f870c9b))
34
+-   fix: [CB-14106](https://issues.apache.org/jira/browse/CB-14106) - device.model is different on simulator and on real device ([#80](https://github.com/apache/cordova-plugin-device/issues/80)) ([`d65cdf6`](https://github.com/apache/cordova-plugin-device/commit/d65cdf6))
35
+
36
+### 2.0.2 (Apr 12, 2018)
37
+* [CB-13893](https://issues.apache.org/jira/browse/CB-13893) **iOS** delete `libz.tbd` from device plugin
38
+
39
+### 2.0.1 (Dec 27, 2017)
40
+* [CB-13702](https://issues.apache.org/jira/browse/CB-13702) Fix to allow 2.0.0 version install
41
+
42
+### 2.0.0 (Dec 15, 2017)
43
+* [CB-13670](https://issues.apache.org/jira/browse/CB-13670) Remove deprecated platforms
44
+
45
+### 1.1.7 (Nov 06, 2017)
46
+* [CB-13472](https://issues.apache.org/jira/browse/CB-13472) (CI) Fixed Travis **Android** builds again
47
+* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) setup `eslint` and removed `jshint`
48
+* [CB-13113](https://issues.apache.org/jira/browse/CB-13113) (browser) `device.isVirtual` is always false
49
+* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
50
+* [CB-13000](https://issues.apache.org/jira/browse/CB-13000) (CI) Speed up **Android** builds
51
+* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
52
+
53
+### 1.1.6 (Apr 27, 2017)
54
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
55
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
56
+* [CB-12105](https://issues.apache.org/jira/browse/CB-12105) (browser) Properly detect Edge
57
+
58
+### 1.1.5 (Feb 28, 2017)
59
+* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
60
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
61
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
62
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
63
+
64
+### 1.1.4 (Dec 07, 2016)
65
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 1.1.4
66
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
67
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
68
+
69
+### 1.1.3 (Sep 08, 2016)
70
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
71
+* Add badges for paramedic builds on Jenkins
72
+* Add pull request template.
73
+* Readme: Add fenced code blocks with langauage hints
74
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md`
75
+
76
+### 1.1.2 (Apr 15, 2016)
77
+* Use passed device, follow create policy forf `CFUUIDCreate`
78
+* [CB-10631](https://issues.apache.org/jira/browse/CB-10631) Fix for `device.uuid` in **iOS 5.1.1**
79
+* Updating the comment to exclude URL
80
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
81
+* Refactored `deviceInfo` on **iOS** for better readability.
82
+
83
+### 1.1.1 (Jan 15, 2016)
84
+* [CB-10238](https://issues.apache.org/jira/browse/CB-10238) **OSX** Move `device-plugin` out from `cordovalib` to the plugin repository
85
+* [CB-9923](https://issues.apache.org/jira/browse/CB-9923) Update `device.platform` documentation for **Browser** platform
86
+
87
+### 1.1.0 (Nov 18, 2015)
88
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
89
+* Add `isVirtual` for **Windows Phone 8.x**
90
+* Added basic **Android** support for hardware serial number
91
+* [CB-9865](https://issues.apache.org/jira/browse/CB-9865) Better simulator detection for **iOS**
92
+* Fixing contribute link.
93
+* Added **WP8** implementation
94
+* update to use `TARGET_OS_SIMULATOR` as `TARGET_IPHONE_SIMULATOR` is deprecated.
95
+* update code to use 'isVirtual'
96
+* create test to verify existence and type of new property 'isVirtual'
97
+* add `isSimulator` for **iOS** & **Android** device
98
+* Updated documentation to mention backwards compatibility
99
+* Updated **README** to reflect new behaviour and quirks on **iOS**
100
+* Check user defaults first to maintain backwards compatibility
101
+* Changed `UUID` to use `[UIDevice identifierForVendor]`
102
+
103
+### 1.0.1 (Jun 17, 2015)
104
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-device documentation translation: cordova-plugin-device
105
+* Attempts to corrent npm markdown issue
106
+
107
+### 1.0.0 (Apr 15, 2015)
108
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
109
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
110
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
111
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
112
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
113
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
114
+* remove defunct windows8 version
115
+* add travis badge
116
+* Add cross-plugin ios paramedic test running for TravisCI
117
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
118
+
119
+### 0.3.0 (Feb 04, 2015)
120
+* Added device.manufacturer property for Android, iOS, Blackberry, WP8
121
+* Support for Windows Phone 8 ANID2 ANID is only supported up to Windows Phone 7.5
122
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Use a local copy of uniqueAppInstanceIdentifier rather than CordovaLib's version
123
+* browser: Fixed a bug that caused an "cannot call method of undefined" error if the browser's user agent wasn't recognized
124
+
125
+### 0.2.13 (Dec 02, 2014)
126
+* Changing `device.platform` to always report the platform as "browser".
127
+* [CB-5892](https://issues.apache.org/jira/browse/CB-5892) - Remove deprecated `window.Settings`
128
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-device documentation translation: cordova-plugin-device
129
+* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
130
+
131
+### 0.2.12 (Sep 17, 2014)
132
+* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-device documentation translation
133
+* [CB-7552](https://issues.apache.org/jira/browse/CB-7552) device.name docs have not been removed
134
+* [fxos] Fix cordova version
135
+* added status box and documentation to manual tests
136
+* [fxos] Fix cordova version
137
+* added status box and documentation to manual tests
138
+* Added plugin support for the browser
139
+* [CB-7262](https://issues.apache.org/jira/browse/CB-7262) Adds support for universal windows apps.
140
+
141
+### 0.2.11 (Aug 06, 2014)
142
+* [FFOS] update DeviceProxy.js
143
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
144
+* Use Windows system calls to get better info
145
+
146
+### 0.2.10 (Jun 05, 2014)
147
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #12
148
+* Changing 1.5 to 2.0
149
+* added firefoxos version - conversion
150
+* added firefoxos version
151
+* [CB-6800](https://issues.apache.org/jira/browse/CB-6800) Add license
152
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
153
+
154
+### 0.2.9 (Apr 17, 2014)
155
+* [CB-5105](https://issues.apache.org/jira/browse/CB-5105): [Android, windows8, WP, BlackBerry10] Removed dead code for device.version
156
+* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
157
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
158
+* Add NOTICE file
159
+
160
+### 0.2.8 (Feb 05, 2014)
161
+* Tizen support added
162
+
163
+### 0.2.7 (Jan 07, 2014)
164
+* [CB-5737](https://issues.apache.org/jira/browse/CB-5737) Fix exception on close caused by left over telephony code from [CB-5504](https://issues.apache.org/jira/browse/CB-5504)
165
+
166
+### 0.2.6 (Jan 02, 2014)
167
+* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Device plugin
168
+* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Moving Telephony Logic out of Device
169
+
170
+### 0.2.5 (Dec 4, 2013)
171
+* [CB-5316](https://issues.apache.org/jira/browse/CB-5316) Spell Cordova as a brand unless it's a command or script
172
+* [ubuntu] use cordova/exec/proxy
173
+* add ubuntu platform
174
+* Modify Device.platform logic to use amazon-fireos as the platform for Amazon Devices
175
+* 1. Added amazon-fireos platform. 2. Change to use cordova-amazon-fireos as the platform if user agent contains 'cordova-amazon-fireos'
176
+
177
+### 0.2.4 (Oct 28, 2013)
178
+* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag in plugin.xml for device plugin
179
+* [CB-5085](https://issues.apache.org/jira/browse/CB-5085) device.cordova returning wrong value
180
+* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
181
+
182
+### 0.2.3 (Sept 25, 2013)
183
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
184
+* [windows8] commandProxy has moved
185
+* [BlackBerry10] removed uneeded permission tags in plugin.xml
186
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.device to org.apache.cordova.device
187
+* Rename CHANGELOG.md -> RELEASENOTES.md
188
+* updated to use commandProxy for ffos
189
+* add firefoxos support
190
+* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch. 
191
+
192
+### 0.2.1 (Sept 5, 2013)
193
+* removed extraneous print statement
194
+* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change

+ 84
- 0
plugins/cordova-plugin-device/package.json Zobrazit soubor

@@ -0,0 +1,84 @@
1
+{
2
+  "_from": "cordova-plugin-device",
3
+  "_id": "cordova-plugin-device@2.0.3",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-Jb3V72btxf3XHpkPQsGdyc8N6tVBYn1vsxSFj43fIz9vonJDUThYPCJJHqk6PX6N4dJw6I4FjxkpfCR4LDYMlw==",
6
+  "_location": "/cordova-plugin-device",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "tag",
10
+    "registry": true,
11
+    "raw": "cordova-plugin-device",
12
+    "name": "cordova-plugin-device",
13
+    "escapedName": "cordova-plugin-device",
14
+    "rawSpec": "",
15
+    "saveSpec": null,
16
+    "fetchSpec": "latest"
17
+  },
18
+  "_requiredBy": [
19
+    "#DEV:/",
20
+    "#USER"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.3.tgz",
23
+  "_shasum": "c2b41b7efd0455dd097f89356d85bfdd5dadeb0f",
24
+  "_spec": "cordova-plugin-device",
25
+  "_where": "/Users/christian/Documents/artesanias",
26
+  "author": {
27
+    "name": "Apache Software Foundation"
28
+  },
29
+  "bugs": {
30
+    "url": "https://issues.apache.org/jira/browse/CB"
31
+  },
32
+  "bundleDependencies": false,
33
+  "cordova": {
34
+    "id": "cordova-plugin-device",
35
+    "platforms": [
36
+      "android",
37
+      "ios",
38
+      "windows",
39
+      "browser",
40
+      "osx"
41
+    ]
42
+  },
43
+  "deprecated": false,
44
+  "description": "Cordova Device Plugin",
45
+  "devDependencies": {
46
+    "eslint": "^3.19.0",
47
+    "eslint-config-semistandard": "^11.0.0",
48
+    "eslint-config-standard": "^10.2.1",
49
+    "eslint-plugin-import": "^2.3.0",
50
+    "eslint-plugin-node": "^5.0.0",
51
+    "eslint-plugin-promise": "^3.5.0",
52
+    "eslint-plugin-standard": "^3.0.1"
53
+  },
54
+  "engines": {
55
+    "cordovaDependencies": {
56
+      "3.0.0": {
57
+        "cordova": ">100"
58
+      }
59
+    }
60
+  },
61
+  "homepage": "https://github.com/apache/cordova-plugin-device#readme",
62
+  "keywords": [
63
+    "cordova",
64
+    "device",
65
+    "ecosystem:cordova",
66
+    "cordova-android",
67
+    "cordova-ios",
68
+    "cordova-windows",
69
+    "cordova-browser",
70
+    "cordova-osx"
71
+  ],
72
+  "license": "Apache-2.0",
73
+  "name": "cordova-plugin-device",
74
+  "repository": {
75
+    "type": "git",
76
+    "url": "git+https://github.com/apache/cordova-plugin-device.git"
77
+  },
78
+  "scripts": {
79
+    "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests",
80
+    "test": "npm run eslint"
81
+  },
82
+  "types": "./types/index.d.ts",
83
+  "version": "2.0.3"
84
+}

+ 93
- 0
plugins/cordova-plugin-device/plugin.xml Zobrazit soubor

@@ -0,0 +1,93 @@
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-device"
25
+    version="2.0.3">
26
+    <name>Device</name>
27
+    <description>Cordova Device Plugin</description>
28
+    <license>Apache 2.0</license>
29
+    <keywords>cordova,device</keywords>
30
+    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git</repo>
31
+    <issue>https://issues.apache.org/jira/browse/CB/component/12320648</issue>
32
+
33
+    <js-module src="www/device.js" name="device">
34
+        <clobbers target="device" />
35
+    </js-module>
36
+
37
+    <!-- android -->
38
+    <platform name="android">
39
+        <config-file target="res/xml/config.xml" parent="/*">
40
+            <feature name="Device" >
41
+                <param name="android-package" value="org.apache.cordova.device.Device"/>
42
+            </feature>
43
+        </config-file>
44
+
45
+        <source-file src="src/android/Device.java" target-dir="src/org/apache/cordova/device" />
46
+    </platform>
47
+
48
+    <!-- ios -->
49
+    <platform name="ios">
50
+        <config-file target="config.xml" parent="/*">
51
+            <feature name="Device">
52
+                <param name="ios-package" value="CDVDevice"/>
53
+            </feature>
54
+        </config-file>
55
+
56
+        <header-file src="src/ios/CDVDevice.h" />
57
+        <source-file src="src/ios/CDVDevice.m" />
58
+    </platform>
59
+
60
+    <!-- windows -->
61
+    <platform name="windows">
62
+        <js-module src="src/windows/DeviceProxy.js" name="DeviceProxy">
63
+            <runs />
64
+        </js-module>
65
+    </platform>
66
+
67
+    <!-- browser -->
68
+    <platform name="browser">
69
+        <config-file target="config.xml" parent="/*">
70
+            <feature name="Device">
71
+                <param name="browser-package" value="Device" />
72
+            </feature>
73
+        </config-file>
74
+
75
+        <js-module src="src/browser/DeviceProxy.js" name="DeviceProxy">
76
+            <runs />
77
+        </js-module>
78
+    </platform>
79
+
80
+    <!-- osx -->
81
+    <platform name="osx">
82
+        <config-file target="config.xml" parent="/*">
83
+            <feature name="Device">
84
+                <param name="ios-package" value="CDVDevice"/>
85
+            </feature>
86
+        </config-file>
87
+
88
+        <header-file src="src/osx/CDVDevice.h" />
89
+        <source-file src="src/osx/CDVDevice.m" />
90
+    </platform>
91
+
92
+
93
+</plugin>

+ 174
- 0
plugins/cordova-plugin-device/src/android/Device.java Zobrazit soubor

@@ -0,0 +1,174 @@
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.device;
20
+
21
+import java.util.TimeZone;
22
+
23
+import org.apache.cordova.CordovaWebView;
24
+import org.apache.cordova.CallbackContext;
25
+import org.apache.cordova.CordovaPlugin;
26
+import org.apache.cordova.CordovaInterface;
27
+import org.json.JSONArray;
28
+import org.json.JSONException;
29
+import org.json.JSONObject;
30
+
31
+import android.provider.Settings;
32
+
33
+public class Device extends CordovaPlugin {
34
+    public static final String TAG = "Device";
35
+
36
+    public static String platform;                            // Device OS
37
+    public static String uuid;                                // Device UUID
38
+
39
+    private static final String ANDROID_PLATFORM = "Android";
40
+    private static final String AMAZON_PLATFORM = "amazon-fireos";
41
+    private static final String AMAZON_DEVICE = "Amazon";
42
+
43
+    /**
44
+     * Constructor.
45
+     */
46
+    public Device() {
47
+    }
48
+
49
+    /**
50
+     * Sets the context of the Command. This can then be used to do things like
51
+     * get file paths associated with the Activity.
52
+     *
53
+     * @param cordova The context of the main Activity.
54
+     * @param webView The CordovaWebView Cordova is running in.
55
+     */
56
+    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
57
+        super.initialize(cordova, webView);
58
+        Device.uuid = getUuid();
59
+    }
60
+
61
+    /**
62
+     * Executes the request and returns PluginResult.
63
+     *
64
+     * @param action            The action to execute.
65
+     * @param args              JSONArry of arguments for the plugin.
66
+     * @param callbackContext   The callback id used when calling back into JavaScript.
67
+     * @return                  True if the action was valid, false if not.
68
+     */
69
+    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
70
+        if ("getDeviceInfo".equals(action)) {
71
+            JSONObject r = new JSONObject();
72
+            r.put("uuid", Device.uuid);
73
+            r.put("version", this.getOSVersion());
74
+            r.put("platform", this.getPlatform());
75
+            r.put("model", this.getModel());
76
+            r.put("manufacturer", this.getManufacturer());
77
+	        r.put("isVirtual", this.isVirtual());
78
+            r.put("serial", this.getSerialNumber());
79
+            callbackContext.success(r);
80
+        }
81
+        else {
82
+            return false;
83
+        }
84
+        return true;
85
+    }
86
+
87
+    //--------------------------------------------------------------------------
88
+    // LOCAL METHODS
89
+    //--------------------------------------------------------------------------
90
+
91
+    /**
92
+     * Get the OS name.
93
+     *
94
+     * @return
95
+     */
96
+    public String getPlatform() {
97
+        String platform;
98
+        if (isAmazonDevice()) {
99
+            platform = AMAZON_PLATFORM;
100
+        } else {
101
+            platform = ANDROID_PLATFORM;
102
+        }
103
+        return platform;
104
+    }
105
+
106
+    /**
107
+     * Get the device's Universally Unique Identifier (UUID).
108
+     *
109
+     * @return
110
+     */
111
+    public String getUuid() {
112
+        String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
113
+        return uuid;
114
+    }
115
+
116
+    public String getModel() {
117
+        String model = android.os.Build.MODEL;
118
+        return model;
119
+    }
120
+
121
+    public String getProductName() {
122
+        String productname = android.os.Build.PRODUCT;
123
+        return productname;
124
+    }
125
+
126
+    public String getManufacturer() {
127
+        String manufacturer = android.os.Build.MANUFACTURER;
128
+        return manufacturer;
129
+    }
130
+
131
+    public String getSerialNumber() {
132
+        String serial = android.os.Build.SERIAL;
133
+        return serial;
134
+    }
135
+
136
+    /**
137
+     * Get the OS version.
138
+     *
139
+     * @return
140
+     */
141
+    public String getOSVersion() {
142
+        String osversion = android.os.Build.VERSION.RELEASE;
143
+        return osversion;
144
+    }
145
+
146
+    public String getSDKVersion() {
147
+        @SuppressWarnings("deprecation")
148
+        String sdkversion = android.os.Build.VERSION.SDK;
149
+        return sdkversion;
150
+    }
151
+
152
+    public String getTimeZoneID() {
153
+        TimeZone tz = TimeZone.getDefault();
154
+        return (tz.getID());
155
+    }
156
+
157
+    /**
158
+     * Function to check if the device is manufactured by Amazon
159
+     *
160
+     * @return
161
+     */
162
+    public boolean isAmazonDevice() {
163
+        if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) {
164
+            return true;
165
+        }
166
+        return false;
167
+    }
168
+
169
+    public boolean isVirtual() {
170
+	return android.os.Build.FINGERPRINT.contains("generic") ||
171
+	    android.os.Build.PRODUCT.contains("sdk");
172
+    }
173
+
174
+}

+ 84
- 0
plugins/cordova-plugin-device/src/browser/DeviceProxy.js Zobrazit soubor

@@ -0,0 +1,84 @@
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 browser = require('cordova/platform');
22
+
23
+function getPlatform () {
24
+    return 'browser';
25
+}
26
+
27
+function getModel () {
28
+    return getBrowserInfo(true);
29
+}
30
+
31
+function getVersion () {
32
+    return getBrowserInfo(false);
33
+}
34
+
35
+function getBrowserInfo (getModel) {
36
+    var userAgent = navigator.userAgent;
37
+    var returnVal = '';
38
+    var offset;
39
+
40
+    if ((offset = userAgent.indexOf('Edge')) !== -1) {
41
+        returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
42
+    } else if ((offset = userAgent.indexOf('Chrome')) !== -1) {
43
+        returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7);
44
+    } else if ((offset = userAgent.indexOf('Safari')) !== -1) {
45
+        if (getModel) {
46
+            returnVal = 'Safari';
47
+        } else {
48
+            returnVal = userAgent.substring(offset + 7);
49
+
50
+            if ((offset = userAgent.indexOf('Version')) !== -1) {
51
+                returnVal = userAgent.substring(offset + 8);
52
+            }
53
+        }
54
+    } else if ((offset = userAgent.indexOf('Firefox')) !== -1) {
55
+        returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8);
56
+    } else if ((offset = userAgent.indexOf('MSIE')) !== -1) {
57
+        returnVal = (getModel) ? 'MSIE' : userAgent.substring(offset + 5);
58
+    } else if ((offset = userAgent.indexOf('Trident')) !== -1) {
59
+        returnVal = (getModel) ? 'MSIE' : '11';
60
+    }
61
+
62
+    if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) {
63
+        returnVal = returnVal.substring(0, offset);
64
+    }
65
+
66
+    return returnVal;
67
+}
68
+
69
+module.exports = {
70
+    getDeviceInfo: function (success, error) {
71
+        setTimeout(function () {
72
+            success({
73
+                cordova: browser.cordovaVersion,
74
+                platform: getPlatform(),
75
+                model: getModel(),
76
+                version: getVersion(),
77
+                uuid: null,
78
+                isVirtual: false
79
+            });
80
+        }, 0);
81
+    }
82
+};
83
+
84
+require('cordova/exec/proxy').add('Device', module.exports);

+ 30
- 0
plugins/cordova-plugin-device/src/ios/CDVDevice.h Zobrazit soubor

@@ -0,0 +1,30 @@
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 <UIKit/UIKit.h>
21
+#import <Cordova/CDVPlugin.h>
22
+
23
+@interface CDVDevice : CDVPlugin
24
+{}
25
+
26
++ (NSString*)cordovaVersion;
27
+
28
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
29
+
30
+@end

+ 115
- 0
plugins/cordova-plugin-device/src/ios/CDVDevice.m Zobrazit soubor

@@ -0,0 +1,115 @@
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
+#include <sys/types.h>
21
+#include <sys/sysctl.h>
22
+#include "TargetConditionals.h"
23
+
24
+#import <Cordova/CDV.h>
25
+#import "CDVDevice.h"
26
+
27
+@implementation UIDevice (ModelVersion)
28
+
29
+- (NSString*)modelVersion
30
+{
31
+#if TARGET_IPHONE_SIMULATOR
32
+    NSString* platform = NSProcessInfo.processInfo.environment[@"SIMULATOR_MODEL_IDENTIFIER"];
33
+#else
34
+    size_t size;
35
+
36
+    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
37
+    char* machine = malloc(size);
38
+    sysctlbyname("hw.machine", machine, &size, NULL, 0);
39
+    NSString* platform = [NSString stringWithUTF8String:machine];
40
+    free(machine);
41
+#endif
42
+    return platform;
43
+}
44
+
45
+@end
46
+
47
+@interface CDVDevice () {}
48
+@end
49
+
50
+@implementation CDVDevice
51
+
52
+- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
53
+{
54
+    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
55
+    static NSString* UUID_KEY = @"CDVUUID";
56
+    
57
+    // Check user defaults first to maintain backwards compaitibility with previous versions
58
+    // which didn't user identifierForVendor
59
+    NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
60
+    if (app_uuid == nil) {
61
+        if ([device respondsToSelector:@selector(identifierForVendor)]) {
62
+            app_uuid = [[device identifierForVendor] UUIDString];
63
+        } else {
64
+            CFUUIDRef uuid = CFUUIDCreate(NULL);
65
+            app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
66
+            CFRelease(uuid);
67
+        }
68
+
69
+        [userDefaults setObject:app_uuid forKey:UUID_KEY];
70
+        [userDefaults synchronize];
71
+    }
72
+    
73
+    return app_uuid;
74
+}
75
+
76
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
77
+{
78
+    NSDictionary* deviceProperties = [self deviceProperties];
79
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
80
+
81
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
82
+}
83
+
84
+- (NSDictionary*)deviceProperties
85
+{
86
+    UIDevice* device = [UIDevice currentDevice];
87
+
88
+    return @{
89
+             @"manufacturer": @"Apple",
90
+             @"model": [device modelVersion],
91
+             @"platform": @"iOS",
92
+             @"version": [device systemVersion],
93
+             @"uuid": [self uniqueAppInstanceIdentifier:device],
94
+             @"cordova": [[self class] cordovaVersion],
95
+             @"isVirtual": @([self isVirtual])
96
+             };
97
+}
98
+
99
++ (NSString*)cordovaVersion
100
+{
101
+    return CDV_VERSION;
102
+}
103
+
104
+- (BOOL)isVirtual
105
+{
106
+    #if TARGET_OS_SIMULATOR
107
+        return true;
108
+    #elif TARGET_IPHONE_SIMULATOR
109
+        return true;
110
+    #else
111
+        return false;
112
+    #endif
113
+}
114
+
115
+@end

+ 28
- 0
plugins/cordova-plugin-device/src/osx/CDVDevice.h Zobrazit soubor

@@ -0,0 +1,28 @@
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 <Cordova/CDVPlugin.h>
21
+
22
+@interface CDVDevice : CDVPlugin
23
+
24
++ (NSString*) cordovaVersion;
25
+
26
+- (void) getDeviceInfo:(CDVInvokedUrlCommand*)command;
27
+
28
+@end

+ 113
- 0
plugins/cordova-plugin-device/src/osx/CDVDevice.m Zobrazit soubor

@@ -0,0 +1,113 @@
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
+#include <sys/sysctl.h>
21
+
22
+#import "CDVDevice.h"
23
+
24
+#define SYSTEM_VERSION_PLIST    @"/System/Library/CoreServices/SystemVersion.plist"
25
+
26
+@implementation CDVDevice
27
+
28
+- (NSString*) modelVersion {
29
+    size_t size;
30
+
31
+    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
32
+    char* machine = malloc(size);
33
+    sysctlbyname("hw.machine", machine, &size, NULL, 0);
34
+    NSString* modelVersion = [NSString stringWithUTF8String:machine];
35
+    free(machine);
36
+
37
+    return modelVersion;
38
+}
39
+
40
+
41
+- (NSString*) getSerialNr {
42
+    NSString* serialNr;
43
+    io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
44
+    if (platformExpert) {
45
+        CFTypeRef serialNumberAsCFString =
46
+                IORegistryEntryCreateCFProperty(platformExpert,
47
+                        CFSTR(kIOPlatformSerialNumberKey),
48
+                        kCFAllocatorDefault, 0);
49
+        if (serialNumberAsCFString) {
50
+            serialNr = (__bridge NSString*) serialNumberAsCFString;
51
+        }
52
+        IOObjectRelease(platformExpert);
53
+    }
54
+    return serialNr;
55
+}
56
+
57
+- (NSString*) uniqueAppInstanceIdentifier {
58
+    NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
59
+    static NSString* UUID_KEY = @"CDVUUID";
60
+
61
+    NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
62
+
63
+    if (app_uuid == nil) {
64
+        CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
65
+        CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
66
+
67
+        app_uuid = [NSString stringWithString:(__bridge NSString*) uuidString];
68
+        [userDefaults setObject:app_uuid forKey:UUID_KEY];
69
+        [userDefaults synchronize];
70
+
71
+        CFRelease(uuidString);
72
+        CFRelease(uuidRef);
73
+    }
74
+
75
+    return app_uuid;
76
+}
77
+
78
+- (NSString*) platform {
79
+    return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductName"];
80
+}
81
+
82
+- (NSString*) systemVersion {
83
+    return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductVersion"];
84
+}
85
+
86
+- (void) getDeviceInfo:(CDVInvokedUrlCommand*) command {
87
+    NSDictionary* deviceProperties = [self deviceProperties];
88
+    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
89
+
90
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
91
+}
92
+
93
+- (NSDictionary*) deviceProperties {
94
+    NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4];
95
+
96
+    devProps[@"manufacturer"] = @"Apple";
97
+    devProps[@"model"] = [self modelVersion];
98
+    devProps[@"platform"] = [self platform];
99
+    devProps[@"version"] = [self systemVersion];
100
+    devProps[@"uuid"] = [self uniqueAppInstanceIdentifier];
101
+    devProps[@"cordova"] = [[self class] cordovaVersion];
102
+    devProps[@"serial"] = [self getSerialNr];
103
+    devProps[@"isVirtual"] = @NO;
104
+
105
+    NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps];
106
+    return devReturn;
107
+}
108
+
109
++ (NSString*) cordovaVersion {
110
+    return CDV_VERSION;
111
+}
112
+
113
+@end

+ 0
- 0
plugins/cordova-plugin-device/src/windows/DeviceProxy.js Zobrazit soubor


Některé soubory nejsou zobrazny, neboť je v této revizi změněno mnoho souborů