cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [29/35] git commit: moved named color resolving to JS so platforms can just worry about hex values
Date Thu, 13 Mar 2014 23:14:42 GMT
moved named color resolving to JS so platforms can just worry about hex values



Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/83cc8464
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/83cc8464
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/83cc8464

Branch: refs/heads/dev
Commit: 83cc8464e10aa930067dabb0ee67e49bdac9c5f5
Parents: a4d6320
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Thu Mar 6 17:40:01 2014 -0800
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Thu Mar 6 17:40:01 2014 -0800

----------------------------------------------------------------------
 www/statusbar.js | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/83cc8464/www/statusbar.js
----------------------------------------------------------------------
diff --git a/www/statusbar.js b/www/statusbar.js
index 04b894b..9fee988 100644
--- a/www/statusbar.js
+++ b/www/statusbar.js
@@ -23,6 +23,23 @@ var argscheck = require('cordova/argscheck'),
     utils = require('cordova/utils'),
     exec = require('cordova/exec');
 
+var namedColors = {
+    "black":"#000000", 
+    "darkGray":"#A9A9A9", 
+    "lightGray":"#D3D3D3", 
+    "white":"#FFFFFF", 
+    "gray":"#808080", 
+    "red":"#FF0000", 
+    "green":"#00FF00", 
+    "blue":"#0000FF", 
+    "cyan":"#00FFFF", 
+    "yellow":"#FFFF00", 
+    "magenta":"#FF00FF", 
+    "orange":"##FFA500", 
+    "purple":"#800080", 
+    "brown":"#A52A2A"
+};
+
 // prime it
 exec(null, null, "StatusBar", "_ready", []);
 
@@ -50,7 +67,7 @@ StatusBar.styleBlackOpaque = function() {
 };
 
 StatusBar.backgroundColorByName = function(colorname) {
-    exec(null, null, "StatusBar", "backgroundColorByName", [colorname]);
+    return StatusBar.backgroundColorByHexString(namedColors[colorname]);
 }
 
 StatusBar.backgroundColorByHexString = function(hexString) {


Mime
View raw message