[ 
https://issues.apache.org/jira/browse/CB-298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238727#comment-13238727
 ] 

Filip Maj commented on CB-298:
------------------------------

{{addConstructor}} was added to the cordova module in cordova-js for backwards 
compatibility.

{{hasResource}} and {{addResource}} do not exist in cordova-js.

As far some guidance on how to move over, I would recommend employing cordova's 
{{define}} and {{require}} in cordova-js. For a {{hasResource}} equivalent, I 
would check if {{cordova.require('mymoduleid')}} throws an exception. If so, 
then go ahead and use {{cordova.define}}. If not, it's already defined, as the 
user does in your above example, simply {{return}} out. In the same vein, 
{{cordova.define}} can be used as a replacement for {{addResource}}.

The only other change would be to the call to {{exec}}. Users can go with 
either calling {{cordova.exec}} directly, or if they want to use the same 
{{require}} syntax they can roll with {{cordova.require('cordova/exec')}}.
                
> DEPRECATE and then remove "plugins" and "PhoneGap" global objects from 
> JavaScript implementation
> ------------------------------------------------------------------------------------------------
>
>                 Key: CB-298
>                 URL: https://issues.apache.org/jira/browse/CB-298
>             Project: Apache Callback
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>            Priority: Minor
>              Labels: api-change, javascript
>             Fix For: 1.6.0, 1.7.0
>
>
> There are two globals currently defined in Cordova-JS' common platform 
> definition, which get dropped onto the `window` object: `plugins` and 
> `PhoneGap`.
> Let's slate these for removal.
> In 1.6, let's set up deprecation notices for these. In 1.7, let's remove them.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to