You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by to...@apache.org on 2016/05/23 13:42:10 UTC

[12/50] cordova-plugin-screen-orientation git commit: Revert "Added WP support"

Revert "Added WP support"


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/commit/56dac9ad
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/tree/56dac9ad
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/diff/56dac9ad

Branch: refs/heads/master
Commit: 56dac9ad10340618fdbfb9e8bc6c1c0d3dd53f7f
Parents: 1b0dee5
Author: Grant Benvenuti <gr...@gmail.com>
Authored: Tue May 12 10:11:12 2015 +1000
Committer: Grant Benvenuti <gr...@gmail.com>
Committed: Tue May 12 10:11:12 2015 +1000

----------------------------------------------------------------------
 plugin.xml                      |  14 +---
 src/wp/YoikScreenOrientation.cs | 127 -----------------------------------
 www/screenorientation.wp8.js    |   8 ---
 3 files changed, 1 insertion(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/56dac9ad/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index dafa2f9..07a9b5d 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -2,7 +2,7 @@
 <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
     xmlns:android="http://schemas.android.com/apk/res/android"
     id="net.yoik.cordova.plugins.screenorientation"
-    version="1.3.3">
+    version="1.3.2">
 
     <name>Screen Orientation</name>
     <description>Adds Screen Orientation API lock and unlock functions to the global screen object in android, iOS and BB10.</description>
@@ -52,16 +52,4 @@
         </js-module>
     </platform>
 
-  <platform name="wp8">
-    <config-file target="config.xml" parent="/*">
-      <feature name="YoikScreenOrientation">
-        <param name="wp-package" value="YoikScreenOrientation"/>
-      </feature>
-    </config-file>
-	  <js-module src="www/screenorientation.wp8.js" name="screenorientation.wp8">
-		  <merges target="cordova.plugins.screenorientation" />
-	  </js-module>
-    <source-file src="src/wp/YoikScreenOrientation.cs" />
-  </platform>
-
 </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/56dac9ad/src/wp/YoikScreenOrientation.cs
----------------------------------------------------------------------
diff --git a/src/wp/YoikScreenOrientation.cs b/src/wp/YoikScreenOrientation.cs
deleted file mode 100644
index 4663998..0000000
--- a/src/wp/YoikScreenOrientation.cs
+++ /dev/null
@@ -1,127 +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 System;
-using System.Net;
-using System.IO;
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Notification;
-using Microsoft.Phone.Shell;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-using System.Windows.Threading;
-using System.Runtime.Serialization;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.Threading;
-
-using WPCordovaClassLib.Cordova;
-using WPCordovaClassLib.Cordova.Commands;
-using WPCordovaClassLib.Cordova.JSON;
-
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-    public class YoikScreenOrientation : BaseCommand
-    {
-        #region Static members
-
-        private const string UNLOCKED = "unlocked";
-        private const string PORTRAIT = "portrait";
-        private const string LANDSCAPE = "landscape";
-
-        #endregion
-
-        /// <summary>
-        /// Current orientation
-        /// </summary>
-        private string currentOrientation;
-
-        public YoikScreenOrientation()
-        {
-
-        }
-
-        /// <summary>
-        /// Changes the orientation
-        /// </summary>
-
-        public void screenOrientation(string options)
-        {
-            string orientation = null;
-            try
-            {
-                orientation = JSON.JsonHelper.Deserialize<string[]>(options)[0];
-            }
-            catch (Exception ex)
-            {
-                this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
-                return;
-            }
-
-            if (string.IsNullOrEmpty(orientation))
-            {
-                this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                return;
-            }
-
-            if (this.currentOrientation != orientation) // Might prevent flickering
-            {
-
-                Deployment.Current.Dispatcher.BeginInvoke(() =>
-                {
-                    PhoneApplicationFrame frame;
-                    PhoneApplicationPage page;
-                    if (TryCast(Application.Current.RootVisual, out frame) &&
-                      TryCast(frame.Content, out page))
-                    {
-                        if (orientation == PORTRAIT)
-                        {
-                            page.SupportedOrientations = SupportedPageOrientation.Portrait;
-                        }
-                        else if (orientation == LANDSCAPE)
-                        {
-                            page.SupportedOrientations = SupportedPageOrientation.Landscape;
-                        }
-                        else if (orientation == UNLOCKED)
-                        {
-                            page.SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
-                        }
-                        else
-                        {
-                            this.DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Screen orientation not detected."));
-                            return;
-                        }
-                        this.currentOrientation = orientation;
-                    }
-                });
-
-                this.DispatchCommandResult();
-            }
-        }
-
-        static bool TryCast<T>(object obj, out T result) where T : class
-        {
-            result = obj as T;
-            return result != null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/56dac9ad/www/screenorientation.wp8.js
----------------------------------------------------------------------
diff --git a/www/screenorientation.wp8.js b/www/screenorientation.wp8.js
deleted file mode 100644
index 4900408..0000000
--- a/www/screenorientation.wp8.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var exec = require('cordova/exec'),
-	screenOrientation = {};
-
-screenOrientation.setOrientation = function(orientation) {
-	exec(null, null, "YoikScreenOrientation", "screenOrientation", [orientation]);
-};
-
-module.exports = screenOrientation;
\ No newline at end of file


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