signalpoint / DrupalGap

An application development kit for Drupal websites.
https://www.drupalgap.org
GNU General Public License v2.0
232 stars 185 forks source link

drupalgap_goto changePage to index.html#[page-id] needs multi-platform support #42

Closed chrisschaub closed 10 years ago

chrisschaub commented 11 years ago

I've pulled the latest alpha, using cordova 2.7 with the latest jquerymobile stuff. I get this error:

missing exec:Logger.logLevel

in the javascript console.

signalpoint commented 11 years ago

Hey Chris,

Is this for iOS? I have never seen that error before. I google'd around for a bit and didn't find too much on it, maybe this will help:

http://stackoverflow.com/a/13559010/763010

If you could provide some more information that would be helpful, I'd like to reproduce this. I haven't seen anything like it in Android, so I should get my xCode environment setup on my Mac Mini and try this out.

signalpoint commented 11 years ago

A few more questions for you...

Are you starting a fresh PhoneGap project, or upgrading an existing one?

What version of PhoneGap and DrupalGap were you using before the latest pull?

Since we last talked (a few months ago) much has changed between the Beta and Alpha versions. I'd recommend starting fresh with the PhoneGap getting started guide for your platform(s), getting the latest DrupalGap going (out of the box), then migrating in any page(s) as such through a custom module and hook_menu in your JS code.

The Getting Started guide over at www.drupalgap.org has some info about the new Alpha features. Thanks!

chrisschaub commented 11 years ago

Hey Tyler. So, I downloaded your latest alpha about a week ago and converted my code to a module. Cool stuff! I'm working with the cordova-cli and ripple to develop my project. I think there are console.log calls in the drupalgap.js that might be trying to log something that is undefined. It could just be a bug with the ripple emulator, still tracking it down. I definitely like the direction the alpha code is taking. Thanks for all of your hard work, more debugging tonight. If you haven't tried cordova-cli, it's cool.

On Sat, May 25, 2013 at 2:26 PM, Tyler Frankenstein < notifications@github.com> wrote:

A few more questions for you...

Are you starting a fresh PhoneGap project, or upgrading an existing one?

What version of PhoneGap and DrupalGap were you using before the latest pull?

Since we last talked (a few months ago) much has changed between the Beta and Alpha versions. I'd recommend starting fresh with the PhoneGap getting started guide for your platform(s), getting the latest DrupalGap going (out of the box), then migrating in any page(s) as such through a custom module and hook_menu in your JS code.

The Getting Started guide over at www.drupalgap.org has some info about the new Alpha features. Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/signalpoint/DrupalGap/issues/42#issuecomment-18452532 .

Christopher Schaub http://chris.schaub.com

chrisschaub commented 11 years ago

I'm attaching a patch that seems to fix some odd behaviour I was having debugging the app. When I would try to run the app in the browser (using ripple and cordova-cli), i would get a blank screen the first try, even though the dom elements were drawn. But, the changePage was not changing the active page to the dashboard's div. When I hit "reload" in the frame, the page would draw correctly, the active div class set. This behaviour did not manifest itself in the IOS or Android sim, just when using/debugging via browser. Since Cordova is going to become optional, this might be a necessary patch. And ripple is really nice, even without cordova's cli.

The patch should be against the latest, did with git diff.

On Sat, May 25, 2013 at 8:59 PM, Christopher Schaub chris@schaub.comwrote:

Hey Tyler. So, I downloaded your latest alpha about a week ago and converted my code to a module. Cool stuff! I'm working with the cordova-cli and ripple to develop my project. I think there are console.log calls in the drupalgap.js that might be trying to log something that is undefined. It could just be a bug with the ripple emulator, still tracking it down. I definitely like the direction the alpha code is taking. Thanks for all of your hard work, more debugging tonight. If you haven't tried cordova-cli, it's cool.

On Sat, May 25, 2013 at 2:26 PM, Tyler Frankenstein < notifications@github.com> wrote:

A few more questions for you...

Are you starting a fresh PhoneGap project, or upgrading an existing one?

What version of PhoneGap and DrupalGap were you using before the latest pull?

Since we last talked (a few months ago) much has changed between the Beta and Alpha versions. I'd recommend starting fresh with the PhoneGap getting started guide for your platform(s), getting the latest DrupalGap going (out of the box), then migrating in any page(s) as such through a custom module and hook_menu in your JS code.

The Getting Started guide over at www.drupalgap.org has some info about the new Alpha features. Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/signalpoint/DrupalGap/issues/42#issuecomment-18452532 .

Christopher Schaub http://chris.schaub.com

Christopher Schaub http://chris.schaub.com

chrisschaub commented 11 years ago

Oh, and you should probably switch the line

var networkState = navigator.network.connection.type;

to

var networkState = navigator.connection.type;

since you are now at jquery 1.9.1, cordova 2.7.

-c

On Mon, May 27, 2013 at 1:12 AM, Christopher Schaub chris@schaub.comwrote:

I'm attaching a patch that seems to fix some odd behaviour I was having debugging the app. When I would try to run the app in the browser (using ripple and cordova-cli), i would get a blank screen the first try, even though the dom elements were drawn. But, the changePage was not changing the active page to the dashboard's div. When I hit "reload" in the frame, the page would draw correctly, the active div class set. This behaviour did not manifest itself in the IOS or Android sim, just when using/debugging via browser. Since Cordova is going to become optional, this might be a necessary patch. And ripple is really nice, even without cordova's cli.

