I added the Pinterest hover module and the assets.pinterest script that is added via that module hijacks the link and converts it to the "pin it" button that shows when hovering images. This was annoying and took awhile to figure out.
Anyways, the solution for me was the following from stack overflow question:
Adding an encoded whitespace before the last fragment of the URL will prevent Pinterest's JS from "hijacking" the link:
Change line #296 in rrssb.module from this:
'pinterest' => '<a href="http://pinterest.com/pin/create/button/?url=' . $my_url . '&media=' . $logo .'&description=' . urlencode($my_title) . '" class="popup">
to this:
'pinterest' => '<a href="http://pinterest.com/pin/create%2Fbutton/?url=' . $my_url . '&media=' . $logo .'&description=' . urlencode($my_title) . '" class="popup">
Notice, all we change is the forward slash convention (%2f) so pinterest's script doesn't override.
//pinterest.com/pin/create<strong>%2F</strong>button/?url=
Hopefully this helps someone else out. If module maintainer doesn't see problem with this it would be nice to add.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2566647-6.patch | 1.11 KB | giorgosk |
| #4 | Adding_an_encoded_whitespace_before_the_last_fragment_of_the_URL_will_prevent_Pinterest_2.patch | 1.5 KB | mist |
Comments
Comment #2
adamps commentedThanks, sounds like a good idea to me.
The ideal way for you to present a code idea for a module is in the form of a patch - see https://www.drupal.org/node/707484.
I would suggest adding a code comment explaining why: "Adding an encoded whitespace before the last fragment of the URL will prevent Pinterest's JS from "hijacking" the link:"
Comment #3
mist commented+1 Thanks for good advice. Patch below.
Comment #4
mist commentedI think something was wrong with my previous patch.
Comment #5
adamps commentedThanks for your continuing interest. I think what is needed next is
Comment #6
giorgoskPatched for the latest dev version
its a trivial patch and it works for me @cthshabel and @mist
so I mark it reviewed and tested by the community
Comment #7
adamps commentedThanks please add comment as per #2 then happy to commit
Comment #8
giorgoskI don't know the exact comment you want so I will leave it as is
Comment #9
adamps commented