Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE0ADD926 for ; Tue, 4 Sep 2012 17:53:04 +0000 (UTC) Received: (qmail 8850 invoked by uid 500); 4 Sep 2012 17:53:04 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 8820 invoked by uid 500); 4 Sep 2012 17:53:04 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 8812 invoked by uid 99); 4 Sep 2012 17:53:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 17:53:04 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fil@adobe.com designates 64.18.1.187 as permitted sender) Received: from [64.18.1.187] (HELO exprod6og104.obsmtp.com) (64.18.1.187) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 17:52:57 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob104.postini.com ([64.18.5.12]) with SMTP ID DSNKUEY/5GNJMxkvvEuNOwVe2U9+V9/lQYbp@postini.com; Tue, 04 Sep 2012 10:52:37 PDT Received: from inner-relay-1.corp.adobe.com (inner-relay-1.corp.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q84HqYP7006326 for ; Tue, 4 Sep 2012 10:52:35 -0700 (PDT) Received: from nacas03.corp.adobe.com (nacas03.corp.adobe.com [10.8.189.121]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q84HqVvt018081 for ; Tue, 4 Sep 2012 10:52:34 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas03.corp.adobe.com ([10.8.189.121]) with mapi; Tue, 4 Sep 2012 10:52:02 -0700 From: Filip Maj To: "callback-dev@incubator.apache.org" Date: Tue, 4 Sep 2012 10:52:13 -0700 Subject: Re: [jira] [Created] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type. Thread-Topic: [jira] [Created] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type. Thread-Index: Ac2Kxf1A5+8rUA9JSrOrEAptFze6Nw== Message-ID: In-Reply-To: <223679219.33030.1346771768478.JavaMail.jiratomcat@arcas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.3.120616 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I don't want to trash an API after one point revision - we need to deprecate it (current policy is 6 months) first :s On 9/4/12 8:16 AM, "Andrew Grieve (JIRA)" wrote: >Andrew Grieve created CB-1368: >--------------------------------- > > Summary: Move navigator.connection.network interface to >navigator.network and make navigator.onLine be based off of network type. > Key: CB-1368 > URL: https://issues.apache.org/jira/browse/CB-1368 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaJS > Reporter: Andrew Grieve > Assignee: Andrew Grieve > Priority: Minor > Fix For: 2.2.0 > > >According to: http://www.w3.org/TR/netinfo-api/ >navigator.connection.network should actually be navigator.network. > >The difficulty before was figuring out how to clobber navigator's own >properties with our own, but the following code can be used to achieve >this: > >function ClassWithNavigatorAsPrototype() {} >ClassWithNavigatorAsPrototype.prototype =3D navigator; >var newNavigator =3D new ClassWithNavigatorAsPrototype(); > >This also allows us to set a consistent onLine property: > >newNavigator.__defineGetter__('onLine', function() { > return this.network.type !=3D 'none'; >}); > > > >-- >This message is automatically generated by JIRA. >If you think it was sent incorrectly, please contact your JIRA >administrators >For more information on JIRA, see: http://www.atlassian.com/software/jira