You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/02/27 12:43:27 UTC
[cordova-windows] 09/26: remove 8.1 (...81) variables,
conditionals and expects
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a commit to branch janpio-win10only
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
commit 9bf5362e909585140b908c7763ce5cc4e748f833
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 23:11:17 2018 +0100
remove 8.1 (...81) variables, conditionals and expects
---
bin/lib/check_reqs.js | 4 +---
cordova-js-src/splashscreen.js | 16 ++++------------
spec/unit/ConfigChanges.spec.js | 16 ----------------
spec/unit/Prepare.Win10.spec.js | 21 ++-------------------
template/cordova/lib/prepare.js | 15 +--------------
5 files changed, 8 insertions(+), 64 deletions(-)
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index d2f0f70..951d785 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -177,9 +177,7 @@ function getInstalledWindowsSdks () {
}
/**
- * Gets list of installed Windows Phone SDKs. Separately searches for 8.1 Phone
- * SDK and Windows 10 SDK, because the latter is needed for both Windows and
- * Windows Phone applications.
+ * Gets list of installed Windows Phone SDKs.
*
* @return {Version[]} List of installed Phone SDKs' versions.
*/
diff --git a/cordova-js-src/splashscreen.js b/cordova-js-src/splashscreen.js
index 7cddd35..8acdcd0 100644
--- a/cordova-js-src/splashscreen.js
+++ b/cordova-js-src/splashscreen.js
@@ -156,13 +156,7 @@ function init(config, manifest) {
extendedSplashImage.classList.add('phone');
}
- if (isWp81) {
- extendedSplashProgress.classList.add('extended-splash-progress-phone');
- } else if (isWp10) {
- extendedSplashProgress.classList.add('extended-splash-progress-wp10');
- } else {
- extendedSplashProgress.classList.add('extended-splash-progress-desktop');
- }
+ extendedSplashProgress.classList.add('extended-splash-progress-wp10');
if (!showSplashScreenSpinner) {
extendedSplashProgress.classList.add('hidden');
@@ -267,12 +261,10 @@ function positionControls() {
extendedSplashImage.style.top = splash.imageLocation.y + 'px';
}
- if (!isWp81) {
- extendedSplashImage.style.height = splash.imageLocation.height + 'px';
- extendedSplashImage.style.width = splash.imageLocation.width + 'px';
+ extendedSplashImage.style.height = splash.imageLocation.height + 'px';
+ extendedSplashImage.style.width = splash.imageLocation.width + 'px';
- extendedSplashProgress.style.marginTop = Math.min(window.innerHeight - PROGRESSRING_HEIGHT - PROGRESSRING_BOTTOM_MARGIN, splash.imageLocation.y + splash.imageLocation.height + 32) + 'px';
- }
+ extendedSplashProgress.style.marginTop = Math.min(window.innerHeight - PROGRESSRING_HEIGHT - PROGRESSRING_BOTTOM_MARGIN, splash.imageLocation.y + splash.imageLocation.height + 32) + 'px';
}
// Updates the location of the extended splash screen image. Should be used to respond to window size changes.
diff --git a/spec/unit/ConfigChanges.spec.js b/spec/unit/ConfigChanges.spec.js
index 71ca461..80ed0b9 100644
--- a/spec/unit/ConfigChanges.spec.js
+++ b/spec/unit/ConfigChanges.spec.js
@@ -219,24 +219,8 @@ describe('generate_plugin_config_munge for windows project', function () {
var pluginInfoProvider = new PluginInfoProvider();
var munger = new configChanges.PlatformMunger('windows', tempDir, 'unused', null, pluginInfoProvider);
var munge = munger.generate_plugin_config_munge(new PluginInfo(configplugin), {});
- var windows81AppxManifest = munge.files['package.windows.appxmanifest'];
- var winphone81AppxManifest = munge.files['package.phone.appxmanifest'];
var windows10AppxManifest = munge.files['package.windows10.appxmanifest'];
- // 1 comes from versions="=8.1.0" + 1 from versions="=8.1.0" device-target="windows"
- expect(windows81AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />');
- expect(windows81AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win81-win-and-phone" />');
- expect(windows81AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-for-win81-win-only" />');
- expect(windows81AppxManifest.parents['/Parent/Capabilities'][3].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />');
- expect(windows81AppxManifest.parents['/Parent/Capabilities'].length).toBe(4);
-
- // 1 comes from versions="=8.1.0" + 1 from versions="=8.1.0" device-target="phone"
- expect(winphone81AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />');
- expect(winphone81AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win81-win-and-phone" />');
- expect(winphone81AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-for-win81-phone-only" />');
- expect(winphone81AppxManifest.parents['/Parent/Capabilities'][3].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />');
- expect(winphone81AppxManifest.parents['/Parent/Capabilities'].length).toBe(4);
-
expect(windows10AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />');
expect(windows10AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />');
expect(windows10AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-in-win10-only" />');
diff --git a/spec/unit/Prepare.Win10.spec.js b/spec/unit/Prepare.Win10.spec.js
index 52377be..afeff6e 100644
--- a/spec/unit/Prepare.Win10.spec.js
+++ b/spec/unit/Prepare.Win10.spec.js
@@ -34,12 +34,7 @@ var applyNavigationWhitelist = prepare.__get__('applyNavigationWhitelist');
var applyStartPage = prepare.__get__('applyStartPage');
var Win10ManifestPath = 'template/package.windows10.appxmanifest';
-var Win81ManifestPath = 'template/package.windows.appxmanifest';
-var WP81ManifestPath = 'template/package.phone.appxmanifest';
-
var Win10ManifestName = path.basename(Win10ManifestPath);
-var Win81ManifestName = path.basename(Win81ManifestPath);
-var WP81ManifestName = path.basename(WP81ManifestPath);
/***
* Unit tests for validating default ms-appx-web:// URI scheme in Win10
@@ -78,7 +73,7 @@ function createMockConfigAndManifestForApplyCoreProperties (startPage, preferenc
}
};
- var filePath = win10 ? Win10ManifestPath : Win81ManifestPath;
+ var filePath = Win10ManifestPath;
var manifest = AppxManifest.get(filePath);
spyOn(fs, 'writeFileSync');
@@ -249,7 +244,7 @@ function createMockConfigAndManifestForApplyAccessRules (isWin10) {
return [];
};
- var filePath = isWin10 ? Win10ManifestPath : Win81ManifestPath;
+ var filePath = Win10ManifestPath;
var manifest = AppxManifest.get(filePath);
spyOn(fs, 'writeFileSync');
@@ -603,21 +598,11 @@ describe('copyIcons method', function () {
spyOn(fs, 'writeFileSync');
var win10Manifest = AppxManifest.get(Win10ManifestPath);
- var win81Manifest = AppxManifest.get(Win81ManifestPath);
- var wp81Manifest = AppxManifest.get(WP81ManifestPath);
spyOn(AppxManifest, 'get').and.callFake(function (manifestPath) {
if (manifestPath.indexOf(Win10ManifestName) !== -1) {
return win10Manifest;
}
-
- if (manifestPath.indexOf(Win81ManifestName) !== -1) {
- return win81Manifest;
- }
-
- if (manifestPath.indexOf(WP81ManifestName) !== -1) {
- return wp81Manifest;
- }
});
var splashScreens = [
@@ -641,7 +626,5 @@ describe('copyIcons method', function () {
updateSplashScreenImageExtensions(project, locations);
expect(win10Manifest.getVisualElements().getSplashScreenExtension()).toBe('.jpg');
- expect(win81Manifest.getVisualElements().getSplashScreenExtension()).toBe('.jpg');
- expect(wp81Manifest.getVisualElements().getSplashScreenExtension()).toBe('.jpg');
});
});
diff --git a/template/cordova/lib/prepare.js b/template/cordova/lib/prepare.js
index e16b5de..31ecab0 100644
--- a/template/cordova/lib/prepare.js
+++ b/template/cordova/lib/prepare.js
@@ -50,8 +50,6 @@ var TEMPLATE =
var SUPPORTED_IMAGE_EXTENSIONS = ['.png', '.jpg', '.jpeg'];
var SPLASH_SCREEN_SIZE_LIMIT = 200 * 1024; // 200 KBytes
-var TARGET_PROJECT_81 = 'TARGET_PROJECT_81';
-var TARGET_PROJECT_WP81 = 'TARGET_PROJECT_WP81';
var TARGET_PROJECT_10 = 'TARGET_PROJECT_10';
var SPLASH_SCREEN_DESKTOP_TARGET_NAME = 'SplashScreen';
var SPLASH_SCREEN_PHONE_TARGET_NAME = 'SplashScreenPhone';
@@ -312,9 +310,7 @@ var PLATFORM_IMAGES = [
{dest: 'StoreLogo.scale-100', width: 50, height: 50},
{dest: 'SplashScreen.scale-100', width: 620, height: 300, targetProject: TARGET_PROJECT_10},
{dest: 'SplashScreen.scale-125', width: 775, height: 375, targetProject: TARGET_PROJECT_10},
- {dest: 'SplashScreen.scale-140', width: 868, height: 420, targetProject: TARGET_PROJECT_81},
{dest: 'SplashScreen.scale-150', width: 930, height: 450, targetProject: TARGET_PROJECT_10},
- {dest: 'SplashScreen.scale-180', width: 1116, height: 540, targetProject: TARGET_PROJECT_81},
{dest: 'SplashScreen.scale-200', width: 1240, height: 600, targetProject: TARGET_PROJECT_10},
{dest: 'SplashScreen.scale-400', width: 2480, height: 1200, targetProject: TARGET_PROJECT_10},
// scaled images are specified here for backward compatibility only so we can find them by size
@@ -328,9 +324,6 @@ var PLATFORM_IMAGES = [
{dest: 'Square310x310Logo.scale-100', width: 310, height: 310},
{dest: 'Wide310x150Logo.scale-100', width: 310, height: 150},
{dest: 'Wide310x150Logo.scale-240', width: 744, height: 360},
- {dest: 'SplashScreenPhone.scale-100', width: 480, height: 800, targetProject: TARGET_PROJECT_WP81},
- {dest: 'SplashScreenPhone.scale-140', width: 672, height: 1120, targetProject: TARGET_PROJECT_WP81},
- {dest: 'SplashScreenPhone.scale-240', width: 1152, height: 1920, targetProject: TARGET_PROJECT_WP81}
];
function findPlatformImage (width, height) {
@@ -514,13 +507,7 @@ function getTargetForImage (splash) {
return;
}
- if (targetImg.targetProject === TARGET_PROJECT_81 || targetImg.targetProject === TARGET_PROJECT_10) {
- return SPLASH_SCREEN_DESKTOP_TARGET_NAME;
- }
-
- if (targetImg.targetProject === TARGET_PROJECT_WP81) {
- return SPLASH_SCREEN_PHONE_TARGET_NAME;
- }
+ return SPLASH_SCREEN_DESKTOP_TARGET_NAME;
}
// Updates manifests to match the app splash screen image types (PNG/JPG/JPEG)
--
To stop receiving notification emails like this one, please contact
janpio@apache.org.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org