" : "") + "
"
} else {
if (xrx52m.wp) {
let urlParts = baseUrl.split("/")
let link = urlParts[0] + '/'
if (currentLang && currentLang.toLowerCase().substring(0, 2) === urlParts[1]) {
link = link + "/" + urlParts.slice(2).join("/")
} else {
link = link + "/" + urlParts.slice(1).join("/")
}
link = link.replace(/\/\/$/, "/").replace(/\/\//g, "/")
langEn.innerHTML = "
" : "") + "
"
// langEn.addEventListener("click", (e) => {
// localStorage.setItem("inilingo-lang", "")
// })
// langFlagEn.addEventListener("click", (e) => {
// localStorage.setItem("inilingo-lang", "")
// })
} else {
const url = new URL(window.location.href)
let link = url.origin + url.pathname + url.search.replace(/\&?lang=[a-z-]{2,5}/i, "").replace(/&&/, "&").replace(/&$/, "")
if (link.match(/\?./)) {
link = link + "&lang=" + origLang
} else if (link.match(/\?/)) {
link = link + "lang=" + origLang
} else {
link = link + "?lang=" + origLang
}
langEn.innerHTML = "
" : "") + "
" : "") + "
"
}
}
langEn.style.padding = "5px 8px"
langEn.setAttribute("inrxlang", "true")
const langEdit = document.createElement("div")
langEdit.id = "xrmxrm77fk"
langEdit.style.display = "flex";
langEdit.style.alignItems = "center"
const exitIcon = ''
langEdit.innerHTML = "
" : "") + "
"
} else {
if (xrx52m.wp) {
let urlParts = baseUrl.split("/")
let link = urlParts[0] + '/' + item.toLowerCase().substring(0, 2)
if (currentLang.toLowerCase().substring(0, 2) === urlParts[1]) {
link = link + "/" + urlParts.slice(2).join("/")
} else {
link = link + "/" + urlParts.slice(1).join("/")
}
el.innerHTML = "
" : "") + "
"
} else {
const url = new URL(window.location.href)
let link = url.origin + url.pathname + url.search.replace(/\&?lang=[a-z-]{2,5}/i, "").replace(/&&/, "&").replace(/&$/, "")
if (link.match(/\?./)) {
link = link + "&lang=" + item
} else if (link.match(/\?/)) {
link = link + "lang=" + item
} else {
link = link + "?lang=" + item
}
el.innerHTML = "
" : "") + "
"
}
}
el.style.padding = "5px 8px"
el.setAttribute("inrxlang", "true")
el.classList.add("inirxmenuitem")
el.style.background = menu.bg || "white"
el.style.color = menu.color || "black"
// if (!xrx52m.seo.includes(item)) {
// const langClick = () => {
// if (currentLang !== item) {
// inirxhands = [document.body, document.querySelector("title"), document.querySelector("meta[name='description']")]
// document.querySelectorAll("[placeholder]").forEach((item) => inirxhands.push(item))
// document.querySelectorAll("[type=submit][value]").forEach((item) => inirxhands.push(item))
// ixImgHanding(item)
// langEdit.style.display = "block"
// const editorBox = document.getElementById("xrmxrm77fk")
// if (editorBox) {
// editorBox.remove()
// }
// mainDiv.childNodes[0].before(el)
// menuDiv.appendChild(mainDiv.childNodes[1])
// menuDiv.style.display = "none"
// icon.style.transform = ""
// inirxloadTranslation(item, true)
// }
// }
// el.addEventListener("click", langClick)
// langFlagLang.addEventListener("click", langClick)
// }
if (currentLang === item) {
mainDiv.appendChild(el)
} else {
menuDiv.appendChild(el)
}
})
// const markmeUp = document.createElement("div")
langDiv.id = "xrxmx"
langDiv.classList.add("inirxmenu" + menu.pos)
// langDiv.style.backgroundColor = menu.bg || "white"
// langDiv.style.color = menu.color || "black"
langDiv.style.cursor = "pointer"
// markmeUp.addEventListener("click", () => {
// if (currentLang) {
// markupAll()
// }
// })
mainDiv.appendChild(icon)
if (menu.pos.includes("top")) {
langDiv.appendChild(mainDiv)
langDiv.appendChild(menuDiv)
} else if (menu.pos.includes("bottom")) {
langDiv.appendChild(menuDiv)
langDiv.appendChild(mainDiv)
}
if (document.readyState === "loading") {
// Loading hasn't finished yet
document.addEventListener("DOMContentLoaded", () => {
if (menu.pos.includes("embed") && xrxIniLingoMenuSelector) {
if (!Array.isArray(xrxIniLingoMenuSelector)) {
xrxIniLingoMenuSelectorTemp = [xrxIniLingoMenuSelector]
} else {
xrxIniLingoMenuSelectorTemp = xrxIniLingoMenuSelector
}
setTimeout(() => {
xrxIniLingoMenuSelectorTemp.forEach(xitem => {
const emb = document.querySelector(xitem)
console.log(emb)
const newDiv = flagDiv.cloneNode(true)
if (xrxIniLingoMenuEmptyParent) {
emb.childNodes.forEach(item => item.remove())
}
if (emb.tagName === "IMG") {
emb.after(newDiv)
} else {
emb.appendChild(newDiv)
}
})
}, 1000)
} else {
setTimeout(() => {
document.body.appendChild(langDiv);
}, 1000)
}
})
} else {
// `DOMContentLoaded` has already fired
console.log("lodedit")
if (menu.pos.includes("embed") && xrxIniLingoMenuSelector) {
if (!Array.isArray(xrxIniLingoMenuSelector)) {
xrxIniLingoMenuSelectorTemp = [xrxIniLingoMenuSelector]
} else {
xrxIniLingoMenuSelectorTemp = xrxIniLingoMenuSelector
}
setTimeout(() => {
xrxIniLingoMenuSelectorTemp.forEach(xitem => {
const emb = document.querySelector(xitem)
if (xrxIniLingoMenuEmptyParent) {
emb.childNodes.forEach(item => item.remove())
}
emb.appendChild(flagDiv)
})
}, 1000)
} else {
setTimeout(() => {
document.body.appendChild(langDiv);
}, 1000)
}
}
let modal;
if (markup.markup) {
document.addEventListener("click", (e) => {
if (modal) { return; }
if (e.target.id === "idrxkokowe") {
e.target.remove();
markupElement.classList.remove("inirxhl")
return;
}
if (!markup.action || e.target.closest("[data-notrans]")) {
return;
}
e.stopPropagation();
e.preventDefault()
const a = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT)
a.currentNode = e.target
var range = document.createRange();
let startNode = null;
let endNode = null;
let orig = ""
const inlineClick = isInline(e.target)
while (a.nextNode()) {
range.selectNode(a.currentNode)
if (isInside(e, range.getBoundingClientRect())) {
console.log("barmi")
if (!sentenceNodes.get(a.currentNode)) {
continue;
}
const myNode = sentenceNodes.get(a.currentNode)
startNode = sentenceNodes.get(a.currentNode)[0]
endNode = sentenceNodes.get(a.currentNode)[1]
editedNode = startNode
// console.log(origNodes.get(a.currentNode))
let deNumbered = {}
if (inirxfullTranslation[encodeURIComponent(myNode[2])]) {
console.log(inirxfullTranslation[encodeURIComponent(myNode[2])])
orig = myNode[2]
deNumbered = [myNode[2], {}]
} else {
deNumbered = deNumber(myNode[2])
orig = deNumbered[0]
}
console.log(deNumbered)
if (markupElement) {
markupElement.classList.remove("inirxhl")
}
markupElement = startNode.parentElement
while (inirxgetDisplayType(markupElement).includes("inline")) {
markupElement = markupElement.parentElement
}
markupElement.classList.add("inirxhl")
modal = document.createElement("div")
modal.setAttribute("data-notrans", "true")
modal.id = "idrxkokowe"
modal.style = "position: fixed; inset:0;background: rgba(0,0,0,0.3);z-index:100000;display:flex;align-items:center;justify-content:center;opacity:0;transition: all 0.2s;font-family:Tahoma;font-size:15px;"
modal.innerHTML = "

" : "") + "
"
} else {
if (xrx52m.wp) {
let urlParts = baseUrl.split("/")
let link = urlParts[0] + '/'
if (currentLang && currentLang.toLowerCase().substring(0, 2) === urlParts[1]) {
link = link + "/" + urlParts.slice(2).join("/")
} else {
link = link + "/" + urlParts.slice(1).join("/")
}
link = link.replace(/\/\/$/, "/").replace(/\/\//g, "/")
langEn.innerHTML = "
" : "") + "
"
// langEn.addEventListener("click", (e) => {
// localStorage.setItem("inilingo-lang", "")
// })
// langFlagEn.addEventListener("click", (e) => {
// localStorage.setItem("inilingo-lang", "")
// })
} else {
const url = new URL(window.location.href)
let link = url.origin + url.pathname + url.search.replace(/\&?lang=[a-z-]{2,5}/i, "").replace(/&&/, "&").replace(/&$/, "")
if (link.match(/\?./)) {
link = link + "&lang=" + origLang
} else if (link.match(/\?/)) {
link = link + "lang=" + origLang
} else {
link = link + "?lang=" + origLang
}
langEn.innerHTML = "
" : "") + "
" : "") + "
"
}
}
langEn.style.padding = "5px 8px"
langEn.setAttribute("inrxlang", "true")
const langEdit = document.createElement("div")
langEdit.id = "xrmxrm77fk"
langEdit.style.display = "flex";
langEdit.style.alignItems = "center"
const exitIcon = ''
langEdit.innerHTML = "
" : "") + "
"
} else {
if (xrx52m.wp) {
let urlParts = baseUrl.split("/")
let link = urlParts[0] + '/' + item.toLowerCase().substring(0, 2)
if (currentLang.toLowerCase().substring(0, 2) === urlParts[1]) {
link = link + "/" + urlParts.slice(2).join("/")
} else {
link = link + "/" + urlParts.slice(1).join("/")
}
el.innerHTML = "
" : "") + "
"
} else {
const url = new URL(window.location.href)
let link = url.origin + url.pathname + url.search.replace(/\&?lang=[a-z-]{2,5}/i, "").replace(/&&/, "&").replace(/&$/, "")
if (link.match(/\?./)) {
link = link + "&lang=" + item
} else if (link.match(/\?/)) {
link = link + "lang=" + item
} else {
link = link + "?lang=" + item
}
el.innerHTML = "
" : "") + "
"
}
}
el.style.padding = "5px 8px"
el.setAttribute("inrxlang", "true")
el.classList.add("inirxmenuitem")
el.style.background = menu.bg || "white"
el.style.color = menu.color || "black"
// if (!xrx52m.seo.includes(item)) {
// const langClick = () => {
// if (currentLang !== item) {
// inirxhands = [document.body, document.querySelector("title"), document.querySelector("meta[name='description']")]
// document.querySelectorAll("[placeholder]").forEach((item) => inirxhands.push(item))
// document.querySelectorAll("[type=submit][value]").forEach((item) => inirxhands.push(item))
// ixImgHanding(item)
// langEdit.style.display = "block"
// const editorBox = document.getElementById("xrmxrm77fk")
// if (editorBox) {
// editorBox.remove()
// }
// mainDiv.childNodes[0].before(el)
// menuDiv.appendChild(mainDiv.childNodes[1])
// menuDiv.style.display = "none"
// icon.style.transform = ""
// inirxloadTranslation(item, true)
// }
// }
// el.addEventListener("click", langClick)
// langFlagLang.addEventListener("click", langClick)
// }
if (currentLang === item) {
mainDiv.appendChild(el)
} else {
menuDiv.appendChild(el)
}
})
// const markmeUp = document.createElement("div")
langDiv.id = "xrxmx"
langDiv.classList.add("inirxmenu" + menu.pos)
// langDiv.style.backgroundColor = menu.bg || "white"
// langDiv.style.color = menu.color || "black"
langDiv.style.cursor = "pointer"
// markmeUp.addEventListener("click", () => {
// if (currentLang) {
// markupAll()
// }
// })
mainDiv.appendChild(icon)
if (menu.pos.includes("top")) {
langDiv.appendChild(mainDiv)
langDiv.appendChild(menuDiv)
} else if (menu.pos.includes("bottom")) {
langDiv.appendChild(menuDiv)
langDiv.appendChild(mainDiv)
}
if (document.readyState === "loading") {
// Loading hasn't finished yet
document.addEventListener("DOMContentLoaded", () => {
if (menu.pos.includes("embed") && xrxIniLingoMenuSelector) {
if (!Array.isArray(xrxIniLingoMenuSelector)) {
xrxIniLingoMenuSelectorTemp = [xrxIniLingoMenuSelector]
} else {
xrxIniLingoMenuSelectorTemp = xrxIniLingoMenuSelector
}
setTimeout(() => {
xrxIniLingoMenuSelectorTemp.forEach(xitem => {
const emb = document.querySelector(xitem)
console.log(emb)
const newDiv = flagDiv.cloneNode(true)
if (xrxIniLingoMenuEmptyParent) {
emb.childNodes.forEach(item => item.remove())
}
if (emb.tagName === "IMG") {
emb.after(newDiv)
} else {
emb.appendChild(newDiv)
}
})
}, 1000)
} else {
setTimeout(() => {
document.body.appendChild(langDiv);
}, 1000)
}
})
} else {
// `DOMContentLoaded` has already fired
console.log("lodedit")
if (menu.pos.includes("embed") && xrxIniLingoMenuSelector) {
if (!Array.isArray(xrxIniLingoMenuSelector)) {
xrxIniLingoMenuSelectorTemp = [xrxIniLingoMenuSelector]
} else {
xrxIniLingoMenuSelectorTemp = xrxIniLingoMenuSelector
}
setTimeout(() => {
xrxIniLingoMenuSelectorTemp.forEach(xitem => {
const emb = document.querySelector(xitem)
if (xrxIniLingoMenuEmptyParent) {
emb.childNodes.forEach(item => item.remove())
}
emb.appendChild(flagDiv)
})
}, 1000)
} else {
setTimeout(() => {
document.body.appendChild(langDiv);
}, 1000)
}
}
let modal;
if (markup.markup) {
document.addEventListener("click", (e) => {
if (modal) { return; }
if (e.target.id === "idrxkokowe") {
e.target.remove();
markupElement.classList.remove("inirxhl")
return;
}
if (!markup.action || e.target.closest("[data-notrans]")) {
return;
}
e.stopPropagation();
e.preventDefault()
const a = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT)
a.currentNode = e.target
var range = document.createRange();
let startNode = null;
let endNode = null;
let orig = ""
const inlineClick = isInline(e.target)
while (a.nextNode()) {
range.selectNode(a.currentNode)
if (isInside(e, range.getBoundingClientRect())) {
console.log("barmi")
if (!sentenceNodes.get(a.currentNode)) {
continue;
}
const myNode = sentenceNodes.get(a.currentNode)
startNode = sentenceNodes.get(a.currentNode)[0]
endNode = sentenceNodes.get(a.currentNode)[1]
editedNode = startNode
// console.log(origNodes.get(a.currentNode))
let deNumbered = {}
if (inirxfullTranslation[encodeURIComponent(myNode[2])]) {
console.log(inirxfullTranslation[encodeURIComponent(myNode[2])])
orig = myNode[2]
deNumbered = [myNode[2], {}]
} else {
deNumbered = deNumber(myNode[2])
orig = deNumbered[0]
}
console.log(deNumbered)
if (markupElement) {
markupElement.classList.remove("inirxhl")
}
markupElement = startNode.parentElement
while (inirxgetDisplayType(markupElement).includes("inline")) {
markupElement = markupElement.parentElement
}
markupElement.classList.add("inirxhl")
modal = document.createElement("div")
modal.setAttribute("data-notrans", "true")
modal.id = "idrxkokowe"
modal.style = "position: fixed; inset:0;background: rgba(0,0,0,0.3);z-index:100000;display:flex;align-items:center;justify-content:center;opacity:0;transition: all 0.2s;font-family:Tahoma;font-size:15px;"
modal.innerHTML = "
