"use strict"; function setFieldValue(value, crmField, datatype) { var attribute = $("#" + crmField).first(); if (attribute === undefined || attribute === null) { alert("CRMField: " + crmField + " is not currently on the form. Please update the form or configuration."); } switch (datatype) { case "string": case "decimal": case "number": attribute.val(value); break; case "boolean": if (attribute.prop("class").indexOf("boolean-dropdown") !== -1) { if (value === true) { attribute.val("1"); } else if (value === false) { attribute.val("0"); } } if (attribute.prop("class").indexOf("boolean-radio") !== -1) { if (value === true) { $("#" + crmField + "_1").first().prop("checked", true); } else if (value === false) { $("#" + crmField + "_0").first().prop("checked", true); } } if (attribute.attr("type") === "checkbox") { attribute.prop("checked", value); } break; default: alert("Attempted to set data type that is not supported. Please contact your system administrator or support@beyondcrm.com.au"); } } function getFieldValue(crmField, datatype) { var attribute = $("#" + crmField).first(); if (attribute === undefined || attribute === null) { alert("CRMField: " + crmField + " is not currently on the form. Please update the form or configuration."); } switch (datatype) { case "string": case "decimal": case "number": return attribute.val(); case "boolean": if (attribute.prop("class").indexOf("boolean-dropdown") !== -1) { if (attribute.val() === "1") return true; else if (attribute.val() === "0") return false; else return null; } if (attribute.prop("class").indexOf("boolean-radio") !== -1) { if ($("#" + crmField + "_1").first().prop("checked") === true) return true; if ($("#" + crmField + "_0").first().prop("checked") === true) return false; else return null; } if (attribute.attr("type") === "checkbox") { return attribute.prop("checked"); } return null; default: alert("Attempted to set data type that is not supported. Please contact your system administrator or support@beyondcrm.com.au"); return null; } } function changeReadOnly(t, e) { e ? ($("#" + t).addClass("readonly"), $("#" + t).prop("readonly", !0)) : ($("#" + t).removeClass("readonly"), $("#" + t).prop("readonly", !1)) } function SetFieldReadOnly(fieldName, readOnly, type) { try { type = type.toLowerCase(); switch (type) { case "date": case "time": case "datetime": SetDateTimeFieldReadOnly(fieldName, readOnly); break; case "lookup": SetLookupFieldReadOnly(fieldName, readOnly); break; case "checkbox": SetCheckboxFieldReadOnly(fieldName, readOnly); break; case "radio": SetRadioFieldReadOnly(fieldName, readOnly); break; case "dropdown": SetDropdownFieldReadOnly(fieldName, readOnly); break; default: if (!!readOnly) { $("#" + fieldName).attr("readonly", true); $("#" + fieldName).css("cursor", "not-allowed"); $("#" + fieldName).on("mousedown", function (e) { e.preventDefault(); return false; }); } else { $("#" + fieldName).attr("readonly", false); $("#" + fieldName).css("cursor", "default"); $("#" + fieldName).off("mousedown"); } break; } } catch (err) { console.error("Error SetFieldReadOnly: " + err.message); return; } }; function SetDateTimeFieldReadOnly(fieldName, readOnly) { if (readOnly) { $('#' + fieldName).siblings("div.datetimepicker").find("input, .input-group-addon").attr("readonly", true); $('#' + fieldName).siblings("div.datetimepicker").find("input, .input-group-addon").css("cursor", "not-allowed"); $('#' + fieldName).siblings("div.datetimepicker").find("input, .input-group-addon").on("mousedown", function (e) { e.preventDefault(); return false; }); } else { $('#' + fieldName).siblings("div.datetimepicker").find("input, .input-group-addon").attr("readonly", false); $('#' + fieldName).siblings("div.datetimepicker").find("input, .input-group-addon").css("cursor", "default"); $('#' + fieldName).siblings("div.datetimepicker").find("input, .input-group-addon").off("mousedown"); } }; function SetLookupFieldReadOnly(fieldName, readOnly) { if (readOnly) { $('#' + fieldName).siblings("div.input-group-btn").find("button").prop("disabled", true); $('#' + fieldName).siblings("div.input-group-btn").hide(); } else { $('#' + fieldName).siblings("div.input-group-btn").find("button").prop("disabled", false); $('#' + fieldName).siblings("div.input-group-btn").show(); } }; function SetCheckboxFieldReadOnly(fieldName, readOnly) { if (readOnly) { $('#' + fieldName).prop("disabled", true); } else { $('#' + fieldName).prop("disabled", false); } }; function SetRadioFieldReadOnly(fieldName, readOnly) { if (readOnly) { $('#' + fieldName).find("input[type='radio']").prop("disabled", true); } else { $('#' + fieldName).find("input[type='radio']").prop("disabled", false); } }; function SetDropdownFieldReadOnly(fieldName, readOnly) { if (readOnly) { $('#' + fieldName).attr("readonly", true); $('#' + fieldName).css("pointer-events", "none"); } else { $('#' + fieldName).attr("readonly", false); $('#' + fieldName).css("pointer-events", "auto"); } }; function addPortalValidator(t, e, a, n) { if ("undefined" != typeof Page_Validators) { var r = document.createElement("span"); r.style.display = "none", r.id = t, r.controltovalidate = e, r.errormessage = a, r.evaluationfunction = n, Page_Validators.push(r) } } function showHideField(t, e) { e ? $("#" + t).closest("td").show() : $("#" + t).closest("td").hide() } function showHideSection(t, e) { e ? $('table[data-name="' + t + '"]').closest("fieldset").show() : $('table[data-name="' + t + '"]').closest("fieldset").hide() } function markRequired(t, e) { e ? $("#" + t + "_label").parent().addClass("info required") : $("#" + t + "_label").parent().removeClass("info required") } function clearAllValidationErrors() { ValidationSummaryEntityFormView.style = "display: none;", ValidationSummaryEntityFormView.innerHTML = "" } function showNewValidationError(t) { if ("display: none;" === ValidationSummaryEntityFormView.style.cssText && (ValidationSummaryEntityFormView.innerHTML = ValidationSummaryEntityFormView.headertext, ValidationSummaryEntityFormView.style = ""), 0 === ValidationSummaryEntityFormView.getElementsByTagName("ul").length) { var e = document.createElement("ul"); ValidationSummaryEntityFormView.appendChild(e) } var a = document.createElement("li"); a.innerText = t, ValidationSummaryEntityFormView.getElementsByTagName("ul")[0].appendChild(a) } function doEditButtonSetup() { $(".tab.clearfix:has(:input:not(.readonly):not(:button):not(:submit):not(:hidden):not(:reset):not([placeholder='Search']))").each(function (t, e) { var a = $(''); a.val("Update"), a.prop("data-name", e.getAttribute("data-name")), a.addClass("btn btn-primary pull-right action"), a.css("margin-right", "38px"), a.on("click", RunOnEdit), a.prop("id", e.getAttribute("data-name").replace(/[^a-z0-9\s]/gi, "").replace(/[_\s]/g, "-") + "-edit"), a.wrapAll('
'), $(e).find(":input:not(.readonly):not(:button):not(select):not(:hidden)").each(function (t, e) { $(e).addClass("readonly reenablerequired"), $(e).prop("disabled", !0) }), $(e).find("select").each(function (t, e) { $copy = $(e).clone(), $copy.removeAttr("id"), $copy.attr("id", "hideOnEdit"), $copy.removeAttr("name"), $copy.prop("disabled", "disabled"), $(e).addClass("readonly reenablerequired"), $(e).parent().prepend($copy), $(e).hide() }), $(e).prepend(a.parents().last()) }) } function RunOnEdit(t) { var e = $("#" + t.srcElement.id); e.prop("disabled", !0), e.val("Updating"), $("[data-name='" + e.prop("data-name") + "']").find(":input.reenablerequired:not(select)").each(function (t, e) { $(e).removeClass("readonly"), $(e).removeClass("reenablerequired"), $(e).prop("disabled", !1) }), $("[data-name='" + e.prop("data-name") + "']").find("select.reenablerequired").each(function (t, e) { $(e).removeClass("readonly"), $(e).removeClass("reenablerequired"), $(e).show(), $(e).prev().hide() }) } $(document).ready(function () { if (0 !== $("p.text-danger").length && "undefined" != typeof ValidationSummaryEntityFormView) { if ($("p.text-danger").first().parent().hide(), "display: none;" === ValidationSummaryEntityFormView.style.cssText && (ValidationSummaryEntityFormView.innerHTML = ValidationSummaryEntityFormView.headertext, ValidationSummaryEntityFormView.style = ""), 0 === ValidationSummaryEntityFormView.getElementsByTagName("ul").length) { var t = document.createElement("ul"); ValidationSummaryEntityFormView.appendChild(t) } var e = document.createElement("li"); e.innerText = $("p.text-danger").first().text(), ValidationSummaryEntityFormView.getElementsByTagName("ul")[0].appendChild(e) } }); /* _ _ _ _ * ___| (_) ___| | __ (_)___ * / __| | |/ __| |/ / | / __| * \__ \ | | (__| < _ | \__ \ * |___/_|_|\___|_|\_(_)/ |___/ * |__/ * Version: 1.9.0 * Author: Ken Wheeler * Website: http://kenwheeler.github.io * Docs: http://kenwheeler.github.io/slick * Repo: http://github.com/kenwheeler/slick * Issues: http://github.com/kenwheeler/slick/issues */ (function (i) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], i) : "undefined" != typeof exports ? module.exports = i(require("jquery")) : i(jQuery) })(function (i) { "use strict"; var e = window.Slick || {}; e = function () { function e(e, o) { var s, n = this; n.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: i(e), appendDots: i(e), arrows: !0, asNavFor: null, prevArrow: '', nextArrow: '', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: "50px", cssEase: "ease", customPaging: function (e, t) { return i('