cleaned up js, removed unused requires, removed unused 'new' object function and defined directly

This commit is contained in:
Jesse MacFadyen 2014-03-12 12:17:04 -07:00
parent 3d5ed0a4f1
commit bdbaf12959

View File

@ -19,9 +19,7 @@
*
*/
var argscheck = require('cordova/argscheck'),
utils = require('cordova/utils'),
exec = require('cordova/exec');
var exec = require('cordova/exec');
var namedColors = {
"black": "#000000",
@ -41,43 +39,43 @@
};
// prime it
exec(function (res) {
StatusBar.isVisible = res;
}, null, "StatusBar", "_ready", []);
var StatusBar = function () {
};
var StatusBar = {
StatusBar.overlaysWebView = function (doOverlay) {
isVisible: true,
overlaysWebView: function (doOverlay) {
exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
};
},
StatusBar.styleDefault = function () {
// dark text on a light background
styleDefault: function () {
// dark text ( to be used on a light background )
exec(null, null, "StatusBar", "styleDefault", []);
};
},
StatusBar.styleLightContent = function () {
// light text on a dark background
styleLightContent: function () {
// light text ( to be used on a dark background )
exec(null, null, "StatusBar", "styleLightContent", []);
};
},
StatusBar.styleBlackTranslucent = function () {
styleBlackTranslucent: function () {
// #88000000 ? Apple says to use lightContent instead
exec(null, null, "StatusBar", "styleBlackTranslucent", []);
};
},
StatusBar.styleBlackOpaque = function () {
styleBlackOpaque: function () {
// #FF000000 ? Apple says to use lightContent instead
exec(null, null, "StatusBar", "styleBlackOpaque", []);
};
},
StatusBar.backgroundColorByName = function (colorname) {
backgroundColorByName: function (colorname) {
return StatusBar.backgroundColorByHexString(namedColors[colorname]);
}
},
StatusBar.backgroundColorByHexString = function (hexString) {
backgroundColorByHexString: function (hexString) {
if (hexString.indexOf("#") < 0) {
hexString = "#" + hexString;
}
@ -88,18 +86,18 @@
}
exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
}
},
StatusBar.hide = function () {
hide: function () {
exec(null, null, "StatusBar", "hide", []);
StatusBar.isVisible = false;
}
},
StatusBar.show = function () {
show: function () {
exec(null, null, "StatusBar", "show", []);
StatusBar.isVisible = true;
}
StatusBar.isVisible = true;
};
module.exports = StatusBar;