You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by al...@apache.org on 2017/07/11 08:57:31 UTC
[4/6] cordova-plugin-splashscreen git commit: CB-11487 (browser) The
"standard" AutoHideSplashScreen config.xml property is now supported by the
browser platform.
CB-11487 (browser) The "standard" AutoHideSplashScreen config.xml property is now supported by the browser platform.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/87d29ad6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/87d29ad6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/87d29ad6
Branch: refs/heads/master
Commit: 87d29ad6d3d5ddeaf2986b8c7b54d9e34bd46efc
Parents: 2db7bac
Author: Peter (Somogyvari) Metz <pe...@unarin.com>
Authored: Sun Jun 26 11:45:43 2016 +0100
Committer: Alexander Sorokin <al...@akvelon.com>
Committed: Tue Jul 11 10:55:18 2017 +0300
----------------------------------------------------------------------
src/browser/SplashScreenProxy.js | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/87d29ad6/src/browser/SplashScreenProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/SplashScreenProxy.js b/src/browser/SplashScreenProxy.js
index de907b5..ae38b2e 100644
--- a/src/browser/SplashScreenProxy.js
+++ b/src/browser/SplashScreenProxy.js
@@ -31,6 +31,7 @@ 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);
@@ -103,8 +104,10 @@ function readPreferencesFromCfg(cfg) {
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 occured on loading preferences from config.xml: ' + JSON.stringify(e);
+ var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
console.error(msg);
}
}
@@ -123,12 +126,17 @@ function showAndHide() {
}
/**
- * Tries to read config.xml and override default properties and then shows and hides splashcreen if it is enabled.
+ * 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);
- showAndHide();
+ if (autoHideSplashScreen) {
+ showAndHide();
+ } else {
+ SplashScreen.show();
+ }
+
}, function(err) {
console.error(err);
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org