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

On Mon, Apr 13, 2015 at 7:18 PM, Neil Ennis <[email protected]> wrote:

> 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());
>
>
> On Thursday, 2 April 2015 05:53:16 UTC+10, [email protected] 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:
>>
>> http://uds.googleusercontent.com/uds/solutions/slideshow/helloworld.html
>>
>> 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
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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
> <https://groups.google.com/d/msgid/google-ajax-search-api/4e03ba77-3656-4244-8b51-dc48802c6edd%40googlegroups.com?utm_medium=email&utm_source=footer>
>
> 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 [email protected].
> 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!
> http://www.debraheightswesleyan.org
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/CAF4cwg_2mcayz2wb-RA%2Bjcf_Gv7zZaa8MdiYubZn1UY1BOV5sg%40mail.gmail.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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to