AddToCalendar / addtocalendar

Free customizable JavaScript widget "Add to Calendar" for event page. It allows users to easily schedule the event in their calendar. Learn more: https://addtocalendar.com
87 stars 43 forks source link

Synchronize code version: addtocalendar.com, github, npm #9

Open stevermeister opened 8 years ago

stevermeister commented 8 years ago

strange error during application unit tests.

stevermeister commented 8 years ago

it looks like load is undefined for some cases:

 Object {languages: Object, calendar_urls: Object, load: undefined}
stevermeister commented 8 years ago

it looks like it's broken from version 1.5.2

truongnguyen1912 commented 8 years ago

I think it is related to #11 PR :D

akrohn commented 8 years ago

+1

akrohn commented 8 years ago

Changing the line: addtocalendar.load = ready(function () { to: addtocalendar.load = function () {

And changing:

    });
    addtocalendar.load();

to:

    };
    addtocalendar.load();

fixes the problem for me.

Hope this helps.

atc-master commented 8 years ago

Sorry for long response time. Please check out the fix!

stevermeister commented 8 years ago

@atc-master great! thank you!

stevermeister commented 8 years ago

stange, version 1.5.3 is still broken for me (tried via bower)

I'm still getting this error: screen shot 2016-09-02 at 15 24 20

thoughtpalette commented 8 years ago

Also have this same exact issue.

ShaneHowell commented 8 years ago

I did some digging since the plugin does what I want minus erring with the NPM package:

The NPM version is different than the GitHub::Master version. The NPM version doesn't contain the NPM fixes but the GitHub::Master one does.

So for me, I ended up including the script this way:

<script type="text/javascript">(function () {
  if (window.addtocalendar)if(typeof window.addtocalendar.start == "function")return;
  if (window.ifaddtocalendar == undefined) { window.ifaddtocalendar = 1;
    var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
    s.type = 'text/javascript';s.charset = 'UTF-8';s.async = true;
    s.src = ('https:' == window.location.protocol ? 'https' : 'http')+'://addtocalendar.com/atc/1.5/atc.min.js';
    var h = d[g]('body')[0];h.appendChild(s); }})();
</script>

and I was finally able to use it in a callback.

kirbee-parsons-hs commented 7 years ago

@atc-master Can you update the npm package to use the fix please?

atc-master commented 7 years ago

Guys! Sorry for long time response. Thank you for help and support!

SiAdcock commented 7 years ago

Hi, would it be possible to publish the latest version of ATC to npm? This would fix this issue for users of npm, Bower and unpkg.com. Please let me know if you need help on how to do this

crgeary commented 7 years ago

Would also be happy to help with this too.. I've recently learnt you can automate the process of deploying to NPM. Me and @SiAdcock would be happy to help you out with this if you needed a hand.