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 52E17DD83 for ; Thu, 16 May 2013 20:40:02 +0000 (UTC) Received: (qmail 9013 invoked by uid 500); 16 May 2013 20:40:02 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 8996 invoked by uid 500); 16 May 2013 20:40:02 -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 8989 invoked by uid 99); 16 May 2013 20:40:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 20:40:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 03A35153E0; Thu, 16 May 2013 20:40:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Message-Id: <4e71a6b685d84b168b732f81cbc5063d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: added tests Date: Thu, 16 May 2013 20:40:01 +0000 (UTC) Updated Branches: refs/heads/master 0c1b24328 -> 01a6372ea added tests 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/01a6372e Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/tree/01a6372e Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/diff/01a6372e Branch: refs/heads/master Commit: 01a6372ead06fd5950851958a8545b124a778763 Parents: 0c1b243 Author: Steven Gill Authored: Thu May 16 13:39:56 2013 -0700 Committer: Steven Gill Committed: Thu May 16 13:39:56 2013 -0700 ---------------------------------------------------------------------- test/autotest/html/SpecView.js | 2 +- test/autotest/index.html | 2 +- test/autotest/pages/compass.html | 2 +- test/compass/index.html | 2 +- test/cordova-incl.js | 70 ++++++++++++++++++++++++++++++++ test/cordova.js | 71 --------------------------------- test/index.html | 4 +- 7 files changed, 76 insertions(+), 77 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/01a6372e/test/autotest/html/SpecView.js ---------------------------------------------------------------------- diff --git a/test/autotest/html/SpecView.js b/test/autotest/html/SpecView.js index 8769bb8..e8a3c23 100644 --- a/test/autotest/html/SpecView.js +++ b/test/autotest/html/SpecView.js @@ -76,4 +76,4 @@ jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { } }; -jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView); \ No newline at end of file +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView); http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/01a6372e/test/autotest/index.html ---------------------------------------------------------------------- diff --git a/test/autotest/index.html b/test/autotest/index.html index e73fd58..6ebccbd 100644 --- a/test/autotest/index.html +++ b/test/autotest/index.html @@ -29,7 +29,7 @@ Cordova API Specs - +

Cordova API Specs

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/01a6372e/test/autotest/pages/compass.html ---------------------------------------------------------------------- diff --git a/test/autotest/pages/compass.html b/test/autotest/pages/compass.html index 00082c9..d97b680 100644 --- a/test/autotest/pages/compass.html +++ b/test/autotest/pages/compass.html @@ -38,7 +38,7 @@ - + http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/01a6372e/test/compass/index.html ---------------------------------------------------------------------- diff --git a/test/compass/index.html b/test/compass/index.html index bc89f60..4d6af2c 100644 --- a/test/compass/index.html +++ b/test/compass/index.html @@ -27,7 +27,7 @@ Cordova Mobile Spec - + '); +} + +function backHome() { + if (window.device && device.platform && device.platform.toLowerCase() == 'android') { + navigator.app.backHistory(); + } + else { + window.history.go(-1); + } +} http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/01a6372e/test/cordova.js ---------------------------------------------------------------------- diff --git a/test/cordova.js b/test/cordova.js deleted file mode 100644 index 91486a6..0000000 --- a/test/cordova.js +++ /dev/null @@ -1,71 +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 VERSION='dev'; -var PLAT; -if (/Android/.exec(navigator.userAgent)) { - PLAT = 'android'; -} else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) { - PLAT = 'ios'; -} else if (/(BB10)|(PlayBook)|(BlackBerry)/.exec(navigator.userAgent)) { - PLAT = 'blackberry'; -} - -var scripts = document.getElementsByTagName('script'); -var currentPath = scripts[scripts.length - 1].src; -var platformCordovaPath = currentPath.replace("cordova.js", "cordova." + PLAT + ".js"); -var versionCordovaPath = currentPath.replace("cordova.js", "cordova-" + VERSION + ".js"); -var cordovaPath = versionCordovaPath; - -if (PLAT) { - // XHR to local file is an error on some platforms, windowsphone for one - try { - var xhr = new XMLHttpRequest(); - xhr.open("GET", platformCordovaPath, false); - xhr.onreadystatechange = function() { - - if (this.readyState == this.DONE && this.responseText.length > 0) { - if(parseInt(this.status) >= 400){ - cordovaPath = versionCordovaPath; - }else{ - cordovaPath = platformCordovaPath; - } - } - }; - xhr.send(null); - } - catch(e){ - cordovaPath = versionCordovaPath; - } // access denied! -} - -if (!window._doNotWriteCordovaScript) { - document.write(''); -} - -function backHome() { - if (window.device && device.platform && device.platform.toLowerCase() == 'android') { - navigator.app.backHistory(); - } - else { - window.history.go(-1); - } -} http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/01a6372e/test/index.html ---------------------------------------------------------------------- diff --git a/test/index.html b/test/index.html index da8f319..2c5447b 100644 --- a/test/index.html +++ b/test/index.html @@ -27,7 +27,7 @@ Cordova Mobile Spec - + @@ -52,7 +52,7 @@ Contacts Events Location - Lazy Loading of cordova.js + Lazy Loading of cordova-incl.js Misc Content Network Notification