[jira] [Commented] (CB-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-09-09 Thread Matthew Windwer (JIRA)

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

Matthew Windwer commented on CB-4708:
-

Update: when referencing 

[jira] [Commented] (CB-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-09-09 Thread Matthew Windwer (JIRA)

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

Matthew Windwer commented on CB-4708:
-

Currently I'm having an issue where referencing phonegap.js from a file within 
a subdirectory results in cordova_plugins.js being injected without the same 
relative path.

E.g. in www/subdir/index.html



Results in (when building):




As you can see, cordova_plugins.js is being injected with the incorrect path. 
It should keep the same relative path as the phonegap.js file.

> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www
> -
>
> Key: CB-4708
> URL: https://issues.apache.org/jira/browse/CB-4708
> Project: Apache Cordova
>  Issue Type: Bug
>Affects Versions: 3.0.0
> Environment: iOS / Xcode 4.6.3 (4H1503)
> OS X 10.8.4
>Reporter: Chris Emerson
>Assignee: Andrew Grieve
>  Labels: cordova_plugins.js,, injectPluginScript, plugins,
>
> Summary: 
> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www. 
> Details:
> I've confirmed that the cordova_plugins.js file that sits in the www folder 
> never gets loaded if the app has navigated to an html file in a sub folder of 
> www. 
> In my app/tests I have 14 plugins loading. The [moduleList] object that is 
> instantiated and set in cordova.js confirms this when I check 
> moduleList.length on the initial load of the app. However, when I check after 
> navigating to a html file in a sub folder of www the moduleList object is 
> empty. 
> The final confirmation of my theory/issue is that if I copy the current 
> cordova_plugins.js file to the sub folder where my app has navigated to the 
> moduleList object *does* get populated correctly, the finishPluginLoading() 
> in cordova.js finishes successfully and my plugins are available in the app 
> once again.

--
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-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-09-03 Thread Chris Emerson (JIRA)

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

Chris Emerson commented on CB-4708:
---

I tried throwing together a test app this AM to show the behavior here - but 
findCordovaPath() actually seems to be working regardless if I do my cordova.js 
include via 

[jira] [Commented] (CB-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-08-30 Thread Andrew Grieve (JIRA)

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

Andrew Grieve commented on CB-4708:
---

The method searches the DOM for the cordova.js script tag, so it shouldn't 
matter how it was put there (document.write is completely acceptable).

The plugin loaders runs right away, but since the code lives within cordova.js, 
it must happen after the script exists.

So... There is a bug here somewhere, but I need you to figure out what it is, 
or provide a sample app that reproduces the problem.

> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www
> -
>
> Key: CB-4708
> URL: https://issues.apache.org/jira/browse/CB-4708
> Project: Apache Cordova
>  Issue Type: Bug
>Affects Versions: 3.0.0
> Environment: iOS / Xcode 4.6.3 (4H1503)
> OS X 10.8.4
>Reporter: Chris Emerson
>Assignee: Andrew Grieve
>  Labels: cordova_plugins.js,, injectPluginScript, plugins,
>
> Summary: 
> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www. 
> Details:
> I've confirmed that the cordova_plugins.js file that sits in the www folder 
> never gets loaded if the app has navigated to an html file in a sub folder of 
> www. 
> In my app/tests I have 14 plugins loading. The [moduleList] object that is 
> instantiated and set in cordova.js confirms this when I check 
> moduleList.length on the initial load of the app. However, when I check after 
> navigating to a html file in a sub folder of www the moduleList object is 
> empty. 
> The final confirmation of my theory/issue is that if I copy the current 
> cordova_plugins.js file to the sub folder where my app has navigated to the 
> moduleList object *does* get populated correctly, the finishPluginLoading() 
> in cordova.js finishes successfully and my plugins are available in the app 
> once again.

--
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-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-08-30 Thread Chris Emerson (JIRA)

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

Chris Emerson commented on CB-4708:
---

Well my app.js does a document.write so the DOM eventually has a 

[jira] [Commented] (CB-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-08-30 Thread Andrew Grieve (JIRA)

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

Andrew Grieve commented on CB-4708:
---

I think the intention of the loader was to work with your use-case. Our test 
suite does actually have pages that are sub-directories of www/, so I think 
there's something special going on here. Are you able to figure out why 
findCordovaPath() is returning null? It's supposed to look for 
src="SOME_PATH/cordova.js"

> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www
> -
>
> Key: CB-4708
> URL: https://issues.apache.org/jira/browse/CB-4708
> Project: Apache Cordova
>  Issue Type: Bug
>Affects Versions: 3.0.0
> Environment: iOS / Xcode 4.6.3 (4H1503)
> OS X 10.8.4
>Reporter: Chris Emerson
>  Labels: cordova_plugins.js,, injectPluginScript, plugins,
>
> Summary: 
> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www. 
> Details:
> I've confirmed that the cordova_plugins.js file that sits in the www folder 
> never gets loaded if the app has navigated to an html file in a sub folder of 
> www. 
> In my app/tests I have 14 plugins loading. The [moduleList] object that is 
> instantiated and set in cordova.js confirms this when I check 
> moduleList.length on the initial load of the app. However, when I check after 
> navigating to a html file in a sub folder of www the moduleList object is 
> empty. 
> The final confirmation of my theory/issue is that if I copy the current 
> cordova_plugins.js file to the sub folder where my app has navigated to the 
> moduleList object *does* get populated correctly, the finishPluginLoading() 
> in cordova.js finishes successfully and my plugins are available in the app 
> once again.

--
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-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-08-30 Thread Chris Emerson (JIRA)

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

Chris Emerson commented on CB-4708:
---

Yep - about 95% sure findCordovaPath() (in cordova.js) is the culprit.

findCordovaPath() depends on the user having  
in the HTML page otherwise it fails and returns null. 

In my case I have abstracted the base init methods for my app into a app.js 
file. To maintain a DRY programming style I have my cordova.js call in that 
app.js file not my HTML files. It is setup like this:

if(isMobile.any()){
document.write("");
}else{
window.console.log('NOT-DEVICE-MODE: Skipping loading of [cordova.js] and 
plugins...');
}

Personally I think this is a better model than putting a 

[jira] [Commented] (CB-4708) injectPluginScript() can't find cordova_plugins.js when app is on an HTML file in a sub folder of www

2013-08-30 Thread Chris Emerson (JIRA)

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

Chris Emerson commented on CB-4708:
---

May be result of findCordovaPath() always returning null (?) - just a theory.

> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www
> -
>
> Key: CB-4708
> URL: https://issues.apache.org/jira/browse/CB-4708
> Project: Apache Cordova
>  Issue Type: Bug
>Affects Versions: 3.0.0
> Environment: iOS / Xcode 4.6.3 (4H1503)
> OS X 10.8.4
>Reporter: Chris Emerson
>  Labels: cordova_plugins.js,, injectPluginScript, plugins,
>
> Summary: 
> injectPluginScript() can't find cordova_plugins.js when app is on an HTML 
> file in a sub folder of www. 
> Details:
> I've confirmed that the cordova_plugins.js file that sits in the www folder 
> never gets loaded if the app has navigated to an html file in a sub folder of 
> www. 
> In my app/tests I have 14 plugins loading. The [moduleList] object that is 
> instantiated and set in cordova.js confirms this when I check 
> moduleList.length on the initial load of the app. However, when I check after 
> navigating to a html file in a sub folder of www the moduleList object is 
> empty. 
> The final confirmation of my theory/issue is that if I copy the current 
> cordova_plugins.js file to the sub folder where my app has navigated to the 
> moduleList object *does* get populated correctly, the finishPluginLoading() 
> in cordova.js finishes successfully and my plugins are available in the app 
> once again.

--
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