Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8497CFB1D for ; Wed, 21 Aug 2013 18:24:39 +0000 (UTC) Received: (qmail 54123 invoked by uid 500); 21 Aug 2013 18:24:39 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 54014 invoked by uid 500); 21 Aug 2013 18:24:34 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 53992 invoked by uid 99); 21 Aug 2013 18:24:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 18:24:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 34E378C1D95; Wed, 21 Aug 2013 18:24:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jeffheifetz@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: [CB-3687] Added compass plugin support for blackberry10 Date: Wed, 21 Aug 2013 18:24:32 +0000 (UTC) Updated Branches: refs/heads/dev 6f408923a -> 79b0908ac [CB-3687] Added compass plugin support for blackberry10 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/79b0908a Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/tree/79b0908a Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/diff/79b0908a Branch: refs/heads/dev Commit: 79b0908ac595f6c776ed9b8bbe71b70c8f854977 Parents: 6f40892 Author: Kristoffer Flores Authored: Fri Aug 16 12:13:55 2013 -0400 Committer: Jeffrey Heifetz Committed: Wed Aug 21 14:08:05 2013 -0400 ---------------------------------------------------------------------- plugin.xml | 24 ++++++++++++++++-------- src/blackberry10/README.md | 25 ------------------------- src/blackberry10/index.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 33 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/79b0908a/plugin.xml ---------------------------------------------------------------------- diff --git a/plugin.xml b/plugin.xml index 3cfee54..a40be82 100644 --- a/plugin.xml +++ b/plugin.xml @@ -4,7 +4,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" id="org.apache.cordova.core.device-orientation" version="0.2.0"> - + Device Orientation Cordova Device Orientation Plugin Apache 2.0 @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -37,19 +37,27 @@ - + + + + + + + + + - + - + - + @@ -88,5 +96,5 @@ - + http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/79b0908a/src/blackberry10/README.md ---------------------------------------------------------------------- diff --git a/src/blackberry10/README.md b/src/blackberry10/README.md deleted file mode 100644 index 2039d3c..0000000 --- a/src/blackberry10/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# BlackBerry 10 Device Orientation Plugin - -Cordova Device Orientation Plugin (compass) functionality is entirely contained within common js and the BB10 js runtime. There is no native implementation required. -To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface). - -If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html). -./cordova-plugin-battery-status/README.md -./cordova-plugin-camera/README.md -./cordova-plugin-console/README.md -./cordova-plugin-contacts/README.md -./cordova-plugin-device/README.md -./cordova-plugin-device-motion/README.md -./cordova-plugin-device-orientation/README.md -./cordova-plugin-device-orientation/src/blackberry10/README.md -./cordova-plugin-file/README.md -./cordova-plugin-file-transfer/README.md -./cordova-plugin-geolocation/README.md -./cordova-plugin-globalization/README.md -./cordova-plugin-inappbrowser/README.md -./cordova-plugin-inappbrowser/src/blackberry10/README.md -./cordova-plugin-media/README.md -./cordova-plugin-media-capture/README.md -./cordova-plugin-network-information/README.md -./cordova-plugin-splashscreen/README.md -./cordova-plugin-vibration/README.md http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/79b0908a/src/blackberry10/index.js ---------------------------------------------------------------------- diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js new file mode 100644 index 0000000..e3f0f94 --- /dev/null +++ b/src/blackberry10/index.js @@ -0,0 +1,33 @@ +/* + * Copyright 2013 Research In Motion Limited. + * + * 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. + */ + +module.exports = { + getHeading: function (success, fail, args, env) { + var result = new PluginResult(args, env), + callback = function (orientation) { + var info = { + magneticHeading: orientation.alpha, + trueHeading: 360-orientation.alpha, + headingAccuracy: 360-(2*orientation.alpha), + timestamp: new Date().getTime + }; + window.removeEventListener("deviceorientation", callback); + result.callbackOk(info, false); + }; + window.addEventListener("deviceorientation", callback); + result.noResult(true); + } +};