Widget:ContactsPageWidget: различия между версиями
Перейти к навигации
Перейти к поиску
(Новая страница: «<noinclude>__NOTOC__ This widget created to hold some JavaScript code for Contacts Button custom behaiour </noinclude> <includeonly> <style> .wk2bUnAuthPopup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 300px; padding: 20px; background-color: white; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); border-radius: 8px; border: 1px solid rgb(167, 215, 249); text-align:...») |
Нет описания правки |
||
| (не показаны 2 промежуточные версии этого же участника) | |||
| Строка 45: | Строка 45: | ||
function wk2bFuncRedirectToContactsPage() { | function wk2bFuncRedirectToContactsPage() { | ||
window.location = window.wk2bRedirectAddress; | window.location = window.wk2bRedirectAddress; | ||
} | |||
function wk2bFuncTurnButtonIntoLink(buttonId) { | |||
const targetButton = document.getElementById(buttonId); | |||
if (targetButton != undefined) { | |||
const linkToGo = targetButton.childNodes[1].childNodes[0].href.replace("source", "returnto"); | |||
const buttonText = targetButton.childNodes[1].childNodes[0].textContent; | |||
targetButton.childNodes[1].removeChild(targetButton.childNodes[1].childNodes[0]) | |||
targetButton.innerHTML = '<p>' + buttonText + '</p>'; | |||
targetButton.onclick = function() { | |||
window.location = linkToGo; | |||
} | |||
} | |||
} | } | ||
| Строка 53: | Строка 67: | ||
function() { | function() { | ||
const targetDivId = "wk2bGetContactsButton"; | const targetDivId = "wk2bGetContactsButton"; | ||
const buttonRegisterId = "wk2bGetContactsButtonRegister"; | |||
const buttonLoginId = "wk2bGetContactsButtonLogin"; | |||
wk2bFuncTurnButtonIntoLink(buttonRegisterId); | |||
wk2bFuncTurnButtonIntoLink(buttonLoginId); | |||
const targetDiv = document.getElementById(targetDivId); | const targetDiv = document.getElementById(targetDivId); | ||
| Строка 78: | Строка 97: | ||
} | } | ||
}, | }, | ||
500); | |||
}; | }; | ||
Текущая версия от 02:15, 6 августа 2024
This widget created to hold some JavaScript code for Contacts Button custom behaiour