1// source --> https://www.3i-infotech.com/wp-content/plugins/announcer/public/js/script.js?ver=6.1 2(function($){ 3$(document).ready(function(){ 4 5 $('.ancr').each(function(){ 6 var $ancr = $(this); 7 this.announcer = new Announcer($ancr); 8 }); 9 10}); 11})(jQuery); 12 13function Announcer_Position(){ 14 this.spacer = false; 15 this.normal_moved = false; 16 17 this.sticky_offset = 0; 18 this.sticky_group = false; 19 this.sticky_elements = false; 20} 21 22function Announcer_State(){ 23 24 this.bars = []; 25 this.top = new Announcer_Position(); 26 this.bottom = new Announcer_Position(); 27 this.on_scroll_bars = []; 28 29 this.listen_on_scroll(); 30 31} 32 33Announcer_State.prototype.add = function(bar){ 34 35 var position = bar.props.position; 36 var position_class = '.ancr-pos-' + position; 37 38 this.bars.push(bar); 39 40 if(bar.props.sticky == 'yes'){ 41 this.add_spacer(position); 42 if(!this[position].sticky_group){ 43 this[position].sticky_group = jQuery(position_class + '.ancr-sticky'); 44 } 45 }else{ 46 if(position == 'top'){ 47 if(!this[position].normal_moved){ 48 var normal_class = position_class + '.ancr-normal'; 49 if(this[position].spacer){ 50 jQuery(normal_class).detach().insertAfter(this[position].spacer); 51 }else{ 52 jQuery(normal_class).detach().prependTo('body'); 53 } 54 this[position].normal_moved = true; 55 } 56 } 57 } 58 59 if(bar.props.show_on == 'page_scroll'){ 60 this.on_scroll_bars.push(bar); 61 } 62 63} 64 65Announcer_State.prototype.add_spacer = function(position){ 66 if(!this[position].spacer){ 67 var $spacer = jQuery('<div class="ancr-' + position + '-spacer"></div>'); 68 this[position].spacer = $spacer; 69 if(position == 'top'){ 70 jQuery('body').prepend($spacer); 71 }else{ 72 jQuery('body').append($spacer); 73 } 74 } 75} 76 77Announcer_State.prototype.update_offsets = function(position){ 78 79 if(this[position].sticky_group){ 80 this[position].sticky_offset = this[position].sticky_group.outerHeight(); 81 this[position].spacer.animate({height: this[position].sticky_offset}, 200); 82 if(jQuery('body').hasClass('admin-bar')){ 83 jQuery('html').css('margin-top', this[position].sticky_offset + 'px'); 84 } 85 } 86 87} 88 89Announcer_State.prototype.set_cookie = function(name, value, expiry_days, site_wide){ 90 91 if(('' + name).includes('PREVIEW')){ 92 return; 93 } 94 95 var expires = ''; 96 var path = '; path=/'; 97 98 if(expiry_days) { 99 var date = new Date(); 100 date.setTime(date.getTime()+(expiry_days*24*60*60*1000)); 101 expires = "; expires=" + date.toGMTString(); 102 } 103 104 if(!site_wide){ 105 path = '; path=' + window.location.pathname; 106 } 107 108 document.cookie = name + '=' + value + expires + path; 109 110} 111 112Announcer_State.prototype.get_cookie = function(name){ 113 114 var name_eq = name + "="; 115 var ca = document.cookie.split(';'); 116 117 for(var i = 0; i < ca.length; i++) { 118 var c = ca[i]; 119 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 120 121 if (c.indexOf(name_eq) == 0){ 122 return c.substring(name_eq.length, c.length); 123 } 124 } 125 126 return null; 127 128} 129 130Announcer_State.prototype.listen_on_scroll = function(){ 131 132 var self = this; 133 var $ = jQuery; 134 135 $(window).scroll(function(){ 136 var at = $(window).scrollTop(); 137 138 for(var i = 0; i < self.on_scroll_bars.length; i++){ 139 var bar = self.on_scroll_bars[i]; 140 141 if(at >= bar.props.show_after_scroll){ 142 if(!bar.is_shown){ 143 if(bar.can_show()) bar.show(); 144 } 145 }else{ 146 if(bar.is_shown){ 147 bar.hide(false); 148 } 149 } 150 } 151 152 }); 153 154} 155 156Announcer_State.prototype.adjust_fixed_elements = function(){ 157 158 var top = this['top']; 159 160 if(!top.sticky_group){ 161 return; 162 } 163 164 if(!top.sticky_elements){ 165 166 var possible_stickies = document.querySelectorAll('div, header, nav'); 167 top.sticky_elements = []; 168 169 for(var i = 0; i < possible_stickies.length; i++){ 170 var element = possible_stickies[i]; 171 172 if(element.className.includes('ancr-')){ 173 continue; 174 } 175 176 var element_bound = element.getBoundingClientRect(); 177 var element_style = window.getComputedStyle(element, null); 178 179 if(element_style.position === 'fixed' && element_style.display != 'none' && element_bound.top <= top['sticky_offset'] && element_bound.left == 0){ 180 top.sticky_elements.push(element); 181 } 182 } 183 184 } 185 186 for(i = 0; i < top.sticky_elements.length; i++){ 187 var element = top.sticky_elements[i]; 188 element.style.top = top['sticky_offset'] + 'px'; 189 } 190 191} 192 193Announcer_State.prototype.is_mobile = function(){ 194 return /Mobi|Android/i.test(navigator.userAgent); 195} 196 197window.ancr_state = new Announcer_State(); 198 199function Announcer($el){ 200 201 this.$el = $el; 202 this.props = $el.data('props'); 203 this.id = this.props.id; 204 this.is_shown = false; 205 this.close_cookie = 'ancr_close_' + this.id; 206 this.force_closed = false; 207 208 ancr_state.add(this); 209 210 this.register_events(); 211 this.check_show(); 212 213} 214 215Announcer.prototype.register_events = function(){ 216 217 var self = this; 218 var $close_btn = this.$el.find('.ancr-close'); 219 220 if(this.props.close_content_click == 'yes'){ 221 $close_btn = $close_btn.add(this.$el.find('.ancr-inner a')); 222 } 223 224 if($close_btn.length != 0){ 225 $close_btn.on('click', function(e){
226 if(jQuery(this).attr('href') == '#'){ 227 e.preventDefault(); 228 } 229 self.hide(); 230 if(self.props.show_on == 'page_scroll'){ 231 self.force_closed = true; 232 } 233 }); 234 } 235 236 if(this.props.layout == 'ticker'){ 237 var initialize_ticker = function(){ 238 self.$el[0].style.setProperty('--ancr-width', self.$el.outerWidth() + 'px'); 239 var $content = self.$el.find('.ancr-content'); 240 var $btn_wrap = self.$el.find('.ancr-btn-wrap'); 241 var total_width = $content.outerWidth() + ($btn_wrap.length ? $btn_wrap.outerWidth() : 0); 242 self.$el.find('.ancr-container').css({ 243 'min-width': total_width + 30, 244 'visibility': 'visible' 245 }); 246 247 var ticker_speed = self.props.ticker_speed; 248 self.$el[0].style.setProperty('--ancr-ticker-speed', ticker_speed + 's'); 249 250 // Start the ticker animation 251 self.$el.addClass('ancr-lo-ticker-anim'); 252 }; 253 jQuery(window).on('resize', initialize_ticker); 254 setTimeout(function(){ 255 initialize_ticker(); 256 }, 500); 257 } 258 259} 260 261Announcer.prototype.can_show = function(){ 262 263 if(this.props.display == 'custom'){ 264 return false; 265 } 266 267 var closed_cookie = ancr_state.get_cookie(this.close_cookie); 268 269 if(this.props.devices == 'mobile_only' && !ancr_state.is_mobile()){ 270 return false; 271 } 272 273 if(this.props.devices == 'desktop_only' && ancr_state.is_mobile()){ 274 return false; 275 } 276 277 if(this.props.keep_closed == 'yes' && closed_cookie){ 278 return false; 279 } 280 281 if(this.props.display == 'schedule'){ 282 var now = Date.now()/1000; 283 var schedule_from = this.props.schedule_from || (now - 1); 284 var schedule_to = this.props.schedule_to || (now + 1); 285 286 if(now > schedule_from && now < schedule_to){ 287 return true; 288 }else{ 289 return false; 290 } 291 } 292 293 if(this.force_closed){ 294 return false; 295 } 296 297 return true; 298 299} 300 301Announcer.prototype.check_show = function(){ 302 303 var self = this; 304 305 if(!this.can_show()){ 306 return; 307 } 308 309 if(this.props.show_on == 'page_open'){ 310 self.show(); 311 }else if(this.props.show_on == 'duration'){ 312 setTimeout(function(){ 313 self.show(); 314 }, this.props.show_after_duration * 1000) 315 } 316 317} 318 319Announcer.prototype.show = function(){ 320 var self = this; 321 this.is_shown = true; 322 323 this.animate('show', function(){ 324 self.after_show(); 325 }); 326 327} 328 329Announcer.prototype.after_show = function(){ 330 331 var position = this.props.position; 332 ancr_state.update_offsets(position); 333 ancr_state.adjust_fixed_elements(); 334 335 if(this.props.auto_close != '0'){ 336 this.auto_close(); 337 } 338 339} 340 341Announcer.prototype.hide = function(set_cookie=true){ 342 var self = this; 343 this.is_shown = false; 344 345 this.animate('hide', function(){ 346 self.after_hide(set_cookie); 347 }); 348} 349 350Announcer.prototype.after_hide = function(set_cookie=true){ 351 352 var position = this.props.position; 353 ancr_state.update_offsets(position); 354 ancr_state.adjust_fixed_elements(); 355 356 var closed_duration = (this.props.closed_duration == '0') ? false : this.props.closed_duration; 357 358 if(this.props.keep_closed == 'yes' && set_cookie){ 359 ancr_state.set_cookie(this.close_cookie, 1, closed_duration, true); 360 } 361 362} 363 364Announcer.prototype.set_offset = function(){ 365 var position = this.props.position; 366 var css_props = {}; 367 var offset = ancr_state[position].offset_total; 368 369 css_props[position] = offset + 'px'; 370 //this.$el.animate(css_props); 371 372} 373 374Announcer.prototype.auto_close = function(){ 375 var self = this; 376 setTimeout(function(){ 377 self.hide(); 378 }, this.props.auto_close * 1000); 379} 380 381Announcer.prototype.animate = function(type, callback){ 382 383 var animations = { 384 'slide' : ['slideDown', 'slideUp'], 385 'fade' : ['fadeIn', 'fadeOut'] 386 }; 387 388 var chosen = (type == 'show') ? this.props.open_animation : this.props.close_animation; 389 var duration = 400; 390 var animation = 'show'; 391 392 if(chosen == 'none'){ 393 animation = (type == 'show') ? 'show' : 'hide'; 394 duration = 0; 395 }else{ 396 animation = (type == 'show') ? animations[chosen][0] : animations[chosen][1]; 397 } 398 399 this.$el[animation](duration, callback); 400 401}; 402// source --> https://www.3i-infotech.com/wp-content/plugins/addon-elements-for-elementor-page-builder/assets/js/iconHelper.js?ver=1.0 403window.eae = {}; 404window.renderIconHtml = function(view,elementor,sett,control_name, wClass = '', index=''){ 405 // console.log("View => ", view); 406 // data.addRenderAttribute('key', 'context', 'value'); 407 // console.log(data.getRenderAttributeString('key')); 408 409 var icon_class = ''; 410 let imageHtml = ''; 411 let lottie_data = []; 412 let iconHtml = ''; 413 if(sett[control_name+'_graphic_type'] != 'none' && sett[control_name+'_graphic_type'] != ''){ 414 icon_class += ' eae-gbl-icon eae-graphic-type-'+ sett[control_name+'_graphic_type'] + ' elementor-animation-' + sett[control_name+'_hover_animation']; 415 if(wClass != ''){ 416 icon_class += ' '+wClass; 417 } 418 419 icon_class += ' eae-graphic-view-'+sett[control_name+'_view']; 420 if(sett[control_name+'_view'] != 'default'){ 421 icon_class += ' eae-graphic-shape-'+sett[control_name+'_shape']; 422 } 423 424 if(sett[control_name+'_graphic_type'] == 'lottie'){ 425 if( (sett[control_name+'_lottie_animation_url'] != '' ) || (sett[control_name+'_source_json']['url'] != '') ) { 426 icon_class += ' eae-lottie-animation eae-lottie'; 427 lottie_data = { 428 'loop' : ( sett[control_name+'_lottie_animation_loop'] === 'yes' ) ? true : false, 429 'reverse' : ( sett[control_name+'_lottie_animation_reverse'] === 'yes' ) ? true : false, 430 } 431 if(sett[control_name+'_source'] == 'media_file' && (sett[control_name+'_source_json']['url'] != '')){ 432 lottie_data.url = sett[control_name+'_source_json']['url']; 433 }else{ 434 lottie_data.url = sett[control_name+'_lottie_animation_url']; 435 } 436 view.addRenderAttribute('panel-icon-'+ index, 'data-lottie-settings', JSON.stringify(lottie_data)); 437 } 438 } 439 view.addRenderAttribute('panel-icon-'+ index, 'class', icon_class); 440 if(sett[control_name+'_graphic_type'] == 'lottie' ){ 441 if(lottie_data.url != undefined){ 442 iconHtml = `<span ${view.getRenderAttributeString( 'panel-icon-'+ index )}></span>`; 443 } 444 }else{
445 if(sett[control_name+'_graphic_type'] === 'icon'){ 446 if(sett[control_name+'_graphic_icon']['value'] != ''){ 447 var icon = elementor.helpers.renderIcon( view, sett[control_name+'_graphic_icon'], { 'aria-hidden': true }, 'i' , 'object' ); 448 imageHtml = icon.value; 449 iconHtml = `<span ${ view.getRenderAttributeString( 'panel-icon-'+ index ) }> 450 ${imageHtml} 451 </span>`; 452 } 453 }else{ 454 if(sett[control_name+'_graphic_image']['url'] != ''){ 455 var image = { 456 id: sett[control_name+'_graphic_image']['id'], 457 url: sett[control_name+'_graphic_image']['url'], 458 size: sett[control_name+'_graphic_image_size'], 459 dimension: sett[control_name+'_graphic_image_custom_dimension'], 460 model: view.getEditModel() 461 }; 462 var image_url = elementor.imagesManager.getImageUrl( image ); 463 imageHtml = '<img src="' + image_url + '" />'; 464 465 iconHtml = `<span ${ view.getRenderAttributeString( 'panel-icon-'+ index ) }> 466 ${imageHtml} 467 </span>`; 468 } 469 } 470 } 471 } 472 return iconHtml; 473} 474 475window.eae.validateHTMLTag = function( $tag, $collection = null, $fallback = null){ 476 if($collection == null){ 477 $collection = ['h1','h2','h3','h4','h5','h6','p','span','div']; 478 } 479 if($fallback == null){ 480 $fallback = 'h3'; 481 } 482 if($collection.includes($tag)){ 483 return $tag; 484 }else{ 485 return $fallback; 486 } 487};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.