Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stevermeister opened this issue Jun 20, 2016 · 14 comments
Open

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

stevermeister opened this issue Jun 20, 2016 · 14 comments

Comments

@stevermeister
Copy link

strange error during application unit tests.

@stevermeister
Copy link
Author

stevermeister commented Jun 20, 2016

it looks like load is undefined for some cases:

 Object {languages: Object, calendar_urls: Object, load: undefined}

@stevermeister
Copy link
Author

it looks like it's broken from version 1.5.2

@truongnguyen1912
Copy link

I think it is related to #11 PR :D

@akrohn
Copy link

akrohn commented Jul 15, 2016

+1

@akrohn
Copy link

akrohn commented Jul 18, 2016

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
Copy link
Contributor

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

@stevermeister
Copy link
Author

@atc-master
great! thank you!

@stevermeister
Copy link
Author

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

@stevermeister stevermeister reopened this Sep 2, 2016
@thoughtpalette
Copy link

Also have this same exact issue.

@ShaneHowell
Copy link

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
Copy link

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

@atc-master atc-master changed the title TypeError: undefined is not a constructor (evaluating 'addtocalendar.load()') at .../addtocalendar.js:1 Synchronize code version: addtocalendar.com, github, npm Jan 24, 2017
@atc-master atc-master added the bug label Jan 24, 2017
@atc-master atc-master added this to the 2.0 milestone Jan 24, 2017
@atc-master
Copy link
Contributor

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

@SiAdcock
Copy link

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
Copy link

crgeary commented Mar 28, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants