(function (w, d) {
w.tsUpdateMetaDescription = function () {
var existingTitle = document.querySelector('title').innerText;
document.querySelector('title').innerText = "***** Rating: 4.8 - 56 Reviews - " + existingTitle;
var existingDesc = document.querySelector('meta[name="description"]').getAttribute("content");
document.querySelector('meta[name="description"]').setAttribute("content", "***** Rating: 4.8 - 56 Reviews - " + existingDesc);
};
var timestamp = document.createElement("meta");
timestamp.setAttribute("name", "ts-timestamp");
timestamp.setAttribute("content", new Date().toLocaleString());
document.head.appendChild(timestamp);
var businessKey = "xxk55f43";
var locationKey = "csih81eb";
var tenantKey = "";
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnRpdHlJZCI6ImNzaWg4MWViIiwiZXhwIjoxNzI1NzU2MTIwLCJpc3MiOiJUcnVzdGlzdCIsImF1ZCI6IldpZGdldHMifQ.fDtrRr1nz8IguXnKB8tg6vAOqumLNVqwjCXiXuG5gaE";
function start(f) { /in/.test(document.readyState) ? setTimeout(start, 5, f) : f(); }
tsAddCssTag("https://fonts.googleapis.com/css2?family=Poppins&display=swap");;
tsAddCssTag("https://wassets.trustist.com/assets/css/cleanslate.css");
tsAddCssTag("https://wassets.trustist.com/assets/css/sidebar.css");
start(function () {
if (d.getElementById("ts-json") === null) {
var filter = Array.prototype.filter;
var els = d.querySelectorAll('h1,title,h2');
var productName = "Great Park Homecare Windsor";
var field = filter.call(els, function (node) {
return node.innerText != "";
})[0];
if (typeof field !== "undefined") {
productName = field.innerText;
}
var json = "[{\"@type\":\"Product\",\"@id\":\"{{url}}#trustist\",\"description\":null,\"logo\":\"https://content.trustist.com/brandlogos/eefe09ac-3f4e-4ab2-891d-bd9bdb8eeeb5.png\",\"image\":[\"https://content.trustist.com/brandlogos/eefe09ac-3f4e-4ab2-891d-bd9bdb8eeeb5.png\"],\"name\":\"{{productName}}\",\"alternateName\":null,\"hasMap\":null,\"geo\":null,\"telephone\":null,\"url\":\"{{url}}\",\"address\":null,\"branchOf\":null,\"openingHoursSpecification\":null,\"sameAs\":[\"https://www.trustist.com/local-reviews/Review-great-park-homecare-windsor-Reviews-40192.html\"],\"@context\":\"http://schema.org\",\"brand\":{\"@type\":\"Organization\",\"@id\":null,\"description\":null,\"logo\":\"https://content.trustist.com/brandlogos/eefe09ac-3f4e-4ab2-891d-bd9bdb8eeeb5.png\",\"image\":[\"https://content.trustist.com/brandlogos/eefe09ac-3f4e-4ab2-891d-bd9bdb8eeeb5.png\"],\"name\":\"Great Park Homecare\",\"alternateName\":null,\"hasMap\":null,\"geo\":null,\"telephone\":null,\"url\":null,\"address\":null,\"branchOf\":null,\"openingHoursSpecification\":null,\"sameAs\":null},\"aggregateRating\":{\"@type\":\"AggregateRating\",\"ratingValue\":4.8,\"bestRating\":5,\"worstRating\":1,\"reviewCount\":56},\"review\":null,\"mpn\":\"{{url}}\",\"sku\":\"{{url}}\"},{\"@type\":\"LocalBusiness\",\"@id\":\"https://www.trustist.com/local-reviews/Review-great-park-homecare-windsor-Reviews-40192.html\",\"description\":null,\"logo\":\"https://content.trustist.com/brandlogos/eefe09ac-3f4e-4ab2-891d-bd9bdb8eeeb5.png\",\"image\":[\"https://content.trustist.com/brandlogos/eefe09ac-3f4e-4ab2-891d-bd9bdb8eeeb5.png\"],\"name\":\"Great Park Homecare\",\"alternateName\":\"Great Park Homecare Windsor\",\"hasMap\":\"https://maps.google.com/maps?cid=7191274964067434073\",\"geo\":{\"@type\":\"GeoCoordinates\",\"latitude\":\"\",\"longitude\":\"\"},\"telephone\":\"\",\"url\":null,\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":\"\",\"addressLocality\":\"\",\"addressRegion\":null,\"postalCode\":null,\"addressCountry\":null},\"branchOf\":{\"@type\":\"Organization\",\"name\":\"Great Park Homecare\",\"sameAs\":null},\"openingHoursSpecification\":[{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Sunday\",\"opens\":\"08:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Monday\",\"opens\":\"08:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Tuesday\",\"opens\":\"08:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Wednesday\",\"opens\":\"08:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Thursday\",\"opens\":\"08:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Friday\",\"opens\":\"08:00:00\"},{\"@type\":\"OpeningHoursSpecification\",\"closes\":\"22:00:00\",\"dayOfWeek\":\"http://schema.org/Saturday\",\"opens\":\"08:00:00\"}],\"sameAs\":[\"https://maps.google.com/maps?cid=7191274964067434073\",\"https://www.facebook.com/871570042936431\",\"https://www.homecare.co.uk/homecare/agency.cfm/id/65432212822#reviews\"],\"@context\":\"http://schema.org\",\"aggregateRating\":null,\"review\":null,\"paymentAccepted\":null,\"makesOffer\":null}]";
var a = d;
var c = a.createElement("script");
c.type = 'application/ld+json';
c.id = 'ts-json';
c.innerText = json
.replace(new RegExp("{{url}}", 'g'), w.location.href)
.replace("{{productName}}", productName)
.replace("\"{{productDesc}}\"", JSON.stringify((d.body.innerText || d.body.textContent).replace(/[^ -~]+/g, "").substring(0, 200) + "..."));
a = a.getElementsByTagName("head")[0];
a.appendChild(c);
}
// iterate over all widgets on the page and render
var div = document.querySelector("[ts-sidebarWidget],div.ts-sidebarWidget");
if (div) {
tsDisplayWidget(div, businessKey, locationKey, tenantKey);
}
else {
}
});
function tsDisplayWidget(target) {
// get options before cleanslate
var options = tsReadAttributes(target);
// draw the main template
var template = '
';
var theme = options.theme;
if (theme !== "white" && theme !== "blue" && theme !== "orange") theme = "white";
var buttonLogo = options.theme === "white" ? "TrustedBy-01.svg" : "TrustedBy-White-01.svg";
target.innerHTML = template
.replace(new RegExp("{{side}}", "g"), options.side)
.replace(new RegExp("{{theme}}", "g"), theme)
.replace(new RegExp("{{buttonLogo}}", "g"), buttonLogo)
.replace(new RegExp("{{buttonBottom}}", "g"), options.widgetBottom)
.replace(new RegExp("{{url}}", "g"), options.reviewPageUrl || "https://www.trustist.com/local-reviews/Review-great-park-homecare-windsor-Reviews-40192.html");
// draw the reviews
var xhr = new XMLHttpRequest();
var url = tsBuildUrl(options);
xhr.open("GET", url);
xhr.onload = function () {
if (xhr.status === 200 && xhr.responseText !== "") {
var reviews = JSON.parse(xhr.responseText);
tsDrawReviews(target, reviews, options);
tsWireUp(options);
} else {
}
};
xhr.send();
}
function tsBuildUrl(options) {
var url = "https://widget.trustist.com/reviewlistdata?v=1&accessToken=" + accessToken + "&pageNum=1&pageSize=" + options.pageSize;
if (typeof tenantKey !== "undefined" && tenantKey !== "") url += "&tenantKey=" + tenantKey;
if (typeof businessKey !== "undefined" && businessKey !== "") url += "&businessKey=" + businessKey;
if (typeof locationKey !== "undefined" && locationKey !== "") url += "&locationKey=" + locationKey;
if (options.ratingsAbove > 0) url += "&ratingFrom=" + options.ratingsAbove;
if (options.exclude > '') url += "&exclude=" + options.exclude;
return url;
}
function tsDrawReviews(target, reviews, options) {
var reviewContent = '';
var template = '
';
var replyTemplate = '';
reviews.forEach(function (review) {
var d = new Date(review.datePublished);
var reviewDate = d.getDate() + ' ' + months[d.getMonth()] + ' ' + d.getFullYear();
var thisReview = template
.replace('{{reviewSourceLogo}}', review.image)
.replace('', review.author.name)
.replace('', reviewDate)
.replace('{{rating}}', (review.reviewRating.ratingValue / 2).toFixed(1))
.replace('{{reviewStarsWidth}}', ((130 * review.reviewRating.ratingValue / 5).toFixed(0)))
.replace('', review.reviewBody);
if (review.reply > '') {
var replyDate = new Date(review.replyDate);
var replyDateString = replyDate.getDate() + " " + months[replyDate.getMonth()] + " " + replyDate.getFullYear();
thisReview = thisReview.replace(
'',
replyTemplate
.replace('', review.reply)
.replace('', replyDateString));
}
reviewContent += thisReview;
});
target.innerHTML = target.innerHTML.replace('', reviewContent).replace('', reviews.length);
}
function tsReadAttributes(target) {
return {
pageSize: target.getAttribute("ts-page-size") || 20,
side: target.getAttribute("ts-side") === "left" ? "left" : "right",
ratingsAbove: parseInt(target.getAttribute("ts-ratings-above")) || 0,
exclude: target.getAttribute("ts-exclude") || "",
theme: target.getAttribute("ts-theme") || "white",
reviewPageUrl: target.getAttribute("ts-reviews-url"),
widgetBottom: target.getAttribute("ts-widget-bottom") || 13.0625,
};
}
function tsAddCssTag(url) {
var includedAlready = tsCheckIfIncluded(url);
var head = d.getElementsByTagName("head")[0];
if (!includedAlready) {
var tag = d.createElement("link");
tag.rel = "stylesheet";
tag.type = "text/css";
tag.href = url;
head.appendChild(tag);
}
}
function tsCheckIfIncluded(file) {
var links = d.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
if (links[i].href?.substr(-file.length) === file)
return true;
}
var scripts = d.getElementsByTagName("script");
for (var j = 0; j < scripts.length; j++) {
if (scripts[j].src?.substr(-file.length) === file)
return true;
}
return false;
}
function addClass(element, className) {
if (element.classList) {
element.classList.add(className); // Modern Browsers
} else {
var currentClassName = element.className;
if (currentClassName.indexOf(className) === -1) {
element.className += ' ' + className; // Older Browsers
}
}
}
function removeClass(element, className) {
if (element.classList) {
element.classList.remove(className); // Modern Browsers
} else {
var currentClassName = ' ' + element.className + ' ';
var classToRemove = ' ' + className + ' ';
if (currentClassName.indexOf(classToRemove) !== -1) {
element.className = currentClassName.replace(classToRemove, ' ').trim(); // Older Browsers
}
}
}
function closeOverlayHover(e) {
var overlay = d.getElementById('ts-sidebar-overlay');
var overlayInner = d.getElementById('ts-sidebar-overlay-inner');
var overlayPopoverLink = d.getElementById('ts-sidebar-read-more-reviews-btn');
removeClass(overlayInner, 'ts-sidebar-overlay-inner-visible');
removeClass(overlayPopoverLink, 'ts-sidebar-read-more-reviews-btn-visible');
overlayInner.addEventListener(
'transitionend',
function () {
removeClass(overlay, 'ts-sidebar-overlay-visible');
},
{ once: true }
);
}
function closeOverlayClick(e) {
var overlay = d.getElementById('ts-sidebar-overlay');
var overlayInner = d.getElementById('ts-sidebar-overlay-inner');
var overlayPopoverLink = d.getElementById('ts-sidebar-read-more-reviews-btn');
if (e.target === overlay || e.target.closest('.ts-sidebar-overlay-close-btn')) {
removeClass(overlayInner, 'ts-sidebar-overlay-inner-visible');
removeClass(overlayPopoverLink, 'ts-sidebar-read-more-reviews-btn-visible');
overlayInner.addEventListener(
'transitionend',
function () {
removeClass(overlay, 'ts-sidebar-overlay-visible');
},
{ once: true }
);
}
}
function openOverlay() {
var overlay = d.getElementById('ts-sidebar-overlay');
var overlayInner = d.getElementById('ts-sidebar-overlay-inner');
addClass(overlay, 'ts-sidebar-overlay-visible');
addClass(overlayInner, 'ts-sidebar-overlay-inner-visible');
}
function handleShowOverlayPopover() {
var overlayPopoverLink = d.getElementById('ts-sidebar-read-more-reviews-btn');
overlayPopoverLink.classList.add('ts-sidebar-read-more-reviews-btn-visible');
}
function tsWireUp(options) {
var button = d.getElementById('ts-sidebar-button');
var overlayInner = d.getElementById('ts-sidebar-overlay-inner');
var overlayCloseBtn = d.getElementById('ts-sidebar-overlay-close-btn');
button.addEventListener('mouseover', openOverlay);
overlayInner.addEventListener('mouseleave', closeOverlayHover);
overlayCloseBtn.addEventListener('click', closeOverlayClick);
overlayInner.addEventListener('scroll', handleShowOverlayPopover);
}
})(window, document);