dejanstojanovic / Facebook-Album-Browser

jQuery plugin for browsing public albums of a Facebook account
http://dejanstojanovic.github.io/Facebook-Album-Browser/
MIT License
74 stars 42 forks source link

share photos from lightbox #22

Closed dchicon closed 9 years ago

dchicon commented 9 years ago

Hello Dejan! I still tying to share the images from lightbox.... I try to do it using addthis, but i can´t. They tell me that I´ve to call the addthis.init(); and addthis.layers.refresh(); functions in the same function that loads the lightbox... No idea of how to do it, and not much help in google

Those are the codes they give me to put into the body of the html.

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50360b776f77c6a6" async="async"></script>
<div id ="botones" class="addthis_sharing_toolbox"></div>

Thank you

dejanstojanovic commented 9 years ago

Hi, The answer you got is correct, this method needs to be called every time new image is loaded. Since I am using a custom code for a light box, adding AddThis elements and its initialization needs to be done in this custom code I wrote in order to support AddThis.

Find function addLikeButton (line 464). This is basically the place where you need to dynamically add your AddThis html and initialize AddThis code. Let me know if this helped.

dchicon commented 9 years ago

Hi Dejan, Thanks for the answer. The problem is that I´m not a developer,( not pro, only amateur. I´m graphic designer) so it´s really difficult for me to change the code because first I´ve to research in google, and as i told you, not much help with addthis.init() and addthis.layers.refresh(). Some extra help, please? Thank you very much

dejanstojanovic commented 9 years ago

No problem man, I'll try to add this thing as an option for the plugin. I already started doing some code, so hopefully soon it will be there. Will let you know

dchicon commented 9 years ago

Great! you're invited to some beers in Spain when you wanna!

dejanstojanovic commented 9 years ago

Give it a try now. Set shareButton to true and addThis to your AddTHis public id from your account. You can check sample test page in this solution as it has these settings which I used to do testing. Let me know if you spot any issue

dchicon commented 9 years ago

It doesn´t work. Addthis don´t appears

dejanstojanovic commented 9 years ago

That is weird. Make sure you took the latest code from the GitHub. Make sure you are running page from some local web server, IIS Expressor XAMP or what ever you have on your machine. Can you send me the HTML code which you use to initialize plugin on your page?

dchicon commented 9 years ago

I test it on Plunker, and i load your code into my server.

<!DOCTYPE html>

``` ```
dchicon commented 9 years ago

how to attach a html code?

dchicon commented 9 years ago

El 04/08/2015, a las 10:39, Dejan Stojanovic notifications@github.com escribió:

That is weird. Make sure you took the latest code from the GitHub. Make sure you are running page from some local web server, IIS Expressor XAMP or what ever you have on your machine. Can you send me the HTML code which you use to initialize plugin on your page?

— Reply to this email directly or view it on GitHub.

dchicon commented 9 years ago

Sent. Thanks again, Dejan

dejanstojanovic commented 9 years ago

I did the same test in Plunker demo and it worked. Check the screenshot addthis I just added addThis value, the same one you provided

dejanstojanovic commented 9 years ago

By the way, take the latest as I just updated code for updating dynamically AddThis URL. It points to Facebook location of the photo

dchicon commented 9 years ago

ufff... gremlins invades my imac. with your new test.html and codes loaded into my server... it´s doesn´t work!! I fell like a stupid. captura de pantalla 2015-08-04 a la s 12 45 14

dchicon commented 9 years ago

There are 2 shareButtons options in test.html. Is it ok?

dejanstojanovic commented 9 years ago

Relax, we'll find what is wrong, no worries :) I think number of buttons depends on the settings you have related to your pub-id from AddThis. I believe you can add more through AddThis settings when you login to their dashboard. Check with pub-id I added in test.html, that one for sure has 4 buttons. By the way, I limited number of buttons to 4, so in case you have more it will only show up only first 4 :)

dchicon commented 9 years ago

tested with your test.html, and codes uploads into my server. Broken arrow again :( I think gremlins are taking a bath into motherboard. Can´t you hear the party? captura de pantalla 2015-08-04 a la s 13 16 11

dchicon commented 9 years ago

look: if i click your "checkout demo on plunker" and i change the body for the one of your new test.html... It´s work!! Like this, plunker work with the codes uploads on your server!

uppps... "checkout demo on plunker" doesn´t work anymore { "statusCode": 400, "error": "Bad Request", "message": "Invalid cookie value" }

dejanstojanovic commented 9 years ago

OK, let's do it this way. Since I used test.html to test and develop everything, grab latest from GitHub, set it up and run on your machine. Than one should work definitely.

I am pretty sure it has something to do with the cached stuff in a browser, but just to make sure, run the code from GitHub on you local and let me know if you are still experiencing any issues

dchicon commented 9 years ago

Sorry Dejan, but github doesn´t work anymore. Same error { "statusCode": 400, "error": "Bad Request", "message": "Invalid cookie value" }

dchicon commented 9 years ago

Hi Dejan. Tested on a local host: with the code of your server it work, and addThis too; but if a I load the actual version of the code into my server... it doesn´t work.

dejanstojanovic commented 9 years ago

Is there any JavaScript error reported by the browser?

dchicon commented 9 years ago

Sorry Dejan!, It works now perfectly with your code and css loaded on my server! Yeeeah!! Take a look

El 05/08/2015, a las 20:58, Dejan Stojanovic notifications@github.com escribió:

Is there any JavaScript error reported by the browser?

— Reply to this email directly or view it on GitHub.

dejanstojanovic commented 9 years ago

Great. Let me know if you find any issue