You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2012/09/04 17:16:08 UTC

[jira] [Created] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type.

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 = navigator;
var newNavigator = new ClassWithNavigatorAsPrototype();

This also allows us to set a consistent onLine property:

newNavigator.__defineGetter__('onLine', function() {
    return this.network.type != '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

[jira] [Commented] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type.

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447954#comment-13447954 ] 

Andrew Grieve commented on CB-1368:
-----------------------------------

To deprecate the old navigator.connection API, we will continue to support it but add a deprecation message to it via the property getter.
                
> 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 = navigator;
> var newNavigator = new ClassWithNavigatorAsPrototype();
> This also allows us to set a consistent onLine property:
> newNavigator.__defineGetter__('onLine', function() {
>     return this.network.type != '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

[jira] [Resolved] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type.

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve resolved CB-1368.
-------------------------------

    Resolution: Fixed

fixed by commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit;h=0982d4d3e98f4a7b60261b645af1ca36bbef336e
                
> 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.network.connection should actually be navigator.connection.
> 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 = navigator;
> var newNavigator = new ClassWithNavigatorAsPrototype();
> This also allows us to set a consistent onLine property:
> newNavigator.__defineGetter__('onLine', function() {
>     return this.network.type != '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

Re: [jira] [Created] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type.

Posted by Filip Maj <fi...@adobe.com>.
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)" <ji...@apache.org> 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 = navigator;
>var newNavigator = new ClassWithNavigatorAsPrototype();
>
>This also allows us to set a consistent onLine property:
>
>newNavigator.__defineGetter__('onLine', function() {
>    return this.network.type != '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


[jira] [Updated] (CB-1368) Move navigator.connection.network interface to navigator.network and make navigator.onLine be based off of network type.

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve updated CB-1368:
------------------------------

    Description: 
According to: http://www.w3.org/TR/netinfo-api/
navigator.network.connection should actually be navigator.connection.

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 = navigator;
var newNavigator = new ClassWithNavigatorAsPrototype();

This also allows us to set a consistent onLine property:

newNavigator.__defineGetter__('onLine', function() {
    return this.network.type != 'none';
});



  was:
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 = navigator;
var newNavigator = new ClassWithNavigatorAsPrototype();

This also allows us to set a consistent onLine property:

newNavigator.__defineGetter__('onLine', function() {
    return this.network.type != 'none';
});



    
> 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.network.connection should actually be navigator.connection.
> 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 = navigator;
> var newNavigator = new ClassWithNavigatorAsPrototype();
> This also allows us to set a consistent onLine property:
> newNavigator.__defineGetter__('onLine', function() {
>     return this.network.type != '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