summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-11-08 12:37:03 -0500
committerJules Laplace <jules@okfoc.us>2016-11-08 12:37:03 -0500
commitef4f212fc1482136dba1e690ec589b315b4a377f (patch)
tree0b7e16d72567fafcfd3e08d7c5c591ad07a63458 /StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
parent5fa81da81260d65113f57a293b6256d334fe8e2d (diff)
build 0.7.0
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js')
-rw-r--r--StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js48
1 files changed, 3 insertions, 45 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js b/StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
index 271a14ca..1003f061 100644
--- a/StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
+++ b/StoneIsland/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
@@ -20,57 +20,15 @@
*/
/*jslint sloppy:true */
-/*global Windows:true, require, module, window, document, WinJS */
-var cordova = require('cordova'),
- channel = require('cordova/channel');
-
-var isPhone = (cordova.platformId == "windows") && WinJS.Utilities.isPhone;
-var isHosted = window.location.protocol.indexOf('http') === 0;
-var localSplash = null;
-var bgColor = "#464646"; // default backgrond color; TDOO - read it from .appxmanifest
-var splashImageSrc = (isHosted ? "ms-appx-web" : "ms-appx") + ":///images/"
- + (isPhone ? "splashscreenphone.png" : "splashscreen.png");
+var splash = require('cordova/splashscreen');
var SplashScreen = {
- setBGColor: function (cssBGColor) {
- bgColor = cssBGColor;
- if (localSplash) {
- localSplash.style.backgroundColor = bgColor;
- }
- },
show: function () {
- if (localSplash) {
- return; // already showed
- }
-
- localSplash = document.createElement("div");
- localSplash.style.backgroundColor = bgColor;
- localSplash.style.position = "fixed";
- localSplash.style.top = "0";
- localSplash.style.width = "100%";
- localSplash.style.height = "100%";
-
- localSplashImage = document.createElement("img");
- localSplashImage.src = splashImageSrc;
- localSplashImage.style.maxWidth = "100%";
- localSplashImage.style.maxHeight = "100%";
- // center horizontally
- localSplashImage.style.margin = "0 auto";
- localSplashImage.style.display = "block";
- // center vertically
- localSplashImage.style.position = "relative";
- localSplashImage.style.top = "50%";
- localSplashImage.style.transform = "translateY(-50%)";
-
- localSplash.appendChild(localSplashImage);
- document.body.appendChild(localSplash);
+ splash.show();
},
hide: function () {
- if (localSplash) {
- document.body.removeChild(localSplash);
- localSplash = null;
- }
+ splash.hide();
}
};