CartoDB / odyssey.js

Making it easy to merge map and narrative
BSD 3-Clause "New" or "Revised" License
1.62k stars 188 forks source link

„Share Story“ Button doesn’t work, error: „ZeroClipboard is deprecated“ #222

Open tibor opened 6 years ago

tibor commented 6 years ago

Hi,

we discovered odyssey.js last week and built a card with it. Unfortunately, the „share story“ button doesn’t work for us, neither in Chrome nor in Firefox or Safari.

I checked the console and got following error messages when I clicked on the button:

`new ZeroClipboard(elements, options)` is deprecated. See docs for more info:
    https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md#deprecations
C @ ZeroClipboard.min.js:9
K @ ZeroClipboard.min.js:9
(anonymous) @ sandbox.js:202
(anonymous) @ d3.js:1047
d3.js:1921 POST https://api.github.com/gists 401 (Unauthorized)
xhr.send @ d3.js:1921
xhr.(anonymous function) @ d3.js:1907
(anonymous) @ sandbox.js:569
(anonymous) @ d3.js:1918
event @ d3.js:430
respond @ d3.js:1871
load (async)
d3_xhr @ d3.js:1859
(anonymous) @ d3.js:1853
Gist @ sandbox.js:555
(anonymous) @ sandbox.js:194
(anonymous) @ d3.js:1047
sandbox.js:570 Uncaught TypeError: Cannot read property 'responseText' of undefined
    at Object.<anonymous> (sandbox.js:570)
    at Object.event (d3.js:430)
    at XMLHttpRequest.respond (d3.js:1873)
erlenbusch commented 6 years ago

+1 please help!

bplmp commented 6 years ago

I'm afraid this is because of the POST https://api.github.com/gists 401 (Unauthorized), which is trying to post a gist to Carto's account from the sandbox. Maybe this is a simple fix?

bplmp commented 6 years ago

Related: github removed anonymous gist creation in February 2018, which probably broke this.

Not sure how this can be fixed, since Carto will probably not authenticate to create sandbox users' gists. Maybe the best solution for now is to teach users on how to create their own gists and view them on bl.ocks.

erlenbusch commented 6 years ago

@bplmp unfortunately, the problem for us is that we need to utilize iframes, which was apart of the sharing feature of odyssey.js, and bl.ocks hasn't supported since 2016.

I haven't been able to get a similar solution from using rawgit.com either. Suggestions welcome!

bplmp commented 6 years ago

@erlenbusch then perhaps you could use github pages? I've used iframes from github pages in other sites previously and it worked ok.