var d = document;
var e;
e = d.getElementById ("kunleisys-reviews");
if (e != null)
{
e.innerHTML = "
5.8 / 6.0
Excellent
100% Recommendation
107 Reviews
Reviews of our customers:Review at 05-Mar-2023
What did you find particularly favourable during your stay:
Review at 21-Feb-2023
What did you find particularly favourable during your stay:
Review at 19-Feb-2023
What did you find particularly favourable during your stay:
Review at 30-Jan-2023
What did you find particularly favourable during your stay:
Review at 09-Sep-2022
What did you find particularly favourable during your stay:
Review at 26-Jul-2022
What did you find particularly favourable during your stay:
Review at 22-Jun-2022
What did you find particularly favourable during your stay:
Review at 22-Jun-2022
What did you find particularly favourable during your stay:
Review at 31-Jan-2022
What did you find particularly favourable during your stay:
";
}
else
{
alert ("Cannot find DIV-Element for KunLeiSys-Widget");
}
(function doMagic() {
let btnShowLess = null;
let btnShowMore = document.getElementById("btn-show-more");
let maxComments = 10; // Amount of comments to show on btnClick
if (document.querySelectorAll("#table_detail").length <= 0)
return;
if (hideElements())
addButton();
function addButton() {
let parentContainer = document.querySelector("#kunleisys-reviews");
if (parentContainer == null || document.querySelector("#table_detail") === null)
return false;
if (btnShowMore !== null)
btnShowMore.parentElement.remove();
let div = document.createElement("div");
div.id = "btn-wrapper";
div.setAttribute("style", "display:grid;grid-template-columns:auto auto;grid-gap:8px;justify-content:center;padding:16px;text-align:center;")
btnShowLess = createButton("btn-show-less", "Weniger Bewertungen anzeigen", "none");
btnShowLess.onclick = () => { showLess(); };
div.appendChild(btnShowLess);
btnShowMore = createButton("btn-show-more", "Mehr Bewertungen anzeigen");
btnShowMore.onclick = () => { showMore(); };
div.appendChild(btnShowMore);
parentContainer.appendChild(div);
return true;
}
function createButton(id, content, display) {
let btn = document.createElement("button");
btn.id = id;
btn.setAttribute("style", "border:1px solid #ccc;color:#888;background-color:#fff;font-size:medium;padding:16px 10px;width:auto;height:auto;line-height:unset;");
btn.innerHTML = content;
if (display != null && display !== "")
btn.style.display = display;
return btn;
}
function hideElements() {
let max = Math.max(maxComments, 15)
let comments = document.querySelectorAll("#table_detail");
if (comments == null || comments.length <= max)
return false;
for(let i = maxComments; i < comments.length; i++)
comments[i].style.display = "none";
return true;
}
function showMore() {
let hiddenComments = document.querySelectorAll("#table_detail[style*='display: none']");
if (hiddenComments == null)
return false;
for(let i = 0; i < 10 && i < hiddenComments.length; i++)
hiddenComments[i].style.display = "";
setButtonState();
}
function showLess() {
let visibleComments = document.querySelectorAll("#table_detail:not([style*='display: none'])");
if (visibleComments == null || visibleComments.length <= 10)
return false;
let start = Math.max(maxComments, visibleComments.length - 10);
for(let i = start; i < visibleComments.length; i++)
visibleComments[i].style.display = "none";
setButtonState();
}
function setButtonState() {
let vc = document.querySelectorAll("#table_detail:not([style*='display: none'])");
if (vc.length <= maxComments)
btnShowLess.style.display = "none";
else
btnShowLess.style.display = "";
let hc = document.querySelectorAll("#table_detail[style*='display: none']");
if (hc == null || hc.length <= 0)
btnShowMore.style.display = "none";
else
btnShowMore.style.display = "";
}
})();