mirror of
https://github.com/apache/cordova-plugin-splashscreen.git
synced 2026-02-05 00:01:30 +08:00
Compare commits
376 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
586b988371 | ||
|
|
0aaecdcddc | ||
|
|
78e8fa07ae | ||
|
|
1b23804f6f | ||
|
|
4803a88fb4 | ||
|
|
9de5951126 | ||
|
|
99d76e0034 | ||
|
|
dbd4bcd79f | ||
|
|
d05de697e4 | ||
|
|
a722382414 | ||
|
|
d2937ad489 | ||
|
|
751b4e48c8 | ||
|
|
40739f24e5 | ||
|
|
144c21673d | ||
|
|
74b70ee1ac | ||
|
|
bde626dd0f | ||
|
|
35c22a8a1a | ||
|
|
d28daa372a | ||
|
|
d780b0d9d6 | ||
|
|
10be9d0aac | ||
|
|
4a4b38b1f5 | ||
|
|
1bc42204e7 | ||
|
|
ea3cbb6079 | ||
|
|
8bdf669a7b | ||
|
|
66d1e00e00 | ||
|
|
be673a94ac | ||
|
|
642549590b | ||
|
|
b0a866cb69 | ||
|
|
eb0d0e5865 | ||
|
|
43f9138d1f | ||
|
|
7e5b4fd93d | ||
|
|
14d17c5c64 | ||
|
|
f41610c2f7 | ||
|
|
a9e73eb642 | ||
|
|
faa8aa937d | ||
|
|
3389695fc5 | ||
|
|
2ee4ff97ff | ||
|
|
050f29cfca | ||
|
|
b893339a98 | ||
|
|
3ede66ef8f | ||
|
|
893ba08e8f | ||
|
|
369f8d148f | ||
|
|
0fba4f31dd | ||
|
|
097ca6ac42 | ||
|
|
d85e440e15 | ||
|
|
3d66c880bc | ||
|
|
048702cb9c | ||
|
|
c1ab711039 | ||
|
|
5bc7d0d63f | ||
|
|
ed1db6650c | ||
|
|
ed30498177 | ||
|
|
06a76567b9 | ||
|
|
35c41091d1 | ||
|
|
46acbadd70 | ||
|
|
054387e02a | ||
|
|
a7706fef58 | ||
|
|
be85a1b14e | ||
|
|
7936e7ea54 | ||
|
|
0934d126d2 | ||
|
|
e44f9d1f1f | ||
|
|
5339fcf377 | ||
|
|
49769ba2d4 | ||
|
|
6800de23b1 | ||
|
|
76bec98b94 | ||
|
|
61e353f549 | ||
|
|
4d8cd6f2fe | ||
|
|
8490496c0b | ||
|
|
95f91bf50c | ||
|
|
e78f1d10b1 | ||
|
|
8ba8f41637 | ||
|
|
91a8210890 | ||
|
|
c95a26ab34 | ||
|
|
d96c08e00b | ||
|
|
09e1f06fb0 | ||
|
|
f9c88b8ab8 | ||
|
|
9a6ff27008 | ||
|
|
cadc68f75b | ||
|
|
be8be330ac | ||
|
|
4ffaaa2952 | ||
|
|
b5e0c786c5 | ||
|
|
5197c664c3 | ||
|
|
fb606fec6a | ||
|
|
57b553a68e | ||
|
|
031afc5056 | ||
|
|
36bf91c9e8 | ||
|
|
a606af98ca | ||
|
|
2ae821c4a8 | ||
|
|
36c43827bb | ||
|
|
326f13220e | ||
|
|
5f41762722 | ||
|
|
5ca43e8c5d | ||
|
|
278c5d8168 | ||
|
|
7cb318727b | ||
|
|
c2c3a980e1 | ||
|
|
1a4b51fbc8 | ||
|
|
0b75c1faa0 | ||
|
|
09e95a2628 | ||
|
|
3180758a4e | ||
|
|
50a55883d3 | ||
|
|
833dc7f783 | ||
|
|
e443871785 | ||
|
|
fcef678a7f | ||
|
|
e5c6772f17 | ||
|
|
7c0ab0fa51 | ||
|
|
7735ae0598 | ||
|
|
b0e1157c8a | ||
|
|
a18cc8241a | ||
|
|
bf9607e27f | ||
|
|
87d29ad6d3 | ||
|
|
2db7bac571 | ||
|
|
d6db9f3459 | ||
|
|
be635a36c1 | ||
|
|
d63786d33b | ||
|
|
98f83fea5a | ||
|
|
c81df6f274 | ||
|
|
ffda2e81b9 | ||
|
|
e0cf396835 | ||
|
|
7f140e0176 | ||
|
|
85aa605a12 | ||
|
|
7c687957f8 | ||
|
|
13849c3d20 | ||
|
|
90ba3dfc5b | ||
|
|
b1ceb532f8 | ||
|
|
1185561549 | ||
|
|
894d164191 | ||
|
|
caa5534c0d | ||
|
|
a922ce0453 | ||
|
|
6195d6741b | ||
|
|
0f2a069588 | ||
|
|
782939f7ef | ||
|
|
04667e04c0 | ||
|
|
de28cf89bf | ||
|
|
770c264d2c | ||
|
|
5a1ade6114 | ||
|
|
62509f6b47 | ||
|
|
2eb78b3724 | ||
|
|
6e43615e25 | ||
|
|
ac39b04b6f | ||
|
|
66f7ee34d1 | ||
|
|
41ca5809b1 | ||
|
|
0a8b5be3d1 | ||
|
|
d65c0c7cc5 | ||
|
|
4102589bd5 | ||
|
|
1eac08c558 | ||
|
|
80b01049c8 | ||
|
|
4adff6f1c9 | ||
|
|
3d924fce1b | ||
|
|
6a737203da | ||
|
|
acb45f3a38 | ||
|
|
8d66b9e353 | ||
|
|
edb6c3d6f8 | ||
|
|
14061d1999 | ||
|
|
6863886d74 | ||
|
|
9832d2e165 | ||
|
|
bea0a4e408 | ||
|
|
41d9ae94ff | ||
|
|
9ca15db91a | ||
|
|
f8311aaca8 | ||
|
|
abbb07e5ee | ||
|
|
2012ba9ab6 | ||
|
|
e877722bac | ||
|
|
617ad81090 | ||
|
|
03ea0a4e80 | ||
|
|
850159490c | ||
|
|
5ea854d8c3 | ||
|
|
e401a4de0f | ||
|
|
2e1ec32916 | ||
|
|
4bc552848f | ||
|
|
5af0016c67 | ||
|
|
617960ee3e | ||
|
|
109c82b29b | ||
|
|
799b0a1737 | ||
|
|
5b3c2c8b14 | ||
|
|
7a12204ba9 | ||
|
|
eada9a6ac1 | ||
|
|
12dcd57d51 | ||
|
|
0f4a9d3f18 | ||
|
|
50318213c4 | ||
|
|
34bc1dbf16 | ||
|
|
3b2e9e5912 | ||
|
|
d7841c7ec9 | ||
|
|
1e67606c60 | ||
|
|
fa3b665223 | ||
|
|
875ccbf5bc | ||
|
|
ccb3c2f453 | ||
|
|
cfc6d74506 | ||
|
|
78d8ef94eb | ||
|
|
e2239306d6 | ||
|
|
ea3f7f7b07 | ||
|
|
d348168e08 | ||
|
|
848bd487e0 | ||
|
|
d034ceee6e | ||
|
|
93aaf0529e | ||
|
|
60fb0621ae | ||
|
|
7eec7c8b43 | ||
|
|
3a79663680 | ||
|
|
b83392df21 | ||
|
|
2b5187b909 | ||
|
|
fb0764c528 | ||
|
|
9a69f12ada | ||
|
|
9bd0ec7091 | ||
|
|
f675376de1 | ||
|
|
9ea2d4c86f | ||
|
|
5aff6590f8 | ||
|
|
f4a92d21ff | ||
|
|
0916db61b4 | ||
|
|
ac23964ac6 | ||
|
|
57ad3602f4 | ||
|
|
4b1df233ae | ||
|
|
c4ba138de5 | ||
|
|
805bcf505d | ||
|
|
fa29a85fcb | ||
|
|
ab26925e25 | ||
|
|
ed00c63d2d | ||
|
|
52c025bbef | ||
|
|
87f3c3a3ac | ||
|
|
6cc3d1f3fe | ||
|
|
b7750760f4 | ||
|
|
00e8999eeb | ||
|
|
9549ce3a9d | ||
|
|
62e92afae8 | ||
|
|
fa60f01adc | ||
|
|
d23ea4e011 | ||
|
|
0a46c4cbbb | ||
|
|
a510cd21ec | ||
|
|
76bf7655a0 | ||
|
|
9575c92db6 | ||
|
|
a9ac114130 | ||
|
|
48def1443a | ||
|
|
559b300d29 | ||
|
|
35272415d3 | ||
|
|
dd9c88204c | ||
|
|
5dc26d7e65 | ||
|
|
1c41959288 | ||
|
|
43e9c75345 | ||
|
|
9b3f750085 | ||
|
|
ba6730e594 | ||
|
|
89c23fad03 | ||
|
|
1d89a2aa1b | ||
|
|
0ff8d52081 | ||
|
|
bb65993a51 | ||
|
|
6ce8a32865 | ||
|
|
5afde1c62f | ||
|
|
6b1e72c631 | ||
|
|
98edfeb73e | ||
|
|
688b138e31 | ||
|
|
8bc540e454 | ||
|
|
4430cfce6b | ||
|
|
c1d4ca8d83 | ||
|
|
bcbc23958f | ||
|
|
b232cd7447 | ||
|
|
a9f0faa499 | ||
|
|
c3a5867c81 | ||
|
|
e86a9cc7a4 | ||
|
|
ddec7008cb | ||
|
|
e320e2504a | ||
|
|
e593fe3f53 | ||
|
|
50e4887aa1 | ||
|
|
f67216d64a | ||
|
|
67e8b9f01d | ||
|
|
29ac24ff9d | ||
|
|
3947f8570a | ||
|
|
d2e62a551c | ||
|
|
c67622f1b9 | ||
|
|
2f37eed184 | ||
|
|
887f0f6c81 | ||
|
|
8804977c84 | ||
|
|
b46cdca795 | ||
|
|
1009019372 | ||
|
|
129830a76c | ||
|
|
24e6f2e0dd | ||
|
|
21f372acc9 | ||
|
|
4d548e67c2 | ||
|
|
55722de1c4 | ||
|
|
0ffe1c2d46 | ||
|
|
95f407ea0d | ||
|
|
99803ba7c6 | ||
|
|
6b87577801 | ||
|
|
d0614c532b | ||
|
|
483182f33a | ||
|
|
d85c6a9359 | ||
|
|
fcd628ffc9 | ||
|
|
e1f17d6665 | ||
|
|
ec7c6aac30 | ||
|
|
0b001fb209 | ||
|
|
e4d8b77027 | ||
|
|
0f63861e88 | ||
|
|
e364377d4f | ||
|
|
395302ee16 | ||
|
|
333b0e7f90 | ||
|
|
3b58cd69b3 | ||
|
|
be8d340f31 | ||
|
|
f833c39ed3 | ||
|
|
8eb2533e78 | ||
|
|
5d25cf0250 | ||
|
|
cd61952efc | ||
|
|
6f23d8e828 | ||
|
|
cf5c5beafb | ||
|
|
1f50d90d9e | ||
|
|
c56bb9efec | ||
|
|
1943a88c8c | ||
|
|
ac1422f49f | ||
|
|
b3b7a561ab | ||
|
|
91ed62deda | ||
|
|
30661dbb42 | ||
|
|
b109c7f234 | ||
|
|
d7f0994f32 | ||
|
|
f37c1557b6 | ||
|
|
988517df7f | ||
|
|
8e12d550a1 | ||
|
|
829dbcc819 | ||
|
|
ae7daf48e3 | ||
|
|
4fda49b771 | ||
|
|
2c68427a8a | ||
|
|
0498d90517 | ||
|
|
5c245c2bc8 | ||
|
|
ec5bbc51e7 | ||
|
|
1c350a061f | ||
|
|
7d78efed0d | ||
|
|
51e054a1ea | ||
|
|
39827ec753 | ||
|
|
71dc86786b | ||
|
|
0a82a8ef2d | ||
|
|
83a6c41132 | ||
|
|
0838b1d3a7 | ||
|
|
bcbb574d05 | ||
|
|
f82ff290a9 | ||
|
|
8052d3804d | ||
|
|
f46aae1075 | ||
|
|
23cbf34bae | ||
|
|
1e54cacac1 | ||
|
|
e3e3996766 | ||
|
|
a10d8f8ca0 | ||
|
|
fca4e5c351 | ||
|
|
0595d4d779 | ||
|
|
6bc271b059 | ||
|
|
3d553eb51a | ||
|
|
91234e2d59 | ||
|
|
61a7a6d3df | ||
|
|
6cb0a8cf0c | ||
|
|
4da6ca883c | ||
|
|
75327c88e4 | ||
|
|
fe288ec3c3 | ||
|
|
424e82cde4 | ||
|
|
1560fc86f8 | ||
|
|
3c2813f505 | ||
|
|
7c520181c3 | ||
|
|
a5d40d0a95 | ||
|
|
c2d22c0671 | ||
|
|
d799eda020 | ||
|
|
9541c1eb37 | ||
|
|
e73b59024a | ||
|
|
01edc0ead2 | ||
|
|
b998129669 | ||
|
|
8dc057b796 | ||
|
|
8aa0b24481 | ||
|
|
9f3b52f4b9 | ||
|
|
cf7c35d399 | ||
|
|
c368b63f0a | ||
|
|
3a1810baa5 | ||
|
|
9ebd08f69b | ||
|
|
c9ff4b428b | ||
|
|
75f78b9032 | ||
|
|
02492654ef | ||
|
|
4b757c8e73 | ||
|
|
71ea946746 | ||
|
|
1cfd009c91 | ||
|
|
6c12ea4380 | ||
|
|
8326da4ee2 | ||
|
|
b0543eee77 | ||
|
|
0b733d1797 | ||
|
|
c2dea2fc02 | ||
|
|
abc62a5eda | ||
|
|
2dc0f42b8f | ||
|
|
71a8c9cc33 | ||
|
|
52b6c539d3 |
22
.asf.yaml
Normal file
22
.asf.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
notifications:
|
||||
commits: commits@cordova.apache.org
|
||||
issues: issues@cordova.apache.org
|
||||
pullrequests_status: issues@cordova.apache.org
|
||||
pullrequests_comment: issues@cordova.apache.org
|
||||
23
.eslintrc.yml
Normal file
23
.eslintrc.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
root: true
|
||||
extends: '@cordova/eslint-config/browser'
|
||||
|
||||
overrides:
|
||||
- files: [tests/**/*.js]
|
||||
extends: '@cordova/eslint-config/node-tests'
|
||||
42
.github/ISSUE_TEMPLATE.md
vendored
Normal file
42
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<!--
|
||||
Please have a look at the issue templates you get when you click "New issue" in the GitHub UI.
|
||||
We very much prefer issues created by using one of these templates.
|
||||
-->
|
||||
|
||||
### Issue Type
|
||||
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
|
||||
|
||||
- [ ] Bug Report
|
||||
- [ ] Feature Request
|
||||
- [ ] Support Question
|
||||
|
||||
## Description
|
||||
|
||||
## Information
|
||||
<!-- Include all relevant information that might help understand and reproduce the problem -->
|
||||
|
||||
### Command or Code
|
||||
<!-- What command or code is needed to reproduce the problem? -->
|
||||
|
||||
### Environment, Platform, Device
|
||||
<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
|
||||
|
||||
|
||||
|
||||
### Version information
|
||||
<!--
|
||||
What are relevant versions you are using?
|
||||
For example:
|
||||
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
|
||||
Other Frameworks: Ionic Framework and CLI version
|
||||
Operating System, Android Studio, Xcode etc.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Checklist
|
||||
<!-- Please check the boxes by putting an `x` in the `[ ]` like so: `[x]` -->
|
||||
|
||||
- [ ] I searched for already existing GitHub issues about this
|
||||
- [ ] I updated all Cordova tooling to their most recent version
|
||||
- [ ] I included all the necessary information above
|
||||
50
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
50
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
name: 🐛 Bug Report
|
||||
about: If something isn't working as expected.
|
||||
|
||||
---
|
||||
|
||||
# Bug Report
|
||||
|
||||
## Problem
|
||||
|
||||
### What is expected to happen?
|
||||
|
||||
|
||||
|
||||
### What does actually happen?
|
||||
|
||||
|
||||
|
||||
## Information
|
||||
<!-- Include all relevant information that might help understand and reproduce the problem -->
|
||||
|
||||
|
||||
|
||||
### Command or Code
|
||||
<!-- What command or code is needed to reproduce the problem? -->
|
||||
|
||||
|
||||
|
||||
### Environment, Platform, Device
|
||||
<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
|
||||
|
||||
|
||||
|
||||
### Version information
|
||||
<!--
|
||||
What are relevant versions you are using?
|
||||
For example:
|
||||
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
|
||||
Other Frameworks: Ionic Framework and CLI version
|
||||
Operating System, Android Studio, Xcode etc.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Checklist
|
||||
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
|
||||
|
||||
- [ ] I searched for existing GitHub issues
|
||||
- [ ] I updated all Cordova tooling to most recent version
|
||||
- [ ] I included all the necessary information above
|
||||
29
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal file
29
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: 🚀 Feature Request
|
||||
about: A suggestion for a new functionality
|
||||
|
||||
---
|
||||
|
||||
# Feature Request
|
||||
|
||||
## Motivation Behind Feature
|
||||
<!-- Why should this feature be implemented? What problem does it solve? -->
|
||||
|
||||
|
||||
|
||||
## Feature Description
|
||||
<!--
|
||||
Describe your feature request in detail
|
||||
Please provide any code examples or screenshots of what this feature would look like
|
||||
Are there any drawbacks? Will this break anything for existing users?
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Alternatives or Workarounds
|
||||
<!--
|
||||
Describe alternatives or workarounds you are currently using
|
||||
Are there ways to do this with existing functionality?
|
||||
-->
|
||||
|
||||
|
||||
27
.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/SUPPORT_QUESTION.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: 💬 Support Question
|
||||
about: If you have a question, please check out our Slack or StackOverflow!
|
||||
|
||||
---
|
||||
|
||||
<!------------^ Click "Preview" for a nicer view! -->
|
||||
|
||||
Apache Cordova uses GitHub Issues as a feature request and bug tracker _only_.
|
||||
For usage and support questions, please check out the resources below. Thanks!
|
||||
|
||||
---
|
||||
|
||||
You can get answers to your usage and support questions about **Apache Cordova** on:
|
||||
|
||||
* Slack Community Chat: https://cordova.slack.com (you can sign-up at http://slack.cordova.io/)
|
||||
* StackOverflow: https://stackoverflow.com/questions/tagged/cordova using the tag `cordova`
|
||||
|
||||
---
|
||||
|
||||
If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels:
|
||||
|
||||
* **Ionic Framework**
|
||||
* [Ionic Community Forum](https://forum.ionicframework.com/)
|
||||
* [Ionic Worldwide Slack](https://ionicworldwide.herokuapp.com/)
|
||||
* **PhoneGap**
|
||||
* [PhoneGap Developer Community](https://forums.adobe.com/community/phonegap)
|
||||
35
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
35
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<!--
|
||||
Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
|
||||
|
||||
http://cordova.apache.org/contribute/contribute_guidelines.html
|
||||
|
||||
Thanks!
|
||||
-->
|
||||
|
||||
### Platforms affected
|
||||
|
||||
|
||||
|
||||
### Motivation and Context
|
||||
<!-- Why is this change required? What problem does it solve? -->
|
||||
<!-- If it fixes an open issue, please link to the issue here. -->
|
||||
|
||||
|
||||
|
||||
### Description
|
||||
<!-- Describe your changes in detail -->
|
||||
|
||||
|
||||
|
||||
### Testing
|
||||
<!-- Please describe in detail how you tested your changes. -->
|
||||
|
||||
|
||||
|
||||
### Checklist
|
||||
|
||||
- [ ] I've run the tests to see all new and existing tests pass
|
||||
- [ ] I added automated test coverage as appropriate for this change
|
||||
- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
|
||||
- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
|
||||
- [ ] I've updated the documentation if necessary
|
||||
73
.github/workflows/chrome.yml
vendored
Normal file
73
.github/workflows/chrome.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
name: Chrome Testsuite
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
- '.eslint*'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
- '.eslint*'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Chrome Latest Test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# hoist configurations to top that are expected to be updated
|
||||
env:
|
||||
# Storing a copy of the repo
|
||||
repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
||||
|
||||
node-version: 16
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.node-version }}
|
||||
|
||||
- name: Run install xvfb
|
||||
run: sudo apt-get install xvfb
|
||||
|
||||
- name: Run Environment Information
|
||||
run: |
|
||||
node --version
|
||||
npm --version
|
||||
|
||||
- name: Run npm install
|
||||
run: |
|
||||
npm i -g cordova@latest
|
||||
npm ci
|
||||
|
||||
- name: Run paramedic install
|
||||
if: ${{ endswith(env.repo, '/cordova-paramedic') != true }}
|
||||
run: npm i -g github:apache/cordova-paramedic
|
||||
|
||||
- name: Run paramedic tests
|
||||
env:
|
||||
test_config: 'browser.config.json'
|
||||
# Generally, this should automatically work for cordova-paramedic & plugins. If the path is unique, this can be manually changed.
|
||||
test_plugin_path: ${{ endswith(env.repo, '/cordova-paramedic') && './spec/testable-plugin/' || './' }}
|
||||
paramedic: ${{ endswith(env.repo, '/cordova-paramedic') && 'node main.js' || 'cordova-paramedic' }}
|
||||
run: xvfb-run --auto-servernum ${{ env.paramedic }} --config ./pr/local/${{ env.test_config }} --plugin ${{ env.test_plugin_path }}
|
||||
56
.github/workflows/lint.yml
vendored
Normal file
56
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
name: Lint Test
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.js'
|
||||
- '.eslint*'
|
||||
- '.github/workflow/lint.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.js'
|
||||
- '.eslint*'
|
||||
- '.github/workflow/lint.yml'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Lint Test
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
node-version: 16
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.node-version }}
|
||||
|
||||
- name: Run Environment Information
|
||||
run: |
|
||||
node --version
|
||||
npm --version
|
||||
|
||||
- name: Run npm install
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
- name: Run lint test
|
||||
run: |
|
||||
npm run lint
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
#If ignorance is bliss, then somebody knock the smile off my face
|
||||
#If ignorance is bliss, then somebody knock the smile off my face
|
||||
|
||||
*.csproj.user
|
||||
*.suo
|
||||
@@ -12,12 +12,4 @@ Thumbs.db
|
||||
*.swp
|
||||
*.user
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
node_modules
|
||||
|
||||
2
.npmignore
Normal file
2
.npmignore
Normal file
@@ -0,0 +1,2 @@
|
||||
.*
|
||||
tests
|
||||
37
CONTRIBUTING.md
Normal file
37
CONTRIBUTING.md
Normal file
@@ -0,0 +1,37 @@
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
-->
|
||||
|
||||
# Contributing to Apache Cordova
|
||||
|
||||
Anyone can contribute to Cordova. And we need your contributions.
|
||||
|
||||
There are multiple ways to contribute: report bugs, improve the docs, and
|
||||
contribute code.
|
||||
|
||||
For instructions on this, start with the
|
||||
[contribution overview](http://cordova.apache.org/contribute/).
|
||||
|
||||
The details are explained there, but the important items are:
|
||||
- Check for Github issues that corresponds to your contribution and link or create them if necessary.
|
||||
- Run the tests so your patch doesn't break existing functionality.
|
||||
|
||||
We look forward to your contributions!
|
||||
|
||||
5
NOTICE
Normal file
5
NOTICE
Normal file
@@ -0,0 +1,5 @@
|
||||
Apache Cordova
|
||||
Copyright 2012 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
184
README.md
184
README.md
@@ -1,18 +1,182 @@
|
||||
cordova-plugin-splashscreen
|
||||
----------------------------
|
||||
---
|
||||
title: Browser Splashscreen
|
||||
description: Control the browser platform splash screen for your app.
|
||||
---
|
||||
<!--
|
||||
# license: Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
-->
|
||||
|
||||
For Android,
|
||||
# cordova-plugin-splashscreen
|
||||
|
||||
In your config.xml, you need to add the following preference
|
||||
[](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/chrome.yml) [](https://github.com/apache/cordova-plugin-splashscreen/actions/workflows/lint.yml)
|
||||
|
||||
`<preference name="splashscreen" value="foo" />`
|
||||
This plugin displays and hides a splash screen while your web application is launching. Using its methods you can also show and hide the splash screen manually.
|
||||
|
||||
Where foo is the name of the splashscreen file. Preferably a 9 patch file. Make sure to add your splashcreen files to your res/xml directory under the appropriate folders.
|
||||
- [cordova-plugin-splashscreen](#cordova-plugin-splashscreen)
|
||||
- [Installation](#installation)
|
||||
- [Supported Platforms](#supported-platforms)
|
||||
- [Platform Splash Screen Image Configuration](#platform-splash-screen-image-configuration)
|
||||
- [Example Configuration](#example-configuration)
|
||||
- [Preferences](#preferences)
|
||||
- [config.xml](#configxml)
|
||||
- [Quirks](#quirks)
|
||||
- [Methods](#methods)
|
||||
- [splashscreen.hide](#splashscreenhide)
|
||||
- [splashscreen.show](#splashscreenshow)
|
||||
|
||||
For Android, you also have to edit your projects main java file. You must add a second parameter representing a time delay to your super.loadUrl.
|
||||
## Installation
|
||||
|
||||
`super.loadUrl(Config.getStartUrl(), 10000);`
|
||||
// npm hosted (new) id
|
||||
cordova plugin add cordova-plugin-splashscreen
|
||||
|
||||
To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface).
|
||||
// you may also install directly from this repo
|
||||
cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
|
||||
|
||||
If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/plugin_ref_plugman.md.html).
|
||||
## Supported Platforms
|
||||
|
||||
- Browser
|
||||
|
||||
## Platform Splash Screen Image Configuration
|
||||
|
||||
### Example Configuration
|
||||
|
||||
In the top-level `config.xml` file (not the one in `platforms`), add configuration elements like those specified here.
|
||||
|
||||
The value of the "src" attribute is relative to the project root directory and NOT to the `www` directory (see `Directory structure` below). You can name the source image file whatever you like. The internal name in the application is automatically determined by Cordova.
|
||||
|
||||
Directory structure:
|
||||
|
||||
```
|
||||
projectRoot
|
||||
hooks
|
||||
platforms
|
||||
plugins
|
||||
www
|
||||
css
|
||||
img
|
||||
js
|
||||
res
|
||||
screen
|
||||
```
|
||||
|
||||
```xml
|
||||
<preference name="SplashScreenDelay" value="10000" />
|
||||
```
|
||||
|
||||
## Preferences
|
||||
|
||||
### config.xml
|
||||
|
||||
- `AutoHideSplashScreen` (boolean, default to `true`). Indicates whether to hide splash screen automatically or not. The splash screen is hidden after the amount of time specified in the `SplashScreenDelay` preference.
|
||||
|
||||
```xml
|
||||
<preference name="AutoHideSplashScreen" value="true" />
|
||||
```
|
||||
|
||||
- `SplashScreenDelay` (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen.
|
||||
|
||||
```xml
|
||||
<preference name="SplashScreenDelay" value="3000" />
|
||||
```
|
||||
|
||||
This value used to be in seconds (but is now milliseconds) so values less than 30 will continue to be treated as seconds. (Consider this a deprecated patch that will disapear in some future version.)
|
||||
|
||||
To disable the splashscreen add the following preference to `config.xml`:
|
||||
```xml
|
||||
<preference name="SplashScreenDelay" value="0"/>
|
||||
```
|
||||
|
||||
- `FadeSplashScreen` (boolean, defaults to `true`): Set to `false` to
|
||||
prevent the splash screen from fading in and out when its display
|
||||
state changes.
|
||||
|
||||
```xml
|
||||
<preference name="FadeSplashScreen" value="false"/>
|
||||
```
|
||||
|
||||
- `FadeSplashScreenDuration` (float, defaults to `500`): Specifies the
|
||||
number of milliseconds for the splash screen fade effect to execute.
|
||||
|
||||
```xml
|
||||
<preference name="FadeSplashScreenDuration" value="750"/>
|
||||
```
|
||||
|
||||
_Note_: `FadeSplashScreenDuration` is included into `SplashScreenDelay`, for example if you have `<preference name="SplashScreenDelay" value="3000" />` and `<preference name="FadeSplashScreenDuration" value="1000"/>` defined in `config.xml`:
|
||||
|
||||
- 00:00 - splashscreen is shown
|
||||
- 00:02 - fading has started
|
||||
- 00:03 - splashscreen is hidden
|
||||
|
||||
Turning the fading off via `<preference name="FadeSplashScreen" value="false"/>` technically means fading duration to be `0` so that in this example the overall splash screen delay will still be 3 seconds.
|
||||
|
||||
_Note_: This only applies to the application startup - you need to take the fading timeout into account when manually showing/hiding the splash screen in your application's code:
|
||||
|
||||
```javascript
|
||||
navigator.splashscreen.show();
|
||||
window.setTimeout(function () {
|
||||
navigator.splashscreen.hide();
|
||||
}, splashDuration - fadeDuration);
|
||||
```
|
||||
|
||||
### Quirks
|
||||
|
||||
You can use the following preferences in your `config.xml`:
|
||||
|
||||
```xml
|
||||
<platform name="browser">
|
||||
<preference name="SplashScreen" value="/images/browser/splashscreen.jpg" /> <!-- defaults to "/img/logo.png" -->
|
||||
<preference name="AutoHideSplashScreen" value="true" /> <!-- defaults to "true" -->
|
||||
<preference name="SplashScreenDelay" value="3000" /> <!-- defaults to "3000" -->
|
||||
<preference name="SplashScreenBackgroundColor" value="green" /> <!-- defaults to "#464646" -->
|
||||
<preference name="ShowSplashScreen" value="false" /> <!-- defaults to "true" -->
|
||||
<preference name="SplashScreenWidth" value="600" /> <!-- defaults to "170" -->
|
||||
<preference name="SplashScreenHeight" value="300" /> <!-- defaults to "200" -->
|
||||
</platform>
|
||||
```
|
||||
|
||||
__Note__: `SplashScreen` value should be absolute in order to work in a sub-page.
|
||||
|
||||
## Methods
|
||||
|
||||
- splashscreen.show
|
||||
- splashscreen.hide
|
||||
|
||||
### splashscreen.hide
|
||||
|
||||
Dismiss the splash screen.
|
||||
|
||||
```js
|
||||
navigator.splashscreen.hide();
|
||||
```
|
||||
|
||||
### splashscreen.show
|
||||
|
||||
Displays the splash screen.
|
||||
|
||||
```js
|
||||
navigator.splashscreen.show();
|
||||
```
|
||||
|
||||
Your application cannot call `navigator.splashscreen.show()` until the application has
|
||||
started and the `deviceready` event has fired. But since typically the splash
|
||||
screen is meant to be visible before your application has started, that would seem to
|
||||
defeat the purpose of the splash screen. Providing any parameters in
|
||||
`config.xml` will automatically `show` the splash screen immediately after your
|
||||
application is launched and before it has fully started and received the `deviceready`
|
||||
event. For this reason, it is unlikely you will need to call `navigator.splashscreen.show()` to make the splash
|
||||
screen visible for application startup.
|
||||
|
||||
275
RELEASENOTES.md
275
RELEASENOTES.md
@@ -20,9 +20,276 @@
|
||||
-->
|
||||
# Release Notes
|
||||
|
||||
### 6.0.2 (Jul 12, 2022)
|
||||
|
||||
* [GH-331](https://github.com/apache/cordova-plugin-splashscreen/pull/331) doc(ios): remove docs from `README` (migrated to cordova-docs)
|
||||
* [GH-329](https://github.com/apache/cordova-plugin-splashscreen/pull/329) chore(android): update **Android** engine requirement `<11.0.0`
|
||||
* [GH-327](https://github.com/apache/cordova-plugin-splashscreen/pull/327) docs: fixup spaces for releasnotes
|
||||
* [GH-326](https://github.com/apache/cordova-plugin-splashscreen/pull/326) chore(CI): remove **iOS** workflow
|
||||
|
||||
### 6.0.1 (Apr 04, 2022)
|
||||
* [GH-325](https://github.com/apache/cordova-plugin-splashscreen/pull/325) chore: update package-lock.json
|
||||
* [GH-213](https://github.com/apache/cordova-plugin-splashscreen/pull/213) GH-180 (android): Fixes nav and title bars still appearing when app is fullscreen
|
||||
* [GH-320](https://github.com/apache/cordova-plugin-splashscreen/pull/320) ci(ios): update workflow w/ **iOS** 15
|
||||
* [GH-319](https://github.com/apache/cordova-plugin-splashscreen/pull/319) ci: add action-badge
|
||||
* [GH-318](https://github.com/apache/cordova-plugin-splashscreen/pull/318) ci: remove travis & appveyor
|
||||
* [GH-317](https://github.com/apache/cordova-plugin-splashscreen/pull/317) ci: add gh-actions workflows
|
||||
* [GH-312](https://github.com/apache/cordova-plugin-splashscreen/pull/312) fix: autofocus after splashscreen
|
||||
* [GH-314](https://github.com/apache/cordova-plugin-splashscreen/pull/314) fix: refocus after webview visible (#186)
|
||||
* [GH-304](https://github.com/apache/cordova-plugin-splashscreen/pull/304) ci: add node-14.x to workflow
|
||||
* [GH-291](https://github.com/apache/cordova-plugin-splashscreen/pull/291) chore(docs): Update missing default resources for **Android** #689
|
||||
* [GH-293](https://github.com/apache/cordova-plugin-splashscreen/pull/293) Documentation Enhancement for **Android** Dark Mode
|
||||
* [GH-300](https://github.com/apache/cordova-plugin-splashscreen/pull/300) docs: Added **iOS** notes to supported platforms.
|
||||
* [GH-296](https://github.com/apache/cordova-plugin-splashscreen/pull/296) chore(pkg): remove default-valued field "homepage"
|
||||
* [GH-292](https://github.com/apache/cordova-plugin-splashscreen/pull/292) ci(travis): updates **Android** API level
|
||||
* [GH-286](https://github.com/apache/cordova-plugin-splashscreen/pull/286) (docs): Add Information about how to use Dark Mode SplashScreens
|
||||
|
||||
### 6.0.0 (Jul 07, 2020)
|
||||
|
||||
* [GH-282](https://github.com/apache/cordova-plugin-splashscreen/pull/282) fix: js `clobber` only on supported platforms
|
||||
* [GH-281](https://github.com/apache/cordova-plugin-splashscreen/pull/281) chore: adds `package-lock` file
|
||||
* [GH-280](https://github.com/apache/cordova-plugin-splashscreen/pull/280) doc(android): various improvements including size specs
|
||||
* [GH-200](https://github.com/apache/cordova-plugin-splashscreen/pull/200) fix(windows): implementation structure
|
||||
* [GH-279](https://github.com/apache/cordova-plugin-splashscreen/pull/279) chore: add missing supported platform **Browser** to `npm` keywords
|
||||
* [GH-278](https://github.com/apache/cordova-plugin-splashscreen/pull/278) chore: update `engine` checks to cover newer versions
|
||||
* [GH-277](https://github.com/apache/cordova-plugin-splashscreen/pull/277) breaking: replace `jshint` with `eslint`
|
||||
* [GH-276](https://github.com/apache/cordova-plugin-splashscreen/pull/276) breaking: drop `node` `engine` requirement
|
||||
* [GH-275](https://github.com/apache/cordova-plugin-splashscreen/pull/275) chore: cleanup repo
|
||||
* [GH-274](https://github.com/apache/cordova-plugin-splashscreen/pull/274) breaking: bump `engine` restriction for cordova dependencies
|
||||
* [GH-263](https://github.com/apache/cordova-plugin-splashscreen/pull/263) breaking: remove **iOS** platform code from plugin repo
|
||||
* [GH-267](https://github.com/apache/cordova-plugin-splashscreen/pull/267) test: force `cordova-ios`@^5.1.1
|
||||
|
||||
### 5.0.4 (Jun 03, 2020)
|
||||
* [GH-261](https://github.com/apache/cordova-plugin-splashscreen/pull/261) chore: add `cordova-ios` requirement <6.0.0
|
||||
* chore(asf): update git notification settings
|
||||
* update CONTRIBUTING.md
|
||||
* [GH-251](https://github.com/apache/cordova-plugin-splashscreen/pull/251) chore(npm): adds ignore list
|
||||
* [GH-252](https://github.com/apache/cordova-plugin-splashscreen/pull/252) ci: updates Node.js versions
|
||||
* [GH-236](https://github.com/apache/cordova-plugin-splashscreen/pull/236) update homepage to github `README` page
|
||||
* [GH-239](https://github.com/apache/cordova-plugin-splashscreen/pull/239) update `README`.md by adding missing info
|
||||
* ci(travis): Upgrade node from 6 to 8
|
||||
* ci(travis): Remove **Android 4.4**, Add **Android** 9.0
|
||||
* [GH-212](https://github.com/apache/cordova-plugin-splashscreen/pull/212) ci(travis): Add ADDITIONAL_TESTS_DIR=./tests/ios
|
||||
|
||||
### 5.0.3 (May 09, 2019)
|
||||
* Update CI configuration and README ([#210](https://github.com/apache/cordova-plugin-splashscreen/pull/210), [#208](https://github.com/apache/cordova-plugin-splashscreen/pull/208), [#198](https://github.com/apache/cordova-plugin-splashscreen/pull/198), [#194](https://github.com/apache/cordova-plugin-splashscreen/pull/194))
|
||||
* Add or update GitHub pull request and issue template
|
||||
* [CB-13826](https://issues.apache.org/jira/browse/CB-13826) Incremented plugin version.
|
||||
* [CB-12277](https://issues.apache.org/jira/browse/CB-12277) (android) avoid NullPointerException on splashImageView when removing splashscreen
|
||||
|
||||
### 5.0.2 (Jan 24, 2018)
|
||||
* [CB-13750](https://issues.apache.org/jira/browse/CB-13750) Add build-tools-26.0.2 to travis
|
||||
* [CB-13737](https://issues.apache.org/jira/browse/CB-13737) (iOS): fix Splash screen images for iPhone X
|
||||
|
||||
### 5.0.1 (Dec 27, 2017)
|
||||
* [CB-13709](https://issues.apache.org/jira/browse/CB-13709) Fix to allow 5.0.0 version install (#144)
|
||||
|
||||
### 5.0.0 (Dec 15, 2017)
|
||||
* [CB-13677](https://issues.apache.org/jira/browse/CB-13677) Remove deprecated platforms
|
||||
|
||||
### 4.1.0 (Nov 06, 2017)
|
||||
* [CB-13473](https://issues.apache.org/jira/browse/CB-13473) (CI) Removed **Browser** builds from AppVeyor
|
||||
* [CB-12011](https://issues.apache.org/jira/browse/CB-12011) (android) added the possibility to change the spinner color on **Android 5.0**+ apps
|
||||
* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
|
||||
* [CB-13094](https://issues.apache.org/jira/browse/CB-13094) (android) Don't show splash when activity being finished
|
||||
* [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) Documented `AutoHideSplashScreen` for **Browser**
|
||||
* [CB-11488](https://issues.apache.org/jira/browse/CB-11488) (browser) The `hide()` call became non re-entrant after the addition of fade out. This fixes the issue.
|
||||
* [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) The standard `AutoHideSplashScreen` `config.xml` property is now supported by the **Browser** platform.
|
||||
* [CB-11486](https://issues.apache.org/jira/browse/CB-11486) (browser) `splashScreenDelay` now feed through `parseInt` to ensure it is an integer by the time it's value is passed in to `setTimeout()` in `hide()`.
|
||||
* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
|
||||
|
||||
### 4.0.3 (Apr 27, 2017)
|
||||
* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
|
||||
* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
|
||||
|
||||
### 4.0.2 (Feb 28, 2017)
|
||||
* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
|
||||
* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
|
||||
* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
|
||||
* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
|
||||
|
||||
### 4.0.1 (Dec 07, 2016)
|
||||
* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 4.0.1
|
||||
* [CB-11751](https://issues.apache.org/jira/browse/CB-11751) 'extendedSplashScreen' is undefined Document that splashscreen needs to be disabled on Windows in case of updating entire document body
|
||||
* [CB-9287](https://issues.apache.org/jira/browse/CB-9287) Not enough Icons and Splashscreens for **Windows 8.1** and Windows Phone 8.1
|
||||
* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
|
||||
* [CB-11830](https://issues.apache.org/jira/browse/CB-11830) (iOS) Fix doc typos in PR#114
|
||||
* [CB-11829](https://issues.apache.org/jira/browse/CB-11829) (iOS) Support for CB-9762; docs (CB-11830)
|
||||
* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
|
||||
|
||||
### 4.0.0 (Sep 08, 2016)
|
||||
* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
|
||||
* [CB-11326](https://issues.apache.org/jira/browse/CB-11326) Prevent crash when initializing plugin after navigating to another URL
|
||||
* Fix crash on **iOS** when reloading page from remote **Safari**
|
||||
* Add badges for paramedic builds on Jenkins
|
||||
* Add pull request template.
|
||||
* [CB-11179](https://issues.apache.org/jira/browse/CB-11179) Extend the windows-splashscreen docs
|
||||
* [CB-11159](https://issues.apache.org/jira/browse/CB-11159) Fix flaky splashscreen native tests
|
||||
* [CB-11156](https://issues.apache.org/jira/browse/CB-11156) Change default `FadeSplashScreenDuration` value
|
||||
* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Updated the dependency version, added it to the docs
|
||||
* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
|
||||
* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Implement splashscreen for **Windows** platform
|
||||
* [CB-6498](https://issues.apache.org/jira/browse/CB-6498) Misleading documentation in **Android** Quirks
|
||||
|
||||
### 3.2.2 (Apr 15, 2016)
|
||||
* [CB-10979](https://issues.apache.org/jira/browse/CB-10979) Fix splashscreen **iOS** native tests. Added `jshintignore` for tests/ios
|
||||
* [CB-10895](https://issues.apache.org/jira/browse/CB-10895) Transparent Splashscreen view sometimes remains
|
||||
* [CB-10562](https://issues.apache.org/jira/browse/CB-10562) `hide()` not working in latest splashscreen plug in 3.1.0 in **iOS**
|
||||
* [CB-10688](https://issues.apache.org/jira/browse/CB-10688) Plugin Splashscreen Readme must have examples.
|
||||
* [CB-10864](https://issues.apache.org/jira/browse/CB-10864) Run **iOS** native tests on Travis
|
||||
|
||||
### 3.2.1 (Mar 09, 2016)
|
||||
* [CB-10764](https://issues.apache.org/jira/browse/CB-10764) Remove emoji in cordova-plugin-splashscreen
|
||||
* [CB-10650](https://issues.apache.org/jira/browse/CB-10650) Non-index content.src causes Splashscreen to be not displayed on **Browser**
|
||||
* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
|
||||
* [CB-10606](https://issues.apache.org/jira/browse/CB-10606) fix deprecation warning for interfaceOrientation on **iOS**
|
||||
* chore: edit package.json license to match SPDX id
|
||||
|
||||
### 3.2.0 (Feb 09, 2016)
|
||||
* [CB-10422](https://issues.apache.org/jira/browse/CB-10422) Splashscreen displays black screen with no image on Android
|
||||
* [CB-10412](https://issues.apache.org/jira/browse/CB-10412) AutoHideSplashScreen "false" isn't taken in account on iOS
|
||||
* [CB-9516](https://issues.apache.org/jira/browse/CB-9516) Android SplashScreen - Spinner Does Not Display
|
||||
* [CB-9094](https://issues.apache.org/jira/browse/CB-9094) Smarter autohide logic on Android
|
||||
* [CB-8396](https://issues.apache.org/jira/browse/CB-8396) Add AutoHideSplashScreen logic to Android's Splashscreen
|
||||
|
||||
### 3.1.0 (Jan 15, 2016)
|
||||
* [CB-9538](https://issues.apache.org/jira/browse/CB-9538) Implementing `FadeSplashScreen` feature for **Android**
|
||||
* [CB-9240](https://issues.apache.org/jira/browse/CB-9240) Cordova splash screen plugin **iPad** landscape mode issue
|
||||
* [CB-10263](https://issues.apache.org/jira/browse/CB-10263) Fix splashscreen plugin filenames for Asset Catalog
|
||||
* [CB-9374](https://issues.apache.org/jira/browse/CB-9374) **Android** add `SplashShowOnlyFirstTime` as preference
|
||||
* [CB-10244](https://issues.apache.org/jira/browse/CB-10244) Don't rotate the **iPhone 6 Plus** splash
|
||||
* [CB-9043](https://issues.apache.org/jira/browse/CB-9043) Fix the **ios** splashscreen being deformed on orientation change
|
||||
* [CB-10079](https://issues.apache.org/jira/browse/CB-10079) Splashscreen plugin does not honor `SplashScreenDelay` on **iOS**
|
||||
* [CB-10231](https://issues.apache.org/jira/browse/CB-10231) Fix `FadeSplashScreen` to default to true on **iOS**
|
||||
|
||||
### 3.0.0 (Nov 18, 2015)
|
||||
* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
|
||||
* Fixing contribute link.
|
||||
* [CB-9750](https://issues.apache.org/jira/browse/CB-9750) `FadeSplashDuration` is now in `msecs`
|
||||
* [CB-8875](https://issues.apache.org/jira/browse/CB-8875) `FadeSplashScreen` was not fading
|
||||
* [CB-9467](https://issues.apache.org/jira/browse/CB-9467) SplashScreen does not show any image in hosted app on **Windows 10**
|
||||
* [CB-7282](https://issues.apache.org/jira/browse/CB-7282) Document `AutoHideSplashScreenpreference`
|
||||
* [CB-9327](https://issues.apache.org/jira/browse/CB-9327) - Splashscreen not receiving `CDVPageLoadNotification`
|
||||
* WP8: Avoid config `value` of a wrong element.
|
||||
|
||||
### 2.1.0 (Jun 17, 2015)
|
||||
* added missing license headers
|
||||
* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
|
||||
* fix npm md issue
|
||||
* Fixed iOS unit tests.
|
||||
* [CB-3562](https://issues.apache.org/jira/browse/CB-3562): Disable screen rotation for iPhone when splash screen is shown. (closes #47)
|
||||
* [CB-8988](https://issues.apache.org/jira/browse/CB-8988): Fix rotation on iOS/iPad (closes #46)
|
||||
* [CB-8904](https://issues.apache.org/jira/browse/CB-8904): Don't reset the static variable when it's destroyed, otherwise we might as well just have a member variable
|
||||
* Removed wp7 from `plugin.xml` and package.json
|
||||
* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Rewrite resoultion helper
|
||||
* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Allow resolution-specific splashscreen images
|
||||
* [CB-8758](https://issues.apache.org/jira/browse/CB-8758) [wp8]: UnauthorizedAccessException on hide()
|
||||
|
||||
### 2.0.0 (Apr 15, 2015)
|
||||
* give users a way to install the bleeding edge.
|
||||
* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
|
||||
* [CB-8797](https://issues.apache.org/jira/browse/CB-8797) - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing
|
||||
* [CB-8836](https://issues.apache.org/jira/browse/CB-8836) - Crashes after animating splashscreen
|
||||
* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Fix missing import in previous commit
|
||||
* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Adds `SplashMaintainAspectRatio` preference (close #43)
|
||||
* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
|
||||
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
|
||||
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
|
||||
* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) Make default for splashscreen resource "screen" (which is what template and CLI assume it to be)
|
||||
* Revert "CB-8345 android: Make "splash" the default resource ID instead of null"
|
||||
* Use TRAVIS_BUILD_DIR, install paramedic by npm
|
||||
* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) android: Make "splash" the default resource ID instead of null
|
||||
* docs: added Windows to supported platforms
|
||||
* [CB-7964](https://issues.apache.org/jira/browse/CB-7964) Add cordova-plugin-splashscreen support for browser platform
|
||||
* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
|
||||
* [wp8] oops, Added back config parse result checks
|
||||
* [WP8] code cleanup, minor refactors, comments to clarify some stuff.
|
||||
* Extend WP8 Splash Screen to respect SplashScreen and SplashScreenDelay preferences from config file
|
||||
* [CB-8574](https://issues.apache.org/jira/browse/CB-8574) Integrate TravisCI
|
||||
* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
|
||||
* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
|
||||
* [CB-8397](https://issues.apache.org/jira/browse/CB-8397) Add support to 'windows' for showing the Windows Phone splashscreen
|
||||
|
||||
### 1.0.0 (Feb 04, 2015)
|
||||
* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using deprecated IsIpad macro
|
||||
* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Add engine tag for Android >= 3.6.0 due to use of `preferences`
|
||||
* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Make SplashScreen plugin compatible with cordova-android@4.0.x
|
||||
|
||||
### 0.3.5 (Dec 02, 2014)
|
||||
* [CB-7204](https://issues.apache.org/jira/browse/CB-7204) - Race condition when hiding and showing spinner (closes #21)
|
||||
* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
|
||||
|
||||
### 0.3.4 (Oct 03, 2014)
|
||||
* Finalized iOS splash screen (image name) tests. 176 tests in all, 44 for each type of device (iPad, iPhone, iPhone5, iPhone6, iPhone 6 Plus).
|
||||
* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - (Re-fix based on updated unit tests) iPhone 6 Plus support
|
||||
* Updated iOS tests for locked orientations
|
||||
* Added more iOS splash screen tests.
|
||||
* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - Add support for iPhone 6/6+
|
||||
* Added failing iPhone 6/6 Plus tests.
|
||||
* Added 'npm test'
|
||||
* [CB-7663](https://issues.apache.org/jira/browse/CB-7663) - iOS unit tests for splash screen
|
||||
* Properly formatted splashscreen preference docs.
|
||||
|
||||
### 0.3.3 (Sep 17, 2014)
|
||||
* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-splashscreen documentation translation
|
||||
* Renamed test dir, added nested `plugin.xml`
|
||||
* added documentation for manual tests
|
||||
* [CB-7196](https://issues.apache.org/jira/browse/CB-7196) port splashscreen tests to framework
|
||||
|
||||
### 0.3.2 (Aug 06, 2014)
|
||||
* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
|
||||
* [CB-7041](https://issues.apache.org/jira/browse/CB-7041) ios: Fix image filename logic when setting the iPad splash screen
|
||||
* fixes Splashscreen crash on WP8
|
||||
* Remove outdated doc
|
||||
|
||||
### 0.3.1 (Jun 05, 2014)
|
||||
* documentation translation: cordova-plugin-splashscreen
|
||||
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
|
||||
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
|
||||
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
|
||||
* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
|
||||
* [CB-6810](https://issues.apache.org/jira/browse/CB-6810) Add license to CONTRIBUTING.md
|
||||
* [wp8] updated quirk for and combined iOS,WP8,BB10 quirks as they are all the same
|
||||
* [wp] implemented OnInit so splash screen can be shown before cordova page is loaded
|
||||
* [wp] plugin must be autoloaded for AutoHideSplashScreen preference to work
|
||||
* [CB-6483](https://issues.apache.org/jira/browse/CB-6483) Use splash screen image from manifest on Windows8
|
||||
* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
|
||||
* Revert "Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen"
|
||||
|
||||
### 0.3.0 (Apr 17, 2014)
|
||||
* Add Tizen support to plugin
|
||||
* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
|
||||
* [CB-4051](https://issues.apache.org/jira/browse/CB-4051): [ios] - Re-fix - Splashscreen rotation problem (closes #13)
|
||||
* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
|
||||
* [CB-6465](https://issues.apache.org/jira/browse/CB-6465): Add license headers to Tizen code
|
||||
* Add NOTICE file
|
||||
|
||||
### 0.2.7 (Feb 05, 2014)
|
||||
* [CB-3562](https://issues.apache.org/jira/browse/CB-3562) Fix aspect ratio on landscape-only iPhone applications
|
||||
* [CB-4051](https://issues.apache.org/jira/browse/CB-4051) fix for splashscreen rotation problem
|
||||
|
||||
### 0.2.6 (Jan 02, 2014)
|
||||
* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Splashscreen plugin
|
||||
* Handle error when splash image is missing.
|
||||
|
||||
### 0.2.5 (Dec 4, 2013)
|
||||
* add ubuntu platform
|
||||
* Added amazon-fireos platform. Change to use amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'
|
||||
* [CB-5124](https://issues.apache.org/jira/browse/CB-5124) - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs
|
||||
|
||||
### 0.2.4 (Oct 28, 2013)
|
||||
* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): add repo + issue tag to `plugin.xml` for splashscreen plugin
|
||||
* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
|
||||
|
||||
### 0.2.3 (Oct 9, 2013)
|
||||
* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Re-fix Update splashscreen image bounds for iOS 7
|
||||
* [CB-4934](https://issues.apache.org/jira/browse/CB-4934) plugin-splashscreen should not show by default on Windows8
|
||||
* [CB-4929](https://issues.apache.org/jira/browse/CB-4929) plugin-splashscreen not loading proxy windows8
|
||||
* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
|
||||
|
||||
### 0.2.2 (Sept 25, 2013)
|
||||
* CB-4889 bumping&resetting version
|
||||
* CB-4889 renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen
|
||||
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
|
||||
* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen
|
||||
* Rename CHANGELOG.md -> RELEASENOTES.md
|
||||
* [CB-4806] Update splashscreen image bounds for iOS 7
|
||||
* [CB-4752] Incremented plugin version on dev branch.
|
||||
* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Update splashscreen image bounds for iOS 7
|
||||
* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
---
|
||||
license: Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
---
|
||||
|
||||
hide
|
||||
===============
|
||||
|
||||
Dismiss the splash screen.
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
navigator.splashscreen.hide() dismisses the applications splash screen.
|
||||
|
||||
Supported Platforms
|
||||
-------------------
|
||||
|
||||
- Android
|
||||
- iOS
|
||||
|
||||
Quick Example
|
||||
-------------
|
||||
|
||||
navigator.splashscreen.hide();
|
||||
|
||||
Full Example
|
||||
------------
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Splashscreen Example</title>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
|
||||
// Wait for Cordova to load
|
||||
//
|
||||
document.addEventListener("deviceready", onDeviceReady, false);
|
||||
|
||||
// Cordova is ready
|
||||
//
|
||||
function onDeviceReady() {
|
||||
navigator.splashscreen.hide();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Example</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
iOS Quirk
|
||||
------------
|
||||
|
||||
1. In your **config.xml**, you need to [modify the value](guide_project-settings_index.md.html#Project%20Settings) for **"AutoHideSplashScreen”** to false
|
||||
|
||||
2. Then, if you want to delay hiding the splash screen for 2 seconds, you can do this in your **deviceready** event handler:
|
||||
|
||||
setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 2000);
|
||||
@@ -1,90 +0,0 @@
|
||||
---
|
||||
license: Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
---
|
||||
|
||||
Splashscreen
|
||||
==========
|
||||
|
||||
> Enables developers to show/hide the application's splash screen.
|
||||
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
- show
|
||||
- hide
|
||||
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
### Android
|
||||
|
||||
#### app/res/xml/config.xml
|
||||
|
||||
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
|
||||
|
||||
### iOS
|
||||
|
||||
#### config.xml
|
||||
|
||||
<plugin name="SplashScreen" value="CDVSplashScreen" />
|
||||
|
||||
Setup
|
||||
-----
|
||||
|
||||
### Android
|
||||
|
||||
1. Copy your splash screen image into the res/drawable directories of your Android project. The sizes of each image should be:
|
||||
|
||||
- xlarge (xhdpi): at least 960 x 720
|
||||
- large (hdpi): at least 640 x 480
|
||||
- medium (mdpi): at least 470 x 320
|
||||
- small (ldpi): at least 426 x 320
|
||||
|
||||
It is highly recommended that you use a [9-patch image](https://developer.android.com/tools/help/draw9patch.html) for your splash screen.
|
||||
|
||||
2. In the onCreate method of the class that extends DroidGap add the following two lines:
|
||||
|
||||
super.setIntegerProperty("splashscreen", R.drawable.splash);
|
||||
super.loadUrl(Config.getStartUrl(), 10000);
|
||||
|
||||
The first line 'super.setIntegerProperty' sets the image to be displayed as the splashscreen. If you have named your image anything other than splash.png you will have to modify this line.
|
||||
The second line is the normal 'super.loadUrl' line but it has a second parameter which is the timeout value for the splash screen. In this example the splash screen will display for 10 seconds. If you want to dismiss the splash screen once you get the "deviceready" event you should call the navigator.splashscreen.hide() method.
|
||||
|
||||
### iOS
|
||||
|
||||
1. Copy your splash screen images into the **Resources/splash** directory of your iOS project. Only add the images for the devices you want to support (iPad screen size or iPhone screen size). The sizes of each image should be:
|
||||
|
||||
- Default-568h@2x~iphone.png (640x1136 pixels)
|
||||
- Default-Landscape@2x~ipad.png (2048x1496 pixels)
|
||||
- Default-Landscape~ipad.png (1024x748 pixels)
|
||||
- Default-Portrait@2x~ipad.png (1536x2008 pixels)
|
||||
- Default-Portrait~ipad.png (768x1004 pixels)
|
||||
- Default@2x~iphone.png (640x960 pixels)
|
||||
- Default~iphone.png (320x480 pixels)
|
||||
|
||||
### BlackBerry10
|
||||
|
||||
## Quirks
|
||||
|
||||
The SplashScreen BlackBerry10 plugin implements hide(), but show() is not possible using the built in OS mechanism. The advantage to using this is the splash screen is displayed before WebKit boots and issupports multiple images for various device resolutions and orientations.
|
||||
We also implemented the AutoHideSplashScreen config.xml value, similar to iOS.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
license: Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
---
|
||||
|
||||
show
|
||||
===============
|
||||
|
||||
Displays the splash screen.
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
navigator.splashscreen.show() displays the applications splash screen.
|
||||
|
||||
Supported Platforms
|
||||
-------------------
|
||||
|
||||
- Android
|
||||
- iOS
|
||||
|
||||
Quick Example
|
||||
-------------
|
||||
|
||||
navigator.splashscreen.show();
|
||||
|
||||
Full Example
|
||||
------------
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Splashscreen Example</title>
|
||||
|
||||
<script type="text/javascript" charset="utf-8" src="cordova-x.x.x.js"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
|
||||
// Wait for Cordova to load
|
||||
//
|
||||
document.addEventListener("deviceready", onDeviceReady, false);
|
||||
|
||||
// Cordova is ready
|
||||
//
|
||||
function onDeviceReady() {
|
||||
navigator.splashscreen.show();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Example</h1>
|
||||
</body>
|
||||
</html>
|
||||
4192
package-lock.json
generated
Normal file
4192
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
54
package.json
Normal file
54
package.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "cordova-plugin-splashscreen",
|
||||
"version": "7.0.0-dev",
|
||||
"description": "Cordova Splashscreen Plugin",
|
||||
"types": "./types/index.d.ts",
|
||||
"cordova": {
|
||||
"id": "cordova-plugin-splashscreen",
|
||||
"platforms": [
|
||||
"browser"
|
||||
]
|
||||
},
|
||||
"repository": "github:apache/cordova-plugin-splashscreen",
|
||||
"bugs": "https://github.com/apache/cordova-plugin-splashscreen/issues",
|
||||
"keywords": [
|
||||
"cordova",
|
||||
"splashscreen",
|
||||
"ecosystem:cordova",
|
||||
"cordova-browser"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run lint",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"engines": {
|
||||
"cordovaDependencies": {
|
||||
"2.0.0": {
|
||||
"cordova-android": ">=3.6.0"
|
||||
},
|
||||
">=4.0.0": {
|
||||
"cordova-android": ">=3.6.0",
|
||||
"cordova-windows": ">=4.4.0"
|
||||
},
|
||||
"<6.0.0": {
|
||||
"cordova-ios": "<6.0.0"
|
||||
},
|
||||
"6.0.2": {
|
||||
"cordova-android": ">=3.6.0 <11.0.0",
|
||||
"cordova-windows": ">=4.4.0"
|
||||
},
|
||||
"<7.0.0": {
|
||||
"cordova-android": ">=3.6.0 <11.0.0",
|
||||
"cordova-windows": ">=4.4.0"
|
||||
},
|
||||
"8.0.0": {
|
||||
"cordova": ">100"
|
||||
}
|
||||
}
|
||||
},
|
||||
"author": "Apache Software Foundation",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@cordova/eslint-config": "^3.0.0"
|
||||
}
|
||||
}
|
||||
99
plugin.xml
99
plugin.xml
@@ -1,81 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="org.apache.cordova.splashscreen"
|
||||
version="0.2.2">
|
||||
id="cordova-plugin-splashscreen"
|
||||
version="7.0.0-dev">
|
||||
<name>Splashscreen</name>
|
||||
<description>Cordova Splashscreen Plugin</description>
|
||||
<license>Apache 2.0</license>
|
||||
<keywords>cordova,splashscreen</keywords>
|
||||
<repo>https://github.com/apache/cordova-plugin-splashscreen.git</repo>
|
||||
<issue>https://github.com/apache/cordova-plugin-splashscreen/issues</issue>
|
||||
<!-- browser -->
|
||||
<platform name="browser">
|
||||
<js-module src="src/browser/SplashScreenProxy.js" name="SplashScreenProxy">
|
||||
<runs />
|
||||
</js-module>
|
||||
|
||||
|
||||
<js-module src="www/splashscreen.js" name="SplashScreen">
|
||||
<clobbers target="navigator.splashscreen" />
|
||||
</js-module>
|
||||
|
||||
<!-- android -->
|
||||
<platform name="android">
|
||||
<config-file target="res/xml/config.xml" parent="/*">
|
||||
<feature name="SplashScreen">
|
||||
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen"/>
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/android/SplashScreen.java" target-dir="src/org/apache/cordova/splashscreen" />
|
||||
</platform>
|
||||
|
||||
<!-- ios -->
|
||||
<platform name="ios">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<feature name="SplashScreen">
|
||||
<param name="ios-package" value="CDVSplashScreen"/>
|
||||
<param name="onload" value="true"/>
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<header-file src="src/ios/CDVSplashScreen.h" />
|
||||
<source-file src="src/ios/CDVSplashScreen.m" />
|
||||
|
||||
<framework src="CoreGraphics.framework" />
|
||||
</platform>
|
||||
|
||||
<!-- blackberry10 -->
|
||||
<platform name="blackberry10">
|
||||
<source-file src="src/blackberry10/index.js" target-dir="SplashScreen" />
|
||||
<config-file target="www/config.xml" parent="/widget">
|
||||
<feature name="SplashScreen" value="SplashScreen"/>
|
||||
</config-file>
|
||||
</platform>
|
||||
|
||||
<!-- wp7 -->
|
||||
<platform name="wp7">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<feature name="SplashScreen">
|
||||
<param name="wp-package" value="SplashScreen"/>
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/wp/SplashScreen.cs" />
|
||||
|
||||
</platform>
|
||||
|
||||
<!-- wp8 -->
|
||||
<platform name="wp8">
|
||||
<config-file target="config.xml" parent="/*">
|
||||
<feature name="SplashScreen">
|
||||
<param name="wp-package" value="SplashScreen"/>
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/wp/SplashScreen.cs" />
|
||||
|
||||
</platform>
|
||||
|
||||
<!-- windows8 -->
|
||||
<platform name="windows8">
|
||||
<js-module src="www/windows8/SplashScreenProxy.js" name="SplashScreenProxy">
|
||||
<merges target="" />
|
||||
<js-module src="www/splashscreen.js" name="SplashScreen">
|
||||
<clobbers target="navigator.splashscreen" />
|
||||
</js-module>
|
||||
</platform>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
package org.apache.cordova.splashscreen;
|
||||
|
||||
import org.apache.cordova.CallbackContext;
|
||||
import org.apache.cordova.CordovaPlugin;
|
||||
import org.json.JSONArray;
|
||||
|
||||
public class SplashScreen extends CordovaPlugin {
|
||||
|
||||
@Override
|
||||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
|
||||
if (action.equals("hide")) {
|
||||
this.webView.postMessage("splashscreen", "hide");
|
||||
} else if (action.equals("show")){
|
||||
this.webView.postMessage("splashscreen", "show");
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
callbackContext.success();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 Research In Motion Limited.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
show: function (success, fail, args, env) {
|
||||
var result = new PluginResult(args, env);
|
||||
result.error("Not supported on platform", false);
|
||||
},
|
||||
|
||||
hide: function (success, fail, args, env) {
|
||||
var result = new PluginResult(args, env);
|
||||
window.qnx.webplatform.getApplication().windowVisible = true;
|
||||
result.ok(undefined, false);
|
||||
}
|
||||
};
|
||||
168
src/browser/SplashScreenProxy.js
Normal file
168
src/browser/SplashScreenProxy.js
Normal file
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
// Default parameter values including image size can be changed in `config.xml`
|
||||
var splashImageWidth = 170;
|
||||
var splashImageHeight = 200;
|
||||
var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
|
||||
var localSplash; // the image to display
|
||||
var localSplashImage;
|
||||
var bgColor = '#464646';
|
||||
var imageSrc = '/img/logo.png';
|
||||
var splashScreenDelay = 3000; // in milliseconds
|
||||
var showSplashScreen = true; // show splashcreen by default
|
||||
var cordova = require('cordova');
|
||||
var configHelper = cordova.require('cordova/confighelper');
|
||||
var autoHideSplashScreen = true;
|
||||
|
||||
function updateImageLocation () {
|
||||
position.width = Math.min(splashImageWidth, window.innerWidth);
|
||||
position.height = position.width * (splashImageHeight / splashImageWidth);
|
||||
|
||||
localSplash.style.width = window.innerWidth + 'px';
|
||||
localSplash.style.height = window.innerHeight + 'px';
|
||||
localSplash.style.top = '0px';
|
||||
localSplash.style.left = '0px';
|
||||
|
||||
localSplashImage.style.top = '50%';
|
||||
localSplashImage.style.left = '50%';
|
||||
localSplashImage.style.height = position.height + 'px';
|
||||
localSplashImage.style.width = position.width + 'px';
|
||||
localSplashImage.style.marginTop = (-position.height / 2) + 'px';
|
||||
localSplashImage.style.marginLeft = (-position.width / 2) + 'px';
|
||||
}
|
||||
|
||||
function onResize () {
|
||||
updateImageLocation();
|
||||
}
|
||||
|
||||
var SplashScreen = {
|
||||
setBGColor: function (cssBGColor) {
|
||||
bgColor = cssBGColor;
|
||||
if (localSplash) {
|
||||
localSplash.style.backgroundColor = bgColor;
|
||||
}
|
||||
},
|
||||
show: function () {
|
||||
if (!localSplash) {
|
||||
window.addEventListener('resize', onResize, false);
|
||||
localSplash = document.createElement('div');
|
||||
localSplash.style.backgroundColor = bgColor;
|
||||
localSplash.style.position = 'absolute';
|
||||
localSplash.style['z-index'] = '99999';
|
||||
|
||||
localSplashImage = document.createElement('img');
|
||||
localSplashImage.src = imageSrc;
|
||||
localSplashImage.style.position = 'absolute';
|
||||
|
||||
updateImageLocation();
|
||||
|
||||
localSplash.appendChild(localSplashImage);
|
||||
document.body.appendChild(localSplash);
|
||||
|
||||
// deviceready fires earlier than the plugin init on cold-start
|
||||
if (SplashScreen.shouldHideImmediately) {
|
||||
SplashScreen.shouldHideImmediately = false;
|
||||
window.setTimeout(function () {
|
||||
SplashScreen.hide();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
},
|
||||
hide: function () {
|
||||
if (localSplash) {
|
||||
var innerLocalSplash = localSplash;
|
||||
localSplash = null;
|
||||
window.removeEventListener('resize', onResize, false);
|
||||
|
||||
innerLocalSplash.style.opacity = '0';
|
||||
innerLocalSplash.style['-webkit-transition'] = 'opacity 1s ease-in-out';
|
||||
innerLocalSplash.style['-moz-transition'] = 'opacity 1s ease-in-out';
|
||||
innerLocalSplash.style['-ms-transition'] = 'opacity 1s ease-in-out';
|
||||
innerLocalSplash.style['-o-transition'] = 'opacity 1s ease-in-out';
|
||||
|
||||
window.setTimeout(function () {
|
||||
document.body.removeChild(innerLocalSplash);
|
||||
innerLocalSplash = null;
|
||||
}, 1000);
|
||||
} else {
|
||||
SplashScreen.shouldHideImmediately = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Reads preferences via ConfigHelper and substitutes default parameters.
|
||||
*/
|
||||
function readPreferencesFromCfg (cfg) {
|
||||
try {
|
||||
var value = cfg.getPreferenceValue('ShowSplashScreen');
|
||||
if (typeof value !== 'undefined') {
|
||||
showSplashScreen = value === 'true';
|
||||
}
|
||||
|
||||
splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
|
||||
splashScreenDelay = parseInt(splashScreenDelay, 10);
|
||||
|
||||
imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc;
|
||||
bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
|
||||
splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
|
||||
splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
|
||||
autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
|
||||
autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
|
||||
} catch (e) {
|
||||
var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
|
||||
console.error(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows and hides splashscreen if it is enabled, with a delay according the current preferences.
|
||||
*/
|
||||
function showAndHide () {
|
||||
if (showSplashScreen) {
|
||||
SplashScreen.show();
|
||||
|
||||
window.setTimeout(function () {
|
||||
SplashScreen.hide();
|
||||
}, splashScreenDelay);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to read config.xml and override default properties and then shows and hides splashscreen if it is enabled.
|
||||
*/
|
||||
(function initAndShow () {
|
||||
configHelper.readConfig(function (config) {
|
||||
readPreferencesFromCfg(config);
|
||||
if (autoHideSplashScreen) {
|
||||
showAndHide();
|
||||
} else {
|
||||
SplashScreen.show();
|
||||
}
|
||||
}, function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
})();
|
||||
|
||||
module.exports = SplashScreen;
|
||||
|
||||
require('cordova/exec/proxy').add('SplashScreen', SplashScreen);
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Cordova/CDVPlugin.h>
|
||||
|
||||
@interface CDVSplashScreen : CDVPlugin {
|
||||
UIActivityIndicatorView* _activityView;
|
||||
UIImageView* _imageView;
|
||||
NSString* _curImageName;
|
||||
BOOL _visible;
|
||||
}
|
||||
|
||||
- (void)show:(CDVInvokedUrlCommand*)command;
|
||||
- (void)hide:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
||||
@@ -1,233 +0,0 @@
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
#import "CDVSplashScreen.h"
|
||||
|
||||
#define kSplashScreenDurationDefault 0.25f
|
||||
|
||||
@implementation CDVSplashScreen
|
||||
|
||||
- (void)pluginInitialize
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:self.webView];
|
||||
|
||||
[self setVisible:YES];
|
||||
}
|
||||
|
||||
- (void)show:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
[self setVisible:YES];
|
||||
}
|
||||
|
||||
- (void)hide:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
[self setVisible:NO];
|
||||
}
|
||||
|
||||
- (void)pageDidLoad
|
||||
{
|
||||
id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]];
|
||||
|
||||
// if value is missing, default to yes
|
||||
if ((autoHideSplashScreenValue == nil) || [autoHideSplashScreenValue boolValue]) {
|
||||
[self setVisible:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context
|
||||
{
|
||||
[self updateImage];
|
||||
}
|
||||
|
||||
- (void)createViews
|
||||
{
|
||||
/*
|
||||
* The Activity View is the top spinning throbber in the status/battery bar. We init it with the default Grey Style.
|
||||
*
|
||||
* whiteLarge = UIActivityIndicatorViewStyleWhiteLarge
|
||||
* white = UIActivityIndicatorViewStyleWhite
|
||||
* gray = UIActivityIndicatorViewStyleGray
|
||||
*
|
||||
*/
|
||||
NSString* topActivityIndicator = [self.commandDelegate.settings objectForKey:[@"TopActivityIndicator" lowercaseString]];
|
||||
UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray;
|
||||
|
||||
if ([topActivityIndicator isEqualToString:@"whiteLarge"]) {
|
||||
topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge;
|
||||
} else if ([topActivityIndicator isEqualToString:@"white"]) {
|
||||
topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite;
|
||||
} else if ([topActivityIndicator isEqualToString:@"gray"]) {
|
||||
topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray;
|
||||
}
|
||||
|
||||
UIView* parentView = self.viewController.view;
|
||||
parentView.userInteractionEnabled = NO; // disable user interaction while splashscreen is shown
|
||||
_activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:topActivityIndicatorStyle];
|
||||
_activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2);
|
||||
_activityView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin
|
||||
| UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin;
|
||||
[_activityView startAnimating];
|
||||
|
||||
// Set the frame & image later.
|
||||
_imageView = [[UIImageView alloc] init];
|
||||
[parentView addSubview:_imageView];
|
||||
|
||||
id showSplashScreenSpinnerValue = [self.commandDelegate.settings objectForKey:[@"ShowSplashScreenSpinner" lowercaseString]];
|
||||
// backwards compatibility - if key is missing, default to true
|
||||
if ((showSplashScreenSpinnerValue == nil) || [showSplashScreenSpinnerValue boolValue]) {
|
||||
[parentView addSubview:_activityView];
|
||||
}
|
||||
|
||||
// Frame is required when launching in portrait mode.
|
||||
// Bounds for landscape since it captures the rotation.
|
||||
[parentView addObserver:self forKeyPath:@"frame" options:0 context:nil];
|
||||
[parentView addObserver:self forKeyPath:@"bounds" options:0 context:nil];
|
||||
|
||||
[self updateImage];
|
||||
}
|
||||
|
||||
- (void)destroyViews
|
||||
{
|
||||
[_imageView removeFromSuperview];
|
||||
[_activityView removeFromSuperview];
|
||||
_imageView = nil;
|
||||
_activityView = nil;
|
||||
_curImageName = nil;
|
||||
|
||||
self.viewController.view.userInteractionEnabled = YES; // re-enable user interaction upon completion
|
||||
[self.viewController.view removeObserver:self forKeyPath:@"frame"];
|
||||
[self.viewController.view removeObserver:self forKeyPath:@"bounds"];
|
||||
}
|
||||
|
||||
// Sets the view's frame and image.
|
||||
- (void)updateImage
|
||||
{
|
||||
UIInterfaceOrientation orientation = self.viewController.interfaceOrientation;
|
||||
|
||||
// Use UILaunchImageFile if specified in plist. Otherwise, use Default.
|
||||
NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
|
||||
|
||||
if (imageName) {
|
||||
imageName = [imageName stringByDeletingPathExtension];
|
||||
} else {
|
||||
imageName = @"Default";
|
||||
}
|
||||
|
||||
if (CDV_IsIPhone5()) {
|
||||
imageName = [imageName stringByAppendingString:@"-568h"];
|
||||
} else if (CDV_IsIPad()) {
|
||||
switch (orientation) {
|
||||
case UIInterfaceOrientationLandscapeLeft:
|
||||
case UIInterfaceOrientationLandscapeRight:
|
||||
imageName = [imageName stringByAppendingString:@"-Landscape"];
|
||||
break;
|
||||
|
||||
case UIInterfaceOrientationPortrait:
|
||||
case UIInterfaceOrientationPortraitUpsideDown:
|
||||
default:
|
||||
imageName = [imageName stringByAppendingString:@"-Portrait"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (![imageName isEqualToString:_curImageName]) {
|
||||
UIImage* img = [UIImage imageNamed:imageName];
|
||||
_imageView.image = img;
|
||||
_curImageName = imageName;
|
||||
}
|
||||
|
||||
// Check that splash screen's image exists before updating bounds
|
||||
if (_imageView.image) {
|
||||
[self updateBounds];
|
||||
} else {
|
||||
NSLog(@"WARNING: The splashscreen image named %@ was not found", imageName);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateBounds
|
||||
{
|
||||
UIImage* img = _imageView.image;
|
||||
CGRect imgBounds = CGRectMake(0, 0, img.size.width, img.size.height);
|
||||
|
||||
CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size;
|
||||
|
||||
// There's a special case when the image is the size of the screen.
|
||||
if (CGSizeEqualToSize(screenSize, imgBounds.size)) {
|
||||
CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
|
||||
imgBounds.origin.y -= statusFrame.size.height;
|
||||
if (!(IsAtLeastiOSVersion(@"7.0"))) {
|
||||
imgBounds.origin.y -= statusFrame.size.height;
|
||||
}
|
||||
} else {
|
||||
CGRect viewBounds = self.viewController.view.bounds;
|
||||
CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height;
|
||||
CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;
|
||||
// This matches the behaviour of the native splash screen.
|
||||
CGFloat ratio;
|
||||
if (viewAspect > imgAspect) {
|
||||
ratio = viewBounds.size.width / imgBounds.size.width;
|
||||
} else {
|
||||
ratio = viewBounds.size.height / imgBounds.size.height;
|
||||
}
|
||||
imgBounds.size.height *= ratio;
|
||||
imgBounds.size.width *= ratio;
|
||||
}
|
||||
|
||||
_imageView.frame = imgBounds;
|
||||
}
|
||||
|
||||
- (void)setVisible:(BOOL)visible
|
||||
{
|
||||
if (visible == _visible) {
|
||||
return;
|
||||
}
|
||||
_visible = visible;
|
||||
|
||||
id fadeSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreen" lowercaseString]];
|
||||
id fadeSplashScreenDuration = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreenDuration" lowercaseString]];
|
||||
|
||||
float fadeDuration = fadeSplashScreenDuration == nil ? kSplashScreenDurationDefault : [fadeSplashScreenDuration floatValue];
|
||||
|
||||
if ((fadeSplashScreenValue == nil) || ![fadeSplashScreenValue boolValue]) {
|
||||
fadeDuration = 0;
|
||||
}
|
||||
|
||||
// Never animate the showing of the splash screen.
|
||||
if (visible) {
|
||||
if (_imageView == nil) {
|
||||
[self createViews];
|
||||
}
|
||||
} else if (fadeDuration == 0) {
|
||||
[self destroyViews];
|
||||
} else {
|
||||
[UIView transitionWithView:self.viewController.view
|
||||
duration:fadeDuration
|
||||
options:UIViewAnimationOptionTransitionNone
|
||||
animations:^(void) {
|
||||
[_imageView setAlpha:0];
|
||||
[_activityView setAlpha:0];
|
||||
}
|
||||
|
||||
completion:^(BOOL finished) {
|
||||
[self destroyViews];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using Microsoft.Phone.Info;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace WPCordovaClassLib.Cordova.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Listens for changes to the state of the battery on the device.
|
||||
/// Currently only the "isPlugged" parameter available via native APIs.
|
||||
/// </summary>
|
||||
public class SplashScreen : BaseCommand
|
||||
{
|
||||
private Popup popup;
|
||||
|
||||
public SplashScreen()
|
||||
{
|
||||
Image SplashScreen = new Image();
|
||||
BitmapImage splash_image = new BitmapImage();
|
||||
splash_image.SetSource(Application.GetResourceStream(new Uri(@"SplashScreenImage.jpg", UriKind.Relative)).Stream);
|
||||
SplashScreen.Source = splash_image;
|
||||
|
||||
// Instansiate the popup and set the Child property of Popup to SplashScreen
|
||||
this.popup = new Popup() {IsOpen = false, Child = SplashScreen };
|
||||
// Orient the popup accordingly
|
||||
this.popup.HorizontalAlignment = HorizontalAlignment.Stretch;
|
||||
this.popup.VerticalAlignment = VerticalAlignment.Center;
|
||||
}
|
||||
|
||||
public void show(string options)
|
||||
{
|
||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
this.popup.IsOpen = true;
|
||||
});
|
||||
}
|
||||
public void hide(string options)
|
||||
{
|
||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
this.popup.IsOpen = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
70
test/cordova-incl.js
vendored
70
test/cordova-incl.js
vendored
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var PLAT;
|
||||
if (/Android/.exec(navigator.userAgent)) {
|
||||
PLAT = 'android';
|
||||
} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {
|
||||
PLAT = 'ios';
|
||||
} else if (/(BB10)|(PlayBook)|(BlackBerry)/.exec(navigator.userAgent)) {
|
||||
PLAT = 'blackberry';
|
||||
}
|
||||
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
var currentPath = scripts[scripts.length - 1].src;
|
||||
var platformCordovaPath = currentPath.replace("cordova-incl.js", "cordova." + PLAT + ".js");
|
||||
var normalCordovaPath = currentPath.replace("cordova-incl.js", "cordova.js");
|
||||
var cordovaPath = normalCordovaPath;
|
||||
|
||||
if (PLAT) {
|
||||
// XHR to local file is an error on some platforms, windowsphone for one
|
||||
try {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", platformCordovaPath, false);
|
||||
xhr.onreadystatechange = function() {
|
||||
|
||||
if (this.readyState == this.DONE && this.responseText.length > 0) {
|
||||
if(parseInt(this.status) >= 400){
|
||||
cordovaPath = normalCordovaPath;
|
||||
}else{
|
||||
cordovaPath = platformCordovaPath;
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
}
|
||||
catch(e){
|
||||
cordovaPath = normalCordovaPath;
|
||||
} // access denied!
|
||||
}
|
||||
|
||||
if (!window._doNotWriteCordovaScript) {
|
||||
document.write('<script type="text/javascript" charset="utf-8" src="' + cordovaPath + '"></script>');
|
||||
}
|
||||
|
||||
function backHome() {
|
||||
if (window.device && device.platform && device.platform.toLowerCase() == 'android') {
|
||||
navigator.app.backHistory();
|
||||
}
|
||||
else {
|
||||
window.history.go(-1);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0" />
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<title>Cordova Mobile Spec</title>
|
||||
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
|
||||
<script type="text/javascript" charset="utf-8" src="cordova-incl.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="main.js"></script>
|
||||
|
||||
</head>
|
||||
<body onload="init();" id="stage" class="theme">
|
||||
<h1>Apache Cordova Tests</h1>
|
||||
<div id="info">
|
||||
<h4>Platform: <span id="platform"> </span></h4>
|
||||
<h4>Version: <span id="version"> </span></h4>
|
||||
<h4>UUID: <span id="uuid"> </span></h4>
|
||||
<h4>Name: <span id="name"> </span></h4>
|
||||
<h4>Model: <span id="model"> </span></h4>
|
||||
<h4>Width: <span id="width"> </span>, Height: <span id="height">
|
||||
</span>, Color Depth: <span id="colorDepth"></span></h4>
|
||||
<h4>User-Agent: <span id="user-agent"> </span></h4>
|
||||
</div>
|
||||
<a href="autotest/index.html" class="btn large">Automatic Test</a>
|
||||
<a href="accelerometer/index.html" class="btn large">Accelerometer</a>
|
||||
<a href="audio/index.html" class="btn large">Audio Play/Record</a>
|
||||
<a href="battery/index.html" class="btn large">Battery</a>
|
||||
<a href="camera/index.html" class="btn large">Camera</a>
|
||||
<a href="compass/index.html" class="btn large">Compass</a>
|
||||
<a href="contacts/index.html" class="btn large">Contacts</a>
|
||||
<a href="events/index.html" class="btn large">Events</a>
|
||||
<a href="location/index.html" class="btn large">Location</a>
|
||||
<a href="lazyloadjs/index.html" class="btn large">Lazy Loading of cordova-incl.js</a>
|
||||
<a href="misc/index.html" class="btn large">Misc Content</a>
|
||||
<a href="network/index.html" class="btn large">Network</a>
|
||||
<a href="notification/index.html" class="btn large">Notification</a>
|
||||
<a href="splashscreen/index.html" class="btn large">Splashscreen</a>
|
||||
<a href="sql/index.html" class="btn large">Web SQL</a>
|
||||
<a href="storage/index.html" class="btn large">Local Storage</a>
|
||||
<a href="benchmarks/index.html" class="btn large">Benchmarks</a>
|
||||
<a href="inappbrowser/index.html" class="btn large">In App Browser</a>
|
||||
</body>
|
||||
</html>
|
||||
163
test/main.js
163
test/main.js
@@ -1,163 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
var deviceInfo = function() {
|
||||
document.getElementById("platform").innerHTML = device.platform;
|
||||
document.getElementById("version").innerHTML = device.version;
|
||||
document.getElementById("uuid").innerHTML = device.uuid;
|
||||
document.getElementById("name").innerHTML = device.name;
|
||||
document.getElementById("model").innerHTML = device.model;
|
||||
document.getElementById("width").innerHTML = screen.width;
|
||||
document.getElementById("height").innerHTML = screen.height;
|
||||
document.getElementById("colorDepth").innerHTML = screen.colorDepth;
|
||||
};
|
||||
|
||||
var getLocation = function() {
|
||||
var suc = function(p) {
|
||||
alert(p.coords.latitude + " " + p.coords.longitude);
|
||||
};
|
||||
var locFail = function() {
|
||||
};
|
||||
navigator.geolocation.getCurrentPosition(suc, locFail);
|
||||
};
|
||||
|
||||
var beep = function() {
|
||||
navigator.notification.beep(2);
|
||||
};
|
||||
|
||||
var vibrate = function() {
|
||||
navigator.notification.vibrate(0);
|
||||
};
|
||||
|
||||
function roundNumber(num) {
|
||||
var dec = 3;
|
||||
var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
|
||||
return result;
|
||||
}
|
||||
|
||||
var accelerationWatch = null;
|
||||
|
||||
function updateAcceleration(a) {
|
||||
document.getElementById('x').innerHTML = roundNumber(a.x);
|
||||
document.getElementById('y').innerHTML = roundNumber(a.y);
|
||||
document.getElementById('z').innerHTML = roundNumber(a.z);
|
||||
}
|
||||
|
||||
var toggleAccel = function() {
|
||||
if (accelerationWatch !== null) {
|
||||
navigator.accelerometer.clearWatch(accelerationWatch);
|
||||
updateAcceleration({
|
||||
x : "",
|
||||
y : "",
|
||||
z : ""
|
||||
});
|
||||
accelerationWatch = null;
|
||||
} else {
|
||||
var options = {};
|
||||
options.frequency = 1000;
|
||||
accelerationWatch = navigator.accelerometer.watchAcceleration(
|
||||
updateAcceleration, function(ex) {
|
||||
alert("accel fail (" + ex.name + ": " + ex.message + ")");
|
||||
}, options);
|
||||
}
|
||||
};
|
||||
|
||||
var preventBehavior = function(e) {
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
function dump_pic(data) {
|
||||
var viewport = document.getElementById('viewport');
|
||||
console.log(data);
|
||||
viewport.style.display = "";
|
||||
viewport.style.position = "absolute";
|
||||
viewport.style.top = "10px";
|
||||
viewport.style.left = "10px";
|
||||
document.getElementById("test_img").src = "data:image/jpeg;base64," + data;
|
||||
}
|
||||
|
||||
function fail(msg) {
|
||||
alert(msg);
|
||||
}
|
||||
|
||||
function show_pic() {
|
||||
navigator.camera.getPicture(dump_pic, fail, {
|
||||
quality : 50
|
||||
});
|
||||
}
|
||||
|
||||
function close() {
|
||||
var viewport = document.getElementById('viewport');
|
||||
viewport.style.position = "relative";
|
||||
viewport.style.display = "none";
|
||||
}
|
||||
|
||||
// This is just to do this.
|
||||
function readFile() {
|
||||
navigator.file.read('/sdcard/cordova.txt', fail, fail);
|
||||
}
|
||||
|
||||
function writeFile() {
|
||||
navigator.file.write('foo.txt', "This is a test of writing to a file",
|
||||
fail, fail);
|
||||
}
|
||||
|
||||
function contacts_success(contacts) {
|
||||
alert(contacts.length
|
||||
+ ' contacts returned.'
|
||||
+ (contacts[2] && contacts[2].name ? (' Third contact is ' + contacts[2].name.formatted)
|
||||
: ''));
|
||||
}
|
||||
|
||||
function get_contacts() {
|
||||
var obj = new ContactFindOptions();
|
||||
obj.filter = "";
|
||||
obj.multiple = true;
|
||||
obj.limit = 5;
|
||||
navigator.service.contacts.find(
|
||||
[ "displayName", "name" ], contacts_success,
|
||||
fail, obj);
|
||||
}
|
||||
|
||||
var networkReachableCallback = function(reachability) {
|
||||
// There is no consistency on the format of reachability
|
||||
var networkState = reachability.code || reachability;
|
||||
|
||||
var currentState = {};
|
||||
currentState[NetworkStatus.NOT_REACHABLE] = 'No network connection';
|
||||
currentState[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection';
|
||||
currentState[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection';
|
||||
|
||||
confirm("Connection type:\n" + currentState[networkState]);
|
||||
};
|
||||
|
||||
function check_network() {
|
||||
navigator.network.isReachable("www.mobiledevelopersolutions.com",
|
||||
networkReachableCallback, {});
|
||||
}
|
||||
|
||||
function init() {
|
||||
// the next line makes it impossible to see Contacts on the HTC Evo since it
|
||||
// doesn't have a scroll button
|
||||
// document.addEventListener("touchmove", preventBehavior, false);
|
||||
document.addEventListener("deviceready", deviceInfo, true);
|
||||
document.getElementById("user-agent").textContent = navigator.userAgent;
|
||||
}
|
||||
164
test/master.css
164
test/master.css
@@ -1,164 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
body {
|
||||
background:#222 none repeat scroll 0 0;
|
||||
color:#666;
|
||||
font-family:Helvetica;
|
||||
font-size:72%;
|
||||
line-height:1.5em;
|
||||
margin:0;
|
||||
border-top:1px solid #393939;
|
||||
}
|
||||
|
||||
#info{
|
||||
background:#ffa;
|
||||
border: 1px solid #ffd324;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
clear:both;
|
||||
margin:15px 6px 0;
|
||||
min-width:295px;
|
||||
max-width:97%;
|
||||
padding:4px 0px 2px 10px;
|
||||
word-wrap:break-word;
|
||||
margin-bottom:10px;
|
||||
display:inline-block;
|
||||
min-height: 160px;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
#info > h4{
|
||||
font-size:.95em;
|
||||
margin:5px 0;
|
||||
}
|
||||
|
||||
#stage.theme{
|
||||
padding-top:3px;
|
||||
}
|
||||
|
||||
/* Definition List */
|
||||
#stage.theme > dl{
|
||||
padding-top:10px;
|
||||
clear:both;
|
||||
margin:0;
|
||||
list-style-type:none;
|
||||
padding-left:10px;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
#stage.theme > dl > dt{
|
||||
font-weight:bold;
|
||||
float:left;
|
||||
margin-left:5px;
|
||||
}
|
||||
|
||||
#stage.theme > dl > dd{
|
||||
width:45px;
|
||||
float:left;
|
||||
color:#a87;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
/* Content Styling */
|
||||
#stage.theme > h1, #stage.theme > h2, #stage.theme > p{
|
||||
margin:1em 0 .5em 13px;
|
||||
}
|
||||
|
||||
#stage.theme > h1{
|
||||
color:#eee;
|
||||
font-size:1.6em;
|
||||
text-align:center;
|
||||
margin:0;
|
||||
margin-top:15px;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#stage.theme > h2{
|
||||
clear:both;
|
||||
margin:0;
|
||||
padding:3px;
|
||||
font-size:1em;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
/* Stage Buttons */
|
||||
#stage.theme .btn{
|
||||
border: 1px solid #555;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
text-align:center;
|
||||
display:inline-block;
|
||||
background:#444;
|
||||
width:150px;
|
||||
color:#9ab;
|
||||
font-size:1.1em;
|
||||
text-decoration:none;
|
||||
padding:1.2em 0;
|
||||
margin:3px 0px 3px 5px;
|
||||
}
|
||||
|
||||
#stage.theme .large{
|
||||
width:308px;
|
||||
padding:1.2em 0;
|
||||
}
|
||||
|
||||
#stage.theme .wide{
|
||||
width:100%;
|
||||
padding:1.2em 0;
|
||||
}
|
||||
|
||||
#stage.theme .backBtn{
|
||||
border: 1px solid #555;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
text-align:center;
|
||||
display:block;
|
||||
float:right;
|
||||
background:#666;
|
||||
width:75px;
|
||||
color:#9ab;
|
||||
font-size:1.1em;
|
||||
text-decoration:none;
|
||||
padding:1.2em 0;
|
||||
margin:3px 5px 3px 5px;
|
||||
}
|
||||
|
||||
#stage.theme .input{
|
||||
border: 1px solid #555;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
text-align:center;
|
||||
display:block;
|
||||
float:light;
|
||||
background:#888;
|
||||
color:#9cd;
|
||||
font-size:1.1em;
|
||||
text-decoration:none;
|
||||
padding:1.2em 0;
|
||||
margin:3px 0px 3px 5px;
|
||||
}
|
||||
|
||||
#stage.theme .numeric{
|
||||
width:100%;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
|
||||
<title>Cordova Mobile Spec</title>
|
||||
<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
|
||||
<script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
function showFor(duration) {
|
||||
navigator.splashscreen.show();
|
||||
window.setTimeout(function() {
|
||||
navigator.splashscreen.hide();
|
||||
}, 1000 * duration);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body id="stage" class="theme">
|
||||
<h1>Splashscreen</h1>
|
||||
<h2>Action</h2>
|
||||
<div class="btn large" onclick="showFor(1)">Show for 1 second</div>
|
||||
<div class="btn large" onclick="showFor(5)">Show for 5 seconds</div>
|
||||
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
|
||||
</body>
|
||||
</html>
|
||||
14
tests/package.json
Normal file
14
tests/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "cordova-plugin-splashscreen-tests",
|
||||
"version": "7.0.0-dev",
|
||||
"description": "",
|
||||
"cordova": {
|
||||
"id": "cordova-plugin-splashscreen-tests",
|
||||
"platforms": []
|
||||
},
|
||||
"keywords": [
|
||||
"ecosystem:cordova"
|
||||
],
|
||||
"author": "",
|
||||
"license": "Apache 2.0"
|
||||
}
|
||||
29
tests/plugin.xml
Normal file
29
tests/plugin.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||
id="cordova-plugin-splashscreen-tests"
|
||||
version="7.0.0-dev">
|
||||
<name>Cordova Splashscreen Plugin Tests</name>
|
||||
<license>Apache 2.0</license>
|
||||
|
||||
<js-module src="tests.js" name="tests">
|
||||
</js-module>
|
||||
</plugin>
|
||||
61
tests/tests.js
Normal file
61
tests/tests.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
exports.defineAutoTests = function () {
|
||||
describe('Splashscreen (cordova)', function () {
|
||||
it('splashscreen.spec.1 should exist', function () {
|
||||
expect(navigator.splashscreen).toBeDefined();
|
||||
});
|
||||
|
||||
it('splashscreen.spec.2 show method should exist', function () {
|
||||
expect(navigator.splashscreen.show).toBeDefined();
|
||||
expect(typeof navigator.splashscreen.show).toBe('function');
|
||||
});
|
||||
|
||||
it('splashscreen.spec.3 hide method should exist', function () {
|
||||
expect(navigator.splashscreen.hide).toBeDefined();
|
||||
expect(typeof navigator.splashscreen.hide).toBe('function');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
exports.defineManualTests = function (contentEl, createActionButton) {
|
||||
function showFor (duration) {
|
||||
navigator.splashscreen.show();
|
||||
window.setTimeout(function () {
|
||||
navigator.splashscreen.hide();
|
||||
}, 1000 * duration);
|
||||
}
|
||||
|
||||
contentEl.innerHTML = '<h1>Splashscreen Tests</h1>' +
|
||||
'<div id="show1"></div>' +
|
||||
'Expected result: Will show the Cordova splashscreen for 1 second' +
|
||||
'</p> <div id="show5"></div>' +
|
||||
'Expected result: Will show the Cordova splashscreen for 5 seconds';
|
||||
|
||||
createActionButton('Show for 1 second', function () {
|
||||
showFor(1);
|
||||
}, 'show1');
|
||||
|
||||
createActionButton('Show for 5 seconds', function () {
|
||||
showFor(5);
|
||||
}, 'show5');
|
||||
};
|
||||
17
types/index.d.ts
vendored
Normal file
17
types/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for Apache Cordova Splashscreen plugin
|
||||
// Project: https://github.com/apache/cordova-plugin-splashscreen
|
||||
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
//
|
||||
// Copyright (c) Microsoft Open Technologies Inc
|
||||
// Licensed under the MIT license.
|
||||
|
||||
interface Navigator {
|
||||
/** This plugin displays and hides a splash screen during application launch. */
|
||||
splashscreen: {
|
||||
/** Dismiss the splash screen. */
|
||||
hide(): void;
|
||||
/** Displays the splash screen. */
|
||||
show(): void;
|
||||
}
|
||||
}
|
||||
@@ -22,11 +22,11 @@
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
var splashscreen = {
|
||||
show:function() {
|
||||
exec(null, null, "SplashScreen", "show", []);
|
||||
show: function () {
|
||||
exec(null, null, 'SplashScreen', 'show', []);
|
||||
},
|
||||
hide:function() {
|
||||
exec(null, null, "SplashScreen", "hide", []);
|
||||
hide: function () {
|
||||
exec(null, null, 'SplashScreen', 'hide', []);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
/*global Windows:true */
|
||||
|
||||
var cordova = require('cordova'),
|
||||
channel = require('cordova/channel');
|
||||
|
||||
/* This is the actual implementation part that returns the result on Windows 8
|
||||
*/
|
||||
|
||||
var position = { x: 0, y: 0, width: 0, height: 0 }; // defined by evt.detail.splashScreen.imageLocation
|
||||
var splash = null; //
|
||||
var localSplash; // the image to display
|
||||
var localSplashImage;
|
||||
var bgColor = "#464646";
|
||||
|
||||
function onResize(evt) {
|
||||
if (splash) {
|
||||
position = splash.imageLocation;
|
||||
updateImageLocation();
|
||||
}
|
||||
}
|
||||
|
||||
function updateImageLocation() {
|
||||
localSplash.style.width = window.innerWidth + "px";
|
||||
localSplash.style.height = window.innerHeight + "px";
|
||||
localSplash.style.top = "0px";
|
||||
localSplash.style.left = "0px";
|
||||
|
||||
localSplashImage.style.top = position.y + "px";
|
||||
localSplashImage.style.left = position.x + "px";
|
||||
localSplashImage.style.height = position.height + "px";
|
||||
localSplashImage.style.width = position.width + "px";
|
||||
}
|
||||
|
||||
var SplashScreen = {
|
||||
setBGColor:function(cssBGColor) {
|
||||
bgColor = cssBGColor;
|
||||
if (localSplash) {
|
||||
localSplash.style.backgroundColor = bgColor;
|
||||
}
|
||||
},
|
||||
show:function(){
|
||||
window.addEventListener("resize", onResize, false);
|
||||
localSplash = document.createElement("div");
|
||||
localSplash.style.backgroundColor = bgColor;;
|
||||
localSplash.style.position = "absolute";
|
||||
|
||||
var img = localSplashImage = document.createElement("img");
|
||||
img.src = "img/splashscreen.png";
|
||||
img.style.position = "absolute";
|
||||
|
||||
updateImageLocation();
|
||||
|
||||
localSplash.appendChild(localSplashImage);
|
||||
document.body.appendChild(localSplash);
|
||||
},
|
||||
hide:function(){
|
||||
window.removeEventListener("resize", onResize, false);
|
||||
document.body.removeChild(localSplash);
|
||||
localSplash = null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SplashScreen;
|
||||
|
||||
function activated(evt) {
|
||||
if (evt.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {
|
||||
splash = evt.detail.splashScreen;
|
||||
position = evt.detail.splashScreen.imageLocation;
|
||||
SplashScreen.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
channel.onCordovaReady.subscribe(function (evt) {
|
||||
document.addEventListener("DOMContentLoaded", function (evt) {
|
||||
WinJS.Application.addEventListener("activated", activated, false);
|
||||
}, false);
|
||||
});
|
||||
|
||||
require("cordova/commandProxy").add("SplashScreen",SplashScreen);
|
||||
|
||||
Reference in New Issue
Block a user