| 1 |
(function(){ |
| 2 |
function getElementSettings($element, setting) { |
| 3 |
var elementSettings = {}, modelCID = $element.data("model-cid"); |
| 4 |
if (typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode() && modelCID) { |
| 5 |
var settings = elementorFrontend.config.elements.data[modelCID], type = settings.attributes.widgetType || settings.attributes.elType, settingsKeys = elementorFrontend.config.elements.keys[type]; |
| 6 |
if (!settingsKeys) { |
| 7 |
settingsKeys = elementorFrontend.config.elements.keys[type] = []; |
| 8 |
jQuery.each(settings.controls, function(name, control) { |
| 9 |
if (control.frontend_available) { |
| 10 |
settingsKeys.push(name); |
| 11 |
} |
| 12 |
}); |
| 13 |
} |
| 14 |
jQuery.each(settings.getActiveControls(), function(controlKey) { |
| 15 |
if (-1 !== settingsKeys.indexOf(controlKey)) { |
| 16 |
elementSettings[controlKey] = settings.attributes[controlKey]; |
| 17 |
} |
| 18 |
}); |
| 19 |
} else { |
| 20 |
elementSettings = $element.data("settings") || {}; |
| 21 |
} |
| 22 |
return getItems(elementSettings, setting); |
| 23 |
} |
| 24 |
function getItems(items, itemKey) { |
| 25 |
if (itemKey) { |
| 26 |
var keyStack = itemKey.split("."), currentKey = keyStack.splice(0, 1); |
| 27 |
if (!keyStack.length) { |
| 28 |
return items[currentKey]; |
| 29 |
} |
| 30 |
if (!items[currentKey]) { |
| 31 |
return; |
| 32 |
} |
| 33 |
return getItems(items[currentKey], keyStack.join(".")); |
| 34 |
} |
| 35 |
return items; |
| 36 |
} |
| 37 |
function getUniqueLoopScopeId($scope) { |
| 38 |
if ($scope.data("jltma-template-widget-id")) { |
| 39 |
return $scope.data("jltma-template-widget-id"); |
| 40 |
} |
| 41 |
return $scope.data("id"); |
| 42 |
} |
| 43 |
function jltMAObserveTarget(target, callback, options = {}) { |
| 44 |
var observer = new IntersectionObserver(function(entries, observer2) { |
| 45 |
entries.forEach(function(entry) { |
| 46 |
if (entry.isIntersecting) { |
| 47 |
callback(entry); |
| 48 |
} |
| 49 |
}); |
| 50 |
}, options); |
| 51 |
observer.observe(target); |
| 52 |
} |
| 53 |
function sanitizeTooltipText(text) { |
| 54 |
const tempDiv = document.createElement("div"); |
| 55 |
tempDiv.textContent = text; |
| 56 |
return tempDiv.innerHTML; |
| 57 |
} |
| 58 |
function stripTags(text) { |
| 59 |
return text.replace(/<\/?[^>]+(>|$)/g, ""); |
| 60 |
} |
| 61 |
function isEditMode() { |
| 62 |
return typeof elementorFrontend !== "undefined" && elementorFrontend.isEditMode(); |
| 63 |
} |
| 64 |
function decodeEntities(str) { |
| 65 |
if (!str) return ""; |
| 66 |
const txt = document.createElement("textarea"); |
| 67 |
txt.innerHTML = str; |
| 68 |
return txt.value; |
| 69 |
} |
| 70 |
function filterFancyBox(element) { |
| 71 |
jQuery(element).find(".jltma-fancybox").each(function() { |
| 72 |
const rawCaption = jQuery(this).data("caption"); |
| 73 |
const caption = decodeEntities(rawCaption); |
| 74 |
const hasDangerousAttr = /\son\w+\s*=/i.test(caption); |
| 75 |
const hasScriptTag = /<\s*script/i.test(caption); |
| 76 |
const hasJsProto = /javascript:/i.test(caption); |
| 77 |
if (caption && (hasDangerousAttr || hasScriptTag || hasJsProto)) { |
| 78 |
jQuery(this).attr("data-caption", ""); |
| 79 |
jQuery(this).closest(".elementor-element").remove(); |
| 80 |
} |
| 81 |
}); |
| 82 |
} |
| 83 |
(function($, elementor) { |
| 84 |
"use strict"; |
| 85 |
var JLTMA_ProgressBars = function($scope, $2) { |
| 86 |
jltMAObserveTarget($scope[0], function() { |
| 87 |
$scope.find(".jltma-stats-bar-content").each(function() { |
| 88 |
var dataperc = $2(this).data("perc"); |
| 89 |
$2(this).animate({ "width": dataperc + "%" }, dataperc * 20); |
| 90 |
}); |
| 91 |
}); |
| 92 |
}; |
| 93 |
$(window).on("elementor/frontend/init", function() { |
| 94 |
elementorFrontend.hooks.addAction("frontend/element_ready/ma-progressbars.default", JLTMA_ProgressBars); |
| 95 |
}); |
| 96 |
})(jQuery, window.elementorFrontend); |
| 97 |
})(); |
| 98 |
|