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

add Zendesk Chat Tag #58

Merged
merged 2 commits into from Aug 19, 2018
Merged

add Zendesk Chat Tag #58

merged 2 commits into from Aug 19, 2018

Conversation

Findus23
Copy link
Member

Works in my quick test and is pretty straight forward.

Unfortunately there is no nice way to copy the ID.

The widget looks like this:

<!--Start of Zendesk Chat Script-->
<script type="text/javascript">
    window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
        d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
    _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");
        $.src="https://v2.zopim.com/?5vsZG8Jx0J9FS85qxc6Xn5MMIfVBDzML";z.t=+new Date;$.
            type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");
</script>
<!--End of Zendesk Chat Script-->

I tried to de-minimize it a bit to make it more readable.

@Findus23 Findus23 added Needs Review New Tag Adding a new Tag labels Aug 15, 2018
Copy link
Member

@tsteur tsteur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works 👍 will merge next time with the other tags so don't have to fix the tests after merging too often.

return function (parameters, TagManager) {
this.fire = function () {
var zendeskChatId = parameters.get("zendeskChatId");
window.$zopim || (function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, maybe we could add a check to execute it only if a zendeskChatId exists: if (! zendeskChatId) {return;}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While a check never hurts, I can't think of a way it could be undefined if it is required.

@tsteur tsteur merged commit a1d2bee into master Aug 19, 2018
@tsteur tsteur deleted the zendesk branch August 19, 2018 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Tag Adding a new Tag
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants