You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by petermetz <gi...@git.apache.org> on 2016/06/26 11:01:31 UTC
[GitHub] cordova-plugin-splashscreen pull request #107: Browser platform brought clos...
GitHub user petermetz opened a pull request:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Browser platform brought closer to iOS/Android behaviour
### Platforms affected
browser
### What does this PR do?
One bug-fix and 2 small features added that were already there for other platforms.
### What testing has been done on this change?
Went few the obvious permutations of the affected configuration parameters and checked them working on the following user agents:
* Chrome - 51.0.2704.103 (64-bit) - El Capitan, Macbook Pro
* Firefox - 47.0 - El Capitan, Macbook Pro
* Chrome 51.0.2704.81 - Android 5.1.1., Nexus 10
* Mobile Safari - iOS 9, iPhone 6
### Checklist
- [ x ] [ICLA](http://www.apache.org/licenses/icla.txt) has been signed and submitted to secretary@apache.org.
- [ x ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [ x ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [ x ] Added automated test coverage as appropriate for this change.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/petermetz/cordova-plugin-splashscreen master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-splashscreen/pull/107.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #107
----
commit dbd1e8b2608a47a773a559901345c25cd7bc31ac
Author: Peter (Somogyvari) Metz <pe...@unarin.com>
Date: 2016-06-26T10:41:44Z
CB-11486 (browser) splashScreenDelay now feed through parseInt to ensure it's an integer by the time it's value is passed in to setTimeout() in hide().
commit 795e5fe6bb6fb5dabeaec9eb42fa72ebfbb6f6a8
Author: Peter (Somogyvari) Metz <pe...@unarin.com>
Date: 2016-06-26T10:45:43Z
CB-11487 (browser) The "standard" AutoHideSplashScreen config.xml property is now supported by the browser platform.
commit 97cecc3f56d19c83a431d453c39a61f24d882c1d
Author: Peter (Somogyvari) Metz <pe...@unarin.com>
Date: 2016-06-26T10:49:08Z
CB-11488 (browser) Added a 1 second long fade out to the splash screen instead of the hard remove from the DOM whenever hide() is called.
Also made a high z-index the default. This could be added from the user's stylesheets but if that only
gets parsed later, there may be flickering between the application UI and the splash screen itself.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
@petermetz, thanks for your contribution!
The code looks good to me, although there is an issue that the splashscreen does not hide on server cold-start sometimes:
```javascript
// index.js
onDeviceReady: function() {
app.receivedEvent('deviceready');
navigator.splashscreen.hide();
},
```
It could be caused by the async nature of `initAndShow` which needs to retrieve and apply config.xml so that `hide` is called before `show`.
Proper solution could be to make the Browser platform wait for the splashscreen plugin init.
A workaround could be like this:
```javascript
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 (shouldHideImmediately) {
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 {
shouldHideImmediately = true;
}
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by cordova-qa <gi...@git.apache.org>.
Github user cordova-qa commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Cordova CI Build has completed successfully.
**Commit** - [Link](https://github.com/apache/cordova-plugin-splashscreen/pull/107/commits/acf6c3b64d97c9a65ee8559a75b75d41df00b506)
**Dashboard** - [Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19/)
| Builder Name | Console Output | Test Report | Device Logs |
| :---: | :---: | :---: | :---: |
| [Windows 8.1 Store]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-store/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-store/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-store/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-store/artifact/) |
| [Windows 10 Store]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-10-store/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-10-store/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-10-store/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-10-store/artifact/) |
| [Windows 8.1 Phone]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-phone/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-phone/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-phone/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=windows-8.1-phone/artifact/) |
| [iOS]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=ios/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=ios/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=ios/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=ios/artifact/) |
| [Android]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=android/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=android/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=android/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/19//PLATFORM=android/artifact/) |
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by ranma42 <gi...@git.apache.org>.
Github user ranma42 commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Is this PR ready for merge? Are there still issues that need to be fixed?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by alsorokin <gi...@git.apache.org>.
Github user alsorokin commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Tested and merged, thanks for the contribution!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen pull request #107: Browser platform brought clos...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by cordova-qa <gi...@git.apache.org>.
Github user cordova-qa commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Cordova CI Build has completed successfully.
**Commit** - [Link](https://github.com/apache/cordova-plugin-splashscreen/pull/107/commits/6cd1cc2c141945e7c637468fb7d08cb0bb9ec5cb)
**Dashboard** - [Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20/)
| Builder Name | Console Output | Test Report | Device Logs |
| :---: | :---: | :---: | :---: |
| [Windows 8.1 Store]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-store/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-store/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-store/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-store/artifact/) |
| [Windows 10 Store]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-10-store/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-10-store/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-10-store/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-10-store/artifact/) |
| [Windows 8.1 Phone]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-phone/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-phone/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-phone/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=windows-8.1-phone/artifact/) |
| [iOS]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=ios/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=ios/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=ios/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=ios/artifact/) |
| [Android]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=android/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=android/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=android/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/20//PLATFORM=android/artifact/) |
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by CelsoSantos <gi...@git.apache.org>.
Github user CelsoSantos commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Hello, @petermetz,
Any chance I could request a small change to this PR? I've modified my plugin code locally to get what I want and is really simple.
Basically on line `localSplash.style.backgroundColor = bgColor;` we can only set a BG color here.
What I want is to have a more complex definition for the background.
Example:
```
...
localSplash.style.background = bgColor; //or change the name if this var to bg, maybe?
...
```
Which means I can now have something like this on config.xml (notice the "complex" value):
```
<preference name="SplashScreenBackgroundColor" value="linear-gradient(0deg,rgba(7,14,18,0.9),rgba(19,38,50,0.85)), url('/assets/images/myimage.jpg') no-repeat top center fixed / cover"/>
```
Any chance this could be introduced along with your PR instead of me having to go through all the process to create a PR which is not nearly as complete as yours? (awesome work BTW)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by cordova-qa <gi...@git.apache.org>.
Github user cordova-qa commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Cordova CI Build has completed successfully.
**Commit** - [Link](https://github.com/apache/cordova-plugin-splashscreen/pull/107/commits/97cecc3f56d19c83a431d453c39a61f24d882c1d)
**Dashboard** - [Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18/)
| Builder Name | Console Output | Test Report | Device Logs |
| :---: | :---: | :---: | :---: |
| [Windows 8.1 Store]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-store/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-store/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-store/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-store/artifact/) |
| [Windows 10 Store]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-10-store/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-10-store/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-10-store/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-10-store/artifact/) |
| [Windows 8.1 Phone]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-phone/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-phone/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-phone/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=windows-8.1-phone/artifact/) |
| [iOS]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=ios/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=ios/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=ios/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=ios/artifact/) |
| [Android]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=android/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=android/console) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=android/testReport/) | [Link]( http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-splashscreen-pr/18//PLATFORM=android/artifact/) |
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by petermetz <gi...@git.apache.org>.
Github user petermetz commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
My pleasure, great to see it made it in! Thank you!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by petermetz <gi...@git.apache.org>.
Github user petermetz commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
Hi @daserge Thanks for the code, I've incorporated it in my PR (attached the shouldHideImmediately variable onto the plugin's reference to satisfy my linter, but otherwise it is exactly as you suggested).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org
[GitHub] cordova-plugin-splashscreen issue #107: Browser platform brought closer to i...
Posted by petermetz <gi...@git.apache.org>.
Github user petermetz commented on the issue:
https://github.com/apache/cordova-plugin-splashscreen/pull/107
@CelsoSantos Sorry for the late reply. Please feel free to do whatever you need/want to do to improve it and then just resubmit it as your own. I totally don't mind.
@ranma42 It always was ready as far as I'm concerned. Not sure about other opinions.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org