File "contextual-info.min.js"

Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/flexible-shipping/assets/js/contextual-info.min.js
File size: 1.2 KB
MIME-type: text/plain
Charset: utf-8

(function($){$.fn.contextualInfo=function(settings){let config=$.extend({'id':'','phrases_in':[],'info_html':'','phrases_not_in':[],'is_limited_width':!1,},settings);return this.each(function(){let $element=$(this);createInfoHTMLElement($element);toggleInfoElement($element);$element.keyup(function(){toggleInfoElement($element)})});function prepareInfoElementId($element){return $element.attr('id')+"_"+config.id}
function createInfoHTMLElement($element){$($element).after(function(){let classes=['description'];if(config.is_limited_width){classes.push('limited-width')}
return'<p class="'+classes.join(' ')+'" id="'+prepareInfoElementId($element)+'" style="display: none;">'+config.info_html+"</p>"})}
function toggleInfoElement($element){let element_value=$element.val().toLowerCase();let show_info=!1;if(config.phrases_in.length===0){show_info=!0}
$(config.phrases_in).each(function(index,value){let phrase_value=value.toLowerCase();show_info=show_info||element_value.indexOf(phrase_value)!==-1});$(config.phrases_not_in).each(function(index,value){let phrase_value=value.toLowerCase();show_info=show_info&&element_value.indexOf(phrase_value)===-1});$('#'+$element.attr('id')+"_"+config.id).toggle(show_info)}}})(jQuery)