cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cordova-lib git commit: Adds copying of blackberry10 splashscreens - fixes CB-9653. This closes #342
Date Sat, 05 Dec 2015 01:35:01 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master b01e3bc69 -> 18eacea16


Adds copying of blackberry10 splashscreens - fixes CB-9653. This closes #342


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/18eacea1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/18eacea1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/18eacea1

Branch: refs/heads/master
Commit: 18eacea1694aa82169aba76130659aa8691194ab
Parents: b01e3bc
Author: Tim Windsor <timothy.windsor@gmail.com>
Authored: Wed Nov 11 15:47:29 2015 -0500
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Fri Dec 4 17:32:31 2015 -0800

----------------------------------------------------------------------
 .../src/cordova/metadata/blackberry10_parser.js | 34 +++++++++++++-------
 1 file changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/18eacea1/cordova-lib/src/cordova/metadata/blackberry10_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/blackberry10_parser.js b/cordova-lib/src/cordova/metadata/blackberry10_parser.js
index a29ca76..136a317 100644
--- a/cordova-lib/src/cordova/metadata/blackberry10_parser.js
+++ b/cordova-lib/src/cordova/metadata/blackberry10_parser.js
@@ -47,8 +47,23 @@ module.exports = blackberry_parser;
 blackberry_parser.prototype.update_from_config = function(config) {
     var projectRoot = util.isCordova(this.path),
         resDir = path.join(this.path, 'platform_www', 'res'),
+        platform_www = path.join(this.path, 'platform_www'),
         icons,
-        i;
+        splashscreens;
+
+    var copyResources = function(resList) {
+        for (var i = 0; i < resList.length; i++) {
+                var src = path.join(projectRoot, resList[i].src),
+                dest = path.join(platform_www, resList[i].src),
+                destFolder = path.dirname(dest);
+
+            if (!fs.existsSync(destFolder)) {
+                shell.mkdir('-p', destFolder); // make sure target dir exists
+            }
+            events.emit('verbose', 'Copying resource from ' + src + ' to ' + dest);
+            shell.cp('-f', src, dest);
+        }
+    };
 
     if (!config instanceof ConfigParser) {
         throw new Error('update_from_config requires a ConfigParser object');
@@ -59,17 +74,12 @@ blackberry_parser.prototype.update_from_config = function(config) {
 
     icons = config.getIcons('blackberry10');
     if (icons) {
-        for (i = 0; i < icons.length; i++) {
-            var src = path.join(projectRoot, icons[i].src),
-                dest = path.join(this.path, 'platform_www', icons[i].src),
-                destFolder = path.dirname(dest);
-
-            if (!fs.existsSync(destFolder)) {
-                shell.mkdir('-p', destFolder); // make sure target dir exists
-            }
-            events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
-            shell.cp('-f', src, dest);
-        }
+        copyResources(icons);
+    }
+    // blackberry10 splash images use custom element rim:splash
+    splashscreens = config.getStaticResources('blackberry10', 'rim:splash');
+    if (splashscreens) {
+        copyResources(splashscreens);
     }
 };
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message