cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject git commit: Statusbar plugin moved to its own repo cordova-statusbar
Date Thu, 13 Mar 2014 19:59:25 GMT
Repository: cordova-plugins
Updated Branches:
  refs/heads/master 4354f7845 -> 5fe04d7ac


Statusbar plugin moved to its own repo cordova-statusbar


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/5fe04d7a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/5fe04d7a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/5fe04d7a

Branch: refs/heads/master
Commit: 5fe04d7ac86c955d98bf8ad07d0d848d0866be84
Parents: 4354f78
Author: Shazron Abdullah <shazron@apache.org>
Authored: Thu Mar 13 12:59:22 2014 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Thu Mar 13 12:59:22 2014 -0700

----------------------------------------------------------------------
 statusbar/README.md                  | 214 ----------------
 statusbar/plugin.xml                 |  67 -----
 statusbar/src/android/StatusBar.java |  90 -------
 statusbar/src/ios/CDVStatusBar.h     |  51 ----
 statusbar/src/ios/CDVStatusBar.m     | 409 ------------------------------
 statusbar/src/wp/StatusBar.cs        | 141 ----------
 statusbar/www/statusbar.js           | 103 --------
 7 files changed, 1075 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/README.md
----------------------------------------------------------------------
diff --git a/statusbar/README.md b/statusbar/README.md
deleted file mode 100644
index 5c05a38..0000000
--- a/statusbar/README.md
+++ /dev/null
@@ -1,214 +0,0 @@
-StatusBar
-======
-
-> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar.
-
-
-Preferences
------------
-
-#### config.xml
-
--  __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar
overlay or not overlay the WebView at startup.
-
-        <preference name="StatusBarOverlaysWebView" value="true" />
-            
-- __StatusBarBackgroundColor__ (color hex string, defaults to #000000). On iOS 7, set the
background color of the statusbar by a hex string (#RRGGBB) at startup.
-
-        <preference name="StatusBarBackgroundColor" value="#000000" />
-
-Hiding at startup
------------
-
-During runtime you can use the StatusBar.hide function below, but if you want the StatusBar
to be hidden at app startup, you must modify your app's Info.plist file.
-
-Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to
**"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit
it manually without Xcode, the keys and values are:
-
-
-	<key>UIStatusBarHidden</key>
-	<true/>
-	<key>UIViewControllerBasedStatusBarAppearance</key>
-	<false/>
-
- 
-Methods
--------
-
-- StatusBar.overlaysWebView
-- StatusBar.styleDefault
-- StatusBar.styleLightContent
-- StatusBar.styleBlackTranslucent
-- StatusBar.styleBlackOpaque
-- StatusBar.backgroundColorByName
-- StatusBar.backgroundColorByHexString
-- StatusBar.hide
-- StatusBar.show
-
-Properties
---------
-
-- StatusBar.isVisible
-
-Permissions
------------
-
-#### config.xml
-
-            <feature name="StatusBar">
-                <param name="ios-package" value="CDVStatusBar" onload="true" />
-            </feature>
-
-StatusBar.overlaysWebView
-=================
-
-On iOS 7, make the statusbar overlay or not overlay the WebView.
-
-    StatusBar.overlaysWebView(true);
-
-Description
------------
-
-On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background
color to suit using the other functions.
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-Quick Example
--------------
-
-    StatusBar.overlaysWebView(true);
-    StatusBar.overlaysWebView(false);
-
-StatusBar.styleDefault
-=================
-
-Use the default statusbar (dark text, for light backgrounds).
-
-    StatusBar.styleDefault();
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-StatusBar.styleLightContent
-=================
-
-Use the lightContent statusbar (light text, for dark backgrounds).
-
-    StatusBar.styleLightContent();
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-StatusBar.styleBlackTranslucent
-=================
-
-Use the blackTranslucent statusbar (light text, for dark backgrounds).
-
-    StatusBar.styleBlackTranslucent();
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-StatusBar.styleBlackOpaque
-=================
-
-Use the blackOpaque statusbar (light text, for dark backgrounds).
-
-    StatusBar.styleBlackOpaque();
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-
-StatusBar.backgroundColorByName
-=================
-
-On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background
color of the statusbar by color name.
-
-    StatusBar.backgroundColorByName("red");
-
-Supported color names are:
-
-    black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange,
purple, brown, clear
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-StatusBar.backgroundColorByHexString
-=================
-
-On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background
color of the statusbar by a hex string (#RRGGBB).
-
-    StatusBar.backgroundColorByHexString("#C0C0C0");
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-StatusBar.hide
-=================
-
-Hide the statusbar.
-
-    StatusBar.hide();
-
-
-Supported Platforms
--------------------
-
-- iOS
-- Android
-
-StatusBar.show
-=================
-
-Shows the statusbar.
-
-    StatusBar.show();
-
-
-Supported Platforms
--------------------
-
-- iOS
-- Android
-
-
-StatusBar.isVisible
-=================
-
-Read this property to see if the statusbar is visible or not.
-
-    if (StatusBar.isVisible) {
-    	// do something
-    }
-
-
-Supported Platforms
--------------------
-
-- iOS
-
-
-
-    
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/plugin.xml
----------------------------------------------------------------------
diff --git a/statusbar/plugin.xml b/statusbar/plugin.xml
deleted file mode 100644
index 6a6c59b..0000000
--- a/statusbar/plugin.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
-    xmlns:rim="http://www.blackberry.com/ns/widgets"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    id="org.apache.cordova.statusbar"
-    version="0.1.4">
-    <name>StatusBar</name>
-    <description>Cordova StatusBar Plugin</description>
-    <license>Apache 2.0</license>
-    <keywords>cordova,statusbar</keywords>
-
-    <engines>
-            <engine name="cordova" version=">=3.0.0" />
-    </engines>
-
-    <js-module src="www/statusbar.js" name="statusbar">
-        <clobbers target="window.StatusBar" />
-    </js-module>
-    
-    <platform name="android">
-        <source-file src="src/android/StatusBar.java" target-dir="src/org/apache/cordova/statusbar"
/>
-
-        <config-file target="res/xml/config.xml" parent="/*">
-            <feature name="StatusBar">
-                <param name="android-package" value="org.apache.cordova.statusbar.StatusBar"
onload="true" />
-            </feature>
-        </config-file>
-    </platform>
-
-    <!-- ios -->
-    <platform name="ios">
-
-        <config-file target="config.xml" parent="/*">
-            <feature name="StatusBar">
-                <param name="ios-package" value="CDVStatusBar" onload="true" />
-            </feature>
-            <preference name="StatusBarOverlaysWebView" value="true" />
-            <preference name="StatusBarBackgroundColor" value="#000000" />
-        </config-file>
-        
-        <header-file src="src/ios/CDVStatusBar.h" />
-        <source-file src="src/ios/CDVStatusBar.m" />
-        
-    </platform>
-
-    <!-- wp7 -->
-    <platform name="wp7">
-        <config-file target="config.xml" parent="/*">
-            <feature name="StatusBar">
-                <param name="wp-package" value="StatusBar"/>
-            </feature>
-        </config-file>
-        <source-file src="src/wp/StatusBar.cs" />
-    </platform>
-
-    <!-- wp8 -->
-    <platform name="wp8">
-        <config-file target="config.xml" parent="/*">
-            <feature name="StatusBar">
-                <param name="wp-package" value="StatusBar"/>
-            </feature>
-        </config-file>
-        <source-file src="src/wp/StatusBar.cs" />
-    </platform>
-
-</plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/src/android/StatusBar.java
----------------------------------------------------------------------
diff --git a/statusbar/src/android/StatusBar.java b/statusbar/src/android/StatusBar.java
deleted file mode 100644
index 24b018f..0000000
--- a/statusbar/src/android/StatusBar.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.cordova.statusbar;
-
-import android.app.Activity;
-import android.util.Log;
-import android.view.Window;
-import android.view.WindowManager;
-
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaArgs;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaWebView;
-import org.json.JSONException;
-
-public class StatusBar extends CordovaPlugin {
-    private static final String TAG = "StatusBar";
-
-    /**
-     * Sets the context of the Command. This can then be used to do things like
-     * get file paths associated with the Activity.
-     *
-     * @param cordova The context of the main Activity.
-     * @param webView The CordovaWebView Cordova is running in.
-     */
-    @Override
-    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
-        Log.v(TAG, "StatusBar: initialization");
-        super.initialize(cordova, webView);
-
-        // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
-        // by the Cordova.
-        Window window = this.cordova.getActivity().getWindow();
-        window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
-    }
-
-    /**
-     * Executes the request and returns PluginResult.
-     *
-     * @param action            The action to execute.
-     * @param args              JSONArry of arguments for the plugin.
-     * @param callbackContext   The callback id used when calling back into JavaScript.
-     * @return                  True if the action was valid, false otherwise.
-     */
-    @Override
-    public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
-        Log.v(TAG, "Executing action: " + action);
-        final Activity activity = this.cordova.getActivity();
-        final Window window = activity.getWindow();
-        if ("show".equals(action)) {
-            this.cordova.getActivity().runOnUiThread(new Runnable() {
-                @Override
-                public void run() {
-                    window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
-                }
-            });
-            return true;
-        }
-
-        if ("hide".equals(action)) {
-            this.cordova.getActivity().runOnUiThread(new Runnable() {
-                @Override
-                public void run() {
-                    window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
-                }
-            });
-            return true;
-        }
-
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/src/ios/CDVStatusBar.h
----------------------------------------------------------------------
diff --git a/statusbar/src/ios/CDVStatusBar.h b/statusbar/src/ios/CDVStatusBar.h
deleted file mode 100644
index df48d2d..0000000
--- a/statusbar/src/ios/CDVStatusBar.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDVPlugin.h>
-#import <Cordova/CDVInvokedUrlCommand.h>
-
-@interface CDVStatusBar : CDVPlugin {
-    @protected
-    BOOL _statusBarOverlaysWebView;
-    @protected
-    UIView* _statusBarBackgroundView;
-    @protected
-    BOOL _uiviewControllerBasedStatusBarAppearance;
-    @protected
-    UIColor* _statusBarBackgroundColor;
-}
-
-@property (atomic, assign) BOOL statusBarOverlaysWebView;
-
-- (void) overlaysWebView:(CDVInvokedUrlCommand*)command;
-
-- (void) styleDefault:(CDVInvokedUrlCommand*)command;
-- (void) styleLightContent:(CDVInvokedUrlCommand*)command;
-- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command;
-- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command;
-
-- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command;
-- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command;
-
-- (void) hide:(CDVInvokedUrlCommand*)command;
-- (void) show:(CDVInvokedUrlCommand*)command;
-    
-- (void) _ready:(CDVInvokedUrlCommand*)command;
-
-@end

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/src/ios/CDVStatusBar.m
----------------------------------------------------------------------
diff --git a/statusbar/src/ios/CDVStatusBar.m b/statusbar/src/ios/CDVStatusBar.m
deleted file mode 100644
index af93134..0000000
--- a/statusbar/src/ios/CDVStatusBar.m
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-/* 
- NOTE: plugman/cordova cli should have already installed this,
- but you need the value UIViewControllerBasedStatusBarAppearance
- in your Info.plist as well to set the styles in iOS 7
- */
-
-#import "CDVStatusBar.h"
-#import <objc/runtime.h>
-#import <Cordova/CDVViewController.h>
-
-static const void *kHideStatusBar = &kHideStatusBar;
-static const void *kStatusBarStyle = &kStatusBarStyle;
-
-@interface CDVViewController (StatusBar)
-
-@property (nonatomic, retain) id sb_hideStatusBar;
-@property (nonatomic, retain) id sb_statusBarStyle;
-    
-@end
-
-@implementation CDVViewController (StatusBar)
-
-@dynamic sb_hideStatusBar;
-@dynamic sb_statusBarStyle;
-    
-- (id)sb_hideStatusBar {
-    return objc_getAssociatedObject(self, kHideStatusBar);
-}
-    
-- (void)setSb_hideStatusBar:(id)newHideStatusBar {
-    objc_setAssociatedObject(self, kHideStatusBar, newHideStatusBar, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-- (id)sb_statusBarStyle {
-    return objc_getAssociatedObject(self, kStatusBarStyle);
-}
-    
-- (void)setSb_statusBarStyle:(id)newStatusBarStyle {
-    objc_setAssociatedObject(self, kStatusBarStyle, newStatusBarStyle, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-    
-- (BOOL) prefersStatusBarHidden {
-    return [self.sb_hideStatusBar boolValue];
-}
-    
-- (UIStatusBarStyle)preferredStatusBarStyle
-{
-    return (UIStatusBarStyle)[self.sb_statusBarStyle intValue];
-}
-    
-@end
-
-
-@implementation CDVStatusBar
-
-- (id)settingForKey:(NSString*)key
-{
-    return [self.commandDelegate.settings objectForKey:[key lowercaseString]];
-}
-
-- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change
context:(void*)context
-{
-    if ([keyPath isEqual:@"statusBarHidden"]) {
-        NSNumber* newValue = [change objectForKey:NSKeyValueChangeNewKey];
-        BOOL boolValue = [newValue boolValue];
-
-        [self.commandDelegate evalJs:[NSString stringWithFormat:@"StatusBar.isVisible = %@;",
boolValue? @"false" : @"true" ]];
-    }
-}
-
-- (void)pluginInitialize
-{
-    BOOL isiOS7 = (IsAtLeastiOSVersion(@"7.0"));
-                   
-    // init
-    NSNumber* uiviewControllerBasedStatusBarAppearance = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];
-    _uiviewControllerBasedStatusBarAppearance = (uiviewControllerBasedStatusBarAppearance
== nil || [uiviewControllerBasedStatusBarAppearance boolValue]) && isiOS7;
-    
-    // observe the statusBarHidden property
-    [[UIApplication sharedApplication] addObserver:self forKeyPath:@"statusBarHidden" options:NSKeyValueObservingOptionNew
context:NULL];
-    
-    _statusBarOverlaysWebView = YES; // default
-    
-    [self initializeStatusBarBackgroundView];
-
-    [self styleLightContent:nil]; // match default backgroundColor of #000000
-    self.viewController.view.autoresizesSubviews = YES;
-    
-    NSString* setting;
-    
-    setting  = @"StatusBarOverlaysWebView";
-    if ([self settingForKey:setting]) {
-        self.statusBarOverlaysWebView = [(NSNumber*)[self settingForKey:setting] boolValue];
-    }
-
-    setting  = @"StatusBarBackgroundColor";
-    if ([self settingForKey:setting]) {
-        [self _backgroundColorByHexString:[self settingForKey:setting]];
-    }
-}
-
-- (void) _ready:(CDVInvokedUrlCommand*)command
-{
-    // set the initial value
-    [self.commandDelegate evalJs:[NSString stringWithFormat:@"StatusBar.isVisible = %@;",
[UIApplication sharedApplication].statusBarHidden? @"false" : @"true" ]];
-}
-
-- (void) initializeStatusBarBackgroundView 
-{
-    CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
-    if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
-        // swap width and height. set origin to zero
-        statusBarFrame = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.size.width);
-    }
-
-    _statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];
-    _statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor;
-    _statusBarBackgroundView.autoresizingMask = (UIViewAutoresizingFlexibleWidth  | UIViewAutoresizingFlexibleBottomMargin);
-    _statusBarBackgroundView.autoresizesSubviews = YES;
-}
-
-- (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView
-{
-    // we only care about the latest iOS version or a change in setting
-    if (!IsAtLeastiOSVersion(@"7.0") || statusBarOverlaysWebView == _statusBarOverlaysWebView)
{
-        return;
-    }
-
-    CGRect bounds = [[UIScreen mainScreen] bounds];
-    
-    if (statusBarOverlaysWebView) {
-        
-        [_statusBarBackgroundView removeFromSuperview];
-        if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
-            self.webView.frame = CGRectMake(0, 0, bounds.size.height, bounds.size.width);
-        } else {
-            self.webView.frame = bounds;
-        }
-
-    } else {
-
-        CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
-
-        [self initializeStatusBarBackgroundView];
-
-        CGRect frame = self.webView.frame;
-
-        if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
-            frame.origin.y = statusBarFrame.size.width;
-            frame.size.height -= statusBarFrame.size.width;
-        } else {
-            frame.origin.y = statusBarFrame.size.height;
-            frame.size.height -= statusBarFrame.size.height;
-        }
-        
-        self.webView.frame = frame;
-        [self.webView.superview addSubview:_statusBarBackgroundView];
-    }
-    
-    _statusBarOverlaysWebView = statusBarOverlaysWebView;
-}
-
-- (BOOL) statusBarOverlaysWebView
-{
-    return _statusBarOverlaysWebView;
-}
-
-- (void) overlaysWebView:(CDVInvokedUrlCommand*)command
-{
-    id value = [command.arguments objectAtIndex:0];
-    if (!([value isKindOfClass:[NSNumber class]])) {
-        value = [NSNumber numberWithBool:YES];
-    }
-    
-    self.statusBarOverlaysWebView = [value boolValue];
-}
-
-- (void) refreshStatusBarAppearance
-{
-    SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
-    if ([self.viewController respondsToSelector:sel]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
-        [self.viewController performSelector:sel withObject:nil];
-#pragma clang diagnostic pop
-    }
-}
-    
-- (void) setStyleForStatusBar:(UIStatusBarStyle)style
-{
-    if (_uiviewControllerBasedStatusBarAppearance) {
-        CDVViewController* vc = (CDVViewController*)self.viewController;
-        vc.sb_statusBarStyle = [NSNumber numberWithInt:style];
-        [self refreshStatusBarAppearance];
-        
-    } else {
-        [[UIApplication sharedApplication] setStatusBarStyle:style];
-    }
-}
-    
-- (void) setStatusBarStyle:(NSString*)statusBarStyle
-{
-    // default, lightContent, blackTranslucent, blackOpaque
-    NSString* lcStatusBarStyle = [statusBarStyle lowercaseString];
-    
-    if ([lcStatusBarStyle isEqualToString:@"default"]) {
-        [self styleDefault:nil];
-    } else if ([lcStatusBarStyle isEqualToString:@"lightcontent"]) {
-        [self styleLightContent:nil];
-    } else if ([lcStatusBarStyle isEqualToString:@"blacktranslucent"]) {
-        [self styleBlackTranslucent:nil];
-    } else if ([lcStatusBarStyle isEqualToString:@"blackopaque"]) {
-        [self styleBlackOpaque:nil];
-    }
-}
-
-- (void) styleDefault:(CDVInvokedUrlCommand*)command
-{
-    [self setStyleForStatusBar:UIStatusBarStyleDefault];
-}
-
-- (void) styleLightContent:(CDVInvokedUrlCommand*)command
-{
-    [self setStyleForStatusBar:UIStatusBarStyleLightContent];
-}
-
-- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command
-{
-    [self setStyleForStatusBar:UIStatusBarStyleBlackTranslucent];
-}
-
-- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command
-{
-    [self setStyleForStatusBar:UIStatusBarStyleBlackOpaque];
-}
-
-- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
-{
-    id value = [command.arguments objectAtIndex:0];
-    if (!([value isKindOfClass:[NSString class]])) {
-        value = @"black";
-    }
-    
-    SEL selector = NSSelectorFromString([value stringByAppendingString:@"Color"]);
-    if ([UIColor respondsToSelector:selector]) {
-        _statusBarBackgroundView.backgroundColor = [UIColor performSelector:selector];
-    }
-}
-
-- (void) _backgroundColorByHexString:(NSString*)hexString
-{
-    unsigned int rgbValue = 0;
-    NSScanner* scanner = [NSScanner scannerWithString:hexString];
-    [scanner setScanLocation:1];
-    [scanner scanHexInt:&rgbValue];
-    
-    _statusBarBackgroundColor = [UIColor colorWithRed:((rgbValue & 0xFF0000) >>
16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0
alpha:1.0];
-    _statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor;
-}
-
-- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command
-{
-    NSString* value = [command.arguments objectAtIndex:0];
-    if (!([value isKindOfClass:[NSString class]])) {
-        value = @"#000000";
-    }
-    
-    if (![value hasPrefix:@"#"] || [value length] < 7) {
-        return;
-    }
-    
-    [self _backgroundColorByHexString:value];
-}
-
-- (void) hideStatusBar
-{
-    if (_uiviewControllerBasedStatusBarAppearance) {
-        CDVViewController* vc = (CDVViewController*)self.viewController;
-        vc.sb_hideStatusBar = [NSNumber numberWithBool:YES];
-        [self refreshStatusBarAppearance];
-
-    } else {
-        UIApplication* app = [UIApplication sharedApplication];
-        [app setStatusBarHidden:YES];
-    }
-}
-    
-- (void) hide:(CDVInvokedUrlCommand*)command
-{
-    UIApplication* app = [UIApplication sharedApplication];
-    
-    if (!app.isStatusBarHidden)
-    {
-        self.viewController.wantsFullScreenLayout = YES;
-        CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
-        
-        [self hideStatusBar];
-
-        if (IsAtLeastiOSVersion(@"7.0")) {
-            [_statusBarBackgroundView removeFromSuperview];
-        }
-        
-        if (!_statusBarOverlaysWebView) {
-        
-            CGRect frame = self.webView.frame;
-            frame.origin.y = 0;
-        
-            if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation))
{
-                frame.size.height += statusBarFrame.size.width;
-            } else {
-                frame.size.height += statusBarFrame.size.height;
-            }
-            
-            self.webView.frame = frame;
-        }
-        
-        _statusBarBackgroundView.hidden = YES;
-    }
-}
-    
-- (void) showStatusBar
-{
-    if (_uiviewControllerBasedStatusBarAppearance) {
-        CDVViewController* vc = (CDVViewController*)self.viewController;
-        vc.sb_hideStatusBar = [NSNumber numberWithBool:NO];
-        [self refreshStatusBarAppearance];
-
-    } else {
-        UIApplication* app = [UIApplication sharedApplication];
-        [app setStatusBarHidden:NO];
-    }
-}
-    
-- (void) show:(CDVInvokedUrlCommand*)command
-{
-    UIApplication* app = [UIApplication sharedApplication];
-    
-    if (app.isStatusBarHidden)
-    {
-        BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
-        self.viewController.wantsFullScreenLayout = isIOS7;
-        
-        [self showStatusBar];
-        
-        if (isIOS7) {
-            CGRect frame = self.webView.frame;
-            self.viewController.view.frame = [[UIScreen mainScreen] bounds];
-            
-            CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
-            
-            if (!self.statusBarOverlaysWebView) {
-                
-                // there is a possibility that when the statusbar was hidden, it was in a
different orientation
-                // from the current one. Therefore we need to expand the statusBarBackgroundView
as well to the
-                // statusBar's current size
-                CGRect sbBgFrame = _statusBarBackgroundView.frame;
-                
-                if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation))
{
-                    frame.origin.y = statusBarFrame.size.width;
-                    frame.size.height -= statusBarFrame.size.width;
-                    sbBgFrame.size = CGSizeMake(statusBarFrame.size.height, statusBarFrame.size.width);
-                } else {
-                    frame.origin.y = statusBarFrame.size.height;
-                    frame.size.height -= statusBarFrame.size.height;
-                    sbBgFrame.size = statusBarFrame.size;
-                }
-                
-                _statusBarBackgroundView.frame = sbBgFrame;
-                [self.webView.superview addSubview:_statusBarBackgroundView];
-            }
-
-            self.webView.frame = frame;
-            
-        } else {
-            
-            CGRect bounds = [[UIScreen mainScreen] applicationFrame];
-            self.viewController.view.frame = bounds;
-        }
-        
-        _statusBarBackgroundView.hidden = NO;
-    }
-}
-
-- (void) dealloc
-{
-    [[UIApplication sharedApplication] removeObserver:self forKeyPath:@"statusBarHidden"];
-}
-
-
-@end

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/src/wp/StatusBar.cs
----------------------------------------------------------------------
diff --git a/statusbar/src/wp/StatusBar.cs b/statusbar/src/wp/StatusBar.cs
deleted file mode 100644
index ec83ca8..0000000
--- a/statusbar/src/wp/StatusBar.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-/*  
-	Licensed under the Apache License, Version 2.0 (the "License");
-	you may not use this file except in compliance with the License.
-	You may obtain a copy of the License at
-	
-	http://www.apache.org/licenses/LICENSE-2.0
-	
-	Unless required by applicable law or agreed to in writing, software
-	distributed under the License is distributed on an "AS IS" BASIS,
-	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	See the License for the specific language governing permissions and
-	limitations under the License.
-*/
-
-
-using Microsoft.Phone.Shell;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.Threading;
-using System.Windows;
-using System.Windows.Media;
-using System.Windows.Threading;
-
-
-/*
- *   http://www.idev101.com/code/User_Interface/StatusBar.html
- *   https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html
- *   https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/c/econst/UIStatusBarStyleDefault
- * */
-
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-    public class StatusBar : BaseCommand
-    {
-
-        // returns an argb value, if the hex is only rgb, it will be full opacity
-        protected Color ColorFromHex(string hexString)
-        {
-            string cleanHex = hexString.Replace("#", "").Replace("0x", "");
-            // turn #FFF into #FFFFFF
-            if (cleanHex.Length == 3)
-            {
-                cleanHex = "" + cleanHex[0] + cleanHex[0] + cleanHex[1] + cleanHex[1] + cleanHex[2]
+ cleanHex[2];
-            }
-            // add an alpha 100% if it is missing
-            if (cleanHex.Length == 6)
-            {
-                cleanHex = "FF" + cleanHex;
-            }
-            int argb = Int32.Parse(cleanHex, NumberStyles.HexNumber);
-            Color clr = Color.FromArgb((byte)((argb & 0xff000000) >> 0x18),
-                              (byte)((argb & 0xff0000) >> 0x10),
-                              (byte)((argb & 0xff00) >> 8),
-                              (byte)(argb & 0xff));
-            return clr;
-        }
-
-        public void _ready(string options)
-        {
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                bool isVis = SystemTray.IsVisible;
-                // TODO: pass this to JS
-                //Debug.WriteLine("Result::" + res);
-                DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isVis));
-            });
-        }
-
-        public void overlaysWebView(string options)
-        {    //exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
-             // string arg = JSON.JsonHelper.Deserialize<string[]>(options)[0];
-        }
-
-        public void styleDefault(string options)
-        {    //exec(null, null, "StatusBar", "styleDefault", []);
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                SystemTray.ForegroundColor = Colors.Black;
-            });
-        }
-
-        public void styleLightContent(string options)
-        {    //exec(null, null, "StatusBar", "styleLightContent", []);
-            
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                SystemTray.ForegroundColor = Colors.White;
-            });
-        }
-
-        public void styleBlackTranslucent(string options)
-        {    //exec(null, null, "StatusBar", "styleBlackTranslucent", []);
-            styleLightContent(options);
-        }
-
-        public void styleBlackOpaque(string options)
-        {    //exec(null, null, "StatusBar", "styleBlackOpaque", []);
-            styleLightContent(options);
-        }
-
-        public void backgroundColorByName(string options)
-        {    //exec(null, null, "StatusBar", "backgroundColorByName", [colorname]);
-             // this should NOT be called, js should now be using/converting color names
to hex 
-        }
-
-        public void backgroundColorByHexString(string options)
-        {    //exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
-            string argb = JSON.JsonHelper.Deserialize<string[]>(options)[0];
-
-            Color clr = ColorFromHex(argb);
-              
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                SystemTray.Opacity = clr.A / 255.0d;
-                SystemTray.BackgroundColor = clr;
-                
-            });
-        }
-
-        public void hide(string options)
-        {    //exec(null, null, "StatusBar", "hide", []);
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                SystemTray.IsVisible = false;
-            });
-
-        }
-
-        public void show(string options)
-        {    //exec(null, null, "StatusBar", "show", []);
-            Deployment.Current.Dispatcher.BeginInvoke(() =>
-            {
-                SystemTray.IsVisible = true;
-            });
-        }
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/5fe04d7a/statusbar/www/statusbar.js
----------------------------------------------------------------------
diff --git a/statusbar/www/statusbar.js b/statusbar/www/statusbar.js
deleted file mode 100644
index 6f4e879..0000000
--- a/statusbar/www/statusbar.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var 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(function (res) {
-    StatusBar.isVisible = res;
-}, null, "StatusBar", "_ready", []);
-
-var StatusBar = {
-
-    isVisible: true,
-
-    overlaysWebView: function (doOverlay) {
-        exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
-    },
-
-    styleDefault: function () {
-        // dark text ( to be used on a light background )
-        exec(null, null, "StatusBar", "styleDefault", []);
-    },
-
-    styleLightContent: function () {
-        // light text ( to be used on a dark background )
-        exec(null, null, "StatusBar", "styleLightContent", []);
-    },
-
-    styleBlackTranslucent: function () {
-        // #88000000 ? Apple says to use lightContent instead
-        exec(null, null, "StatusBar", "styleBlackTranslucent", []);
-    },
-
-    styleBlackOpaque: function () {
-        // #FF000000 ? Apple says to use lightContent instead
-        exec(null, null, "StatusBar", "styleBlackOpaque", []);
-    },
-
-    backgroundColorByName: function (colorname) {
-        return StatusBar.backgroundColorByHexString(namedColors[colorname]);
-    },
-
-    backgroundColorByHexString: function (hexString) {
-        if (hexString.indexOf("#") < 0) {
-            hexString = "#" + hexString;
-        }
-
-        if (hexString.length == 4) {
-            var split = hexString.split("");
-            hexString = "#" + hexString[1] + hexString[1] + hexString[2] + hexString[2] +
hexString[3] + hexString[3];
-        }
-
-        exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
-    },
-
-    hide: function () {
-        exec(null, null, "StatusBar", "hide", []);
-        StatusBar.isVisible = false;
-    },
-
-    show: function () {
-        exec(null, null, "StatusBar", "show", []);
-        StatusBar.isVisible = true;
-    }
-
-};
-
-module.exports = StatusBar;


Mime
View raw message