You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/03/06 21:15:04 UTC

[1/2] cordova-plugin-device-orientation git commit: Updated plugin to be 'windows' instead of 'windows8'

Repository: cordova-plugin-device-orientation
Updated Branches:
  refs/heads/master 1358eb869 -> 527bb316e


Updated plugin to be 'windows' instead of 'windows8'


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

Branch: refs/heads/master
Commit: d4157035ce7786f4bb0ce06de89b304daa5b81e4
Parents: 1358eb8
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 6 12:13:31 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 6 12:14:18 2015 -0800

----------------------------------------------------------------------
 plugin.xml                   |  6 ++---
 src/windows/CompassProxy.js  | 50 +++++++++++++++++++++++++++++++++++++++
 src/windows8/CompassProxy.js | 50 ---------------------------------------
 3 files changed, 53 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/d4157035/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index ebcfce0..61c3573 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -150,9 +150,9 @@
         <source-file src="src/wp/Compass.cs" />
     </platform>
 
-        <!-- windows8 -->
-    <platform name="windows8">
-        <js-module src="src/windows8/CompassProxy.js" name="CompassProxy">
+        <!-- windows -->
+    <platform name="windows">
+        <js-module src="src/windows/CompassProxy.js" name="CompassProxy">
             <merges target="" />
         </js-module>
     </platform>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/d4157035/src/windows/CompassProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CompassProxy.js b/src/windows/CompassProxy.js
new file mode 100644
index 0000000..a9ad68d
--- /dev/null
+++ b/src/windows/CompassProxy.js
@@ -0,0 +1,50 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*jslint sloppy:true */
+/*global Windows:true, require, module, setTimeout */
+
+var cordova = require('cordova'),
+    CompassHeading = require('org.apache.cordova.device-orientation.CompassHeading'),
+    CompassError = require('org.apache.cordova.device-orientation.CompassError');
+
+
+module.exports = {
+
+    onReadingChanged: null,
+    getHeading: function (win, lose) {
+        var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
+        if (!deviceCompass) {
+            setTimeout(function () {
+                lose(CompassError.COMPASS_NOT_SUPPORTED);
+            }, 0);
+        } else {
+            var reading = deviceCompass.getCurrentReading(),
+                heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth, null, reading.timestamp.getTime());
+            win(heading);
+        }
+    },
+    stopHeading: function (win, lose) {
+        win();
+    }
+};
+
+require("cordova/exec/proxy").add("Compass", module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/d4157035/src/windows8/CompassProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/CompassProxy.js b/src/windows8/CompassProxy.js
deleted file mode 100644
index a9ad68d..0000000
--- a/src/windows8/CompassProxy.js
+++ /dev/null
@@ -1,50 +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.
- *
-*/
-
-/*jslint sloppy:true */
-/*global Windows:true, require, module, setTimeout */
-
-var cordova = require('cordova'),
-    CompassHeading = require('org.apache.cordova.device-orientation.CompassHeading'),
-    CompassError = require('org.apache.cordova.device-orientation.CompassError');
-
-
-module.exports = {
-
-    onReadingChanged: null,
-    getHeading: function (win, lose) {
-        var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
-        if (!deviceCompass) {
-            setTimeout(function () {
-                lose(CompassError.COMPASS_NOT_SUPPORTED);
-            }, 0);
-        } else {
-            var reading = deviceCompass.getCurrentReading(),
-                heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth, null, reading.timestamp.getTime());
-            win(heading);
-        }
-    },
-    stopHeading: function (win, lose) {
-        win();
-    }
-};
-
-require("cordova/exec/proxy").add("Compass", module.exports);


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


[2/2] cordova-plugin-device-orientation git commit: force async callbacks

Posted by pu...@apache.org.
force async callbacks


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/commit/527bb316
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/tree/527bb316
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/diff/527bb316

Branch: refs/heads/master
Commit: 527bb316ed5aa95f4d960fb5912e7a812b2f6ff7
Parents: d415703
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 6 12:14:57 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 6 12:14:57 2015 -0800

----------------------------------------------------------------------
 src/windows/CompassProxy.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/527bb316/src/windows/CompassProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CompassProxy.js b/src/windows/CompassProxy.js
index a9ad68d..a5e055f 100644
--- a/src/windows/CompassProxy.js
+++ b/src/windows/CompassProxy.js
@@ -39,11 +39,15 @@ module.exports = {
         } else {
             var reading = deviceCompass.getCurrentReading(),
                 heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth, null, reading.timestamp.getTime());
-            win(heading);
+            setTimeout(function () {
+                win(heading);
+            }, 0);
         }
     },
     stopHeading: function (win, lose) {
-        win();
+        setTimeout(function () {
+            win();
+        }, 0);
     }
 };
 


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