Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/212#discussion_r89991524
  
    --- Diff: template/cordova/lib/prepare.js ---
    @@ -297,48 +305,80 @@ function applyNavigationWhitelist(config, manifest) {
         manifest.getApplication().setAccessRules(whitelistRules);
     }
     
    -function mapImageResources(images, imagesDir) {
    -    var pathMap = {};
    +// Platform default images
    +var platformImages = [
    +    {dest: 'Square150x150Logo.scale-100', width: 150, height: 150},
    +    {dest: 'Square30x30Logo.scale-100', width: 30, height: 30},
    +    {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
    +    {dest: 'StoreLogo.scale-240', width: 120, height: 120},
    +    {dest: 'Square44x44Logo.scale-100', width: 44, height: 44},
    +    {dest: 'Square44x44Logo.scale-240', width: 106, height: 106},
    +    {dest: 'Square70x70Logo.scale-100', width: 70, height: 70},
    +    {dest: 'Square71x71Logo.scale-100', width: 71, height: 71},
    +    {dest: 'Square71x71Logo.scale-240', width: 170, height: 170},
    +    {dest: 'Square150x150Logo.scale-240', width: 360, height: 360},
    +    {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) {
    +    if (!width && !height){
    +        // this could be default image,
    +        // Windows requires specific image dimension so we can't apply it
    +        return null;
    +    }
    +    for (var idx in platformImages){
    +        var res = platformImages[idx];
    +        // If only one of width or height is not specified, use another 
parameter for comparation
    +        // If both specified, compare both.
    +        if ((!width || (width == res.width)) &&
    +            (!height || (height == res.height))){
    +            return res;
    +        }
    +    }
    +    return null;
    +}
     
    -    // Platform default images
    -    var platformImages = [
    -        {dest: 'Square150x150Logo.scale-100.png', width: 150, height: 150},
    -        {dest: 'Square30x30Logo.scale-100.png', width: 30, height: 30},
    -        {dest: 'StoreLogo.scale-100.png', width: 50, height: 50},
    -        {dest: 'SplashScreen.scale-100.png', width: 620, height: 300},
    -        // scaled images are specified here for backward compatibility 
only so we can find them by size
    -        {dest: 'StoreLogo.scale-240.png', width: 120, height: 120},
    -        {dest: 'Square44x44Logo.scale-100.png', width: 44, height: 44},
    -        {dest: 'Square44x44Logo.scale-240.png', width: 106, height: 106},
    -        {dest: 'Square70x70Logo.scale-100.png', width: 70, height: 70},
    -        {dest: 'Square71x71Logo.scale-100.png', width: 71, height: 71},
    -        {dest: 'Square71x71Logo.scale-240.png', width: 170, height: 170},
    -        {dest: 'Square150x150Logo.scale-240.png', width: 360, height: 360},
    -        {dest: 'Square310x310Logo.scale-100.png', width: 310, height: 310},
    -        {dest: 'Wide310x150Logo.scale-100.png', width: 310, height: 150},
    -        {dest: 'Wide310x150Logo.scale-240.png', width: 744, height: 360},
    -        {dest: 'SplashScreenPhone.scale-240.png', width: 1152, height: 
1920}
    -    ];
    +/** Maps MRT splashscreen image to its target project defined in 
platformImages -> 8.1|WP8.1|10
    --- End diff --
    
    nit: another JSDoc format issue


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to