granviace / mobile-bookmark-bubble

Automatically exported from code.google.com/p/mobile-bookmark-bubble
Apache License 2.0
0 stars 0 forks source link

mobile-bookmark-bubble not displaying #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Go to http://www.gwpahs.org/m/index.html
2. mobile-bookmark-bubble does not appear
3. No error messages or anything.... Just doesn't appear

What is the expected output? What do you see instead?

I am using iphonenav.js for our mobile site and have changed the following to 
localStorage as described in the comments of example.js but no 
mobile-bookmark-bubble is displayed:

bubble.setHashParameter = function() {
      if (!this.hasHashParameter()) {
        window.localStorage += parameter;
      }
    };

What version of the product are you using? On what operating system?

iPhone 4 (4.2.1) + Xcode iOS SDK Emulator (iPad/iPhone etc) on OS X for some 
testing

Please provide any additional information below.

Links to significant files:

http://www.gwpahs.org/m/bookmark_bubble.js
http://www.gwpahs.org/m/example.js
http://www.gwpahs.org/m/iphonenav.js

As mentioned above, I have changed the following to localStorage as described 
in the comments of example.js but is still not working (am I missing something 
or is there more too it):

bubble.setHashParameter = function() {
      if (!this.hasHashParameter()) {
        window.localStorage += parameter;
      }
    };

Maybe I need to make more changes but Im not too sure where....?

Original issue reported on code.google.com by york.ric...@gmail.com on 27 Feb 2011 at 5:40

GoogleCodeExporter commented 8 years ago
Your setHashParameter() function uses window.localStorage incorrectly. Check 
out this tutorial from Dive Into HTML5 for more details: 
http://diveintohtml5.org/storage.html#methods

Try something like this instead:
var BUBBLE_STORAGE_KEY = 'bubble';

bubble.hasHashParameter = function() {
  return window.localStorage[BUBBLE_STORAGE_KEY];
};

bubble.setHashParameter = function() {
  window.localStorage[BUBBLE_STORAGE_KEY] = '1';
};

Original comment by ntho...@google.com on 28 Feb 2011 at 3:52

GoogleCodeExporter commented 8 years ago
Thanks for taking the time to reply. I'm still having issues as I don't fully 
understand what the problem is. I have tried the code provided above and it 
didn't work for me.

Is there a way of simply not using cookies or html5 localStorage and just 
display the bubble by clicking a hyperlink?

As you can probably tell, Im not too good with JavaScript but this bubble is 
such a great idea I'd love to integrate it into out mobile site...

Many thanks,

Rich

Original comment by york.ric...@gmail.com on 1 Mar 2011 at 10:23

GoogleCodeExporter commented 8 years ago
Sorry for the delay in getting back to you.

I just tried downloading your code and running it locally, and it worked fine 
for me. One thing to note is that with your implementation of 
setHashParameter(), the bubble will only ever be shown once per device (unless 
the user clears their cache). For testing, you might want to change this so 
that the bubble is _always_ shown:

bubble.setHashParameter = function() { }
bubble.hasHashParameter = function() {
  return false;
}

Original comment by ntho...@google.com on 3 Mar 2011 at 9:47

GoogleCodeExporter commented 8 years ago
Thanks, I have tried the above code and the bubble still does not display. I 
have no idea what is stopping it from displaying. Im getting close to giving up 
now :( Thanks for you help and patience

Original comment by york.ric...@gmail.com on 8 Mar 2011 at 8:40

GoogleCodeExporter commented 8 years ago
Do you have the current version of your code running somewhere that I can 
experiment with it? It looks like the links in your initial bug report are 
still pointing to an older version of the code that uses window.localStorage.

Original comment by ntho...@google.com on 11 Mar 2011 at 11:26

GoogleCodeExporter commented 8 years ago
Hi, yes sorry it is now back to your latest suggestion. Many thanks for your 
continued support!

Original comment by york.ric...@gmail.com on 12 Mar 2011 at 9:01

GoogleCodeExporter commented 8 years ago
Sorry, I've been swamped with other projects recently. I'll take a look at this 
as soon as I can. :)

Original comment by ntho...@google.com on 17 Mar 2011 at 2:54

GoogleCodeExporter commented 8 years ago
It looks like the add to homescreen link now just shows an alert() with text 
instructions. Is there somewhere else that the bookmark bubble is being 
triggered?

Original comment by ntho...@google.com on 3 Apr 2011 at 2:17

GoogleCodeExporter commented 8 years ago
I've been having the identical issue, cropped up recently although am unaware 
how long I've overlooked it.

I've made no changes to the js, until going through this post to attempt to fix 
the issue with the comments provided.

A live instance of this occurrance:
http://www.allscenes.com/allscenes
http://www.allscenes.com/allscenes/static/js/bookmark_bubble.js
http://www.allscenes.com/allscenes/static/js/bookmark.js

What I find odd is that I've made no change to cause the issue,
Does the library rely on any external resources??

I do have other google services installed (Analytics & Translate) but removing 
them has no change so I don't thing they're conflicting.

Help appreciated.

Original comment by ghy...@allscenes.com on 12 May 2011 at 10:16

GoogleCodeExporter commented 8 years ago
Going through our sites today my issue has resolved itself oddly enough.
Unsure as to the original cause or indication as to how it resolved on it's own 
(Wasn't just from me restarting as it was occurring on my other devices as 
well).

Original comment by ghy...@allscenes.com on 12 May 2011 at 9:11

GoogleCodeExporter commented 8 years ago
Glad to hear it's working again. For the record, the library doesn't rely on 
any external resources.

Original comment by ntho...@google.com on 12 May 2011 at 9:14