You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2022/09/29 11:13:21 UTC

[cordova-plugin-statusbar] branch master updated: fix: remove deprecated windows platform (#245)

This is an automated email from the ASF dual-hosted git repository.

jcesarmobile pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-statusbar.git


The following commit(s) were added to refs/heads/master by this push:
     new 76b56a5  fix: remove deprecated windows platform (#245)
76b56a5 is described below

commit 76b56a5be8571d357108204b66c486a999e1746e
Author: jcesarmobile <jc...@gmail.com>
AuthorDate: Thu Sep 29 13:13:16 2022 +0200

    fix: remove deprecated windows platform (#245)
---
 README.md                     |  11 +----
 package.json                  |   6 +--
 plugin.xml                    |   6 ---
 src/windows/StatusBarProxy.js | 106 ------------------------------------------
 4 files changed, 4 insertions(+), 125 deletions(-)

diff --git a/README.md b/README.md
index fc1b057..07c4cd8 100644
--- a/README.md
+++ b/README.md
@@ -171,7 +171,6 @@ Supported Platforms
 
 - iOS
 - Android 6+
-- Windows
 
 StatusBar.styleLightContent
 =================
@@ -186,7 +185,6 @@ Supported Platforms
 
 - iOS
 - Android 6+
-- Windows
 
 StatusBar.backgroundColorByName
 =================
@@ -204,8 +202,7 @@ Supported Platforms
 -------------------
 
 - iOS
-- Android 5+
-- Windows
+- Android
 
 StatusBar.backgroundColorByHexString
 =================
@@ -227,8 +224,7 @@ Supported Platforms
 -------------------
 
 - iOS
-- Android 5+
-- Windows
+- Android
 
 StatusBar.hide
 =================
@@ -243,7 +239,6 @@ Supported Platforms
 
 - iOS
 - Android
-- Windows
 
 StatusBar.show
 =================
@@ -258,7 +253,6 @@ Supported Platforms
 
 - iOS
 - Android
-- Windows
 
 StatusBar.isVisible
 =================
@@ -275,7 +269,6 @@ Supported Platforms
 
 - iOS
 - Android
-- Windows
 
 statusTap
 =========
diff --git a/package.json b/package.json
index 9436392..71b3cbf 100644
--- a/package.json
+++ b/package.json
@@ -7,8 +7,7 @@
     "id": "cordova-plugin-statusbar",
     "platforms": [
       "android",
-      "ios",
-      "windows"
+      "ios"
     ]
   },
   "repository": "github:apache/cordova-plugin-statusbar",
@@ -18,8 +17,7 @@
     "statusbar",
     "ecosystem:cordova",
     "cordova-android",
-    "cordova-ios",
-    "cordova-windows"
+    "cordova-ios"
   ],
   "scripts": {
     "test": "npm run lint",
diff --git a/plugin.xml b/plugin.xml
index be15d2e..a57dfdd 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -67,10 +67,4 @@
         <header-file src="src/ios/CDVStatusBar.h" />
         <source-file src="src/ios/CDVStatusBar.m" />
     </platform>
-
-    <platform name="windows">
-        <js-module src="src/windows/StatusBarProxy.js" name="StatusBarProxy">
-            <runs />
-        </js-module>
-    </platform>
 </plugin>
diff --git a/src/windows/StatusBarProxy.js b/src/windows/StatusBarProxy.js
deleted file mode 100644
index 07c5a31..0000000
--- a/src/windows/StatusBarProxy.js
+++ /dev/null
@@ -1,106 +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.
- *
- */
-
-/* global Windows */
-
-var _supported = null; // set to null so we can check first time
-
-function isSupported () {
-    // if not checked before, run check
-    if (_supported === null) {
-        var viewMan = Windows.UI.ViewManagement;
-        _supported = viewMan.StatusBar && viewMan.StatusBar.getForCurrentView;
-    }
-    return _supported;
-}
-
-function getViewStatusBar () {
-    if (!isSupported()) {
-        throw new Error('Status bar is not supported');
-    }
-    return Windows.UI.ViewManagement.StatusBar.getForCurrentView();
-}
-
-function hexToRgb (hex) {
-    // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
-    var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
-    hex = hex.replace(shorthandRegex, function (m, r, g, b) {
-        return r + r + g + g + b + b;
-    });
-
-    var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
-    return result
-        ? {
-            r: parseInt(result[1], 16),
-            g: parseInt(result[2], 16),
-            b: parseInt(result[3], 16)
-        }
-        : null;
-}
-
-module.exports = {
-    _ready: function (win, fail) {
-        if (isSupported()) {
-            var statusBar = getViewStatusBar();
-            win(statusBar.occludedRect.height !== 0);
-        }
-    },
-    overlaysWebView: function () {
-        // not supported
-    },
-
-    styleDefault: function () {
-        // dark text ( to be used on a light background )
-        if (isSupported()) {
-            getViewStatusBar().foregroundColor = { a: 0, r: 0, g: 0, b: 0 };
-        }
-    },
-
-    styleLightContent: function () {
-        // light text ( to be used on a dark background )
-        if (isSupported()) {
-            getViewStatusBar().foregroundColor = { a: 0, r: 255, g: 255, b: 255 };
-        }
-    },
-
-    backgroundColorByHexString: function (win, fail, args) {
-        var rgb = hexToRgb(args[0]);
-        if (isSupported()) {
-            var statusBar = getViewStatusBar();
-            statusBar.backgroundColor = { a: 0, r: rgb.r, g: rgb.g, b: rgb.b };
-            statusBar.backgroundOpacity = 1;
-        }
-    },
-
-    show: function (win, fail) {
-        // added support check so no error thrown, when calling this method
-        if (isSupported()) {
-            getViewStatusBar().showAsync().done(win, fail);
-        }
-    },
-
-    hide: function (win, fail) {
-        // added support check so no error thrown, when calling this method
-        if (isSupported()) {
-            getViewStatusBar().hideAsync().done(win, fail);
-        }
-    }
-};
-require('cordova/exec/proxy').add('StatusBar', module.exports);


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