Skip to content

Commit 4355e58

Browse files
author
Yevhen Lisovenko
committed
fix: added roistat for testing
1 parent 1ef215a commit 4355e58

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

nuxt.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,21 @@ export default {
5555
rel: 'stylesheet'
5656
}
5757
],
58+
__dangerouslyDisableSanitizers: ['script'],
5859
script: [
60+
{
61+
hid: 'roistat-id',
62+
innerHTML: `
63+
(function(w, d, s, h, id) {
64+
w.roistatProjectId = id; w.roistatHost = h;
65+
var p = d.location.protocol == "https:" ? "https://" : "http://";
66+
var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init?referrer="+encodeURIComponent(d.location.href);
67+
var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2);
68+
})(window, document, 'script', 'cloud.roistat.com', 'a5f619e4d3d33285a4091525dad6e0f3');
69+
`,
70+
type: 'text/javascript',
71+
charset: 'utf-8'
72+
},
5973
{
6074
hid: 'uikit',
6175
src: 'https://cdn.jsdelivr.net/npm/uikit@3.6.22/dist/js/uikit.min.js',

pages/roistat.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<div>
3+
<h1 class="uk-heading-small">Roistat Test</h1>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'RoistatPage',
10+
head() {
11+
return {
12+
script: [
13+
{
14+
innerHTML: `
15+
window.onRoistatAllModulesLoaded = function () {
16+
window.roistat.registerOnVisitProcessedCallback(function() {
17+
console.log("Установлен номер визита: " + window.roistat.getVisit());
18+
new window.EasyWeekWidget({
19+
url: "https://widget.easyweek.io/awescode-gmbh?roistat_visit=" + window.roistat.getVisit(),
20+
button: { text: 'Онлайн-запись', showText: true }
21+
});
22+
});
23+
};`,
24+
type: 'text/javascript',
25+
body: true
26+
}
27+
],
28+
// this line need for application/ld+json
29+
__dangerouslyDisableSanitizers: ['script']
30+
}
31+
}
32+
}
33+
</script>

0 commit comments

Comments
 (0)