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

whatsapp #43

Open
halukkaramete opened this issue Mar 21, 2020 · 1 comment
Open

whatsapp #43

halukkaramete opened this issue Mar 21, 2020 · 1 comment

Comments

@halukkaramete
Copy link

halukkaramete commented Mar 21, 2020

Hi Max,

Probably it is no news to you, but I just want to tell that I appreciate your code. :)

I've got one question on how to bring in new sharers..
I've checked the twitter.js to understand what is going on there.
But the code there is minimized/uglified for a good reason.

Could you recommend a place where I can go get/or study & build ,say WhatsApp sharing, capability for example?

@halukkaramete
Copy link
Author

Well, I figured it out! it was not all that bad. This should give others to lead...

        <script>
// put this in whatsapp.js if you like, just like the twitter.js
          !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(e.ShareThisViaWhatsApp=e.ShareThisViaWhatsApp||{})}(this,function(e){"use strict";function o(e,o,n){return'<a href="'+this.getShareUrl(e,n)+'" target="_blank" rel="noopener nofollow noreferrer"><img src=https://icons.iconarchive.com/icons/dtafalonso/android-l/32/WhatsApp-icon.png></a>'}function n(e,o){return"https://web.whatsapp.com/send?text=="+encodeURIComponent(e)+"&u="+encodeURIComponent(o)}function t(e,o){e.preventDefault(),o.ownerDocument.defaultView.open(o.firstChild.href,"share_via_whatsapp","height=440,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,width=640").opener=null}e.render=o,e.getShareUrl=n,e.action=t,e.name="whatsapp",Object.defineProperty(e,"__esModule",{value:!0})});
        </script>
        <script src="https://maxart2501.github.io/share-this/dist/sharers/twitter.js"></script>
        <script>
          ShareThis({
              sharers: [ ShareThisViaTwitter,  ShareThisViaWhatsApp, ShareThisViaReddit  ],
              selector: "article"
          }).init();
</script>

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

No branches or pull requests

1 participant