gfslideshow.js links going to same page as slideshow

已查看 75 次
跳至第一个未读帖子

poxb...@bepress.com

未读,
2015年4月1日 15:53:162015/4/1
收件人 google-ajax...@googlegroups.com
Hello.

I've noticed recently (at least within the last few weeks, maybe longer) that clicking on images just takes you to the same page you are already on. Even with google.feeds.LINK_TARGET_BLANK set up correctly, clicking on a slideshow images will launch a new tab or window, but the new page is the same as the page hosting the slideshow. You can see this behavior on the "Hello World" example directly from the Google Ajax Feed:


When examining the code through web developer tools, the links show empty "href" elements, like so: <a href="" target="_blank">. I believe the href="" used to contain the <link> value as parsed from the XML or ATOM source feed. This was typically the source gallery page that hosted the image. This no longer appears to be the case and I'm not quite sure why.

Has anyone else noticed this change and/or know of any possible solutions? Any suggestions would be greatly appreciated.

Thanks!

Neil Ennis

未读,
2015年4月13日 20:22:012015/4/13
收件人 google-ajax...@googlegroups.com
I've noticed the same problem.  I tried to fix it with an  imageClickCallback function which sort of worked but:
1. Stopped the slideshow, and
2. Also opened the current page in a new window.

I'd appreciate some suggestions also.

Here's my feeble attempt at working around it:

// slideshow image click callback function
  function myClickHandler(entry) {
    window.open(entry.link,'_blank');
  }

// slideshow options
function ssOptions() {
    var options = {
        linkTarget : google.feeds.LINK_TARGET_BLANK,
        scaleImages: true,
        fullControlPanel : true,
        fullControlPanelSmallIcons : true,
        pauseOnHover : false,
        imageClickCallback : myClickHandler,
        thumbnailTag : "content"
    };
    return options;
}

var mySS = new GFslideShow(myUri, myDiv, ssOptions());

Jeremy Geerdes

未读,
2015年4月13日 20:38:072015/4/13
收件人 google-ajax...@googlegroups.com
AFTER you include the gfslideshow.js library into your page, and BEFORE you initialize the control, add this:

<script type="text/javascript">
GFslideShow.prototype.createLink = function(href) {
  var link = document.createElement('a');
  link.setAttribute('href', href);

  // Only allow http/https urls, reading back href should fully qualify any
  // relative URLs
  if (!/^https?:\/\//i.test(link.href)) {
    link.href = '';
  }
  if (this.options.linkTarget) {
    link.setAttribute('target', this.options.linkTarget);
  }
  return link;
};
</script>

This will override the GFslideShow's built-in createLink method, which has a bug on line 651. Namely, the ! was deleted at some point, so every time the function builds a link, it's subsequently blanking out the href attribute. This causes the same document to load in a new window when someone clicks on the link.

jg

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/4e03ba77-3656-4244-8b51-dc48802c6edd%40googlegroups.com

For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

Neil Ennis

未读,
2015年4月13日 21:22:222015/4/13
收件人 google-ajax...@googlegroups.com
It works!!!!!!

I am tempted to cut and paste "Thank you" a couple of hundred times.

I've been banging my head on the table for months over this issue.

Thanks so much.


On Thursday, 2 April 2015 05:53:16 UTC+10, poxb...@bepress.com wrote:

Jeremy Geerdes

未读,
2015年4月13日 21:33:152015/4/13
收件人 google-ajax...@googlegroups.com
I tracked the issue down with Chrome's Debugging Tools. Firefox and Safari both have similar resources. If you do much web development, they will save you immense amounts of time and headache.

And here's a bonus tip: The Feeds API's TOS have been changed such that, after this month, Google may discontinue the service - with or without notice - at any time. You will likely want to begin working on a migration plan if this application is mission-critical.

jg

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit

For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

poxb...@bepress.com

未读,
2015年4月16日 19:21:422015/4/16
收件人 google-ajax...@googlegroups.com
This fixed the issue, thank you!  And thank you for the heads up about the potential discontinued feed service.  



On Monday, April 13, 2015 at 6:33:15 PM UTC-7, jgeerdes [AJAX APIs "Guru"] wrote:
I tracked the issue down with Chrome's Debugging Tools. Firefox and Safari both have similar resources. If you do much web development, they will save you immense amounts of time and headache.

And here's a bonus tip: The Feeds API's TOS have been changed such that, after this month, Google may discontinue the service - with or without notice - at any time. You will likely want to begin working on a migration plan if this application is mission-critical.

jg
On Mon, Apr 13, 2015 at 8:22 PM, Neil Ennis <neil....@gmail.com> wrote:
It works!!!!!!

I am tempted to cut and paste "Thank you" a couple of hundred times.

I've been banging my head on the table for months over this issue.

Thanks so much.

On Thursday, 2 April 2015 05:53:16 UTC+10, poxb...@bepress.com wrote:
Hello.

I've noticed recently (at least within the last few weeks, maybe longer) that clicking on images just takes you to the same page you are already on. Even with google.feeds.LINK_TARGET_BLANK set up correctly, clicking on a slideshow images will launch a new tab or window, but the new page is the same as the page hosting the slideshow. You can see this behavior on the "Hello World" example directly from the Google Ajax Feed:


When examining the code through web developer tools, the links show empty "href" elements, like so: <a href="" target="_blank">. I believe the href="" used to contain the <link> value as parsed from the XML or ATOM source feed. This was typically the source gallery page that hosted the image. This no longer appears to be the case and I'm not quite sure why.

Has anyone else noticed this change and/or know of any possible solutions? Any suggestions would be greatly appreciated.

Thanks!

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to

To view this message on the web, visit

For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-search-api+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
回复全部
回复作者
转发
0 个新帖子