support.php
2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
$setup1 = get_option('ebayaffinity_setup1');
$setup2 = get_option('ebayaffinity_setup2');
$setup3 = get_option('ebayaffinity_setup3');
$setup4 = get_option('ebayaffinity_setup4');
$setup5 = get_option('ebayaffinity_setup5');
if ((!empty($setup1)) && (!empty($setup2)) && (!empty($setup3)) && (!empty($setup4)) && (!empty($setup5))) {
?>
<script type="text/javascript">
window.zESettings = {
webWidget: {
helpCenter: {
filter: {
category: '203792408-eBay-Sync-for-WooCommerce'
}
}
}
};
function zendesk_web_widget(){
window.zEmbed = window.zE = null;
jQuery('head iframe[src="javascript:false"]').remove();
(function(url, host) {
var queue = [],
dom,
doc,
where,
iframe = document.createElement('iframe'),
iWin,
iDoc;
window.zEmbed = function() {
queue.push(arguments);
};
window.zE = window.zE || window.zEmbed;
iframe.src = 'javascript:false';
iframe.title = ''; iframe.role='presentation'; // a11y
(iframe.frameElement || iframe).style.cssText = 'display: none';
where = document.getElementsByTagName('script');
where = where[where.length - 1];
where.parentNode.insertBefore(iframe, where);
iWin = iframe.contentWindow;
iDoc = iWin.document;
try {
doc = iDoc;
} catch(e) {
dom = document.domain;
iframe.src='javascript:var d=document.open();d.domain="'+dom+'";void(0);';
doc = iDoc;
}
doc.open()._l = function() {
var js = this.createElement('script');
if (dom) this.domain = dom;
js.id = 'js-iframe-async';
js.src = url;
this.t = +new Date();
this.zendeskHost = host;
this.zEQueue = queue;
this.body.appendChild(js);
};
doc.write('<body onload="document._l();">');
doc.close();
}('//assets.zendesk.com/embeddable_framework/main.js', "ebaysync.zendesk.com"));
}
jQuery(document).on("ready page:load", function() {
zendesk_web_widget();
});
</script>
<?php
}