PluginProbe
Setmore / 9.6
Setmore v9.6
trunk 10.0 10.1 10.2 10.3 10.4 10.5 11.0 11.2 11.3 11.6 11.7 11.8 11.9 12.0 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 2.0 3.0 All 58 releases
setmore-appointments / script / setmoreFormScript.js

setmoreFormScript.js in Setmore 9.6, at script/setmoreFormScript.js

50 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 window.onload = function () {
2 var bookingPageUrl = document.querySelector("#setmore_booking_page_url").value;
3
4 if (bookingPageUrl && bookingPageUrl != "https://my.setmore.com" && bookingPageUrl != null && bookingPageUrl != "") {
5 document.querySelector(".sm-acc-info").style.display = "block";
6 }
7 else {
8 document.querySelector(".sm-acc-info").style.display = "none";
9 }
10 var optionList = document.querySelector('.sm-dropdown ul');
11 document.querySelector("#dropDown").onclick = function () {
12 optionList.style.display = "block ";
13 }
14 var langList = document.querySelectorAll('.sm-dropdown ul li');
15
16 for (var i = 0; i < langList.length; i++) {
17 langList[i].onclick = function () {
18 document.querySelector(".sm-dropdown input").value = this.textContent;
19 optionList.style.display = "none ";
20 }
21 }
22
23 document.addEventListener("click", function (event) {
24 if (event.target.className == "fa fa-sort-down" || event.target.className == "langaugeList") {
25 optionList.style.display = "block ";
26 } else {
27 optionList.style.display = "none";
28 }
29 });
30
31 document.querySelector(".btn-login").onclick = function () {
32 var siteUrl = this.getAttribute("siteurl");
33 var popupWindow = window.open('https://my.setmore.com/integration/wordpress/oauth?siteUrl=' + siteUrl, "_blank", "scrollbars=yes,resizable=yes,top=108,left=0,right=0,width=821,height=625,margin= 0 auto;");
34 popupWindow.focus();
35 var pollTimer = window.setInterval(function () {
36 console.log('the popupwindow', popupWindow.location.href);
37 if (popupWindow.location.href.indexOf("status=true") != -1) {
38 const urlParams = new URLSearchParams(popupWindow.location.search);
39 document.querySelector(".sm-acc-info").style.display = "block";
40 document.querySelector("#setmore_booking_page_url").value = urlParams.get("bookingpageurl");
41 window.clearInterval(pollTimer);
42 popupWindow.close();
43 }
44 }, 1000);
45 }
46 }
47
48
49
50