The patch should be against the latest, did with git diff.

  • Chris

On Sat, May 25, 2013 at 8:59 PM, Christopher Schaub chris@schaub.comwrote:

Hey Tyler. So, I downloaded your latest alpha about a week ago and converted my code to a module. Cool stuff! I'm working with the cordova-cli and ripple to develop my project. I think there are console.log calls in the drupalgap.js that might be trying to log something that is undefined. It could just be a bug with the ripple emulator, still tracking it down. I definitely like the direction the alpha code is taking. Thanks for all of your hard work, more debugging tonight. If you haven't tried cordova-cli, it's cool.

On Sat, May 25, 2013 at 2:26 PM, Tyler Frankenstein < notifications@github.com> wrote:

A few more questions for you...

Are you starting a fresh PhoneGap project, or upgrading an existing one?

What version of PhoneGap and DrupalGap were you using before the latest pull?

Since we last talked (a few months ago) much has changed between the Beta and Alpha versions. I'd recommend starting fresh with the PhoneGap getting started guide for your platform(s), getting the latest DrupalGap going (out of the box), then migrating in any page(s) as such through a custom module and hook_menu in your JS code.

The Getting Started guide over at www.drupalgap.org has some info about the new Alpha features. Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/signalpoint/DrupalGap/issues/42#issuecomment-18452532 .

Christopher Schaub http://chris.schaub.com

Christopher Schaub http://chris.schaub.com

Christopher Schaub http://chris.schaub.com

signalpoint commented 11 years ago

Hey Chris, thanks for the information about the bug with the first run active page. I didn't see your patch come through via e-mail. Please try to send it again if you can.

It would be cool if you could submit a pull request, and then we could start merging in your improvements quickly.

I attempted Ripple a few months ago to no avail, I really need to try again, because debugging on the device and in the emulator is a terrible experience (it seems only limited to watching console.log() ouput, no fun).

chrisschaub commented 11 years ago

Here it is ... I'll do pull requests from now on!

On Tue, May 28, 2013 at 8:46 PM, Tyler Frankenstein < notifications@github.com> wrote:

Hey Chris, thanks for the information about the bug with the first run active page. I didn't see your patch come through via e-mail. Please try to send it again if you can.

It would be cool if you could submit a pull request, and then we could start merging in your improvements quickly.

I attempted Ripple a few months ago to no avail, I really need to try again, because debugging on the device and in the emulator is a terrible experience (it seems only limited to watching console.log() ouput, no fun).

— Reply to this email directly or view it on GitHubhttps://github.com/signalpoint/DrupalGap/issues/42#issuecomment-18591427 .

Christopher Schaub http://chris.schaub.com

signalpoint commented 11 years ago

It looks like GitHub might not do attachments to issues via e-mail reply, nothing came through again.

chrisschaub commented 11 years ago

Just pasting for now, such a simple change...

diff --git a/includes/common.inc.js b/includes/common.inc.js index 1048ceb..cf24d92 100644 --- a/includes/common.inc.js +++ b/includes/common.inc.js @@ -202,7 +202,7 @@ function drupalgap_goto(path) { if (drupalgap.settings.debug) { console.log('drupalgap_goto - changePage => ' + page_id); }

On Tue, May 28, 2013 at 10:31 PM, Tyler Frankenstein < notifications@github.com> wrote:

It looks like GitHub might not do attachments to issues via e-mail reply, nothing came through again.

— Reply to this email directly or view it on GitHubhttps://github.com/signalpoint/DrupalGap/issues/42#issuecomment-18594170 .

Christopher Schaub http://chris.schaub.com

signalpoint commented 11 years ago

Chris, if you run this line of code in your Ripple emulator, what value is alerted?

alert(device.platform);

http://docs.phonegap.com/en/2.7.0/cordova_device_device.md.html#device.platform

I ask because, it seems for the 'Android' value, the need for the 'index.html' prefix before the changePage may be necessary.

chrisschaub commented 11 years ago

After testing some more, I think this might be an issue emulating in the browser via Ripple. If you build for Android or IOS with Cordova, the index.html# format seems to be ok. But the index.html part needs to be dropped for it to work with Ripple / Chrome. So, the exception seems to be for Ripple or browsers in general. It might become more of an issue when you remove Cordova as a dependency. It works for me now in IOS and Android with your latest commit, so it seems good. Just still a little mysterious. Cordova-cli is awesome with Ripple for doing design work, debugging. I'll post this issue in the Ripple Jira queue.

signalpoint commented 11 years ago

Thanks. So that seems to clarify iOS doesn't mind the lack of 'index.html' in the changePage. I still have to test that myself. Please let me know what the device.platform value is when using Ripple if you get a chance, or if you can submit a patch (or pull request) that works for Ripple and we can close this issue!

signalpoint commented 10 years ago

This now seems stable, I've been successfully developing in Ripple and also compiling straight to Android. Please re-open if any issue with iOS seems issue remaining with the 'index.html#' url.