| 1 |
(function(){ |
| 2 |
(function($) { |
| 3 |
"use strict"; |
| 4 |
var currentDevice = ""; |
| 5 |
var getElementSettings = function($element, setting) { |
| 6 |
var elementSettings = {}, modelCID = $element.data("model-cid"); |
| 7 |
if (elementorFrontend.isEditMode() && modelCID) { |
| 8 |
var settings = elementorFrontend.config.elements.data[modelCID], type = settings.attributes.widgetType || settings.attributes.elType, settingsKeys = elementorFrontend.config.elements.keys[type]; |
| 9 |
if (!settingsKeys) { |
| 10 |
settingsKeys = elementorFrontend.config.elements.keys[type] = []; |
| 11 |
jQuery.each(settings.controls, function(name, control) { |
| 12 |
if (control.frontend_available) settingsKeys.push(name); |
| 13 |
}); |
| 14 |
} |
| 15 |
jQuery.each(settings.getActiveControls(), function(controlKey) { |
| 16 |
if (-1 !== settingsKeys.indexOf(controlKey)) elementSettings[controlKey] = settings.attributes[controlKey]; |
| 17 |
}); |
| 18 |
} else elementSettings = $element.data("settings") || {}; |
| 19 |
return getItems(elementSettings, setting); |
| 20 |
}; |
| 21 |
var getItems = function(items, itemKey) { |
| 22 |
if (itemKey) { |
| 23 |
var keyStack = itemKey.split("."), currentKey = keyStack.splice(0, 1); |
| 24 |
if (!keyStack.length) return items[currentKey]; |
| 25 |
if (!items[currentKey]) return; |
| 26 |
return this.getItems(items[currentKey], keyStack.join(".")); |
| 27 |
} |
| 28 |
return items; |
| 29 |
}; |
| 30 |
var getUniqueLoopScopeId = function($scope) { |
| 31 |
if ($scope.data("jltma-template-widget-id")) return $scope.data("jltma-template-widget-id"); |
| 32 |
return $scope.data("id"); |
| 33 |
}; |
| 34 |
function jltMAObserveTarget(target, callback) { |
| 35 |
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; |
| 36 |
new IntersectionObserver(function(entries, observer) { |
| 37 |
entries.forEach(function(entry) { |
| 38 |
if (entry.isIntersecting) callback(entry); |
| 39 |
}); |
| 40 |
}, options).observe(target); |
| 41 |
} |
| 42 |
function stripTags(text) { |
| 43 |
return text.replace(/<\/?[^>]+(>|$)/g, ""); |
| 44 |
} |
| 45 |
var Master_Addons = { |
| 46 |
animatedProgressbar: function(id, type, value, strokeColor, trailColor, strokeWidth, strokeTrailWidth) { |
| 47 |
var triggerClass = ".jltma-progress-bar-" + id; |
| 48 |
if ("line" == type) new ldBar(triggerClass, { |
| 49 |
"type": "stroke", |
| 50 |
"path": "M0 10L100 10", |
| 51 |
"aspect-ratio": "none", |
| 52 |
"stroke": strokeColor, |
| 53 |
"stroke-trail": trailColor, |
| 54 |
"stroke-width": strokeWidth, |
| 55 |
"stroke-trail-width": strokeTrailWidth |
| 56 |
}).set(value); |
| 57 |
if ("line-bubble" == type) { |
| 58 |
new ldBar(triggerClass, { |
| 59 |
"type": "stroke", |
| 60 |
"path": "M0 10L100 10", |
| 61 |
"aspect-ratio": "none", |
| 62 |
"stroke": strokeColor, |
| 63 |
"stroke-trail": trailColor, |
| 64 |
"stroke-width": strokeWidth, |
| 65 |
"stroke-trail-width": strokeTrailWidth |
| 66 |
}).set(value); |
| 67 |
$($(".jltma-progress-bar-" + id).find(".ldBar-label")).animate({ left: value + "%" }, 1e3, "swing"); |
| 68 |
} |
| 69 |
if ("circle" == type) new ldBar(triggerClass, { |
| 70 |
"type": "stroke", |
| 71 |
"path": "M50 10A40 40 0 0 1 50 90A40 40 0 0 1 50 10", |
| 72 |
"stroke-dir": "normal", |
| 73 |
"stroke": strokeColor, |
| 74 |
"stroke-trail": trailColor, |
| 75 |
"stroke-width": strokeWidth, |
| 76 |
"stroke-trail-width": strokeTrailWidth |
| 77 |
}).set(value); |
| 78 |
if ("fan" == type) new ldBar(triggerClass, { |
| 79 |
"type": "stroke", |
| 80 |
"path": "M10 90A40 40 0 0 1 90 90", |
| 81 |
"stroke": strokeColor, |
| 82 |
"stroke-trail": trailColor, |
| 83 |
"stroke-width": strokeWidth, |
| 84 |
"stroke-trail-width": strokeTrailWidth |
| 85 |
}).set(value); |
| 86 |
}, |
| 87 |
MA_Accordion: function($scope, $) { |
| 88 |
var elementSettings = getElementSettings($scope), $accordionHeader = $scope.find(".jltma-accordion-header"), $accordionType = elementSettings.accordion_type, $accordionSpeed = elementSettings.toggle_speed ? elementSettings.toggle_speed : 300; |
| 89 |
$accordionHeader.each(function() { |
| 90 |
if ($(this).hasClass("active-default")) { |
| 91 |
$(this).addClass("show active"); |
| 92 |
$(this).next().slideDown($accordionSpeed); |
| 93 |
} |
| 94 |
}); |
| 95 |
$accordionHeader.unbind("click"); |
| 96 |
$accordionHeader.click(function(e) { |
| 97 |
e.preventDefault(); |
| 98 |
var $this = $(this); |
| 99 |
if ($accordionType === "accordion") if ($this.hasClass("show")) { |
| 100 |
$this.removeClass("show active"); |
| 101 |
$this.next().slideUp($accordionSpeed); |
| 102 |
} else { |
| 103 |
$this.parent().parent().find(".jltma-accordion-header").removeClass("show active"); |
| 104 |
$this.parent().parent().find(".jltma-accordion-tab-content").slideUp($accordionSpeed); |
| 105 |
$this.toggleClass("show active"); |
| 106 |
$this.next().slideDown($accordionSpeed); |
| 107 |
} |
| 108 |
else if ($this.hasClass("show")) { |
| 109 |
$this.removeClass("show active"); |
| 110 |
$this.next().slideUp($accordionSpeed); |
| 111 |
} else { |
| 112 |
$this.addClass("show active"); |
| 113 |
$this.next().slideDown($accordionSpeed); |
| 114 |
} |
| 115 |
}); |
| 116 |
}, |
| 117 |
MA_Tabs: function($scope, $) { |
| 118 |
try { |
| 119 |
(function($) { |
| 120 |
var $tabsWrapper = $scope.find("[data-tabs]"), $tabEffect = $tabsWrapper.data("tab-effect"); |
| 121 |
$tabsWrapper.each(function() { |
| 122 |
var tab = $(this); |
| 123 |
var isContentActive = false; |
| 124 |
tab.find("[data-tab]").each(function() { |
| 125 |
if ($(this).hasClass("active")) {} |
| 126 |
}); |
| 127 |
tab.find(".jltma--advance-tab-content").each(function() { |
| 128 |
if ($(this).hasClass("active")) isContentActive = true; |
| 129 |
}); |
| 130 |
if (!isContentActive) tab.find(".jltma--advance-tab-content").eq(0).addClass("active"); |
| 131 |
if ($tabEffect == "hover") tab.find("[data-tab]").hover(function() { |
| 132 |
var $data_tab_id = $(this).data("tab-id"); |
| 133 |
$(this).siblings().removeClass("active"); |
| 134 |
$(this).addClass("active"); |
| 135 |
$(this).closest("[data-tabs]").find(".jltma--advance-tab-content").removeClass("active"); |
| 136 |
$("#" + $data_tab_id).addClass("active"); |
| 137 |
}); |
| 138 |
else tab.find("[data-tab]").click(function() { |
| 139 |
var $data_tab_id = $(this).data("tab-id"); |
| 140 |
$(this).siblings().removeClass("active"); |
| 141 |
$(this).addClass("active"); |
| 142 |
$(this).closest("[data-tabs]").find(".jltma--advance-tab-content").removeClass("active"); |
| 143 |
$("#" + $data_tab_id).addClass("active"); |
| 144 |
}); |
| 145 |
}); |
| 146 |
})(jQuery); |
| 147 |
} catch (e) {} |
| 148 |
}, |
| 149 |
MA_ProgressBar: function($scope, $) { |
| 150 |
var id = $scope.data("id"), $progressBarWrapper = $scope.find(".jltma-progress-bar-" + id), type = $progressBarWrapper.data("type"), value = $progressBarWrapper.data("progress-bar-value"), strokeWidth = $progressBarWrapper.data("progress-bar-stroke-width"), strokeTrailWidth = $progressBarWrapper.data("progress-bar-stroke-trail-width"), color = $progressBarWrapper.data("stroke-color"), trailColor = $progressBarWrapper.data("stroke-trail-color"); |
| 151 |
$progressBarWrapper.find("svg").remove(); |
| 152 |
$progressBarWrapper.find(".ldBar-label").remove(); |
| 153 |
$progressBarWrapper.removeClass("ldBar"); |
| 154 |
Master_Addons.animatedProgressbar(id, type, value, color, trailColor, strokeWidth, strokeTrailWidth); |
| 155 |
}, |
| 156 |
MA_Image_Hotspot: function($scope, $) { |
| 157 |
getElementSettings($scope); |
| 158 |
var $ma_hotspot = $scope.find(".jltma-hotspots-container"); |
| 159 |
if (!$ma_hotspot.length) return; |
| 160 |
var $tooltip = $ma_hotspot.find("> .jltma-tooltip-item"), widgetID = $scope.data("id"); |
| 161 |
$tooltip.each(function(index) { |
| 162 |
tippy(this, { |
| 163 |
allowHTML: false, |
| 164 |
theme: "jltma-tippy-" + widgetID |
| 165 |
}); |
| 166 |
}); |
| 167 |
}, |
| 168 |
MA_Pricing_Table: function($scope, $) { |
| 169 |
var $jltma_pricing_table = $scope.find(".jltma-price-table-details ul"); |
| 170 |
if (!$jltma_pricing_table.length) return; |
| 171 |
var $tooltip = $jltma_pricing_table.find("> .jltma-tooltip-item"), widgetID = $scope.data("id"); |
| 172 |
$tooltip.each(function(index) { |
| 173 |
tippy(this, { |
| 174 |
allowHTML: false, |
| 175 |
theme: "jltma-pricing-table-tippy-" + widgetID, |
| 176 |
appendTo: document.body |
| 177 |
}); |
| 178 |
}); |
| 179 |
}, |
| 180 |
JLTMA_Data_Table: function($scope, $) { |
| 181 |
var a = $scope.find(".jltma-data-table-container"), n = a.data("source"), r = a.data("sourcecsv"); |
| 182 |
if (1 == a.data("buttons")) var l = "Bfrtip"; |
| 183 |
else l = "frtip"; |
| 184 |
if ("custom" == n) { |
| 185 |
var i = $scope.find("table thead tr th").length; |
| 186 |
$scope.find("table tbody tr").each(function() { |
| 187 |
if (e(this).find("td").length < i) { |
| 188 |
var t = i - e(this).find("td").length; |
| 189 |
e(this).append(new Array(++t).join("<td></td>")); |
| 190 |
} |
| 191 |
}), $scope.find(".jltma-data-table").DataTable({ |
| 192 |
dom: l, |
| 193 |
paging: a.data("paging"), |
| 194 |
pagingType: "numbers", |
| 195 |
pageLength: a.data("pagelength"), |
| 196 |
info: a.data("info"), |
| 197 |
scrollX: !0, |
| 198 |
searching: a.data("searching"), |
| 199 |
ordering: a.data("ordering"), |
| 200 |
buttons: [ |
| 201 |
{ |
| 202 |
extend: "csvHtml5", |
| 203 |
text: JLTMA_DATA_TABLE.csvHtml5 |
| 204 |
}, |
| 205 |
{ |
| 206 |
extend: "excelHtml5", |
| 207 |
text: JLTMA_DATA_TABLE.excelHtml5 |
| 208 |
}, |
| 209 |
{ |
| 210 |
extend: "pdfHtml5", |
| 211 |
text: JLTMA_DATA_TABLE.pdfHtml5 |
| 212 |
}, |
| 213 |
{ |
| 214 |
extend: "print", |
| 215 |
text: JLTMA_DATA_TABLE.print |
| 216 |
} |
| 217 |
], |
| 218 |
language: { |
| 219 |
lengthMenu: JLTMA_DATA_TABLE.lengthMenu, |
| 220 |
zeroRecords: JLTMA_DATA_TABLE.zeroRecords, |
| 221 |
info: JLTMA_DATA_TABLE.info, |
| 222 |
infoEmpty: JLTMA_DATA_TABLE.infoEmpty, |
| 223 |
infoFiltered: JLTMA_DATA_TABLE.infoFiltered, |
| 224 |
search: "", |
| 225 |
searchPlaceholder: JLTMA_DATA_TABLE.searchPlaceholder, |
| 226 |
processing: JLTMA_DATA_TABLE.processing |
| 227 |
} |
| 228 |
}); |
| 229 |
} else if ("csv" == n) ({ init: function(t) { |
| 230 |
var a = (t = t || {}).csv_path || "", n = $scope.element || $("#table-container"), r = $scope.csv_options || {}, l = $scope.datatables_options || {}, i = $scope.custom_formatting || [], s = {}; |
| 231 |
$.each(i, function(e, t) { |
| 232 |
var a = t[0]; |
| 233 |
s[a] = t[1]; |
| 234 |
}); |
| 235 |
var d = $("<table class=\"jltma-data-table cell-border\" style=\"width:100%;visibility:hidden;\">"); |
| 236 |
n.empty().append(d), $.when($.get(a)).then(function(t) { |
| 237 |
for (var a = e.csv.toArrays(t, r), n = $("<thead></thead>"), i = a[0], o = $("<tr></tr>"), c = 0; c < i.length; c++) o.append($("<th></th>").text(i[c])); |
| 238 |
n.append(o), d.append(n); |
| 239 |
for (var m = $("<tbody></tbody>"), p = 1; p < a.length; p++) for (var _ = $("<tr></tr>"), g = 0; g < a[p].length; g++) { |
| 240 |
var b = $("<td></td>"), f = s[g]; |
| 241 |
f ? b.html(f(a[p][g])) : b.text(a[p][g]), _.append(b), m.append(_); |
| 242 |
} |
| 243 |
d.append(m), d.DataTable(l); |
| 244 |
}); |
| 245 |
} }).init({ |
| 246 |
csv_path: r, |
| 247 |
element: a, |
| 248 |
datatables_options: { |
| 249 |
dom: l, |
| 250 |
paging: a.data("paging"), |
| 251 |
pagingType: "numbers", |
| 252 |
pageLength: a.data("pagelength"), |
| 253 |
info: a.data("info"), |
| 254 |
scrollX: !0, |
| 255 |
searching: a.data("searching"), |
| 256 |
ordering: a.data("ordering"), |
| 257 |
buttons: [ |
| 258 |
{ |
| 259 |
extend: "csvHtml5", |
| 260 |
text: JLTMA_DATA_TABLE.csvHtml5 |
| 261 |
}, |
| 262 |
{ |
| 263 |
extend: "excelHtml5", |
| 264 |
text: JLTMA_DATA_TABLE.excelHtml5 |
| 265 |
}, |
| 266 |
{ |
| 267 |
extend: "pdfHtml5", |
| 268 |
text: JLTMA_DATA_TABLE.pdfHtml5 |
| 269 |
}, |
| 270 |
{ |
| 271 |
extend: "print", |
| 272 |
text: JLTMA_DATA_TABLE.print |
| 273 |
} |
| 274 |
], |
| 275 |
language: { |
| 276 |
lengthMenu: JLTMA_DATA_TABLE.lengthMenu, |
| 277 |
zeroRecords: JLTMA_DATA_TABLE.zeroRecords, |
| 278 |
info: JLTMA_DATA_TABLE.info, |
| 279 |
infoEmpty: JLTMA_DATA_TABLE.infoEmpty, |
| 280 |
infoFiltered: JLTMA_DATA_TABLE.infoFiltered, |
| 281 |
search: "", |
| 282 |
searchPlaceholder: JLTMA_DATA_TABLE.searchPlaceholder, |
| 283 |
processing: JLTMA_DATA_TABLE.processing |
| 284 |
} |
| 285 |
} |
| 286 |
}); |
| 287 |
$scope.find(".jltma-data-table").css("visibility", "visible"); |
| 288 |
}, |
| 289 |
JLTMA_Dropdown_Button: function($scope, $) { |
| 290 |
$scope.find(".jltma-dropdown").hover(function() { |
| 291 |
$scope.find(".jltma-dd-menu").addClass("jltma-dd-menu-opened"); |
| 292 |
}, function() { |
| 293 |
$scope.find(".jltma-dd-menu").removeClass("jltma-dd-menu-opened"); |
| 294 |
}); |
| 295 |
}, |
| 296 |
JLTMA_WC_Add_To_Cart: function($scope, $) { |
| 297 |
$(document).on("click", ".ajax_add_to_cart", function(e) { |
| 298 |
$(this).append("<i class=\"fa fa-spinner animated rotateIn infinite\"></i>"); |
| 299 |
}); |
| 300 |
$(".jltma-wc-add-to-cart-btn-custom-js").each(function(index) { |
| 301 |
$($(this).attr("data-jltma-wc-add-to-cart-btn-custom-css")).appendTo("head"); |
| 302 |
}); |
| 303 |
}, |
| 304 |
MA_Offcanvas_Menu: function($scope, $) { |
| 305 |
Master_Addons.MA_Offcanvas_Menu.elementSettings = $scope.data("settings"); |
| 306 |
var widgetSelector = "jltma-offcanvas-menu", getID = $scope.data("id"), getElementSettings = $scope.data("settings"), is_esc_close = getElementSettings.esc_close ? getElementSettings.esc_close : "", classes = { |
| 307 |
widget: widgetSelector, |
| 308 |
triggerButton: "jltma-offcanvas__trigger", |
| 309 |
offcanvasContent: "jltma-offcanvas__content", |
| 310 |
offcanvasContentBody: "".concat(widgetSelector, "__body"), |
| 311 |
offcanvasContainer: "".concat(widgetSelector, "__container"), |
| 312 |
offcanvasContainerOverlay: "".concat(widgetSelector, "__container__overlay"), |
| 313 |
offcanvasWrapper: "".concat(widgetSelector, "__wrapper"), |
| 314 |
closeButton: "".concat(widgetSelector, "__close"), |
| 315 |
menuArrow: "".concat(widgetSelector, "__arrow"), |
| 316 |
menuInner: "".concat(widgetSelector, "__menu-inner"), |
| 317 |
itemHasChildrenLink: "menu-item-has-children > a", |
| 318 |
contentClassPart: "jltma-offcanvas-content", |
| 319 |
contentOpenClass: "jltma-offcanvas-content-open", |
| 320 |
customContainer: "".concat(widgetSelector, "__custom-container") |
| 321 |
}, selectors = { |
| 322 |
widget: ".".concat(classes.widget), |
| 323 |
triggerButton: ".".concat(classes.triggerButton), |
| 324 |
offcanvasContent: ".".concat(classes.offcanvasContent), |
| 325 |
offcanvasContentBody: ".".concat(classes.offcanvasContentBody), |
| 326 |
offcanvasContainer: ".".concat(classes.offcanvasContainer), |
| 327 |
offcanvasContainerOverlay: ".".concat(classes.offcanvasContainerOverlay), |
| 328 |
offcanvasWrapper: ".".concat(classes.offcanvasWrapper), |
| 329 |
closeButton: ".".concat(classes.closeButton), |
| 330 |
menuArrow: ".".concat(classes.menuArrow), |
| 331 |
menuParent: ".".concat(classes.menuInner, " .").concat(classes.itemHasChildrenLink), |
| 332 |
contentClassPart: ".".concat(classes.contentClassPart), |
| 333 |
contentOpenClass: ".".concat(classes.contentOpenClass), |
| 334 |
customContainer: ".".concat(classes.customContainer) |
| 335 |
}, elements = { |
| 336 |
$document: jQuery(document), |
| 337 |
$html: jQuery(document).find("html"), |
| 338 |
$body: jQuery(document).find("body"), |
| 339 |
$outsideContainer: jQuery(selectors.offcanvasContainer), |
| 340 |
$containerOverlay: jQuery(selectors.offcanvasContainerOverlay), |
| 341 |
$triggerButton: $scope.find(selectors.triggerButton), |
| 342 |
$offcanvasContent: $scope.find(selectors.offcanvasContent), |
| 343 |
$offcanvasContentBody: $scope.find(selectors.offcanvasContentBody), |
| 344 |
$offcanvasContainer: $scope.find(selectors.offcanvasContainer), |
| 345 |
$offcanvasWrapper: $scope.find(selectors.offcanvasWrapper), |
| 346 |
$closeButton: $scope.find(selectors.closeButton), |
| 347 |
$menuParent: $scope.find(selectors.menuParent) |
| 348 |
}; |
| 349 |
Master_Addons.MA_Offcanvas_Menu.resetCanvas = function() { |
| 350 |
var contentId = getID; |
| 351 |
elements.$html.addClass("".concat(classes.offcanvasContent, "-widget")); |
| 352 |
if (!elements.$outsideContainer.length) { |
| 353 |
elements.$body.append("<div class=\"".concat(classes.offcanvasContainerOverlay, "\" />")); |
| 354 |
elements.$body.wrapInner("<div class=\"".concat(classes.offcanvasContainer, "\" />")); |
| 355 |
elements.$offcanvasContent.insertBefore(selectors.offcanvasContainer); |
| 356 |
} |
| 357 |
var $wrapperContent = elements.$offcanvasWrapper.find(selectors.offcanvasContent); |
| 358 |
if ($wrapperContent.length) { |
| 359 |
var $containerContent = elements.$outsideContainer.find("> .".concat(classes.contentClassPart, "-").concat(contentId)); |
| 360 |
if ($containerContent.length) $containerContent.remove(); |
| 361 |
var $bodyContent = elements.$body.find("> .".concat(classes.contentClassPart, "-").concat(contentId)); |
| 362 |
if ($bodyContent.length) $bodyContent.remove(); |
| 363 |
if (elements.$html.hasClass(classes.contentOpenClass)) $wrapperContent.addClass("active"); |
| 364 |
elements.$body.prepend($wrapperContent); |
| 365 |
} |
| 366 |
}; |
| 367 |
Master_Addons.MA_Offcanvas_Menu.offcanvasClose = function() { |
| 368 |
var openId = elements.$html.data("open-id"); |
| 369 |
var regex = new RegExp("".concat(classes.contentClassPart, "-.*")); |
| 370 |
var classList = elements.$html.attr("class").split(/\s+/); |
| 371 |
jQuery("".concat(selectors.contentClassPart, "-").concat(openId)).removeClass("active"); |
| 372 |
elements.$triggerButton.removeClass("trigger-active"); |
| 373 |
classList.forEach(function(className) { |
| 374 |
if (!className.match(regex)) return; |
| 375 |
elements.$html.removeClass(className); |
| 376 |
}); |
| 377 |
elements.$html.removeData("open-id"); |
| 378 |
}; |
| 379 |
Master_Addons.MA_Offcanvas_Menu.containerClick = function(event) { |
| 380 |
if (getID !== elements.$html.data("open-id") || !getElementSettings.overlay_close) return; |
| 381 |
if (!elements.$html.hasClass(classes.contentOpenClass)) return; |
| 382 |
Master_Addons.MA_Offcanvas_Menu.offcanvasClose(); |
| 383 |
}; |
| 384 |
Master_Addons.MA_Offcanvas_Menu.closeESC = function(event) { |
| 385 |
if (27 !== event.keyCode) return; |
| 386 |
Master_Addons.MA_Offcanvas_Menu.offcanvasClose(); |
| 387 |
$(elements.$triggerButton).removeClass("trigger-active"); |
| 388 |
}; |
| 389 |
Master_Addons.MA_Offcanvas_Menu.addLoaderIcon = function() { |
| 390 |
jQuery(document).find(".jltma-offcanvas__content").addClass("jltma-loading"); |
| 391 |
}; |
| 392 |
Master_Addons.MA_Offcanvas_Menu.removeLoaderIcon = function() { |
| 393 |
jQuery(document).find(".jltma-offcanvas__content").removeClass("jltma-loading"); |
| 394 |
}; |
| 395 |
Master_Addons.MA_Offcanvas_Menu.bindEvents = function() { |
| 396 |
elements.$body.on("click", selectors.offcanvasContainerOverlay, Master_Addons.MA_Offcanvas_Menu.containerClick.bind(this)); |
| 397 |
if ("yes" === is_esc_close) elements.$document.on("keydown", Master_Addons.MA_Offcanvas_Menu.closeESC.bind(this)); |
| 398 |
elements.$triggerButton.on("click", Master_Addons.MA_Offcanvas_Menu.offcanvasContent.bind(this)); |
| 399 |
elements.$closeButton.on("click", Master_Addons.MA_Offcanvas_Menu.offcanvasClose.bind(this)); |
| 400 |
elements.$menuParent.on("click", Master_Addons.MA_Offcanvas_Menu.onParentClick.bind(this)); |
| 401 |
$(elements.$menuParent).on("change", function() { |
| 402 |
Master_Addons.MA_Offcanvas_Menu.onParentClick.bind($(this)); |
| 403 |
}); |
| 404 |
$("[data-settings=animation_type]").on("click", function() { |
| 405 |
Master_Addons.MA_Offcanvas_Menu.changeControl.bind($(this)); |
| 406 |
}); |
| 407 |
}; |
| 408 |
Master_Addons.MA_Offcanvas_Menu.perfectScrollInit = function() { |
| 409 |
if (!Master_Addons.MA_Offcanvas_Menu.scrollPerfect) { |
| 410 |
Master_Addons.MA_Offcanvas_Menu.scrollPerfect = new PerfectScrollbar(elements.$offcanvasContentBody.get(0), { |
| 411 |
wheelSpeed: .5, |
| 412 |
suppressScrollX: true |
| 413 |
}); |
| 414 |
return; |
| 415 |
} |
| 416 |
Master_Addons.MA_Offcanvas_Menu.scrollPerfect.update(); |
| 417 |
}; |
| 418 |
Master_Addons.MA_Offcanvas_Menu.onEdit = function() { |
| 419 |
if (!Master_Addons.MA_Offcanvas_Menu.isEdit) return; |
| 420 |
if (void 0 === $element.data("opened")) $element.data("opened", "false"); |
| 421 |
elementor.channels.editor.on("section:activated", Master_Addons.MA_Offcanvas_Menu.sectionActivated.bind(this)); |
| 422 |
}; |
| 423 |
Master_Addons.MA_Offcanvas_Menu.sectionActivated = function(sectionName, editor) { |
| 424 |
var elementsData = elementorFrontend.config.elements.data[this.getModelCID()]; |
| 425 |
var editedElement = editor.getOption("editedElementView"); |
| 426 |
if (this.getModelCID() !== editor.model.cid || elementsData.get("widgetType") !== editedElement.model.get("widgetType")) return; |
| 427 |
if (-1 !== this.sectionsArray.indexOf(sectionName)) { |
| 428 |
if ("true" === $element.data("opened")) { |
| 429 |
var editedModel = editor.getOption("model"); |
| 430 |
Master_Addons.MA_Offcanvas_Menu.offcanvasContent(null, editedModel.get("id")); |
| 431 |
} |
| 432 |
$element.data("opened", "true"); |
| 433 |
} else Master_Addons.MA_Offcanvas_Menu.offcanvasClose(); |
| 434 |
}; |
| 435 |
Master_Addons.MA_Offcanvas_Menu.offcanvasContent = function(event) { |
| 436 |
var widgetId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 437 |
var boxPosition = getElementSettings.canvas_position; |
| 438 |
var offcanvasType = getElementSettings.animation_type; |
| 439 |
var contentId = getID; |
| 440 |
if (null !== widgetId) contentId = widgetId; |
| 441 |
elements.$triggerButton.addClass("trigger-active"); |
| 442 |
jQuery("".concat(selectors.contentClassPart, "-").concat(contentId)).addClass("active"); |
| 443 |
elements.$html.addClass("".concat(classes.contentOpenClass)).addClass("".concat(classes.contentOpenClass, "-").concat(contentId)).addClass("".concat(classes.contentClassPart, "-").concat(boxPosition)).addClass("".concat(classes.contentClassPart, "-").concat(offcanvasType)).data("open-id", contentId); |
| 444 |
}; |
| 445 |
Master_Addons.MA_Offcanvas_Menu.onParentClick = function(event) { |
| 446 |
var $clickedItem = jQuery(event.target); |
| 447 |
var noLinkArray = ["", "#"]; |
| 448 |
var $menuParent = $clickedItem.hasClass(classes.menuArrow) ? $clickedItem.parent() : $clickedItem; |
| 449 |
if ($clickedItem.hasClass(classes.menuArrow) || -1 !== noLinkArray.indexOf($clickedItem.attr("href")) || !$menuParent.hasClass("active")) event.preventDefault(); |
| 450 |
var $menuParentNext = $menuParent.next(); |
| 451 |
$menuParent.removeClass("active"); |
| 452 |
$menuParentNext.slideUp("normal"); |
| 453 |
if ($menuParentNext.is("ul") && !$menuParentNext.is(":visible")) { |
| 454 |
$menuParent.addClass("active"); |
| 455 |
$menuParentNext.slideDown("normal"); |
| 456 |
} |
| 457 |
}; |
| 458 |
Master_Addons.MA_Offcanvas_Menu.changeControl = function() { |
| 459 |
Master_Addons.MA_Offcanvas_Menu.offcanvasClose(); |
| 460 |
}; |
| 461 |
Master_Addons.MA_Offcanvas_Menu.onInit = function() { |
| 462 |
Master_Addons.MA_Offcanvas_Menu.resetCanvas(); |
| 463 |
Master_Addons.MA_Offcanvas_Menu.bindEvents(); |
| 464 |
}; |
| 465 |
return Master_Addons.MA_Offcanvas_Menu.onInit(); |
| 466 |
}, |
| 467 |
MA_Image_Filter_Gallery: function($scope, $) { |
| 468 |
var elementSettings = getElementSettings($scope), $jltma_image_filter_gallery_wrapper = $scope.find(".jltma-image-filter-gallery-wrapper").eq(0), $ma_el_image_filter_gallery_container = $scope.find(".jltma-image-filter-gallery"), $ma_el_image_filter_gallery_nav = $scope.find(".jltma-image-filter-nav"), $ma_el_image_filter_gallery_wrapper = $scope.find(".jltma-image-filter-gallery-wrapper"), $uniqueId = getUniqueLoopScopeId($scope), $maxtilt = elementSettings.ma_el_image_gallery_max_tilt, $perspective = elementSettings.ma_el_image_gallery_perspective, $speed = elementSettings.ma_el_image_gallery_speed, $axis = elementSettings.ma_el_image_gallery_tilt_axis, $glare = elementSettings.ma_el_image_gallery_glare; |
| 469 |
elementSettings.line_location; |
| 470 |
var $ma_el_image_gallery_tooltip = elementSettings.ma_el_image_gallery_tooltip, $container = $(".elementor-element-" + $uniqueId + " .jltma-image-filter-gallery"), layoutMode = $ma_el_image_filter_gallery_wrapper.hasClass("jltma-masonry-yes") ? "masonry" : "fitRows"; |
| 471 |
if (!$jltma_image_filter_gallery_wrapper.length) return; |
| 472 |
if ($ma_el_image_gallery_tooltip == "yes") { |
| 473 |
var $img_filter_gallery = $jltma_image_filter_gallery_wrapper.find("ul.jltma-tooltip"); |
| 474 |
if (!$img_filter_gallery.length) return; |
| 475 |
var $tooltip = $img_filter_gallery.find("> .jltma-tooltip-item"), widgetID = $scope.data("id"); |
| 476 |
$tooltip.each(function(index) { |
| 477 |
tippy(this, { |
| 478 |
allowHTML: false, |
| 479 |
theme: "jltma-image-filter-tippy-" + widgetID |
| 480 |
}); |
| 481 |
}); |
| 482 |
} |
| 483 |
var optValues = { |
| 484 |
filter: "*", |
| 485 |
itemSelector: ".jltma-image-filter-item", |
| 486 |
percentPosition: true, |
| 487 |
animationOptions: { |
| 488 |
duration: 750, |
| 489 |
easing: "linear", |
| 490 |
queue: false |
| 491 |
} |
| 492 |
}; |
| 493 |
var adata = Object.assign({}, optValues); |
| 494 |
if (layoutMode === "fitRows") optValues["layoutMode"] = "fitRows"; |
| 495 |
if (layoutMode === "masonry") { |
| 496 |
adata["macolumnWidthsonry"] = ".jltma-image-filter-item"; |
| 497 |
adata["horizontalOrder"] = true; |
| 498 |
} |
| 499 |
var $grid = $container.isotope(adata); |
| 500 |
$grid.imagesLoaded().progress(function() { |
| 501 |
$grid.isotope("layout"); |
| 502 |
$scope.find(".jltma-image-filter-gallery").css({ "min-height": "300px" }); |
| 503 |
}); |
| 504 |
if ($.isFunction($.fn.imagesLoaded)) $ma_el_image_filter_gallery_container.imagesLoaded(function() { |
| 505 |
if ($.isFunction($.fn.isotope)) $ma_el_image_filter_gallery_container.isotope(optValues); |
| 506 |
}); |
| 507 |
if ($axis === "x") $axis = "y"; |
| 508 |
else if ($axis === "y") $axis = "x"; |
| 509 |
else $axis = "both"; |
| 510 |
if ($glare === "yes") var $max_glare = elementSettings.ma_el_image_gallery_max_glare; |
| 511 |
if ($glare === "yes") $glare = true; |
| 512 |
else $glare = false; |
| 513 |
if ($scope.find(".jltma-tilt-enable")) { |
| 514 |
var tilt_args = { |
| 515 |
maxTilt: $maxtilt, |
| 516 |
perspective: $perspective, |
| 517 |
easing: "linear", |
| 518 |
scale: 1, |
| 519 |
speed: $speed, |
| 520 |
disableAxis: $axis, |
| 521 |
transition: true, |
| 522 |
reset: true, |
| 523 |
glare: $glare, |
| 524 |
maxGlare: $max_glare |
| 525 |
}; |
| 526 |
$scope.find(".jltma-tilt").tilt(tilt_args); |
| 527 |
} |
| 528 |
$ma_el_image_filter_gallery_nav.on("click", "li", function() { |
| 529 |
$ma_el_image_filter_gallery_nav.find(".active").removeClass("active"); |
| 530 |
$(this).addClass("active"); |
| 531 |
if ($.isFunction($.fn.isotope)) { |
| 532 |
var selector = $(this).attr("data-filter"); |
| 533 |
$ma_el_image_filter_gallery_container.isotope({ filter: selector }); |
| 534 |
return false; |
| 535 |
} |
| 536 |
}); |
| 537 |
$("jltma-fancybox").fancybox({ |
| 538 |
protect: true, |
| 539 |
animationDuration: 366, |
| 540 |
transitionDuration: 366, |
| 541 |
transitionEffect: "fade", |
| 542 |
animationEffect: "fade", |
| 543 |
preventCaptionOverlap: true, |
| 544 |
infobar: false, |
| 545 |
buttons: [ |
| 546 |
"zoom", |
| 547 |
"share", |
| 548 |
"slideShow", |
| 549 |
"fullScreen", |
| 550 |
"download", |
| 551 |
"thumbs", |
| 552 |
"close" |
| 553 |
], |
| 554 |
afterLoad: function(instance, current) { |
| 555 |
var pixelRatio = window.devicePixelRatio || 1; |
| 556 |
if (pixelRatio > 1.5) { |
| 557 |
current.width = current.width / pixelRatio; |
| 558 |
current.height = current.height / pixelRatio; |
| 559 |
} |
| 560 |
} |
| 561 |
}); |
| 562 |
}, |
| 563 |
MA_Carousel: function($swiper, settings) { |
| 564 |
var $slides = $swiper.find(".jltma-swiper__slide"), elementorBreakpoints = elementorFrontend.config.breakpoints, swiperInstance = $swiper.data("swiper"), swiperArgs = { |
| 565 |
autoHeight: settings.element.autoHeight || false, |
| 566 |
direction: settings.element.direction || settings.default.direction, |
| 567 |
effect: settings.element.effect || settings.default.effect, |
| 568 |
slidesPerView: settings.default.slidesPerView, |
| 569 |
slidesPerColumn: settings.default.slidesPerColumn, |
| 570 |
slidesPerColumnFill: "row", |
| 571 |
slidesPerGroup: settings.default.slidesPerGroup, |
| 572 |
spaceBetween: settings.default.spaceBetween, |
| 573 |
pagination: {}, |
| 574 |
navigation: {}, |
| 575 |
autoplay: settings.element.autoplay || false, |
| 576 |
grabCursor: true, |
| 577 |
watchSlidesProgress: true, |
| 578 |
watchSlidesVisibility: true |
| 579 |
}; |
| 580 |
if (settings.default.breakpoints) { |
| 581 |
swiperArgs.breakpoints = {}; |
| 582 |
swiperArgs.breakpoints[elementorBreakpoints.md] = settings.default.breakpoints.tablet; |
| 583 |
swiperArgs.breakpoints[elementorBreakpoints.lg] = settings.default.breakpoints.desktop; |
| 584 |
} |
| 585 |
if (!elementorFrontend.isEditMode()) { |
| 586 |
if (!settings.element.freeMode) { |
| 587 |
swiperArgs.observer = true; |
| 588 |
swiperArgs.observeParents = true; |
| 589 |
swiperArgs.observeSlideChildren = true; |
| 590 |
} |
| 591 |
} else { |
| 592 |
swiperArgs.observer = true; |
| 593 |
swiperArgs.observeParents = true; |
| 594 |
swiperArgs.observeSlideChildren = true; |
| 595 |
} |
| 596 |
Master_Addons.MA_Carousel.init = function() { |
| 597 |
if (swiperInstance) { |
| 598 |
Master_Addons.MA_Carousel.destroy(); |
| 599 |
return; |
| 600 |
} |
| 601 |
if (swiperArgs.breakpoints) { |
| 602 |
if (settings.element.breakpoints.desktop.slidesPerView) swiperArgs.breakpoints[elementorBreakpoints.lg].slidesPerView = settings.stretch ? Math.min($slides.length, +settings.element.breakpoints.desktop.slidesPerView || 3) : +settings.element.breakpoints.desktop.slidesPerView || 3; |
| 603 |
if (settings.element.breakpoints.tablet.slidesPerView) swiperArgs.breakpoints[elementorBreakpoints.md].slidesPerView = settings.stretch ? Math.min($slides.length, +settings.element.breakpoints.tablet.slidesPerView || 2) : +settings.element.breakpoints.tablet.slidesPerView || 2; |
| 604 |
} |
| 605 |
if (settings.element.slidesPerView) swiperArgs.slidesPerView = settings.stretch ? Math.min($slides.length, +settings.element.slidesPerView || 1) : +settings.element.slidesPerView || 1; |
| 606 |
if (swiperArgs.breakpoints) { |
| 607 |
if (settings.element.breakpoints.desktop.slidesPerGroup) swiperArgs.breakpoints[elementorBreakpoints.lg].slidesPerGroup = Math.min($slides.length, +settings.element.breakpoints.desktop.slidesPerGroup || 3); |
| 608 |
if (settings.element.breakpoints.tablet.slidesPerGroup) swiperArgs.breakpoints[elementorBreakpoints.md].slidesPerGroup = Math.min($slides.length, +settings.element.breakpoints.tablet.slidesPerGroup || 2); |
| 609 |
} |
| 610 |
if (settings.element.slidesPerGroup) swiperArgs.slidesPerGroup = Math.min($slides.length, +settings.element.slidesPerGroup || 1); |
| 611 |
if (swiperArgs.breakpoints) { |
| 612 |
if (settings.element.breakpoints.desktop.slidesPerColumn) swiperArgs.breakpoints[elementorBreakpoints.lg].slidesPerColumn = settings.element.breakpoints.desktop.slidesPerColumn; |
| 613 |
if (settings.element.breakpoints.tablet.slidesPerColumn) swiperArgs.breakpoints[elementorBreakpoints.md].slidesPerColumn = settings.element.breakpoints.tablet.slidesPerColumn; |
| 614 |
} |
| 615 |
if (settings.element.slidesPerColumn) swiperArgs.slidesPerColumn = settings.element.slidesPerColumn; |
| 616 |
if (swiperArgs.breakpoints) { |
| 617 |
swiperArgs.breakpoints[elementorBreakpoints.lg].spaceBetween = settings.element.breakpoints.desktop.spaceBetween || 0; |
| 618 |
swiperArgs.breakpoints[elementorBreakpoints.md].spaceBetween = settings.element.breakpoints.tablet.spaceBetween || 0; |
| 619 |
} |
| 620 |
if (settings.element.spaceBetween) swiperArgs.spaceBetween = settings.element.spaceBetween || 0; |
| 621 |
if (settings.element.slidesPerColumnFill) swiperArgs.slidesPerColumnFill = settings.element.slidesPerColumnFill; |
| 622 |
if (settings.element.arrows) { |
| 623 |
swiperArgs.navigation.disabledClass = "jltma-swiper__button--disabled"; |
| 624 |
var $prevButton = settings.scope.find(settings.element.arrowPrev), $nextButton = settings.scope.find(settings.element.arrowNext); |
| 625 |
if ($prevButton.length && $nextButton.length) { |
| 626 |
var arrowPrev = settings.element.arrowPrev + "-" + settings.id, arrowNext = settings.element.arrowNext + "-" + settings.id; |
| 627 |
$prevButton.addClass(arrowPrev.replace(".", "")); |
| 628 |
$nextButton.addClass(arrowNext.replace(".", "")); |
| 629 |
swiperArgs.navigation.prevEl = arrowPrev; |
| 630 |
swiperArgs.navigation.nextEl = arrowNext; |
| 631 |
} |
| 632 |
} |
| 633 |
if (settings.element.pagination) { |
| 634 |
swiperArgs.pagination.el = ".jltma-swiper__pagination-" + settings.id; |
| 635 |
swiperArgs.pagination.type = settings.element.paginationType; |
| 636 |
if (settings.element.paginationClickable) swiperArgs.pagination.clickable = true; |
| 637 |
} |
| 638 |
if (settings.element.loop) swiperArgs.loop = true; |
| 639 |
if (swiperArgs.autoplay && (settings.element.autoplaySpeed || settings.element.disableOnInteraction)) { |
| 640 |
swiperArgs.autoplay = {}; |
| 641 |
if (settings.element.autoplaySpeed) swiperArgs.autoplay.delay = settings.element.autoplaySpeed; |
| 642 |
if (settings.element.autoplaySpeed) swiperArgs.autoplay.disableOnInteraction = settings.element.disableOnInteraction; |
| 643 |
} |
| 644 |
if (settings.element.speed) swiperArgs.speed = settings.element.speed; |
| 645 |
if (settings.element.resistance) swiperArgs.resistanceRatio = 1 - settings.element.resistance; |
| 646 |
if (settings.element.freeMode) { |
| 647 |
swiperArgs.freeMode = true; |
| 648 |
swiperArgs.freeModeSticky = settings.element.freeModeSticky; |
| 649 |
swiperArgs.freeModeMomentum = settings.element.freeModeMomentum; |
| 650 |
swiperArgs.freeModeMomentumBounce = settings.element.freeModeMomentumBounce; |
| 651 |
if (settings.element.freeModeMomentumRatio) swiperArgs.freeModeMomentumRatio = settings.element.freeModeMomentumRatio; |
| 652 |
if (settings.element.freeModeMomentumVelocityRatio) swiperArgs.freeModeMomentumVelocityRatio = settings.element.freeModeMomentumVelocityRatio; |
| 653 |
if (settings.element.freeModeMomentumBounceRatio) swiperArgs.freeModeMomentumBounceRatio = settings.element.freeModeMomentumBounceRatio; |
| 654 |
} |
| 655 |
return swiperArgs; |
| 656 |
}; |
| 657 |
Master_Addons.MA_Carousel.onAfterInit = function($swiper, swiper, settings) { |
| 658 |
if ("undefined" == typeof settings || "undefined" == typeof swiper) return; |
| 659 |
if (settings.element.stopOnHover) { |
| 660 |
$swiper.on("mouseover", function() { |
| 661 |
swiper.autoplay.stop(); |
| 662 |
}); |
| 663 |
$swiper.on("mouseout", function() { |
| 664 |
swiper.autoplay.start(); |
| 665 |
}); |
| 666 |
} |
| 667 |
if (settings.element.slideChangeTriggerResize) swiper.on("slideChange", function() { |
| 668 |
$(window).trigger("resize"); |
| 669 |
}); |
| 670 |
$swiper.data("swiper", swiper); |
| 671 |
}; |
| 672 |
return Master_Addons.MA_Carousel.init(); |
| 673 |
}, |
| 674 |
MA_Gallery_Slider: function($scope, $) { |
| 675 |
var elementSettings = getElementSettings($scope), $swiperSlider = $scope.find(".jltma-gallery-slider__slider"), $swiperCarousel = $scope.find(".jltma-gallery-slider__carousel"), uniqueId = getUniqueLoopScopeId($scope); |
| 676 |
$scope.data("id"); |
| 677 |
$scope.find(".jltma-gallery-slider__preview"); |
| 678 |
$scope.find(".jltma-swiper__wrapper .jltma-gallery__item"); |
| 679 |
$scope.find(".jltma-gallery-slider__gallery .jltma-gallery"); |
| 680 |
elementSettings.jltma_gallery_slider_thumb_type; |
| 681 |
elementSettings.jltma_gallery_slider_preview_position; |
| 682 |
elementorFrontend.config.is_rtl; |
| 683 |
elementorFrontend.config.is_rtl; |
| 684 |
var hasCarousel = $swiperCarousel.length, swiperSlider = null, swiperCarousel = null, sliderSettings = { |
| 685 |
key: "slider", |
| 686 |
scope: $scope, |
| 687 |
id: uniqueId, |
| 688 |
element: { |
| 689 |
autoHeight: "yes" === elementSettings.jltma_gallery_slider_adaptive_height ? true : false, |
| 690 |
autoplay: "yes" === elementSettings.jltma_gallery_slider_autoplay ? true : false, |
| 691 |
autoplaySpeed: "yes" === elementSettings.jltma_gallery_slider_autoplay && elementSettings.jltma_gallery_slider_autoplay_speed ? elementSettings.jltma_gallery_slider_autoplay_speed.size : false, |
| 692 |
disableOnInteraction: "" !== elementSettings.autoplay_disable_on_interaction, |
| 693 |
stopOnHover: "yes" === elementSettings.jltma_gallery_slider_pause_on_hover, |
| 694 |
loop: "yes" === elementSettings.jltma_gallery_slider_infinite, |
| 695 |
arrows: "" !== elementSettings.jltma_gallery_slider_show_arrows, |
| 696 |
arrowPrev: ".jltma-arrow--prev", |
| 697 |
arrowNext: ".jltma-arrow--next", |
| 698 |
effect: elementSettings.jltma_gallery_slider_effect, |
| 699 |
speed: elementSettings.jltma_gallery_slider_speed ? elementSettings.jltma_gallery_slider_speed : 500, |
| 700 |
resistance: elementSettings.resistance ? elementSettings.resistance.size : .25, |
| 701 |
keyboard: { enabled: true } |
| 702 |
}, |
| 703 |
default: { |
| 704 |
effect: "slide", |
| 705 |
direction: "horizontal", |
| 706 |
slidesPerView: 1, |
| 707 |
slidesPerGroup: 1, |
| 708 |
slidesPerColumn: 1, |
| 709 |
spaceBetween: 0 |
| 710 |
} |
| 711 |
}; |
| 712 |
if (hasCarousel) var carouselSettings = { |
| 713 |
key: "carousel", |
| 714 |
scope: $scope, |
| 715 |
id: uniqueId, |
| 716 |
element: { |
| 717 |
direction: elementSettings.carousel_orientation, |
| 718 |
arrows: "" !== elementSettings.jltma_gallery_slider_thumb_show_arrows, |
| 719 |
arrowPrev: ".jltma-arrow--prev", |
| 720 |
arrowNext: ".jltma-arrow--next", |
| 721 |
autoHeight: false, |
| 722 |
loop: "yes" === elementSettings.jltma_gallery_slider_thumb_infinite ? true : false, |
| 723 |
autoplay: "yes" === elementSettings.jltma_gallery_slider_thumb_autoplay ? true : false, |
| 724 |
autoplaySpeed: "yes" === elementSettings.jltma_gallery_slider_thumb_autoplay && elementSettings.jltma_gallery_slider_thumb_autoplay_speed ? elementSettings.jltma_gallery_slider_thumb_autoplay_speed.size : false, |
| 725 |
stopOnHover: "yes" === elementSettings.jltma_gallery_slider_thumb_pause_on_hover, |
| 726 |
speed: elementSettings.jltma_gallery_slider_thumb_speed ? elementSettings.jltma_gallery_slider_thumb_speed : 500, |
| 727 |
slidesPerView: elementSettings.jltma_gallery_slider_thumb_items_mobile, |
| 728 |
slidesPerColumn: "vertical" === elementSettings.carousel_orientation ? 1 : elementSettings.carousel_slides_per_column_mobile, |
| 729 |
slidesPerGroup: elementSettings.carousel_slides_to_scroll_mobile, |
| 730 |
resistance: elementSettings.carousel_resistance ? elementSettings.carousel_resistance.size : .15, |
| 731 |
spaceBetween: elementSettings.carousel_spacing_mobile ? elementSettings.carousel_spacing_mobile.size : 0, |
| 732 |
breakpoints: { |
| 733 |
tablet: { |
| 734 |
slidesPerView: elementSettings.jltma_gallery_slider_thumb_items_tablet, |
| 735 |
slidesPerColumn: "vertical" === elementSettings.carousel_orientation ? 1 : elementSettings.carousel_slides_per_column_tablet, |
| 736 |
slidesPerGroup: elementSettings.carousel_slides_to_scroll_tablet, |
| 737 |
spaceBetween: elementSettings.carousel_spacing_tablet ? elementSettings.carousel_spacing_tablet.size : 0 |
| 738 |
}, |
| 739 |
desktop: { |
| 740 |
slidesPerView: elementSettings.jltma_gallery_slider_thumb_items, |
| 741 |
slidesPerColumn: "vertical" === elementSettings.carousel_orientation ? 1 : elementSettings.carousel_slides_per_column, |
| 742 |
slidesPerGroup: elementSettings.carousel_slides_to_scroll, |
| 743 |
spaceBetween: elementSettings.carousel_spacing ? elementSettings.carousel_spacing.size : 0 |
| 744 |
} |
| 745 |
} |
| 746 |
}, |
| 747 |
default: { |
| 748 |
effect: "slide", |
| 749 |
slidesPerView: 1, |
| 750 |
slidesPerGroup: 1, |
| 751 |
slidesPerColumn: 1, |
| 752 |
spaceBetween: 6, |
| 753 |
breakpoints: { |
| 754 |
tablet: { |
| 755 |
slidesPerView: 2, |
| 756 |
slidesPerGroup: 1, |
| 757 |
slidesPerColumn: 2, |
| 758 |
spaceBetween: 12 |
| 759 |
}, |
| 760 |
desktop: { |
| 761 |
slidesPerView: 3, |
| 762 |
slidesPerGroup: 1, |
| 763 |
slidesPerColumn: 3, |
| 764 |
spaceBetween: 24 |
| 765 |
} |
| 766 |
} |
| 767 |
} |
| 768 |
}; |
| 769 |
Master_Addons.MA_Gallery_Slider.init = function() { |
| 770 |
var sliderArgs = Master_Addons.MA_Carousel($swiperSlider, sliderSettings); |
| 771 |
if (hasCarousel) var carouselArgs = Master_Addons.MA_Carousel($swiperCarousel, carouselSettings); |
| 772 |
if ("undefined" === typeof Swiper) { |
| 773 |
const asyncSwiper = elementorFrontend.utils.swiper; |
| 774 |
new asyncSwiper($swiperSlider, sliderArgs).then(function(sliderSwiperInstance) { |
| 775 |
if (!hasCarousel) { |
| 776 |
Master_Addons.MA_Gallery_Slider.initSliders($scope, sliderSwiperInstance, false); |
| 777 |
Master_Addons.MA_Carousel.onAfterInit($swiperSlider, sliderSwiperInstance, sliderSettings); |
| 778 |
} else new asyncSwiper($swiperCarousel, carouselArgs).then(function(carouselSwiperInstance) { |
| 779 |
Master_Addons.MA_Gallery_Slider.initSliders($scope, sliderSwiperInstance, carouselSwiperInstance); |
| 780 |
Master_Addons.MA_Carousel.onAfterInit($swiperSlider, sliderSwiperInstance, sliderSettings); |
| 781 |
Master_Addons.MA_Carousel.onAfterInit($swiperCarousel, carouselSwiperInstance, carouselSettings); |
| 782 |
}); |
| 783 |
}); |
| 784 |
} else { |
| 785 |
if (hasCarousel) { |
| 786 |
var swiper = new Swiper($swiperSlider[1], { ...carouselArgs }); |
| 787 |
var swiperSlider = new Swiper($swiperSlider[0], { |
| 788 |
...sliderArgs, |
| 789 |
thumbs: { swiper } |
| 790 |
}); |
| 791 |
} else var swiperSlider = new Swiper($swiperSlider[0], { ...sliderArgs }); |
| 792 |
if (hasCarousel) swiperCarousel = new Swiper($swiperCarousel, carouselArgs); |
| 793 |
Master_Addons.MA_Gallery_Slider.initSliders($scope, swiperSlider, swiperCarousel); |
| 794 |
Master_Addons.MA_Carousel.onAfterInit($swiperSlider, swiperSlider, sliderSettings); |
| 795 |
if (hasCarousel) Master_Addons.MA_Carousel.onAfterInit($swiperCarousel, swiperCarousel, carouselSettings); |
| 796 |
} |
| 797 |
}; |
| 798 |
Master_Addons.MA_Gallery_Slider.getSlider = function() { |
| 799 |
return $scope.find(".jltma-gallery-slider__slider"); |
| 800 |
}; |
| 801 |
Master_Addons.MA_Gallery_Slider.getCarousel = function() { |
| 802 |
return $scope.find(".jltma-gallery-slider__carousel"); |
| 803 |
}; |
| 804 |
Master_Addons.MA_Gallery_Slider.initSliders = function($scope, swiperSlider, swiperCarousel) { |
| 805 |
var data = { |
| 806 |
scope: $scope, |
| 807 |
slider: swiperSlider, |
| 808 |
carousel: swiperCarousel |
| 809 |
}; |
| 810 |
Master_Addons.MA_Gallery_Slider.onSlideChange(data); |
| 811 |
Master_Addons.MA_Gallery_Slider.events(data); |
| 812 |
}; |
| 813 |
Master_Addons.MA_Gallery_Slider.events = function(data) { |
| 814 |
var $thumbs = data.scope.find(".jltma-gallery__item"); |
| 815 |
data.slider.on("slideChange", function(instance) { |
| 816 |
Master_Addons.MA_Gallery_Slider.onSlideChange(data); |
| 817 |
}); |
| 818 |
$thumbs.on("click", function() { |
| 819 |
var offset = sliderSettings.element.loop ? 1 : 0; |
| 820 |
event.preventDefault(); |
| 821 |
data.slider.slideTo($(this).index() + offset); |
| 822 |
}); |
| 823 |
}; |
| 824 |
Master_Addons.MA_Gallery_Slider.onSlideChange = function(data) { |
| 825 |
var activeIndex = sliderSettings.element.loop ? data.slider.realIndex : data.slider.activeIndex; |
| 826 |
if (hasCarousel) data.carousel.slideTo(activeIndex); |
| 827 |
var $thumbs = data.scope.find(".jltma-gallery__item"); |
| 828 |
$thumbs.removeClass("is--active"); |
| 829 |
$thumbs.eq(activeIndex).addClass("is--active"); |
| 830 |
}; |
| 831 |
Master_Addons.MA_Gallery_Slider.onThumbClicked = function(event) { |
| 832 |
var offset = sliderSettings.element.loop ? 1 : 0; |
| 833 |
event.preventDefault(); |
| 834 |
swiperSlider.slideTo($(this).index() + offset, 500, true); |
| 835 |
}; |
| 836 |
Master_Addons.onElementRemove($scope, function() { |
| 837 |
$scope.find(".swiper-container").each(function() { |
| 838 |
if ($(this).data("swiper")) $(this).data("swiper").destroy(); |
| 839 |
}); |
| 840 |
}); |
| 841 |
Master_Addons.MA_Gallery_Slider.init(); |
| 842 |
}, |
| 843 |
onElementRemove: function($element, callback) { |
| 844 |
if (elementorFrontend.isEditMode()) elementor.channels.data.on("element:before:remove", function(model) { |
| 845 |
if ($element.data("id") === model.id) callback(); |
| 846 |
}); |
| 847 |
}, |
| 848 |
MA_Timeline: function($scope, $) { |
| 849 |
var elementSettings = getElementSettings($scope), $timeline = $scope.find(".jltma-timeline"), $swiperSlider = $scope.find(".jltma-timeline-slider"), $timeline_type = elementSettings.ma_el_timeline_type || "custom", $timeline_layout = elementSettings.ma_el_timeline_design_type || "vertical", timelineArgs = {}; |
| 850 |
$swiperSlider.length; |
| 851 |
getUniqueLoopScopeId($scope); |
| 852 |
if ($timeline_layout === "horizontal") { |
| 853 |
var $carousel = $scope.find(".jltma-timeline-carousel-slider"); |
| 854 |
if (!$carousel.length) return; |
| 855 |
var $carouselContainer = $scope.find(".swiper"), $settings = $carousel.data("settings"), Swiper = elementorFrontend.utils.swiper; |
| 856 |
initSwiper(); |
| 857 |
async function initSwiper() { |
| 858 |
await new Swiper($carouselContainer[0], $settings); |
| 859 |
if ($settings.pauseOnHover) $carouselContainer.hover(function() { |
| 860 |
this.swiper.autoplay.stop(); |
| 861 |
}, function() { |
| 862 |
this.swiper.autoplay.start(); |
| 863 |
}); |
| 864 |
} |
| 865 |
} |
| 866 |
if ($timeline_layout === "vertical" || $timeline_type === "post") { |
| 867 |
var $timeline = $scope.find(".jltma-timeline"), timelineArgs = {}; |
| 868 |
Master_Addons.MA_Timeline.init = function() { |
| 869 |
if (elementorFrontend.isEditMode()) timelineArgs.scope = window.elementor.$previewContents; |
| 870 |
if ("undefined" !== typeof elementSettings.line_location && elementSettings.line_location.size) timelineArgs.lineLocation = elementSettings.line_location.size; |
| 871 |
$timeline.maTimeline(timelineArgs); |
| 872 |
}; |
| 873 |
Master_Addons.MA_Timeline.init(); |
| 874 |
} |
| 875 |
}, |
| 876 |
MA_NewsTicker: function($scope, $) { |
| 877 |
try { |
| 878 |
var newsTickerWrapper = $scope.find(".jltma-news-ticker"); |
| 879 |
newsTickerWrapper.data("tickertype"); |
| 880 |
newsTickerWrapper.data("tickerid"); |
| 881 |
newsTickerWrapper.data("feedurl"); |
| 882 |
newsTickerWrapper.data("feedanimation"); |
| 883 |
newsTickerWrapper.data("limitposts"); |
| 884 |
var tickerStyleEffect = newsTickerWrapper.data("scroll") || "slide-h", autoplay = newsTickerWrapper.data("autoplay"), timer = newsTickerWrapper.data("timer") || 3e3; |
| 885 |
var swiperContainer = $scope.find(".jltma-ticker-content-inner.swiper")[0]; |
| 886 |
if (!swiperContainer) return; |
| 887 |
var swiperOptions = { |
| 888 |
loop: true, |
| 889 |
slidesPerView: 1, |
| 890 |
spaceBetween: 0, |
| 891 |
speed: 500, |
| 892 |
navigation: { |
| 893 |
nextEl: $scope.find(".jltma-ticker-next")[0], |
| 894 |
prevEl: $scope.find(".jltma-ticker-prev")[0] |
| 895 |
} |
| 896 |
}; |
| 897 |
if (tickerStyleEffect === "slide-v") swiperOptions.direction = "vertical"; |
| 898 |
else if (tickerStyleEffect === "scroll-h") { |
| 899 |
swiperOptions.direction = "horizontal"; |
| 900 |
swiperOptions.freeMode = { |
| 901 |
enabled: true, |
| 902 |
momentum: false |
| 903 |
}; |
| 904 |
swiperOptions.speed = 5e3; |
| 905 |
swiperOptions.autoplay = { |
| 906 |
delay: 0, |
| 907 |
disableOnInteraction: false, |
| 908 |
pauseOnMouseEnter: true |
| 909 |
}; |
| 910 |
} else swiperOptions.direction = "horizontal"; |
| 911 |
if (autoplay && tickerStyleEffect !== "scroll-h") swiperOptions.autoplay = { |
| 912 |
delay: timer, |
| 913 |
disableOnInteraction: false, |
| 914 |
pauseOnMouseEnter: true |
| 915 |
}; |
| 916 |
new Swiper(swiperContainer, swiperOptions); |
| 917 |
} catch (e) { |
| 918 |
console.log("News Ticker Error:", e); |
| 919 |
} |
| 920 |
}, |
| 921 |
MA_Blog: function($scope, $) { |
| 922 |
getElementSettings($scope); |
| 923 |
getUniqueLoopScopeId($scope); |
| 924 |
$scope.data("id"); |
| 925 |
$scope.find(".jltma-swiper__container"); |
| 926 |
$scope.find(".jltma-grid__item"); |
| 927 |
var blogElement = $scope.find(".jltma-blog-wrapper"); |
| 928 |
blogElement.data("col"); |
| 929 |
var carousel = blogElement.data("carousel"); |
| 930 |
blogElement.data("grid"); |
| 931 |
$scope.find(".jltma-blog-cats-container li a").click(function(e) { |
| 932 |
e.preventDefault(); |
| 933 |
$scope.find(".jltma-blog-cats-container li .active").removeClass("active"); |
| 934 |
$(this).addClass("active"); |
| 935 |
var selector = $(this).attr("data-filter"); |
| 936 |
blogElement.isotope({ filter: selector }); |
| 937 |
return false; |
| 938 |
}); |
| 939 |
if (blogElement.hasClass("jltma-blog-masonry") && !carousel) blogElement.imagesLoaded(function() { |
| 940 |
blogElement.isotope({ |
| 941 |
itemSelector: ".jltma-post-outer-container", |
| 942 |
percentPosition: true, |
| 943 |
animationOptions: { |
| 944 |
duration: 750, |
| 945 |
easing: "linear", |
| 946 |
queue: false |
| 947 |
} |
| 948 |
}); |
| 949 |
}); |
| 950 |
var $carousel = $scope.find(".jltma-blog-carousel-slider"); |
| 951 |
if (!$carousel.length) return; |
| 952 |
var $carouselContainer = $scope.find(".swiper"), $settings = $carousel.data("settings"), Swiper = elementorFrontend.utils.swiper; |
| 953 |
initSwiper(); |
| 954 |
async function initSwiper() { |
| 955 |
await new Swiper($carouselContainer[0], $settings); |
| 956 |
if ($settings.pauseOnHover) $carouselContainer.hover(function() { |
| 957 |
this.swiper.autoplay.stop(); |
| 958 |
}, function() { |
| 959 |
this.swiper.autoplay.start(); |
| 960 |
}); |
| 961 |
} |
| 962 |
}, |
| 963 |
/**** MA Image Carousel ****/ |
| 964 |
MA_Image_Carousel: function($scope, $) { |
| 965 |
var $carousel = $scope.find(".jltma-image-carousel-slider"); |
| 966 |
if (!$carousel.length) return; |
| 967 |
var $carouselContainer = $scope.find(".swiper"), $settings = $carousel.data("settings"), Swiper = elementorFrontend.utils.swiper; |
| 968 |
initSwiper(); |
| 969 |
async function initSwiper() { |
| 970 |
await new Swiper($carouselContainer[0], $settings); |
| 971 |
if ($settings.pauseOnHover) $carouselContainer.hover(function() { |
| 972 |
this.swiper.autoplay.stop(); |
| 973 |
}, function() { |
| 974 |
this.swiper.autoplay.start(); |
| 975 |
}); |
| 976 |
} |
| 977 |
}, |
| 978 |
/**** MA Logo Slider ****/ |
| 979 |
MA_Logo_Slider: function($scope, $) { |
| 980 |
var $carousel = $scope.find(".jltma-logo-carousel-slider"); |
| 981 |
if (!$carousel.length) return; |
| 982 |
var $carouselContainer = $scope.find(".swiper"), $settings = $carousel.data("settings"), Swiper = elementorFrontend.utils.swiper; |
| 983 |
initSwiper(); |
| 984 |
async function initSwiper() { |
| 985 |
await new Swiper($carouselContainer[0], $settings); |
| 986 |
if ($settings.pauseOnHover) $carouselContainer.hover(function() { |
| 987 |
this.swiper.autoplay.stop(); |
| 988 |
}, function() { |
| 989 |
this.swiper.autoplay.start(); |
| 990 |
}); |
| 991 |
} |
| 992 |
/** |
| 993 |
* Icon click for hover |
| 994 |
*/ |
| 995 |
$carousel.find(".jltma-logo-slider-figure").on("click", ".item-hover-icon", function() { |
| 996 |
var $this = $(this); |
| 997 |
$this.toggleClass("hide"); |
| 998 |
$this.siblings(".jltma-hover-click").toggleClass("show"); |
| 999 |
}); |
| 1000 |
$carousel.find(".jltma-logo-slider-item").each(function(e) { |
| 1001 |
var $currentTooltip = $(this).attr("id"); |
| 1002 |
if ($currentTooltip) { |
| 1003 |
var $dataId = $(this).data("id"); |
| 1004 |
var $tooltipSettings = $(this).data("tooltip-settings"); |
| 1005 |
var selector = "#" + $currentTooltip; |
| 1006 |
var $follow_cursor = $tooltipSettings.follow_cursor; |
| 1007 |
var placement_cursor; |
| 1008 |
if ($follow_cursor == 1) placement_cursor = { followCursor: true }; |
| 1009 |
else placement_cursor = { |
| 1010 |
placement: $tooltipSettings.placement, |
| 1011 |
followCursor: false |
| 1012 |
}; |
| 1013 |
var arrowType = false; |
| 1014 |
if ($tooltipSettings.arrow == 1) if ($tooltipSettings.arrow_type == "round") arrowType = tippy.roundArrow; |
| 1015 |
else arrowType = true; |
| 1016 |
tippy(selector, { |
| 1017 |
content: $tooltipSettings.text, |
| 1018 |
...placement_cursor, |
| 1019 |
animation: $tooltipSettings.animation, |
| 1020 |
arrow: arrowType, |
| 1021 |
duration: $tooltipSettings.duration, |
| 1022 |
delay: $tooltipSettings.delay, |
| 1023 |
trigger: $tooltipSettings.trigger, |
| 1024 |
offset: [$tooltipSettings.x_offset, $tooltipSettings.y_offset], |
| 1025 |
zIndex: 999999, |
| 1026 |
allowHTML: false, |
| 1027 |
theme: "jltma-tippy-" + $dataId, |
| 1028 |
onShow(instance) { |
| 1029 |
var tippyPopper = instance.popper; |
| 1030 |
$(tippyPopper).addClass($dataId); |
| 1031 |
} |
| 1032 |
}); |
| 1033 |
} |
| 1034 |
}); |
| 1035 |
}, |
| 1036 |
/**** MA Team Slider ****/ |
| 1037 |
MA_TeamSlider: function($scope, $) { |
| 1038 |
if ($scope.find(".jltma-team-carousel-wrapper").eq(0).data("team-preset") == "-content-drawer") try { |
| 1039 |
(function($) { |
| 1040 |
$(".gridder").gridderExpander({ |
| 1041 |
scroll: false, |
| 1042 |
scrollOffset: 0, |
| 1043 |
scrollTo: "panel", |
| 1044 |
animationSpeed: 400, |
| 1045 |
animationEasing: "easeInOutExpo", |
| 1046 |
showNav: true, |
| 1047 |
nextText: "<span></span>", |
| 1048 |
prevText: "<span></span>", |
| 1049 |
closeText: "", |
| 1050 |
onStart: function() {}, |
| 1051 |
onContent: function() {}, |
| 1052 |
onClosed: function() {} |
| 1053 |
}); |
| 1054 |
})(jQuery); |
| 1055 |
} catch (e) {} |
| 1056 |
else { |
| 1057 |
var $carousel = $scope.find(".jltma-team-carousel-slider"); |
| 1058 |
if (!$carousel.length) return; |
| 1059 |
var $carouselContainer = $scope.find(".swiper"), $settings = $carousel.data("settings"), Swiper = elementorFrontend.utils.swiper; |
| 1060 |
async function initSwiper() { |
| 1061 |
await new Swiper($carouselContainer[0], $settings); |
| 1062 |
if ($settings.pauseOnHover) $carouselContainer.hover(function() { |
| 1063 |
this.swiper.autoplay.stop(); |
| 1064 |
}, function() { |
| 1065 |
this.swiper.autoplay.start(); |
| 1066 |
}); |
| 1067 |
} |
| 1068 |
initSwiper(); |
| 1069 |
} |
| 1070 |
}, |
| 1071 |
/**** MA Advanced Image ****/ |
| 1072 |
MA_Advanced_Image: function($scope, $) { |
| 1073 |
Master_Addons.MA_Advanced_Image.elementSettings = getElementSettings($scope); |
| 1074 |
$scope.find(".jltma-img-dynamic-dropshadow").each(function() { |
| 1075 |
var imgFrame, clonedImg, img; |
| 1076 |
if (this instanceof jQuery) if (this && this[0]) img = this[0]; |
| 1077 |
else return; |
| 1078 |
else img = this; |
| 1079 |
if (!img.classList.contains("jltma-img-has-shadow")) { |
| 1080 |
imgFrame = document.createElement("div"); |
| 1081 |
clonedImg = img.cloneNode(); |
| 1082 |
clonedImg.classList.add("jltma-img-dynamic-dropshadow-cloned"); |
| 1083 |
clonedImg.classList.remove("jltma-img-dynamic-dropshadow"); |
| 1084 |
img.classList.add("jltma-img-has-shadow"); |
| 1085 |
imgFrame.classList.add("jltma-img-dynamic-dropshadow-frame"); |
| 1086 |
img.parentNode.appendChild(imgFrame); |
| 1087 |
imgFrame.appendChild(img); |
| 1088 |
imgFrame.appendChild(clonedImg); |
| 1089 |
} |
| 1090 |
}); |
| 1091 |
$scope.find(".jltma-tilt-box").tilt({ |
| 1092 |
maxTilt: $(this).data("max-tilt"), |
| 1093 |
easing: "cubic-bezier(0.23, 1, 0.32, 1)", |
| 1094 |
speed: $(this).data("time"), |
| 1095 |
perspective: 2e3 |
| 1096 |
}); |
| 1097 |
}, |
| 1098 |
MA_Tooltip: function($scope, $) { |
| 1099 |
"use strict"; |
| 1100 |
if (!$scope || !$scope.length || !$ || typeof getElementSettings !== "function") return; |
| 1101 |
if (typeof tippy === "undefined") { |
| 1102 |
var retryCount = ($scope.data("ma-tooltip-retry") || 0) + 1; |
| 1103 |
if (retryCount <= 10) { |
| 1104 |
$scope.data("ma-tooltip-retry", retryCount); |
| 1105 |
setTimeout(function() { |
| 1106 |
Master_Addons.MA_Tooltip($scope, $); |
| 1107 |
}, 100); |
| 1108 |
} |
| 1109 |
return; |
| 1110 |
} |
| 1111 |
$scope.removeData("ma-tooltip-retry"); |
| 1112 |
var elementSettings = getElementSettings($scope), scopeId = $scope.data("id"), currentTooltipElement = null; |
| 1113 |
if (!scopeId || typeof scopeId !== "string") return; |
| 1114 |
try { |
| 1115 |
currentTooltipElement = document.getElementById("jltma-tooltip-" + scopeId); |
| 1116 |
if (!currentTooltipElement) { |
| 1117 |
var $fallbackElement = $scope.find("#jltma-tooltip-" + scopeId); |
| 1118 |
if ($fallbackElement && $fallbackElement.length > 0) { |
| 1119 |
var fallbackEl = $fallbackElement[0]; |
| 1120 |
if (fallbackEl && fallbackEl.nodeType === 1) currentTooltipElement = fallbackEl; |
| 1121 |
} |
| 1122 |
} |
| 1123 |
if (!currentTooltipElement || !currentTooltipElement.nodeType || currentTooltipElement.nodeType !== 1) return; |
| 1124 |
if (currentTooltipElement.jquery) { |
| 1125 |
currentTooltipElement = currentTooltipElement[0]; |
| 1126 |
if (!currentTooltipElement || !currentTooltipElement.nodeType) return; |
| 1127 |
} |
| 1128 |
} catch (error) { |
| 1129 |
return; |
| 1130 |
} |
| 1131 |
var initTooltip = function() { |
| 1132 |
try { |
| 1133 |
if (currentTooltipElement && currentTooltipElement._maTooltipInitializing) return; |
| 1134 |
if (!elementSettings || typeof elementSettings !== "object") return; |
| 1135 |
var tooltipText = elementSettings.ma_el_tooltip_text; |
| 1136 |
if (!tooltipText || typeof tooltipText !== "string") return; |
| 1137 |
if (currentTooltipElement) currentTooltipElement._maTooltipInitializing = true; |
| 1138 |
var $jltma_el_tooltip_text = stripTags(tooltipText), $jltma_el_tooltip_direction = elementSettings.ma_el_tooltip_direction || "top", $jltma_tooltip_animation = elementSettings.jltma_tooltip_animation || "shift-away", $jltma_tooltip_arrow = elementSettings.jltma_tooltip_arrow !== false, $jltma_tooltip_duration = parseInt(elementSettings.jltma_tooltip_duration) || 300, $jltma_tooltip_delay = parseInt(elementSettings.jltma_tooltip_delay) || 300, $jltma_tooltip_arrow_type = elementSettings.jltma_tooltip_arrow_type || "sharp", $jltma_tooltip_trigger = elementSettings.jltma_tooltip_trigger || "mouseenter", $jltma_tooltip_custom_trigger = elementSettings.jltma_tooltip_custom_trigger, $animateFill = elementSettings.jltma_tooltip_animation === "fill"; |
| 1139 |
$jltma_tooltip_duration = Math.max(100, Math.min(5e3, $jltma_tooltip_duration)); |
| 1140 |
$jltma_tooltip_delay = Math.max(0, Math.min(5e3, $jltma_tooltip_delay)); |
| 1141 |
var $jltma_tooltip_x_offset = 0, $jltma_tooltip_y_offset = 0; |
| 1142 |
try { |
| 1143 |
if (elementSettings.jltma_tooltip_x_offset && elementSettings.jltma_tooltip_x_offset.size !== void 0) $jltma_tooltip_x_offset = parseInt(elementSettings.jltma_tooltip_x_offset.size) || 0; |
| 1144 |
if (elementSettings.jltma_tooltip_y_offset && elementSettings.jltma_tooltip_y_offset.size !== void 0) $jltma_tooltip_y_offset = parseInt(elementSettings.jltma_tooltip_y_offset.size) || 0; |
| 1145 |
} catch (error) { |
| 1146 |
$jltma_tooltip_x_offset = 0; |
| 1147 |
$jltma_tooltip_y_offset = 0; |
| 1148 |
} |
| 1149 |
var $jltma_el_tooltip_text_width = 200; |
| 1150 |
try { |
| 1151 |
if (elementSettings.ma_el_tooltip_text_width && elementSettings.ma_el_tooltip_text_width.size) $jltma_el_tooltip_text_width = parseInt(elementSettings.ma_el_tooltip_text_width.size) || 200; |
| 1152 |
} catch (error) { |
| 1153 |
$jltma_el_tooltip_text_width = 200; |
| 1154 |
} |
| 1155 |
if (!currentTooltipElement || !currentTooltipElement.nodeType || currentTooltipElement.nodeType !== 1) return; |
| 1156 |
if (!$jltma_el_tooltip_text || !$jltma_el_tooltip_text.trim()) return; |
| 1157 |
try { |
| 1158 |
var parentElement = currentTooltipElement.parentElement; |
| 1159 |
if (parentElement && parentElement.classList && parentElement.classList.contains("jltma-tooltip-element")) return; |
| 1160 |
} catch (error) {} |
| 1161 |
var tooltipConfig = { |
| 1162 |
content: $jltma_el_tooltip_text, |
| 1163 |
animation: $jltma_tooltip_animation, |
| 1164 |
arrow: $jltma_tooltip_arrow, |
| 1165 |
duration: [$jltma_tooltip_duration, $jltma_tooltip_delay], |
| 1166 |
trigger: $jltma_tooltip_trigger, |
| 1167 |
animateFill: $animateFill, |
| 1168 |
flipOnUpdate: true, |
| 1169 |
maxWidth: Math.max(50, Math.min(1e3, $jltma_el_tooltip_text_width)), |
| 1170 |
zIndex: 999, |
| 1171 |
allowHTML: false, |
| 1172 |
theme: "jltma-tooltip-tippy-" + scopeId, |
| 1173 |
interactive: true, |
| 1174 |
hideOnClick: true, |
| 1175 |
offset: [Math.max(-500, Math.min(500, $jltma_tooltip_x_offset)), Math.max(-500, Math.min(500, $jltma_tooltip_y_offset))], |
| 1176 |
appendTo: function() { |
| 1177 |
try { |
| 1178 |
return typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode() ? document.body : "parent"; |
| 1179 |
} catch (error) { |
| 1180 |
return "parent"; |
| 1181 |
} |
| 1182 |
}, |
| 1183 |
onShow: function(instance) { |
| 1184 |
try { |
| 1185 |
if (instance && instance.popper && typeof jQuery !== "undefined") jQuery(instance.popper).attr("data-tippy-popper-id", scopeId); |
| 1186 |
} catch (error) {} |
| 1187 |
}, |
| 1188 |
onCreate: function(instance) { |
| 1189 |
try { |
| 1190 |
if (instance && instance.reference && !instance.reference.nodeType) { |
| 1191 |
if (instance.reference.jquery) instance.reference = instance.reference[0]; |
| 1192 |
} |
| 1193 |
} catch (error) {} |
| 1194 |
}, |
| 1195 |
onDestroy: function() { |
| 1196 |
if (currentTooltipElement) currentTooltipElement._tippyInstance = null; |
| 1197 |
} |
| 1198 |
}; |
| 1199 |
if ($jltma_tooltip_arrow && $jltma_tooltip_arrow_type === "round") try { |
| 1200 |
if (typeof tippy !== "undefined" && tippy.roundArrow) tooltipConfig.arrow = tippy.roundArrow; |
| 1201 |
} catch (error) { |
| 1202 |
tooltipConfig.arrow = true; |
| 1203 |
} |
| 1204 |
if (elementSettings.jltma_tooltip_follow_cursor === "yes" || elementSettings.jltma_tooltip_follow_cursor === true) tooltipConfig.followCursor = true; |
| 1205 |
else if ($jltma_el_tooltip_direction && typeof $jltma_el_tooltip_direction === "string") { |
| 1206 |
if ([ |
| 1207 |
"top", |
| 1208 |
"bottom", |
| 1209 |
"left", |
| 1210 |
"right", |
| 1211 |
"top-start", |
| 1212 |
"top-end", |
| 1213 |
"bottom-start", |
| 1214 |
"bottom-end", |
| 1215 |
"left-start", |
| 1216 |
"left-end", |
| 1217 |
"right-start", |
| 1218 |
"right-end", |
| 1219 |
"auto" |
| 1220 |
].indexOf($jltma_el_tooltip_direction) !== -1) tooltipConfig.placement = $jltma_el_tooltip_direction; |
| 1221 |
} |
| 1222 |
if ($jltma_tooltip_trigger === "manual" && $jltma_tooltip_custom_trigger && typeof $jltma_tooltip_custom_trigger === "string") try { |
| 1223 |
var sanitizedSelector = $jltma_tooltip_custom_trigger.replace(/[<>'"]/g, ""); |
| 1224 |
var customTriggerEl = document.querySelector(sanitizedSelector); |
| 1225 |
if (customTriggerEl && customTriggerEl.nodeType === 1) { |
| 1226 |
tooltipConfig.trigger = "manual"; |
| 1227 |
tooltipConfig.hideOnClick = false; |
| 1228 |
var customClickHandler = function() { |
| 1229 |
var targetEl = currentTooltipElement; |
| 1230 |
if (targetEl && targetEl.jquery) targetEl = targetEl[0]; |
| 1231 |
var instance = targetEl ? targetEl._tippyInstance : null; |
| 1232 |
if (instance && instance.state) if (instance.state.isVisible) instance.hide(); |
| 1233 |
else { |
| 1234 |
instance.show(); |
| 1235 |
setTimeout(function() { |
| 1236 |
if (instance && !instance.state.isDestroyed) instance.hide(); |
| 1237 |
}, 1500); |
| 1238 |
} |
| 1239 |
}; |
| 1240 |
customTriggerEl.addEventListener("click", customClickHandler); |
| 1241 |
if (!currentTooltipElement._maTooltipCleanup) currentTooltipElement._maTooltipCleanup = []; |
| 1242 |
currentTooltipElement._maTooltipCleanup.push({ |
| 1243 |
element: customTriggerEl, |
| 1244 |
event: "click", |
| 1245 |
handler: customClickHandler |
| 1246 |
}); |
| 1247 |
} |
| 1248 |
} catch (error) {} |
| 1249 |
try { |
| 1250 |
[ |
| 1251 |
"[data-tippy-popper-id=\"" + scopeId + "\"]", |
| 1252 |
".tippy-popper[data-tippy-root]", |
| 1253 |
".tippy-box[data-theme*=\"" + scopeId + "\"]" |
| 1254 |
].forEach(function(selector) { |
| 1255 |
try { |
| 1256 |
document.querySelectorAll(selector).forEach(function(popper) { |
| 1257 |
if (popper && popper.parentNode) popper.parentNode.removeChild(popper); |
| 1258 |
}); |
| 1259 |
} catch (error) {} |
| 1260 |
}); |
| 1261 |
if (currentTooltipElement._tippyInstance) { |
| 1262 |
currentTooltipElement._tippyInstance.destroy(); |
| 1263 |
currentTooltipElement._tippyInstance = null; |
| 1264 |
} |
| 1265 |
if (currentTooltipElement._tippy) { |
| 1266 |
currentTooltipElement._tippy.destroy(); |
| 1267 |
currentTooltipElement._tippy = null; |
| 1268 |
} |
| 1269 |
if (currentTooltipElement._maTooltipCleanup) { |
| 1270 |
currentTooltipElement._maTooltipCleanup.forEach(function(cleanup) { |
| 1271 |
try { |
| 1272 |
cleanup.element.removeEventListener(cleanup.event, cleanup.handler); |
| 1273 |
} catch (error) {} |
| 1274 |
}); |
| 1275 |
currentTooltipElement._maTooltipCleanup = []; |
| 1276 |
} |
| 1277 |
} catch (error) {} |
| 1278 |
if (!currentTooltipElement || !currentTooltipElement.nodeType || currentTooltipElement.nodeType !== 1) return; |
| 1279 |
var sanitizedConfig = {}; |
| 1280 |
for (var key in tooltipConfig) if (tooltipConfig.hasOwnProperty(key)) sanitizedConfig[key] = tooltipConfig[key]; |
| 1281 |
if (typeof sanitizedConfig.appendTo === "function") try { |
| 1282 |
var appendToResult = sanitizedConfig.appendTo(); |
| 1283 |
if (appendToResult === "parent") sanitizedConfig.appendTo = "parent"; |
| 1284 |
else if (appendToResult && appendToResult.nodeType) sanitizedConfig.appendTo = appendToResult; |
| 1285 |
else sanitizedConfig.appendTo = "parent"; |
| 1286 |
} catch (error) { |
| 1287 |
sanitizedConfig.appendTo = "parent"; |
| 1288 |
} |
| 1289 |
try { |
| 1290 |
var nativeElement = currentTooltipElement; |
| 1291 |
if (nativeElement && nativeElement.jquery) nativeElement = nativeElement[0]; |
| 1292 |
if (!nativeElement || !nativeElement.nodeType || nativeElement.nodeType !== 1) throw new Error("Invalid DOM element for tooltip"); |
| 1293 |
var tippyInstance = tippy(nativeElement, sanitizedConfig); |
| 1294 |
if (tippyInstance && Array.isArray(tippyInstance) && tippyInstance.length > 0) { |
| 1295 |
nativeElement._tippyInstance = tippyInstance[0]; |
| 1296 |
currentTooltipElement._tippyInstance = tippyInstance[0]; |
| 1297 |
$scope.data("ma-tooltip-active", true); |
| 1298 |
} |
| 1299 |
} catch (error) { |
| 1300 |
return; |
| 1301 |
} finally { |
| 1302 |
if (currentTooltipElement) currentTooltipElement._maTooltipInitializing = false; |
| 1303 |
} |
| 1304 |
} catch (error) { |
| 1305 |
if (currentTooltipElement) currentTooltipElement._maTooltipInitializing = false; |
| 1306 |
return; |
| 1307 |
} |
| 1308 |
}; |
| 1309 |
initTooltip(); |
| 1310 |
if (typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode()) try { |
| 1311 |
$scope.data("ma-tooltip-initialized", true); |
| 1312 |
var changeTimeout = null; |
| 1313 |
var isChanging = false; |
| 1314 |
var handleTooltipChange = function() { |
| 1315 |
if (isChanging) return; |
| 1316 |
if (changeTimeout) clearTimeout(changeTimeout); |
| 1317 |
changeTimeout = setTimeout(function() { |
| 1318 |
try { |
| 1319 |
isChanging = true; |
| 1320 |
elementSettings = getElementSettings($scope); |
| 1321 |
document.querySelectorAll(".tippy-popper:not([data-tippy-popper-id])").forEach(function(tooltip) { |
| 1322 |
if (tooltip.parentNode) tooltip.parentNode.removeChild(tooltip); |
| 1323 |
}); |
| 1324 |
initTooltip(); |
| 1325 |
changeTimeout = null; |
| 1326 |
setTimeout(function() { |
| 1327 |
isChanging = false; |
| 1328 |
}, 100); |
| 1329 |
} catch (error) { |
| 1330 |
isChanging = false; |
| 1331 |
} |
| 1332 |
}, 200); |
| 1333 |
}; |
| 1334 |
if (typeof elementorModules !== "undefined" && elementorModules.frontend && elementorModules.frontend.handlers && elementorModules.frontend.handlers.Base) { |
| 1335 |
var MATooltipEditorHandler = elementorModules.frontend.handlers.Base.extend({ |
| 1336 |
onElementChange: function(propertyName) { |
| 1337 |
if (propertyName && typeof propertyName === "string" && (propertyName.indexOf("ma_el_tooltip") === 0 || propertyName.indexOf("jltma_tooltip") === 0)) handleTooltipChange(); |
| 1338 |
}, |
| 1339 |
onDestroy: function() { |
| 1340 |
if (changeTimeout) clearTimeout(changeTimeout); |
| 1341 |
if (currentTooltipElement && currentTooltipElement._tippyInstance) try { |
| 1342 |
currentTooltipElement._tippyInstance.destroy(); |
| 1343 |
} catch (error) {} |
| 1344 |
} |
| 1345 |
}); |
| 1346 |
try { |
| 1347 |
elementorFrontend.elementsHandler.addHandler(MATooltipEditorHandler, { $element: $scope }); |
| 1348 |
} catch (error) { |
| 1349 |
$scope.one("remove", function() { |
| 1350 |
if (changeTimeout) clearTimeout(changeTimeout); |
| 1351 |
if (currentTooltipElement && currentTooltipElement._tippyInstance) try { |
| 1352 |
currentTooltipElement._tippyInstance.destroy(); |
| 1353 |
} catch (error) {} |
| 1354 |
}); |
| 1355 |
} |
| 1356 |
} |
| 1357 |
} catch (error) {} |
| 1358 |
if (typeof window !== "undefined" && window.addEventListener) { |
| 1359 |
var cleanupTooltip = function() { |
| 1360 |
if (currentTooltipElement) { |
| 1361 |
if (currentTooltipElement._tippyInstance) try { |
| 1362 |
currentTooltipElement._tippyInstance.destroy(); |
| 1363 |
} catch (error) {} |
| 1364 |
if (currentTooltipElement._maTooltipCleanup) currentTooltipElement._maTooltipCleanup.forEach(function(cleanup) { |
| 1365 |
try { |
| 1366 |
cleanup.element.removeEventListener(cleanup.event, cleanup.handler); |
| 1367 |
} catch (error) {} |
| 1368 |
}); |
| 1369 |
} |
| 1370 |
}; |
| 1371 |
window.addEventListener("beforeunload", cleanupTooltip); |
| 1372 |
window.addEventListener("pagehide", cleanupTooltip); |
| 1373 |
} |
| 1374 |
}, |
| 1375 |
/**** MA Twitter Slider ****/ |
| 1376 |
MA_Twitter_Slider: function($scope, $) { |
| 1377 |
var $carousel = $scope.find(".jltma-twitter-carousel-slider"); |
| 1378 |
if (!$carousel.length) return; |
| 1379 |
var $carouselContainer = $scope.find(".swiper"), $settings = $carousel.data("settings"), Swiper = elementorFrontend.utils.swiper; |
| 1380 |
initSwiper(); |
| 1381 |
async function initSwiper() { |
| 1382 |
await new Swiper($carouselContainer[0], $settings); |
| 1383 |
if ($settings.pauseOnHover) $carouselContainer.hover(function() { |
| 1384 |
this.swiper.autoplay.stop(); |
| 1385 |
}, function() { |
| 1386 |
this.swiper.autoplay.start(); |
| 1387 |
}); |
| 1388 |
} |
| 1389 |
}, |
| 1390 |
MA_ParticlesBG: function($scope, $) { |
| 1391 |
function isElementorEditor() { |
| 1392 |
return typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode(); |
| 1393 |
} |
| 1394 |
if ($scope.hasClass("jltma-particle-yes") || $scope.attr("data-jltma-particle") || $scope.find(".jltma-particle-wrapper").attr("data-jltma-particles-editor")) { |
| 1395 |
let element_type = $scope.data("element_type"); |
| 1396 |
let sectionID = encodeURIComponent($scope.data("id")); |
| 1397 |
let particlesJSON; |
| 1398 |
if (!isElementorEditor()) particlesJSON = $scope.attr("data-jltma-particle"); |
| 1399 |
else particlesJSON = $scope.find(".jltma-particle-wrapper").attr("data-jltma-particles-editor"); |
| 1400 |
if (("section" === element_type || "column" === element_type || "container" === element_type) && particlesJSON) if (!isElementorEditor()) { |
| 1401 |
$scope.prepend("<div class=\"jltma-particle-wrapper\" id=\"jltma-particle-" + sectionID + "\"></div>"); |
| 1402 |
try { |
| 1403 |
let parsedData = JSON.parse(particlesJSON); |
| 1404 |
particlesJS("jltma-particle-" + sectionID, parsedData); |
| 1405 |
setTimeout(function() { |
| 1406 |
window.dispatchEvent(new Event("resize")); |
| 1407 |
}, 500); |
| 1408 |
setTimeout(function() { |
| 1409 |
window.dispatchEvent(new Event("resize")); |
| 1410 |
}, 1500); |
| 1411 |
} catch (e) {} |
| 1412 |
} else if ($scope.hasClass("jltma-particle-yes")) try { |
| 1413 |
let parsedData = JSON.parse(particlesJSON); |
| 1414 |
particlesJS("jltma-particle-" + sectionID, parsedData); |
| 1415 |
$scope.find(".elementor-column").css("z-index", 9); |
| 1416 |
setTimeout(function() { |
| 1417 |
window.dispatchEvent(new Event("resize")); |
| 1418 |
}, 500); |
| 1419 |
setTimeout(function() { |
| 1420 |
window.dispatchEvent(new Event("resize")); |
| 1421 |
}, 1500); |
| 1422 |
} catch (e) {} |
| 1423 |
else $scope.find(".jltma-particle-wrapper").remove(); |
| 1424 |
} |
| 1425 |
}, |
| 1426 |
MA_BgSlider: function($scope, $) { |
| 1427 |
function isElementorEditor() { |
| 1428 |
return typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode(); |
| 1429 |
} |
| 1430 |
if (!isElementorEditor()) { |
| 1431 |
if (!$scope.hasClass("has_ma_el_bg_slider")) return; |
| 1432 |
} else if (!$scope.find(".ma-el-section-bs").length) return; |
| 1433 |
var ma_el_slides = [], ma_el_slides_json = [], ma_el_transition, ma_el_animation, ma_el_custom_overlay, ma_el_overlay, ma_el_cover, ma_el_delay, ma_el_timer; |
| 1434 |
var slider_images; |
| 1435 |
if (!isElementorEditor()) slider_images = $scope.attr("data-ma-el-bg-slider-images"); |
| 1436 |
else { |
| 1437 |
var slider_wrapper = $scope.find(".ma-el-section-bs-inner"); |
| 1438 |
if (slider_wrapper.length) slider_images = slider_wrapper.attr("data-ma-el-bg-slider"); |
| 1439 |
} |
| 1440 |
if (!slider_images) return; |
| 1441 |
if (!isElementorEditor()) { |
| 1442 |
ma_el_transition = $scope.attr("data-ma-el-bg-slider-transition"); |
| 1443 |
ma_el_animation = $scope.attr("data-ma-el-bg-slider-animation"); |
| 1444 |
ma_el_custom_overlay = $scope.attr("data-ma-el-bg-custom-overlay"); |
| 1445 |
ma_el_cover = $scope.attr("data-ma-el-bg-slider-cover"); |
| 1446 |
ma_el_delay = $scope.attr("data-ma-el-bs-slider-delay"); |
| 1447 |
ma_el_timer = $scope.attr("data-ma-el-bs-slider-timer"); |
| 1448 |
if (ma_el_custom_overlay == "yes") ma_el_overlay = JLTMA_SCRIPTS.assets_url + "/assets/vendor/vegas/overlays/00.png"; |
| 1449 |
else { |
| 1450 |
var overlay_file = $scope.attr("data-ma-el-bg-slider-overlay"); |
| 1451 |
if (overlay_file) ma_el_overlay = JLTMA_SCRIPTS.assets_url + "/assets/vendor/vegas/overlays/" + overlay_file + ".png"; |
| 1452 |
else ma_el_overlay = JLTMA_SCRIPTS.assets_url + "/assets/vendor/vegas/overlays/00.png"; |
| 1453 |
} |
| 1454 |
} else { |
| 1455 |
var slider_wrapper = $scope.find(".ma-el-section-bs-inner"); |
| 1456 |
ma_el_transition = slider_wrapper.attr("data-ma-el-bg-slider-transition"); |
| 1457 |
ma_el_animation = slider_wrapper.attr("data-ma-el-bg-slider-animation"); |
| 1458 |
ma_el_custom_overlay = slider_wrapper.attr("data-ma-el-bg-custom-overlay"); |
| 1459 |
ma_el_cover = slider_wrapper.attr("data-ma-el-bg-slider-cover"); |
| 1460 |
ma_el_delay = slider_wrapper.attr("data-ma-el-bs-slider-delay"); |
| 1461 |
ma_el_timer = slider_wrapper.attr("data-ma-el-bs-slider-timer"); |
| 1462 |
if (ma_el_custom_overlay == "yes") ma_el_overlay = JLTMA_SCRIPTS.assets_url + "/assets/vendor/vegas/overlays/00.png"; |
| 1463 |
else { |
| 1464 |
var overlay_file = slider_wrapper.attr("data-ma-el-bg-slider-overlay"); |
| 1465 |
if (overlay_file && overlay_file !== "00.png") ma_el_overlay = JLTMA_SCRIPTS.assets_url + "/assets/vendor/vegas/overlays/" + overlay_file; |
| 1466 |
else ma_el_overlay = JLTMA_SCRIPTS.assets_url + "/assets/vendor/vegas/overlays/00.png"; |
| 1467 |
} |
| 1468 |
} |
| 1469 |
ma_el_slides = slider_images.split(","); |
| 1470 |
jQuery.each(ma_el_slides, function(key, value) { |
| 1471 |
var slide = []; |
| 1472 |
slide.src = value; |
| 1473 |
ma_el_slides_json.push(slide); |
| 1474 |
}); |
| 1475 |
var slider_container; |
| 1476 |
if (!$scope.find(".ma-el-section-bs").length) $scope.prepend("<div class=\"ma-el-section-bs\"><div class=\"ma-el-section-bs-inner\"></div></div>"); |
| 1477 |
slider_container = $scope.find(".ma-el-section-bs-inner"); |
| 1478 |
slider_container.vegas({ |
| 1479 |
slides: ma_el_slides_json, |
| 1480 |
transition: ma_el_transition, |
| 1481 |
animation: ma_el_animation, |
| 1482 |
overlay: ma_el_overlay, |
| 1483 |
cover: ma_el_cover == "true" ? true : false, |
| 1484 |
delay: parseInt(ma_el_delay) || 5e3, |
| 1485 |
timer: ma_el_timer == "true" ? true : false, |
| 1486 |
init: function() { |
| 1487 |
if (ma_el_custom_overlay == "yes") slider_container.children(".vegas-overlay").css("background-image", ""); |
| 1488 |
} |
| 1489 |
}); |
| 1490 |
}, |
| 1491 |
MA_AnimatedGradient: function($scope, $) { |
| 1492 |
if ($scope.hasClass("ma-el-animated-gradient-yes")) { |
| 1493 |
let color = $scope.data("color") || $scope.attr("data-color"); |
| 1494 |
let angle = $scope.data("angle") || $scope.attr("data-angle"); |
| 1495 |
let duration = $scope.data("duration") || $scope.attr("data-duration") || "6s"; |
| 1496 |
let smoothness = parseInt($scope.data("smoothness") || $scope.attr("data-smoothness") || 3); |
| 1497 |
let easing = $scope.data("easing") || $scope.attr("data-easing") || "cubic-bezier(0.4, 0.0, 0.2, 1)"; |
| 1498 |
if (!color || !angle) return; |
| 1499 |
let colors = color.split(","); |
| 1500 |
if (colors.length < 2) return; |
| 1501 |
let animationName = "jltma-animated-gradient-" + Math.random().toString(36).substring(2, 11); |
| 1502 |
let keyframes = `@keyframes ${animationName} {`; |
| 1503 |
let totalSteps = colors.length; |
| 1504 |
for (let i = 0; i <= totalSteps; i++) { |
| 1505 |
let percentage = i / totalSteps * 100; |
| 1506 |
let currentColorIndex = i % colors.length; |
| 1507 |
let nextColorIndex = (i + 1) % colors.length; |
| 1508 |
keyframes += `${percentage.toFixed(2)}% { background: linear-gradient(${angle}, ${colors[currentColorIndex].trim()}, ${colors[nextColorIndex].trim()}); }`; |
| 1509 |
if (i < totalSteps) { |
| 1510 |
let segmentSize = 100 / totalSteps; |
| 1511 |
for (let j = 1; j <= smoothness; j++) { |
| 1512 |
let interpPercentage = percentage + segmentSize * (j / (smoothness + 1)); |
| 1513 |
let interpColorIndex = nextColorIndex; |
| 1514 |
let interpNextColorIndex = (nextColorIndex + 1) % colors.length; |
| 1515 |
keyframes += `${interpPercentage.toFixed(2)}% { background: linear-gradient(${angle}, ${colors[interpColorIndex].trim()}, ${colors[interpNextColorIndex].trim()}); }`; |
| 1516 |
} |
| 1517 |
} |
| 1518 |
} |
| 1519 |
keyframes += "}"; |
| 1520 |
let style = document.createElement("style"); |
| 1521 |
style.textContent = keyframes; |
| 1522 |
document.head.appendChild(style); |
| 1523 |
$scope.css({ |
| 1524 |
"animation": `${animationName} ${duration} ${easing} infinite`, |
| 1525 |
"background-size": "400% 400%" |
| 1526 |
}); |
| 1527 |
if ($scope.hasClass("elementor-element-edit-mode")) { |
| 1528 |
let editorGradient = $scope.find(".animated-gradient"); |
| 1529 |
if (editorGradient.length > 0) { |
| 1530 |
let editorColor = editorGradient.data("color") || editorGradient.attr("data-color"); |
| 1531 |
let editorAngle = editorGradient.data("angle") || editorGradient.attr("data-angle"); |
| 1532 |
let editorDuration = editorGradient.data("duration") || editorGradient.attr("data-duration") || "6s"; |
| 1533 |
if (editorColor && editorAngle) { |
| 1534 |
let editorColors = editorColor.split(","); |
| 1535 |
if (editorColors.length >= 2) { |
| 1536 |
let editorAnimationName = "jltma-animated-gradient-editor-" + Math.random().toString(36).substring(2, 11); |
| 1537 |
let editorKeyframes = `@keyframes ${editorAnimationName} {`; |
| 1538 |
let totalSteps = editorColors.length; |
| 1539 |
for (let i = 0; i <= totalSteps; i++) { |
| 1540 |
let percentage = i / totalSteps * 100; |
| 1541 |
let currentColorIndex = i % editorColors.length; |
| 1542 |
let nextColorIndex = (i + 1) % editorColors.length; |
| 1543 |
editorKeyframes += `${percentage.toFixed(2)}% { background: linear-gradient(${editorAngle}, ${editorColors[currentColorIndex].trim()}, ${editorColors[nextColorIndex].trim()}); }`; |
| 1544 |
if (i < totalSteps) { |
| 1545 |
let segmentSize = 100 / totalSteps; |
| 1546 |
for (let j = 1; j <= smoothness; j++) { |
| 1547 |
let interpPercentage = percentage + segmentSize * (j / (smoothness + 1)); |
| 1548 |
let interpColorIndex = nextColorIndex; |
| 1549 |
let interpNextColorIndex = (nextColorIndex + 1) % editorColors.length; |
| 1550 |
editorKeyframes += `${interpPercentage.toFixed(2)}% { background: linear-gradient(${editorAngle}, ${editorColors[interpColorIndex].trim()}, ${editorColors[interpNextColorIndex].trim()}); }`; |
| 1551 |
} |
| 1552 |
} |
| 1553 |
} |
| 1554 |
editorKeyframes += "}"; |
| 1555 |
let editorStyle = document.createElement("style"); |
| 1556 |
editorStyle.textContent = editorKeyframes; |
| 1557 |
document.head.appendChild(editorStyle); |
| 1558 |
editorGradient.css({ |
| 1559 |
"animation": `${editorAnimationName} ${editorDuration} ${easing} infinite`, |
| 1560 |
"background-size": "400% 400%" |
| 1561 |
}); |
| 1562 |
} |
| 1563 |
} |
| 1564 |
} |
| 1565 |
} |
| 1566 |
} |
| 1567 |
}, |
| 1568 |
MA_Image_Comparison: function($scope, $) { |
| 1569 |
var $jltma_image_comp_wrap = $scope.find(".jltma-image-comparison").eq(0), $jltma_image_data = $jltma_image_comp_wrap.data("image-comparison-settings"); |
| 1570 |
$jltma_image_comp_wrap.twentytwenty({ |
| 1571 |
default_offset_pct: $jltma_image_data.visible_ratio, |
| 1572 |
orientation: $jltma_image_data.orientation, |
| 1573 |
before_label: $jltma_image_data.before_label, |
| 1574 |
after_label: $jltma_image_data.after_label, |
| 1575 |
move_slider_on_hover: $jltma_image_data.slider_on_hover, |
| 1576 |
move_with_handle_only: $jltma_image_data.slider_with_handle, |
| 1577 |
click_to_move: $jltma_image_data.slider_with_click, |
| 1578 |
no_overlay: $jltma_image_data.no_overlay |
| 1579 |
}); |
| 1580 |
}, |
| 1581 |
MA_BarCharts: function BarChart($scope) { |
| 1582 |
jltMAObserveTarget($scope[0], function() { |
| 1583 |
var $container = $scope.find(".jltma-bar-chart-container"), $chart_canvas = $scope.find("#jltma-bar-chart"), settings = $container.data("settings"); |
| 1584 |
if ($container.length) new Chart($chart_canvas, settings); |
| 1585 |
}); |
| 1586 |
}, |
| 1587 |
MA_PieCharts: function($scope, $) { |
| 1588 |
jltMAObserveTarget($scope[0], function() { |
| 1589 |
$scope.find(".ma-el-piechart .ma-el-percentage").each(function() { |
| 1590 |
var track_color = $(this).data("track-color"); |
| 1591 |
var bar_color = $(this).data("bar-color"); |
| 1592 |
$(this).easyPieChart({ |
| 1593 |
animate: 2e3, |
| 1594 |
lineWidth: 10, |
| 1595 |
barColor: bar_color, |
| 1596 |
trackColor: track_color, |
| 1597 |
scaleColor: false, |
| 1598 |
lineCap: "square", |
| 1599 |
size: 220 |
| 1600 |
}); |
| 1601 |
}); |
| 1602 |
}); |
| 1603 |
}, |
| 1604 |
ProgressBars: function($scope, $) { |
| 1605 |
jltMAObserveTarget($scope[0], function() { |
| 1606 |
$scope.find(".jltma-stats-bar-content").each(function() { |
| 1607 |
var dataperc = $(this).data("perc"); |
| 1608 |
$(this).animate({ "width": dataperc + "%" }, dataperc * 20); |
| 1609 |
}); |
| 1610 |
}); |
| 1611 |
}, |
| 1612 |
MA_Toggle_Content: function($scope, $) { |
| 1613 |
Master_Addons.getElementSettings = getElementSettings($scope); |
| 1614 |
var $wrapper = $scope.find(".jltma-toggle-content"), toggleElementArgs = { active: Master_Addons.getElementSettings.jltma_toggle_content_active_index }; |
| 1615 |
if ("" !== Master_Addons.getElementSettings.jltma_toggle_content_indicator_color) toggleElementArgs.indicatorColor = Master_Addons.getElementSettings.jltma_toggle_content_indicator_color; |
| 1616 |
if (Master_Addons.getElementSettings.jltma_toggle_content_indicator_speed.size) toggleElementArgs.speed = Master_Addons.getElementSettings.jltma_toggle_content_indicator_speed.size; |
| 1617 |
if (elementorFrontend.isEditMode()) toggleElementArgs.watchControls = true; |
| 1618 |
$wrapper.MA_ToggleElement(toggleElementArgs); |
| 1619 |
}, |
| 1620 |
MA_Comment_Form_reCaptcha: function($scope, $) { |
| 1621 |
Master_Addons.getElementSettings = getElementSettings($scope); |
| 1622 |
var $commentsWrapper = $scope.find(".jltma-comments-wrap"); |
| 1623 |
$commentsWrapper.data("recaptcha"); |
| 1624 |
if ($commentsWrapper.data("jltma-comment-settings").reCaptchaprotected == "yes") {} |
| 1625 |
}, |
| 1626 |
MA_Counter_Up: function($scope, $) { |
| 1627 |
var $counterup = $scope.find(".jltma-counter-up-number"); |
| 1628 |
if ($.isFunction($.fn.counterUp)) $counterup.counterUp({ |
| 1629 |
duration: 2e3, |
| 1630 |
delay: 15 |
| 1631 |
}); |
| 1632 |
}, |
| 1633 |
MA_CountdownTimer: function($scope, $) { |
| 1634 |
var $countdownWidget = $scope.find(".jltma-widget-countdown"); |
| 1635 |
$.fn.MasterCountDownTimer = function() { |
| 1636 |
var $wrapper = $(this).find(".jltma-countdown-wrapper"), data = { |
| 1637 |
year: $wrapper.data("countdown-year"), |
| 1638 |
month: $wrapper.data("countdown-month"), |
| 1639 |
day: $wrapper.data("countdown-day"), |
| 1640 |
hour: $wrapper.data("countdown-hour"), |
| 1641 |
min: $wrapper.data("countdown-min"), |
| 1642 |
sec: $wrapper.data("countdown-sec") |
| 1643 |
}; |
| 1644 |
$wrapper.data("countdown-infinite"); |
| 1645 |
var targetDate = new Date(data.year, data.month, data.day, data.hour, data.min, data.sec); |
| 1646 |
var $year = $wrapper.find(".jltma-countdown-year"), $month = $wrapper.find(".jltma-countdown-month"), $day = $wrapper.find(".jltma-countdown-day"), $hour = $wrapper.find(".jltma-countdown-hour"), $min = $wrapper.find(".jltma-countdown-min"), $sec = $wrapper.find(".jltma-countdown-sec"); |
| 1647 |
var countdownInterval = setInterval(function() { |
| 1648 |
var currentTime = /* @__PURE__ */ new Date(); |
| 1649 |
var diffTime = (Date.parse(targetDate) - Date.parse(currentTime)) / 1e3; |
| 1650 |
if (diffTime <= 0) { |
| 1651 |
$year.text(0); |
| 1652 |
$month.text(0); |
| 1653 |
$day.text(0); |
| 1654 |
$hour.text(0); |
| 1655 |
$min.text(0); |
| 1656 |
$sec.text(0); |
| 1657 |
clearInterval(countdownInterval); |
| 1658 |
return; |
| 1659 |
} |
| 1660 |
var totalSeconds = diffTime; |
| 1661 |
var years = Math.floor(totalSeconds / 31536e3); |
| 1662 |
totalSeconds %= 31536e3; |
| 1663 |
var months = Math.floor(totalSeconds / 2592e3); |
| 1664 |
totalSeconds %= 2592e3; |
| 1665 |
var days = Math.floor(totalSeconds / 86400); |
| 1666 |
totalSeconds %= 86400; |
| 1667 |
var hours = Math.floor(totalSeconds / 3600); |
| 1668 |
totalSeconds %= 3600; |
| 1669 |
var minutes = Math.floor(totalSeconds / 60); |
| 1670 |
var seconds = Math.floor(totalSeconds % 60); |
| 1671 |
$year.text(years); |
| 1672 |
$month.text(months); |
| 1673 |
$day.text(days); |
| 1674 |
$hour.text(hours); |
| 1675 |
$min.text(minutes); |
| 1676 |
$sec.text(seconds); |
| 1677 |
}, 1e3); |
| 1678 |
}, $countdownWidget.each(function() { |
| 1679 |
$(this).MasterCountDownTimer(); |
| 1680 |
}); |
| 1681 |
}, |
| 1682 |
/** |
| 1683 |
* Fancybox popup |
| 1684 |
*/ |
| 1685 |
MA_Fancybox_Popup: function($scope, $) { |
| 1686 |
(function($) { |
| 1687 |
if ($.isFunction($.fn.fancybox)) $("[data-fancybox]").fancybox({}); |
| 1688 |
})(jQuery); |
| 1689 |
}, |
| 1690 |
MA_Reveal: function($scope, $) { |
| 1691 |
Master_Addons.MA_Reveal.elementSettings = getElementSettings($scope); |
| 1692 |
var rev1; |
| 1693 |
Master_Addons.MA_Reveal.revealAction = function() { |
| 1694 |
rev1 = new RevealFx(revealistance, { revealSettings: { |
| 1695 |
bgcolor: Master_Addons.MA_Reveal.elementSettings.reveal_bgcolor, |
| 1696 |
direction: Master_Addons.MA_Reveal.elementSettings.reveal_direction, |
| 1697 |
duration: Number(Master_Addons.MA_Reveal.elementSettings.reveal_speed.size) * 100, |
| 1698 |
delay: Number(Master_Addons.MA_Reveal.elementSettings.reveal_delay.size) * 100, |
| 1699 |
onCover: function(contentEl, revealerEl) { |
| 1700 |
contentEl.style.opacity = 1; |
| 1701 |
} |
| 1702 |
} }); |
| 1703 |
}; |
| 1704 |
Master_Addons.MA_Reveal.runReveal = function() { |
| 1705 |
rev1.reveal(); |
| 1706 |
}; |
| 1707 |
if (Master_Addons.MA_Reveal.elementSettings.enabled_reveal) { |
| 1708 |
var revealId = "#reveal-" + $scope.data("id"), revealistance = document.querySelector(revealId); |
| 1709 |
if (!jQuery(revealId).hasClass("block-revealer")) Master_Addons.MA_Reveal.revealAction(); |
| 1710 |
Master_Addons.MA_Reveal.waypointOptions = { |
| 1711 |
offset: "100%", |
| 1712 |
triggerOnce: true |
| 1713 |
}; |
| 1714 |
jltMAObserveTarget(revealistance, Master_Addons.MA_Reveal.runReveal, Master_Addons.MA_Reveal.waypointOptions); |
| 1715 |
} |
| 1716 |
}, |
| 1717 |
MA_Rellax: function($scope, $) { |
| 1718 |
var elementSettings = getElementSettings($scope); |
| 1719 |
var rellax = null; |
| 1720 |
$(window).on("resize", function() { |
| 1721 |
if (rellax) { |
| 1722 |
rellax.destroy(); |
| 1723 |
if (rellax) initRellax(); |
| 1724 |
} |
| 1725 |
}); |
| 1726 |
var initRellax = function() { |
| 1727 |
if (elementSettings.enabled_rellax) { |
| 1728 |
if (typeof Rellax === "undefined") return; |
| 1729 |
currentDevice = elementorFrontend.getCurrentDeviceMode(); |
| 1730 |
var setting_speed = "speed_rellax"; |
| 1731 |
var value_speed = 0; |
| 1732 |
if (currentDevice != "desktop") setting_speed = "speed_rellax_" + currentDevice; |
| 1733 |
var speed_setting = elementSettings[setting_speed]; |
| 1734 |
if (speed_setting && typeof speed_setting.size !== "undefined") value_speed = speed_setting.size; |
| 1735 |
var rellaxId = "#rellax-" + $scope.data("id"); |
| 1736 |
if ($(rellaxId).length) try { |
| 1737 |
rellax = new Rellax(rellaxId, { speed: value_speed }); |
| 1738 |
} catch (error) {} |
| 1739 |
} |
| 1740 |
}; |
| 1741 |
initRellax(); |
| 1742 |
}, |
| 1743 |
MA_Rellax_Final: function(panel, model, view) { |
| 1744 |
Master_Addons.getElementSettings = getElementSettings($scope); |
| 1745 |
var $scope = view.$el; |
| 1746 |
$scope.find("#scene"); |
| 1747 |
}, |
| 1748 |
MA_Entrance_Animation: function($scope, $) { |
| 1749 |
$scope = $scope || $(this); |
| 1750 |
var $target = $scope.hasClass("jltma-appear-watch-animation") ? $scope : $scope.find(".jltma-appear-watch-animation"), hasAnimation = $("body").hasClass("jltma-page-animation"); |
| 1751 |
if (!$target.length) return; |
| 1752 |
if (hasAnimation) document.body.addEventListener("JltmaPageAnimationDone", function(event) { |
| 1753 |
$target.appearl({ |
| 1754 |
offset: "200px", |
| 1755 |
insetOffset: "0px" |
| 1756 |
}).one("appear", function(event, data) { |
| 1757 |
this.classList.add("jltma-animated"); |
| 1758 |
this.classList.add("jltma-animated-once"); |
| 1759 |
}); |
| 1760 |
}); |
| 1761 |
else $target.appearl({ |
| 1762 |
offset: "200px", |
| 1763 |
insetOffset: "0px" |
| 1764 |
}).one("appear", function(event, data) { |
| 1765 |
this.classList.add("jltma-animated"); |
| 1766 |
this.classList.add("jltma-animated-once"); |
| 1767 |
}); |
| 1768 |
}, |
| 1769 |
MA_Wrapper_Link: function($scope, $) { |
| 1770 |
$("body").off("click.onWrapperLink", "[data-jltma-wrapper-link]"); |
| 1771 |
$("body").on("click.onWrapperLink", "[data-jltma-wrapper-link]", function(e) { |
| 1772 |
e.preventDefault(); |
| 1773 |
e.stopPropagation(); |
| 1774 |
var $wrapper = $(this), data = $wrapper.data("jltma-wrapper-link"), id = $wrapper.data("id"), anchor = document.createElement("a"); |
| 1775 |
anchor.id = "master-addons-wrapper-link-" + id; |
| 1776 |
anchor.href = data.url; |
| 1777 |
anchor.target = data.is_external ? "_blank" : "_self"; |
| 1778 |
anchor.rel = data.nofollow ? "nofollow noreferer" : ""; |
| 1779 |
anchor.style.display = "none"; |
| 1780 |
document.body.appendChild(anchor); |
| 1781 |
document.getElementById(anchor.id); |
| 1782 |
if (data && data.url) if (data.is_external) window.open(data.url, "_blank", data.nofollow ? "noopener,noreferrer" : "noopener"); |
| 1783 |
else window.location.href = data.url; |
| 1784 |
}); |
| 1785 |
}, |
| 1786 |
/** |
| 1787 |
* Restrict Content |
| 1788 |
*/ |
| 1789 |
MA_Restrict_Content_Ajax: function($scope, $) { |
| 1790 |
Master_Addons.getElementSettings = getElementSettings($scope); |
| 1791 |
var $restrictwrapper = $scope.find(".jltma-restrict-content-wrap").eq(0), $scopeId = $scope.data("id"), $restrict_layout = $restrictwrapper.data("restrict-layout-type"), $restrict_type = $restrictwrapper.data("restrict-type"), $error_message = $restrictwrapper.data("error-message"); |
| 1792 |
$restrictwrapper.data("rc-ajaxify"); |
| 1793 |
var $storageID = "ma_el_rc_" + $scopeId, $formID = $scope.find(".jltma-restrict-form").eq(0).data("form-id"); |
| 1794 |
"" + $scopeId; |
| 1795 |
var $popup = $scope.find(".jltma-restrict-content-popup-content"), $content_pass = $restrictwrapper.data("content-pass") ? $restrictwrapper.data("content-pass") : "", $popup_type = $popup.data("popup-type") ? $popup.data("popup-type") : "", $age_wrapper = $scope.find(".jltma-restrict-age-wrapper").eq(0), $restrict_age = { |
| 1796 |
min_age: $age_wrapper.data("min-age"), |
| 1797 |
age_type: $age_wrapper.data("age-type"), |
| 1798 |
age_title: $age_wrapper.data("age-title"), |
| 1799 |
age_content: $age_wrapper.data("age-content"), |
| 1800 |
age_submit: $("#" + $formID).find("button[name=\"submit\"]").val(), |
| 1801 |
checkbox_msg: $age_wrapper.data("checkbox-msg") ? $age_wrapper.data("checkbox-msg") : "", |
| 1802 |
empty_bday: $age_wrapper.data("empty-bday") ? $age_wrapper.data("empty-bday") : "", |
| 1803 |
non_exist_bday: $age_wrapper.data("non-exist-bday") ? $age_wrapper.data("non-exist-bday") : "" |
| 1804 |
}; |
| 1805 |
if (localStorage.getItem($storageID)) { |
| 1806 |
$(".jltma-rc-button").addClass("d-none"); |
| 1807 |
$("#" + $formID).addClass("d-none"); |
| 1808 |
$("#jltma-restrict-age-" + $scopeId).removeClass("card"); |
| 1809 |
$("#jltma-restrict-age-" + $scopeId).removeClass("text-center"); |
| 1810 |
$("#restrict-content-" + $scopeId).addClass("d-block"); |
| 1811 |
} else { |
| 1812 |
if ($restrict_layout == "popup") var dom_selector = "#jltma-rc-modal-" + $scopeId; |
| 1813 |
else var dom_selector = "#jltma-restrict-content-" + $scopeId; |
| 1814 |
$(dom_selector).on("click", ".jltma_ra_select", function() { |
| 1815 |
var wrap = $(this).closest(".jltma_ra_select_wrap"); |
| 1816 |
if (!wrap.find(".jltma_ra_options").hasClass("jltma_ra_active")) { |
| 1817 |
$(".jltma_ra_options").removeClass("jltma_ra_active"); |
| 1818 |
wrap.find(".jltma_ra_options").addClass("jltma_ra_active"); |
| 1819 |
wrap.find(".jltma_ra_options").find("li:contains(\"" + wrap.find(".jltma_ra_select_val").html() + "\")").addClass("jltma_ra_active"); |
| 1820 |
} else wrap.find(".jltma_ra_options").removeClass("jltma_ra_active"); |
| 1821 |
}); |
| 1822 |
$(dom_selector).on("click", ".jltma_ra_options ul li", function() { |
| 1823 |
var wrap = $(this).closest(".jltma_ra_select_wrap"); |
| 1824 |
wrap.find(".jltma_ra_select_val").html($(this).html()); |
| 1825 |
wrap.find("select").val($(this).attr("data-val")); |
| 1826 |
wrap.find(".jltma_ra_options").removeClass("jltma_ra_active"); |
| 1827 |
}); |
| 1828 |
$(dom_selector).on("mouseover", ".jltma_ra_options ul li", function() { |
| 1829 |
if ($(".jltma_ra_options ul li").hasClass("jltma_ra_active")) $(".jltma_ra_options ul li").removeClass("jltma_ra_active"); |
| 1830 |
}); |
| 1831 |
$(document).click(function(e) { |
| 1832 |
if ($(e.target).attr("class") != "jltma_ra_select" && !$(".jltma_ra_select").find($(e.target)).length) { |
| 1833 |
if ($(".jltma_ra_options.jltma_ra_active").length) $(".jltma_ra_options").removeClass("jltma_ra_active"); |
| 1834 |
} |
| 1835 |
}); |
| 1836 |
if ($popup_type == "windowload" || $popup_type == "windowloadfullscreen") $("#ma-el-rc-modal-hidden").fancybox().trigger("click"); |
| 1837 |
else $("[data-fancybox]").fancybox({}); |
| 1838 |
$(dom_selector).on("submit", "#" + $formID, function(event) { |
| 1839 |
event.preventDefault(); |
| 1840 |
var form = $(this); |
| 1841 |
form.find(".jltma_rc_result").remove(); |
| 1842 |
$.ajax({ |
| 1843 |
type: "POST", |
| 1844 |
url: JLTMA_SCRIPTS.ajaxurl, |
| 1845 |
data: { |
| 1846 |
action: "jltma_restrict_content", |
| 1847 |
nonce: JLTMA_SCRIPTS.nonce, |
| 1848 |
fields: form.serialize(), |
| 1849 |
restrict_type: $restrict_type, |
| 1850 |
error_message: $error_message, |
| 1851 |
content_pass: $content_pass, |
| 1852 |
restrict_age: $restrict_age |
| 1853 |
}, |
| 1854 |
cache: false, |
| 1855 |
success: function(result) { |
| 1856 |
try { |
| 1857 |
result = jQuery.parseJSON(result); |
| 1858 |
if (result["result"] == "success") { |
| 1859 |
$("#restrict-content-" + $scopeId).removeClass("d-none").addClass("d-block"); |
| 1860 |
$("#" + $formID).addClass("d-none"); |
| 1861 |
$("#jltma-restrict-age-" + $scopeId).removeClass("card"); |
| 1862 |
$("#jltma-restrict-age-" + $scopeId).removeClass("text-center"); |
| 1863 |
localStorage.setItem($storageID, true); |
| 1864 |
$.fancybox.close(); |
| 1865 |
$(".jltma-rc-button").addClass("d-none"); |
| 1866 |
} else if (result["result"] == "validate") $("#" + $formID + " .jltma_rc_submit").after("<div class=\"jltma_rc_result\"><span class=\"eicon-info-circle-o\"></span> " + result["output"] + "</div>"); |
| 1867 |
else throw 0; |
| 1868 |
} catch (err) { |
| 1869 |
$("#" + $formID + " .jltma_rc_submit").after("<div class=\"jltma_rc_result\"><span class=\"eicon-loading\"></span> Failed, please try again.</div>"); |
| 1870 |
} |
| 1871 |
} |
| 1872 |
}); |
| 1873 |
}); |
| 1874 |
} |
| 1875 |
}, |
| 1876 |
MA_Restrict_Content: function($scope, $) { |
| 1877 |
try { |
| 1878 |
(function($) { |
| 1879 |
Master_Addons.getElementSettings = getElementSettings($scope); |
| 1880 |
var $restrictwrapper = $scope.find(".jltma-restrict-content-wrap").eq(0); |
| 1881 |
$scope.data("id"); |
| 1882 |
$restrictwrapper.data("restrict-layout-type"); |
| 1883 |
$restrictwrapper.data("restrict-type"); |
| 1884 |
$scope.find(".jltma-restrict-content-popup-content"); |
| 1885 |
$restrictwrapper.data("content-pass"); |
| 1886 |
var $age_wrapper = $scope.find(".jltma-restrict-age-wrapper").eq(0); |
| 1887 |
$age_wrapper.data("min-age"); |
| 1888 |
$age_wrapper.data("age-type"); |
| 1889 |
$age_wrapper.data("age-title"); |
| 1890 |
$age_wrapper.data("age-content"); |
| 1891 |
$age_wrapper.data("checkbox-msg"); |
| 1892 |
Master_Addons.MA_Restrict_Content_Ajax($scope, $); |
| 1893 |
})(jQuery); |
| 1894 |
} catch (e) {} |
| 1895 |
}, |
| 1896 |
MA_Nav_Menu: function($scope, $) { |
| 1897 |
Master_Addons.getElementSettings = getElementSettings($scope); |
| 1898 |
var $menuContainer = $scope.find(".jltma-nav-menu-element"), $menuID = $menuContainer.data("menu-id"), $menu_type = $menuContainer.data("menu-layout"); |
| 1899 |
$menuContainer.data("menu-trigger"); |
| 1900 |
var $menu_offcanvas = $menuContainer.data("menu-offcanvas"), $menu_toggletype = $menuContainer.data("menu-toggletype"), $submenu_animation = $menuContainer.data("menu-animation"), $menu_container_id = $menuContainer.data("menu-container-id"), $sticky_type = $menuContainer.data("sticky-type"), navbar_height = $("#" + $menu_container_id).outerHeight(), menu_container_selector = $("#" + $menu_container_id); |
| 1901 |
if ($menu_type == "onepage") { |
| 1902 |
$(document).on("click", ".jltma-navbar-nav li a", function(e) { |
| 1903 |
if ($(this).attr("href")) { |
| 1904 |
var self = $(this), el = self.get(0), href = el.href, hasHash = href.indexOf("#"), enable = self.parents(".jltma-navbar-nav-default").hasClass("jltma-one-page-enabled"); |
| 1905 |
if (hasHash !== -1 && href.length > 1 && enable && el.pathname == window.location.pathname) { |
| 1906 |
e.preventDefault(); |
| 1907 |
self.parents(".jltma-menu-container").find(".jltma-close").trigger("click"); |
| 1908 |
} |
| 1909 |
} |
| 1910 |
}); |
| 1911 |
$(document).on("click", function(e) { |
| 1912 |
$(e.target); |
| 1913 |
if ($(".navbar-collapse").hasClass("show") === true) $(".jltma-one-page-enabled").removeClass("show"); |
| 1914 |
}); |
| 1915 |
} else { |
| 1916 |
"" + $submenu_animation; |
| 1917 |
var submenu_selector = $(".jltma-dropdown.jltma-sub-menu"); |
| 1918 |
$("#" + $menuID + " .jltma-menu-has-children").hover(function() { |
| 1919 |
if (submenu_selector.hasClass("fade-up")) submenu_selector.removeClass("fade-up"); |
| 1920 |
if (submenu_selector.hasClass("fade-down")) submenu_selector.removeClass("fade-down"); |
| 1921 |
$(".jltma-dropdown.jltma-sub-menu").addClass($submenu_animation); |
| 1922 |
}); |
| 1923 |
if ($sticky_type == "fixed-onscroll") { |
| 1924 |
if ($(window).width() > 768) $(function() { |
| 1925 |
$(window).scroll(function() { |
| 1926 |
if ($(window).scrollTop() >= 10) menu_container_selector.removeClass("" + $menu_container_id).addClass("jltma-on-scroll-fixed"); |
| 1927 |
else menu_container_selector.removeClass("jltma-on-scroll-fixed").addClass("" + $menu_container_id); |
| 1928 |
}); |
| 1929 |
}); |
| 1930 |
} |
| 1931 |
if ($sticky_type == "sticky-top") { |
| 1932 |
if ($(window).width() > 768) $(function() { |
| 1933 |
$(window).scroll(function() { |
| 1934 |
if ($(window).scrollTop() >= 10) menu_container_selector.removeClass("" + $menu_container_id).addClass("sticky-top"); |
| 1935 |
else menu_container_selector.removeClass("sticky-top").addClass("" + $menu_container_id); |
| 1936 |
}); |
| 1937 |
}); |
| 1938 |
} |
| 1939 |
if ($sticky_type == "smart-scroll") { |
| 1940 |
$("body").css("padding-top", navbar_height + "px"); |
| 1941 |
menu_container_selector.addClass("jltma-smart-scroll"); |
| 1942 |
if ($(".jltma-smart-scroll").length > 0) { |
| 1943 |
var last_scroll_top = 0; |
| 1944 |
$(window).on("scroll", function() { |
| 1945 |
var scroll_top = $(this).scrollTop(); |
| 1946 |
if (scroll_top < last_scroll_top) $(".jltma-smart-scroll").removeClass("scrolled-down").addClass("scrolled-up"); |
| 1947 |
else $(".jltma-smart-scroll").removeClass("scrolled-up").addClass("scrolled-down"); |
| 1948 |
last_scroll_top = scroll_top; |
| 1949 |
}); |
| 1950 |
} |
| 1951 |
} |
| 1952 |
if ($sticky_type == "nav-fixed-top") { |
| 1953 |
if ($(window).width() > 768) $(function() { |
| 1954 |
$("body").css("padding-top", navbar_height + "px"); |
| 1955 |
menu_container_selector.addClass("jltma-fixed-top"); |
| 1956 |
}); |
| 1957 |
} |
| 1958 |
if ($menu_toggletype == "toggle") $("#" + $menuID + " .navbar-nav.toggle .jltma-menu-dropdown-toggle").click(function(e) { |
| 1959 |
$(this).parents(".dropdown").toggleClass("open"); |
| 1960 |
e.stopPropagation(); |
| 1961 |
}); |
| 1962 |
if ($menu_offcanvas == "toggle-bar") $(".jltma-nav-panel .navbar-toggler").on("click", function(e) { |
| 1963 |
$(".jltma-burger").toggleClass("jltma-close"); |
| 1964 |
}); |
| 1965 |
if ($menu_offcanvas == "offcanvas" || $menu_offcanvas == "overlay") { |
| 1966 |
$(".jltma-nav-panel .navbar-toggler").on("click", function(e) { |
| 1967 |
e.preventDefault(); |
| 1968 |
e.stopPropagation(); |
| 1969 |
$($(this).attr("data-trigger")).toggleClass("show"); |
| 1970 |
$("body").toggleClass("offcanvas-active"); |
| 1971 |
$(".jltma-nav-panel ").toggleClass("offcanvas-nav"); |
| 1972 |
if ($menu_offcanvas == "overlay") $(".jltma-nav-panel ").toggleClass("offcanvas-overlay"); |
| 1973 |
}); |
| 1974 |
$(document).on("keydown", function(event) { |
| 1975 |
if (event.keyCode === 27) { |
| 1976 |
$(".mobile-offcanvas").removeClass("show"); |
| 1977 |
$(".desktop-offcanvas").removeClass("show"); |
| 1978 |
$("body").removeClass("overlay-active"); |
| 1979 |
} |
| 1980 |
}); |
| 1981 |
$(".btn-close, .jltma-nav-panel .offcanvas-nav, .jltma-nav-panel.desktop .jltma-close, .jltma-close").click(function(e) { |
| 1982 |
$(".jltma-nav-panel ").removeClass("offcanvas-nav"); |
| 1983 |
$(".mobile-offcanvas").removeClass("show"); |
| 1984 |
$(".desktop-offcanvas").removeClass("show"); |
| 1985 |
$("body").removeClass("offcanvas-active"); |
| 1986 |
if ($menu_offcanvas == "overlay") $(".jltma-nav-panel ").removeClass("offcanvas-overlay"); |
| 1987 |
}); |
| 1988 |
} |
| 1989 |
} |
| 1990 |
}, |
| 1991 |
initEvents: function($scope, $) { |
| 1992 |
$scope.find(".jltma-search-wrapper").eq(0).data("search-type"); |
| 1993 |
var mainContainer = $scope.find(".jltma-search-main-wrap"), openCtrl = document.getElementById("jltma-btn-search"), closeCtrl = document.getElementById("jltma-btn-search-close"), searchContainer = $scope.find(".jltma-search"), inputSearch = searchContainer.find(".jltma-search__input"); |
| 1994 |
$(openCtrl).on("click", function() { |
| 1995 |
mainContainer.addClass("main-wrap--move"); |
| 1996 |
searchContainer.addClass("search--open"); |
| 1997 |
setTimeout(function() { |
| 1998 |
inputSearch.focus(); |
| 1999 |
}, 600); |
| 2000 |
}); |
| 2001 |
$(closeCtrl).on("click", function() { |
| 2002 |
mainContainer.removeClass("main-wrap--move"); |
| 2003 |
searchContainer.removeClass("search--open"); |
| 2004 |
inputSearch.blur(); |
| 2005 |
inputSearch.value = ""; |
| 2006 |
}); |
| 2007 |
document.addEventListener("keyup", function(ev) { |
| 2008 |
if (ev.keyCode == 27) Master_Addons.closeSearch(); |
| 2009 |
}); |
| 2010 |
}, |
| 2011 |
MA_Header_Search: function($scope, $) { |
| 2012 |
$("body").addClass("js"); |
| 2013 |
Master_Addons.initEvents($scope, $); |
| 2014 |
} |
| 2015 |
}; |
| 2016 |
function filter_fancy_box(element) { |
| 2017 |
$(element).find(".jltma-fancybox").each(function() { |
| 2018 |
const rawCaption = $(this).data("caption"); |
| 2019 |
function decodeEntities(str) { |
| 2020 |
if (!str) return ""; |
| 2021 |
const txt = document.createElement("textarea"); |
| 2022 |
txt.innerHTML = str; |
| 2023 |
return txt.value; |
| 2024 |
} |
| 2025 |
const caption = decodeEntities(rawCaption); |
| 2026 |
const hasDangerousAttr = /\son\w+\s*=/i.test(caption); |
| 2027 |
const hasScriptTag = /<\s*script/i.test(caption); |
| 2028 |
const hasJsProto = /javascript:/i.test(caption); |
| 2029 |
if (caption && (hasDangerousAttr || hasScriptTag || hasJsProto)) { |
| 2030 |
$(this).attr("data-caption", ""); |
| 2031 |
$(this).closest(".elementor-element").remove(); |
| 2032 |
} |
| 2033 |
}); |
| 2034 |
} |
| 2035 |
$(document).ready(function() { |
| 2036 |
filter_fancy_box(document.body); |
| 2037 |
new MutationObserver((mutations) => { |
| 2038 |
mutations.forEach((mutation) => { |
| 2039 |
mutation.addedNodes.forEach((node) => { |
| 2040 |
if (node.nodeType === 1) filter_fancy_box(node); |
| 2041 |
}); |
| 2042 |
}); |
| 2043 |
}).observe(document.body, { |
| 2044 |
childList: true, |
| 2045 |
subtree: true |
| 2046 |
}); |
| 2047 |
}); |
| 2048 |
$(window).on("elementor/frontend/init", function() { |
| 2049 |
if (elementorFrontend.isEditMode()) {} |
| 2050 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", Master_Addons.MA_AnimatedGradient); |
| 2051 |
elementorFrontend.hooks.addAction("frontend/element_ready/container", Master_Addons.MA_AnimatedGradient); |
| 2052 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", Master_Addons.MA_BgSlider); |
| 2053 |
elementorFrontend.hooks.addAction("frontend/element_ready/container", Master_Addons.MA_BgSlider); |
| 2054 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", Master_Addons.MA_ParticlesBG); |
| 2055 |
elementorFrontend.hooks.addAction("frontend/element_ready/container", Master_Addons.MA_ParticlesBG); |
| 2056 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", Master_Addons.MA_Reveal); |
| 2057 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", Master_Addons.MA_Rellax); |
| 2058 |
elementorFrontend.hooks.addAction("frontend/element_ready/global", Master_Addons.MA_Wrapper_Link); |
| 2059 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-headlines.default", Master_Addons.MA_Animated_Headlines); |
| 2060 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-advanced-accordion.default", Master_Addons.MA_Accordion); |
| 2061 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-tabs.default", Master_Addons.MA_Tabs); |
| 2062 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-progressbar.default", Master_Addons.MA_ProgressBar); |
| 2063 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-team-members-slider.default", Master_Addons.MA_TeamSlider); |
| 2064 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-image-carousel.default", Master_Addons.MA_Image_Carousel); |
| 2065 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-blog-post.default", Master_Addons.MA_Blog); |
| 2066 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-news-ticker.default", Master_Addons.MA_NewsTicker); |
| 2067 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-el-countdown-timer.default", Master_Addons.MA_CountdownTimer); |
| 2068 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-counter-up.default", Master_Addons.MA_Counter_Up); |
| 2069 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-piecharts.default", Master_Addons.MA_PieCharts); |
| 2070 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-timeline.default", Master_Addons.MA_Timeline); |
| 2071 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-image-filter-gallery.default", Master_Addons.MA_Image_Filter_Gallery); |
| 2072 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-gallery-slider.default", Master_Addons.MA_Gallery_Slider); |
| 2073 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-el-image-comparison.default", Master_Addons.MA_Image_Comparison); |
| 2074 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-el-restrict-content.default", Master_Addons.MA_Restrict_Content); |
| 2075 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-search.default", Master_Addons.MA_Header_Search); |
| 2076 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-progressbars.default", Master_Addons.ProgressBars); |
| 2077 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-instagram-feed.default", Master_Addons.MA_Instagram_Feed); |
| 2078 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-toggle-content.default", Master_Addons.MA_Toggle_Content); |
| 2079 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-comments.default", Master_Addons.MA_Comment_Form_reCaptcha); |
| 2080 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-logo-slider.default", Master_Addons.MA_Logo_Slider); |
| 2081 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-twitter-slider.default", Master_Addons.MA_Twitter_Slider); |
| 2082 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-advanced-image.default", Master_Addons.MA_Advanced_Image); |
| 2083 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-tooltip.default", Master_Addons.MA_Tooltip); |
| 2084 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-image-hotspot.default", Master_Addons.MA_Image_Hotspot); |
| 2085 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-pricing-table.default", Master_Addons.MA_Pricing_Table); |
| 2086 |
if (elementorFrontend.isEditMode()) { |
| 2087 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-headlines.default", Master_Addons.MA_Animated_Headlines); |
| 2088 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-piecharts.default", Master_Addons.MA_PieCharts); |
| 2089 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-progressbars.default", Master_Addons.ProgressBars); |
| 2090 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-progressbar.default", Master_Addons.MA_ProgressBar); |
| 2091 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-news-ticker.default", Master_Addons.MA_NewsTicker); |
| 2092 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-gallery-slider.default", Master_Addons.MA_Gallery_Slider); |
| 2093 |
elementorFrontend.hooks.addAction("frontend/element_ready/jltma-counter-up.default", Master_Addons.MA_Counter_Up); |
| 2094 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-tooltip.default", Master_Addons.MA_Tooltip); |
| 2095 |
} |
| 2096 |
}); |
| 2097 |
})(jQuery); |
| 2098 |
//#endregion |
| 2099 |
})(); |
| 2100 |
|