���� JFIF �� �
"" $(4,$&1'-=-157:::#+?D?8C49:7
7%%77777777777777777777777777777777777777777777777777�� { �" �� �� 5 !1AQa"q�2��BR��#b������� �� �� ? ��D@DDD@DDD@DDkK��6 �UG�4V�1��
�����릟�@�#���RY�dqp�
����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Æ��ܯsO"B�c>;
�e�4��5�k��/CB��.
�J?��;�҈�������������������~�<�VZ�ê¼2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ
B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r�����
Ď0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�?
�0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA׾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC
PK ! yC
readme.txtnu [ === Ad Inserter - Ad Manager & AdSense Ads ===
Contributors: adinserter, spacetime
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LHGZEMRTR7WB4
Tags: ads, adsense, ad rotation, ad manager, amp, amazon, ad blocking detection, header code, banners, in-feed ads, sticky fixed widgets, hooks
Requires at least: 4.9
Tested up to: 6.2
Requires PHP: 5.6
Stable tag: 2.7.29
License: GPLv3
Manage Google AdSense, Media.net, Amazon banners, ads.txt, ad rotation, sticky widgets, AMP ads, DFP, tracking, AdSense header and footer code
== Description ==
Ad management plugin with many advanced advertising features to insert ad codes at optimal positions.
Supports all kinds of ads including **Google AdSense**, **Google Ad Manager** (DFP - DoubleClick for publishers), contextual **Amazon Native Shopping Ads**, **Media.net** , **Infolinks** and **rotating banners.**
This plugin is more than AdSense plugin or plugin for ads. It provides many advanced options to insert opt-in forms, header scripts, Javascript, CSS, HTML, PHP, analytics, tracking or advert code anywhere on the page.
**Insert ads where other plugins fail**.
It's all about the [settings](https://adinserter.pro/documentation).
[Plugin reviews](https://wordpress.org/support/topic/wow-684/):
> I've been using another ad placement manager for a couple years and just recently started using Ad Inserter.
>
> I'm blown AWAY with the power and flexibility of it.
>
> I can HIGHLY recommend this plugin to anyone looking for an easy way to manage ads within WordPress.
>
> Difficult to choose, but certainly top 3 plugins I've ever used in WordPress, ever.
**Features** - check [documentation](https://adinserter.pro/documentation/features) for the complete list
* [AdSense integration](https://adinserter.pro/documentation/adsense-ads)
* Support for [Google Ad Manager](https://adinserter.pro/documentation/ad-manager-ads) (DoubleClick for publishers)
* Syntax highlighting [editor](https://adinserter.pro/documentation/code-editing)
* Plain JavaScript code on front-end - no library dependencies
* Code preview with visual CSS editor
* Automatically inserts ads on posts and pages
* Insert before or after post
* Insert before or after content
* Insert before or after paragraph
* Insert before or after random paragraph
* Insert before or after multiple paragraphs
* Insert before or after image
* Insert before or after comments
* Insert before or after excerpt
* Insert near any element on the page (using CSS selectors)
* Insert above the header (after `` tag)
* Insert in the footer (before `` tag)
* Insert at relative positions in posts
* Insert between posts on blog pages (in-feed AdSense)
* Insert between excerpts on blog pages
* Insert between comments
* Insert at custom hook positions (`do_action ()` WP function)
* Insert before or after any HTML element using CSS selectors
* Visual HTML element selector (DOM explorer)
* Avoid inserting ads near images or headers (AdSense TOS)
* Disable ads on individual posts or pages
* Insert header (`` section) and footer code
* Insert raw HTTP response header lines
* Insert Google Analytics, Matomo (Piwik) or any other tracking code
* Insert images, HTML, CSS, Javascript or PHP code
* Code generator for banners and placeholders
* AdSense code generator
* Support to detect, hide or replace blank AdSense blocks
* Visual advert editor - create adverts from scratch
* Manual insertion: widgets, shortcodes, PHP function call
* Sticky (fixed) widgets (sticky sidebar - the sidebar does not move when the page is scrolled)
* Custom alignments and styles
* Insert different ad codes on AMP pages
* Custom CSS class name for wrapping divs to avoid ad blockers
* Use shortcodes from other plugins
* Use custom fields as defined in posts
* Use post title, tags or category names to create contextual adverts
* PHP code processing
* Ad labels - show customized label above adverts
* ads.txt editor
* Support for [GDPR consent checks](https://adinserter.pro/faq/gdpr-compliance-cookies-consent)
* Support for IAB TCF 2.0 GDPR consent API (used by Quantcast Choice)
* Ad rotation (server-side and client-side - works with caching)
* Timed ad rotation - define times to rotate adverts in a single ad block
* Create rich media ads with standard WordPress TinyMCE editor
* Ad blocking detection - popup message, page redirection
* Desktop/mobile device detection (server-side and client-side - works with caching)
* [Blacklist/Whitelist](https://adinserter.pro/documentation/black-and-white-lists) categories, tags, taxonomies, post IDs, urls, url query parameters, cookies, referrers, browsers, operating systems
* Easy copying and pasting ads or settings using internal clipboard
* Use it with Google Site Kit or replace it to have more control over ad placement
* Simple troubleshooting with many debugging functions
* Function to visualize inserted blocks
* Function to visualize AdSense ads with ad names and IDs
* Function to visualize available insertion positions
* Function to visualize HTML tags
* You name it :)
👉 TEST the plugin on a [demo website](https://tastewp.com/template/AdInserterDemo?redirect=options-general.php%3Fpage%3Dad-inserter.php%26ai-demo%3D1&ni=true)
[Review on WP Mayor](https://wpmayor.com/ad-inserter-review-the-best-wordpress-ad-management-plugin/)
> The Best WordPress Ad Management Plugin?
[Review on ShoutMeLoud](https://www.shoutmeloud.com/ad-inserter-review.html)
> Both Google and Amazon recommend this plugin for inserting ads, which is a testament to its quality
**Endorsed by Google** - [How to insert ad code in your WordPress site](https://support.google.com/adsense/answer/7527509)
> If you're new to AdSense, one of your first tasks is to connect your site to AdSense. This requires you to copy the code on your AdSense homepage and paste it into the HTML of your page, between the `` and `` tags.
**Endorsed by Amazon** - Wordpress Integration Guide for Native Shopping Ads.
> Native Shopping Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end or within your content to create a more compelling visitor experience and shopping opportunity.
**Pro version** supports additional [advanced features](https://adinserter.pro/documentation/features):
* Geolocation using internal or [MaxMind](http://www.maxmind.com/) databases (works also with caching)
* Country, state, region and city level geotargeting
* Blacklist/Whitelist IP addresses or countries/cities (works also with caching)
* Ad impression and click statistics (works also with `
Installation
------------
Install using composer:
```bash
composer require jenssegers/agent
```
Laravel (optional)
------------------
Add the service provider in `config/app.php`:
```php
Jenssegers\Agent\AgentServiceProvider::class,
```
And add the Agent alias to `config/app.php`:
```php
'Agent' => Jenssegers\Agent\Facades\Agent::class,
```
Basic Usage
-----------
Start by creating an `Agent` instance (or use the `Agent` Facade if you are using Laravel):
```php
use Jenssegers\Agent\Agent;
$agent = new Agent();
```
If you want to parse user agents other than the current request in CLI scripts for example, you can use the `setUserAgent` and `setHttpHeaders` methods:
```php
$agent->setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2');
$agent->setHttpHeaders($headers);
```
All of the original [Mobile Detect](https://github.com/serbanghita/Mobile-Detect) methods are still available, check out some original examples at https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
### Is?
Check for a certain property in the user agent.
```php
$agent->is('Windows');
$agent->is('Firefox');
$agent->is('iPhone');
$agent->is('OS X');
```
### Magic is-method
Magic method that does the same as the previous `is()` method:
```php
$agent->isAndroidOS();
$agent->isNexus();
$agent->isSafari();
```
### Mobile detection
Check for mobile device:
```php
$agent->isMobile();
$agent->isTablet();
```
### Match user agent
Search the user agent with a regular expression:
```php
$agent->match('regexp');
```
Additional Functionality
------------------------
### Accept languages
Get the browser's accept languages. Example:
```php
$languages = $agent->languages();
// ['nl-nl', 'nl', 'en-us', 'en']
```
### Device name
Get the device name, if mobile. (iPhone, Nexus, AsusTablet, ...)
```php
$device = $agent->device();
```
### Operating system name
Get the operating system. (Ubuntu, Windows, OS X, ...)
```php
$platform = $agent->platform();
```
### Browser name
Get the browser name. (Chrome, IE, Safari, Firefox, ...)
```php
$browser = $agent->browser();
```
### Desktop detection
Check if the user is using a desktop device.
```php
$agent->isDesktop();
```
*This checks if a user is not a mobile device, tablet or robot.*
### Phone detection
Check if the user is using a phone device.
```php
$agent->isPhone();
```
### Robot detection
Check if the user is a robot. This uses [jaybizzle/crawler-detect](https://github.com/JayBizzle/Crawler-Detect) to do the actual robot detection.
```php
$agent->isRobot();
```
### Robot name
Get the robot name.
```php
$robot = $agent->robot();
```
### Browser/platform version
MobileDetect recently added a `version` method that can get the version number for components. To get the browser or platform version you can use:
```php
$browser = $agent->browser();
$version = $agent->version($browser);
$platform = $agent->platform();
$version = $agent->version($platform);
```
*Note, the version method is still in beta, so it might not return the correct result.*
## License
Laravel User Agent is licensed under [The MIT License (MIT)](LICENSE).
PK ! >6 6 includes/agent/LICENSEnu [ The MIT License (MIT)
Copyright (c) 2015 Jens Segers
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
PK ! Y_) _) includes/agent/Agent.phpnu [ 'Macintosh',
];
/**
* List of additional operating systems.
* @var array
*/
protected static $additionalOperatingSystems = [
'Windows' => 'Windows',
'Windows NT' => 'Windows NT',
'OS X' => 'Mac OS X',
'Debian' => 'Debian',
'Ubuntu' => 'Ubuntu',
'Macintosh' => 'PPC',
'OpenBSD' => 'OpenBSD',
'Linux' => 'Linux',
'ChromeOS' => 'CrOS',
];
/**
* List of additional browsers.
* @var array
*/
protected static $additionalBrowsers = [
'Opera Mini' => 'Opera Mini',
'Opera' => 'Opera|OPR',
'Edge' => 'Edge',
'UCBrowser' => 'UCBrowser',
'Vivaldi' => 'Vivaldi',
'Chrome' => 'Chrome',
'Firefox' => 'Firefox',
'Safari' => 'Safari',
'IE' => 'MSIE|IEMobile|MSIEMobile|Trident/[.0-9]+',
'Netscape' => 'Netscape',
'Mozilla' => 'Mozilla',
];
/**
* List of additional properties.
* @var array
*/
protected static $additionalProperties = [
// Operating systems
'Windows' => 'Windows NT [VER]',
'Windows NT' => 'Windows NT [VER]',
'OS X' => 'OS X [VER]',
'BlackBerryOS' => ['BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'],
'AndroidOS' => 'Android [VER]',
'ChromeOS' => 'CrOS x86_64 [VER]',
// Browsers
'Opera Mini' => 'Opera Mini/[VER]',
'Opera' => [' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]', 'Opera [VER]'],
'Netscape' => 'Netscape/[VER]',
'Mozilla' => 'rv:[VER]',
'IE' => ['IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];', 'rv:[VER]'],
'Edge' => 'Edge/[VER]',
'Vivaldi' => 'Vivaldi/[VER]',
];
/**
* @var CrawlerDetect
*/
protected static $crawlerDetect;
/**
* Get all detection rules. These rules include the additional
* platforms and browsers and utilities.
* @return array
*/
public static function getDetectionRulesExtended()
{
static $rules;
if (!$rules) {
$rules = static::mergeRules(
static::$desktopDevices, // NEW
static::$phoneDevices,
static::$tabletDevices,
static::$operatingSystems,
static::$additionalOperatingSystems, // NEW
static::$browsers,
static::$additionalBrowsers, // NEW
static::$utilities
);
}
return $rules;
}
public function getRules()
{
if ($this->detectionType === static::DETECTION_TYPE_EXTENDED) {
return static::getDetectionRulesExtended();
}
return static::getMobileDetectionRules();
}
/**
* @return CrawlerDetect
*/
public function getCrawlerDetect()
{
if (static::$crawlerDetect === null) {
static::$crawlerDetect = new CrawlerDetect();
}
return static::$crawlerDetect;
}
public static function getBrowsers()
{
return static::mergeRules(
static::$additionalBrowsers,
static::$browsers
);
}
public static function getOperatingSystems()
{
return static::mergeRules(
static::$operatingSystems,
static::$additionalOperatingSystems
);
}
public static function getPlatforms()
{
return static::mergeRules(
static::$operatingSystems,
static::$additionalOperatingSystems
);
}
public static function getDesktopDevices()
{
return static::$desktopDevices;
}
public static function getProperties()
{
return static::mergeRules(
static::$additionalProperties,
static::$properties
);
}
/**
* Get accept languages.
* @param string $acceptLanguage
* @return array
*/
public function languages($acceptLanguage = null)
{
if ($acceptLanguage === null) {
$acceptLanguage = $this->getHttpHeader('HTTP_ACCEPT_LANGUAGE');
}
if (!$acceptLanguage) {
return [];
}
$languages = [];
// Parse accept language string.
foreach (explode(',', $acceptLanguage) as $piece) {
$parts = explode(';', $piece);
$language = strtolower($parts[0]);
$priority = empty($parts[1]) ? 1. : floatval(str_replace('q=', '', $parts[1]));
$languages[$language] = $priority;
}
// Sort languages by priority.
arsort($languages);
return array_keys($languages);
}
/**
* Match a detection rule and return the matched key.
* @param array $rules
* @param string|null $userAgent
* @return string
*/
protected function findDetectionRulesAgainstUA(array $rules, $userAgent = null)
{
// Loop given rules
foreach ($rules as $key => $regex) {
if (empty($regex)) {
continue;
}
// Check match
if ($this->match($regex, $userAgent)) {
return $key ?: reset($this->matchesArray);
}
}
return false;
}
/**
* Get the browser name.
* @param string|null $userAgent
* @return string
*/
public function browser($userAgent = null)
{
return $this->findDetectionRulesAgainstUA(static::getBrowsers(), $userAgent);
}
/**
* Get the platform name.
* @param string|null $userAgent
* @return string
*/
public function platform($userAgent = null)
{
return $this->findDetectionRulesAgainstUA(static::getPlatforms(), $userAgent);
}
/**
* Get the device name.
* @param string|null $userAgent
* @return string
*/
public function device($userAgent = null)
{
$rules = static::mergeRules(
static::getDesktopDevices(),
static::getPhoneDevices(),
static::getTabletDevices(),
static::getUtilities()
);
return $this->findDetectionRulesAgainstUA($rules, $userAgent);
}
/**
* Check if the device is a desktop computer.
* @param string|null $userAgent deprecated
* @param array $httpHeaders deprecated
* @return bool
*/
public function isDesktop($userAgent = null, $httpHeaders = null)
{
return !$this->isMobile($userAgent, $httpHeaders) && !$this->isTablet($userAgent, $httpHeaders) && !$this->isRobot($userAgent);
}
/**
* Check if the device is a mobile phone.
* @param string|null $userAgent deprecated
* @param array $httpHeaders deprecated
* @return bool
*/
public function isPhone($userAgent = null, $httpHeaders = null)
{
return $this->isMobile($userAgent, $httpHeaders) && !$this->isTablet($userAgent, $httpHeaders);
}
/**
* Get the robot name.
* @param string|null $userAgent
* @return string|bool
*/
public function robot($userAgent = null)
{
if ($this->getCrawlerDetect()->isCrawler($userAgent ?: $this->userAgent)) {
return ucfirst($this->getCrawlerDetect()->getMatches());
}
return false;
}
/**
* Check if device is a robot.
* @param string|null $userAgent
* @return bool
*/
public function isRobot($userAgent = null)
{
return $this->getCrawlerDetect()->isCrawler($userAgent ?: $this->userAgent);
}
public function version($propertyName, $type = self::VERSION_TYPE_STRING)
{
if (empty($propertyName)) {
return false;
}
// set the $type to the default if we don't recognize the type
if ($type !== self::VERSION_TYPE_STRING && $type !== self::VERSION_TYPE_FLOAT) {
$type = self::VERSION_TYPE_STRING;
}
$properties = self::getProperties();
// Check if the property exists in the properties array.
if (true === isset($properties[$propertyName])) {
// Prepare the pattern to be matched.
// Make sure we always deal with an array (string is converted).
$properties[$propertyName] = (array) $properties[$propertyName];
foreach ($properties[$propertyName] as $propertyMatchString) {
if (is_array($propertyMatchString)) {
$propertyMatchString = implode("|", $propertyMatchString);
}
$propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);
// Identify and extract the version.
preg_match(sprintf('#%s#is', $propertyPattern), $this->userAgent, $match);
if (false === empty($match[1])) {
$version = ($type === self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1]);
return $version;
}
}
}
return false;
}
/**
* Merge multiple rules into one array.
* @param array $all
* @return array
*/
protected static function mergeRules(...$all)
{
$merged = [];
foreach ($all as $rules) {
foreach ($rules as $key => $value) {
if (empty($merged[$key])) {
$merged[$key] = $value;
} elseif (is_array($merged[$key])) {
$merged[$key][] = $value;
} else {
$merged[$key] .= '|' . $value;
}
}
}
return $merged;
}
/**
* @inheritdoc
*/
public function __call($name, $arguments)
{
// Make sure the name starts with 'is', otherwise
if (strpos($name, 'is') !== 0) {
throw new BadMethodCallException("No such method exists: $name");
}
$this->setDetectionType(self::DETECTION_TYPE_EXTENDED);
$key = substr($name, 2);
return $this->matchUAAgainstKey($key);
}
}
PK ! K includes/js/jquery.scombobox.jsnu [ /**
* jquery.simple-combobox v1.1.26 (2015-11-05): jQuery combobox plugin | (c) 2014-2015 Ilya Kremer
* MIT license http://www.opensource.org/licenses/mit-license.php
*/
// Fill free to use this jQuery plugin in any projects you want
// while keeping the comment above on top of the script.
// Don't forget not to remove it from a minimised version also.
// Thank you!
// TODO consider to use markup when filling combobox from original select options
// TODO consider to add fadeout background for items (checkboxes mode)
// TODO implement items removal (for infinite number of items)
/**
* Original plugin structure taken and extended from http://stackoverflow.com/a/6871820/837165
* See and change default options at the end of the code or use
* $.scombobox.extendDefaults(options) method if you don't feel like
* touching the original plugin source code.
* This plugin uses following JS native methods:
*
* String.prototype.trim()
* Array.prototype.indexOf()
* Object.keys()
* console object
*
* so don't forget to add them to your project for better browser compatibility.
* You can use missed.js file for that purpose from original GitHub project:
* https://github.com/ivkremer/jquery-simple-combobox
*
* This plugin adds click listener on document, so don't forget to check if events
* can rich it or use scombobox.close method.
* @param {Object} $ jQuery reference
* @param {Object} document (HTMLDocument)
* @returns {undefined}
*/
(function($, document) {
'use strict';
var pname = 'scombobox'; // plugin name, don't forget to change css prefixes if necessary
var cp = '.' + pname;
var cdisplay = '-display',
cvalue = '-value',
cinvalid = '-invalid',
cdiv = cdisplay + '-div',
cditem = cdiv + '-item',
cdiremove = cditem + '-remove',
cdholder = cdiv + '-holder',
clist = '-list',
cmainspan = '-mainspan',
chovered = '-hovered',
csep = '-separator',
cpheader = '-header',
cddback = '-dropdown-background',
cddarr = '-dropdown-arrow',
cdisabled = '-disabled',
crequired = '-required';
function durations(d) {
return ({
fast: 200,
normal: 400,
slow: 600
})[d] || d;
}
var pInt = parseInt;
var methods = {
/**
* Initializes the combobox.
* @returns {Object} jQuery object
*/
init: function() {
var $div = this.find(cp + clist),
$select = this.find('select'),
$dropdownBack = this.find(cp + cddback),
$dropdownArr = this.find(cp + cddarr);
var opts = this.data(pname);
this.addClass(pname);
if ($select.length == 0) {
this.append($(''));
}
if (this.attr('id')) {
$select.removeAttr('id');
}
if ($select.attr('multiple')) {
this.data(pname).mode = 'checkboxes';
}
if ($dropdownBack.length == 0) {
this.append('');
}
if ($dropdownArr.length == 0) {
this.append('');
}
methods.displayDropdown.call(this, opts.showDropDown);
if (opts.mode != 'checkboxes') {
if (this.find(cp + cdisplay).length == 0) {
var $inputDisplay = $('');
$inputDisplay.attr('title', $select.attr('title'));
$inputDisplay.attr('placeholder', opts.placeholder);
this.append($inputDisplay);
this.height(+$inputDisplay.css('font-size') +
+$inputDisplay.css('padding-top') +
+$inputDisplay.css('padding-bottom')
);
}
}
if (opts.tabindex != null) {
this.find(cp + cdisplay).attr('tabindex', opts.tabindex);
}
if (this.find(cp + cvalue).length == 0) {
this.append('');
}
if (this.find(cp + cdisplay).is(':disabled') || opts.disabled) {
this.find(cp + cddback + ', ' + cp + cddarr).hide();
}
if (opts.disabled) {
this.find(cp + cdisplay).prop('disabled', true);
this.addClass(pname + cdisabled);
}
if ($select.attr('required') || opts.required) {
this.find(cp + cdisplay).prop('required', 'required');
this.addClass(pname + crequired);
}
if ($div.length == 0) {
this.append($div = $(''));
}
if (opts.mode == 'checkboxes') {
this.addClass(pname + '-checkboxes');
this.find(cp + cdisplay).remove();
var $displayDiv = this.find(cp + cdisplay + '-div');
if ($displayDiv.length == 0) {
$displayDiv = this.append('
');
}
$displayDiv.attr('title', $select.attr('title'));
$div.insertAfter(this.find(cp + cdisplay + '-div'));
var $dholder = this.find(cp + cdholder);
var $testItem = $('
x
');
$dholder.append($testItem.css('margin-left', '-9999px').show());
var height = $testItem.height() + pInt($testItem.css('padding-top')) + pInt($testItem.css('padding-top')) + pInt($testItem.css('margin-top')) + pInt($testItem.css('margin-top')) + pInt($testItem.css('border-top-width')) + pInt($testItem.css('border-top-width')) + pInt($dholder.css('padding-top')) + pInt($dholder.css('padding-top'));
this.find(cp + cdisplay + '-div').css('min-height', height + 'px');
$testItem.remove();
} else {
this.find(cp + '-display-div').remove();
$div.insertAfter(this.find(cp + cdisplay));
}
$div.css({ 'max-width': opts.listMaxWidth, 'max-height': opts.maxHeight });
if (opts.wrap == true) {
$div.css('white-space', 'normal');
}
if (opts.autoLoad != $.noop) {
opts.loopScrolling = false; // there is no way to support this feature when auto loading more items
}
addListeners.call(this);
this.data(pname + '-init', true); // true says that it is right after initialization, it is necessary for callback
return methods.fill.call(this, opts.data); // (will be set to false after filling)
},
/**
* Fills the combobox with specified data or using options list in select if no data given.
* @see comments in defaults
* @param {Array} data array of data objects. See comments in defaults
* @param {Number} appendMode flag defining if to append (1) or prepend (2) data to existing items
* @returns {Object} jQuery object
*/
fill: function(data, appendMode) {
var $options = this.find('select').children('option, optgroup');
// don't ever rely on div content, always use select options instead
var $div = this.find('.' + pname + clist),
$select = this.find('select');
data = normalizeData(data);
var opts = this.data(pname);
var mode = opts.mode;
if (!data) { // no data were given; get data from select options
if (opts.removeDuplicates) {
removeDupsjQ($options);
purifyOptions($options);
$options = this.find('select').children('option, optgroup'); // update after removal
}
if ($options.length == 0) {
// TODO restore, using $p.data(pname).key if provided instead
} else { // here are options:
$options.each(function() {
var $t = $(this);
var $p = $('');
$p.attr('title', $t.attr('title'));
if ($t.hasClass(pname + csep)) { // separator, not an option
if ($t.hasClass(pname + cpheader)) { // if header text also given then add only header
$div.append($p.addClass(pname + cpheader).text($t.text()));
} else { // else add separator itself
$p.addClass(pname + csep);
}
} else if (this.tagName.toLowerCase() == 'optgroup') {
var label = $t.attr('label');
var $innerOptions = $('option', this);
$t.before(''); // don't know why after doesn't work correctly
$t.after($innerOptions); // unwrap it
$t.remove(); // remove optgroup tag itself
$div.append(label ? $p.addClass(pname + cpheader).text(label) : $p.addClass(pname + csep));
$innerOptions.each(function() {
$div.append($('').attr('title', this.title).append($('').text($(this).text())).data('value', this.value));
});
return;
} else {
$p.append($('').text($t.text())).data('value', this.value);
if (mode == 'checkboxes') {
$p.prepend('');
}
}
$div.append($p);
});
}
} else { // fill directly from given data
if (opts.removeDuplicates) {
removeDups(data);
}
purifyData(data);
if (opts.sort) {
data.sort(sortF);
if (!opts.sortAsc) {
data.reverse();
}
}
if (!appendMode) {
$select.empty();
$div.empty();
this.children(cp + cvalue + ', ' + cp + cdisplay).val('');
} // TODO consider if appendMode == 2 is not a stupid piece of code
renderItems.call(this, data, appendMode == 2); // if appendMode == 2, then it is prepend
}
if (this.data(pname + '-init')) {
opts.callback.func.apply(this, opts.callback.args);
this.data(pname + '-init', false);
}
$options = this.find('select').children('option'); // update
if (!opts.empty) {
if (mode != 'checkboxes') {
this[pname]('val', $options.filter('option:selected:last').val());
} else {
var selectedValues = $options.filter(':selected').map(function() {
return $(this).val();
}).get();
this[pname]('val', selectedValues);
}
}
return this;
},
/**
* Removes all items from combobox (html-based removal)
* @returns {Object} jQuery object
*/
clear: function() { // TODO check why to or not to remove data itself
this.children('select').empty();
this.children(cp + clist).empty().width('');
this.children(cp + cdisplay).removeClass(pname + cinvalid);
this.children(cp + cddback).removeClass(pname + cddback + cinvalid);
return this;
},
/**
* Updates data without touching html items or gets the data.
* For updating combobox contents use fill method.
* @param {string} data
* @returns {Object} jQuery object
*/
data: function(data) { // this method is required because after setting new options
// via options method the data will be merged which probably will be wrong
if (arguments.length == 0) {
return this.data(pname).data;
} else {
this.data(pname).data = data;
}
return this;
},
/**
* Enables and disables combobox.
* @param {Boolean} b flag
* @returns {Object|Boolean} jQuery object or boolean desabled status.
*/
disabled: function(b) {
var mode = this.data(pname).mode;
if (arguments.length == 0) {
if (mode == 'checkboxes') {
return this.hasClass(pname + cdisabled);
} else { // default mode
return this.children(cp + cdisplay).prop('disabled');
}
}
b = !!b;
this.children(cp + cdisplay).prop('disabled', b);
if (b) {
this.addClass(pname + cdisabled);
this.children(cp + cddback + ', ' + cp + cddarr).hide();
} else {
this.removeClass(pname + cdisabled);
this.children(cp + cddback + ', ' + cp + cddarr).show();
}
return this;
},
/**
* Sets the tabindex attribute for search input.
* @param index
* @returns {Number|Object}
*/
tabindex: function(index) {
var $display = this.find(cp + cdisplay);
if (arguments.length == 0) {
return $display.attr('tabindex');
} else {
$display.attr('tabindex', index);
return this;
}
},
/**
* Resets options or see the options. Do not use this for changing data because merging is deep, so
* data may be merged instead of being replaced.
* For updating data use data method.
* @param {Object} options
* @returns {Object} jQuery object or options object
*/
options: function(options) {
if (arguments.length == 0) {
return this.data(pname);
}
$.extend(true, this.data(pname), toCamelCase(options));
return this;
},
/**
* Combobox value setter and getter.
* @param {String|Array} v value
* @returns {Object|String|Array} jQuery object or string/array combobox current value.
* Value returns as string in the default mode and as an array of values where items were
* checked in checkboxes mode.
* If combobox is disabled then empty string is returned.
*/ // TODO add the second parameter: flag if trigger changing the value (now it is triggering by default)
val: function(v) {
var opts = this.data(pname),
mode = opts.mode;
if (arguments.length == 0) { // get the value
if (mode == 'default') {
var value = this.find(cp + cvalue).val();
}
return mode == 'default' ?
(this.find(cp + cdisplay).is(':disabled') ? '' : value) :
(mode == 'checkboxes' ? getValues.call(this) : null);
} else { // set the value
if (mode == 'default') {
setValue.call(this, v);
} else if (mode == 'checkboxes') {
setValues.call(this, v);
}
}
return this;
},
open: function() {
slide.call(this.children(cp + clist), 'down');
return this;
},
close: function() {
slide.call(this.children(cp + clist), 'up');
return this;
},
/*
* Listeners.
* Call $('#combo').combobox('keyup', null, 'namespace');
* to trigger an event of specific namespace.
*/
change: function(callback, namespace) {
return bindOrTrig.call(this, 'change', this.children(cp + cvalue), callback, namespace);
},
focus: function(callback, namespace) {
return bindOrTrig.call(this, 'focus', this.children(cp + cdisplay), callback, namespace);
},
blur: function(callback, namespace) {
return bindOrTrig.call(this, 'blur', this.children(cp + cdisplay), callback, namespace);
},
keyup: function(callback, namespace) {
return bindOrTrig.call(this, 'keyup', this.children(cp + cdisplay), callback, namespace);
},
keydown: function(callback, namespace) {
return bindOrTrig.call(this, 'keydown', this.children(cp + cdisplay), callback, namespace);
},
keypress: function(callback, namespace) {
return bindOrTrig.call(this, 'keypress', this.children(cp + cdisplay), callback, namespace);
},
click: function(callback, namespace) {
return bindOrTrig.call(this, 'click', this.children(cp + cdisplay), callback, namespace);
},
mousedown: function(callback, namespace) {
return bindOrTrig.call(this, 'mousedown', this.children(cp + cdisplay), callback, namespace);
},
clickDropdown: function(callback, namespace) {
return bindOrTrig.call(this, 'click', this.children(cp + cddarr), callback, namespace);
},
toSelect: function() {
var $select = this.children('select').insertAfter(this);
if (this.data(pname).reassignId) {
$select.attr('id', this.attr('id'));
}
this.remove();
return $select;
},
displayDropdown: function(b) {
if (arguments.length) {
if (!!b) {
this.children(cp + cddarr + ', ' + cp + cddback).show();
} else {
this.children(cp + cddarr + ', ' + cp + cddback).hide();
}
} else {
if (this.data(pname).showDropdown) {
this.children(cp + cddarr + ', ' + cp + cddback).show();
} else {
this.children(cp + cddarr + ', ' + cp + cddback).hide();
}
}
return this;
},
placeholder: function(text) {
var $input = this.children(cp + cdisplay);
if (!arguments.length) {
return $input.attr('placeholder');
} else {
$input.attr('placeholder', text);
return this;
}
}
};
function bindOrTrig(type, $element, callback, namespace) {
if (typeof callback != 'function') { // trigger
var action = type + (typeof callback == 'string' ? '.' + callback : (typeof namespace == 'string' ? '.' + namespace : ''));
$element.trigger(action);
} else { // bind
addAdditionalListener.call($element, type, callback, namespace);
}
return this;
}
function addAdditionalListener(type, callback, namespace) {
var action = type + (typeof namespace == 'string' ? '.' + namespace : '');
this.bind(action, callback);
}
function getValues() { // for checkbox mode
return JSON.parse(this.find(cp + cvalue).val() || '[]');
}
/**
* Executes after checking a checkbox.
* this refers to combobox.
*/ // TODO remove duplicate code if possible
function updateValueInput() { // used for checkboxes mode only
var $paragraphs = $(this).find(cp + clist + ' p'),
$vInput = $(this).children(cp + cvalue),
arrV = [];
$paragraphs.each(function() {
var $p = $(this);
var $check = $p.find(':checkbox');
if ($check.prop('checked')) {
arrV.push($p.data('value'));
}
});
$(this).children('select').val(arrV);
$vInput.val(JSON.stringify(arrV));
}
function setValues(values) { // for checkboxes mode; this refers to combobox
var $paragraphs = $(this).find(cp + clist + ' p'),
$vInput = $(this).children(cp + cvalue),
arrV = [];
var $lastChecked;
for (var i = 0; i < $paragraphs.length; i++) {
var $p = $paragraphs.eq(i),
ind = values.indexOf($p.data('value'));
if (values.indexOf($p.data('value')) >= 0) {
$lastChecked = $p.find(':checkbox').prop('checked', true);
arrV.push(values[ind]);
} else {
$p.find(':checkbox').prop('checked', false);
}
}
$(this).children('select').val(values);
if ($lastChecked) {
$lastChecked.trigger(pname + '-chupdate', [true]);
$vInput.val(JSON.stringify(arrV));
}
}
function setValue(value) { // for default mode
var $t = $(this);
var O = this.data(pname);
var $select = $t.children('select'),
$valueInput = $t.children(cp + cvalue),
$display = $t.children(cp + cdisplay);
//find the option whose 'value' is (=) to the given value in the select element
var $selected = $select
.find('option')
.filter(function() {
return this.value == value;
});
$display.removeClass(pname + cinvalid).siblings(cp + cddback).removeClass(pname + cddback + cinvalid)
if (!$selected.length) { // no such value
$t.find(cp + clist + ' p').removeClass(pname + chovered);
$select.children().prop('selected', false);
if (!O.invalidAsValue) {
value = ''; // TODO make combobox return null instead of empty string (standard select behavior)
} else {
if (O.highlightInvalid || (O.invalidAsValue ? (O.highlightInvalid) : O.highlightInvalid === null)) {
$display.addClass(pname + cinvalid).siblings(cp + cddback)
.addClass(pname + cddback + cinvalid);
}
}
$valueInput.val(value);
$display.val(value);
return;
}
$t.find(cp + clist + ' p').eq($selected[0].index).addClass(pname + chovered).siblings().removeClass(pname + chovered);
$valueInput.val(value).data('changed', true);
$select.val(value).change();
}
/**
* Add all the combobox logic.
* @returns {undefined}
*/
var blurTimer;
function addListeners() {
if (this.data('listenersAdded')) { // prevent duplicating listeners
return;
}
var $T = this,
O = $T.data(pname);
var typingTimer = null;
this.on('keyup', cp + cdisplay + ', ' + cp + cdiv, function(e) { // filter
// Ignore keys that can't alter input field value on their own
if ([38, //Up arrow
40, //Down arrow
13, //Enter
27, //Escape
9, //Tab
37, //Left arrow
39, //Right arrow
17, //Ctrl
18, //Alt
16, //Shift
20, //Caps lock
33, //Page up
34, //Page down
35, //End
36 //Home
].indexOf(e.which) >= 0) {
return;
}
var doneTyping = function(e) {
// Some extra cases
if (!e.ctrlKey && !e.shiftKey && e.which == 45) return; //Insert without modifier
if (e.ctrlKey && e.which == 65) return; //Ctrl+A; imperfect because sometimes we release the A *after* the Ctrl
var fullMatch = O.fullMatch,
highlight = O.highlight;
if (fullMatch) {
highlight = highlight !== false;
} else {
highlight = !!highlight;
}
var $t = $(this),
search = this.value.trim();
if (O.filterIgnoreCase) {
search = search.toLowerCase();
}
if (O.filterIgnoreAccents && String.prototype.latinize) {
search = search.latinize();
}
var $div = $t.closest(cp).children(cp + clist);
slide.call($div, 'down', true);
var $options = $t.closest(cp).find('select option');
$(cp + ' ' + cp + clist).each(function() {
if ($div[0] != this) {
slide.call($(this), 'up');
}
});
if (!search) {
$div.children('p').show().each(function() {
$(cp + '-marker', this).contents().unwrap(); // remove selection
});
return;
}
var hideSelector = O.hideSeparatorsOnSearch ? 'p' : 'p:not(' + cp + csep + ', ' + cp + cpheader + ')';
$div.children(hideSelector).hide();
$options.each(function() {
var text = $(this).text().trim();
if (O.filterIgnoreCase) {
text = text.toLowerCase();
}
if (O.filterIgnoreAccents && String.prototype.latinize) {
text = text.latinize();
}
if (fullMatch ? text.indexOf(search) >= 0 : text.indexOf(search) == 0) {
// check index and show corresponding paragraph
var regexFlags = O.filterIgnoreCase ? 'i' : '';
var re = new RegExp("(" + search.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1") + ")", fullMatch ? regexFlags + 'g' : regexFlags);
var $ps = $div.children('p:eq(' + $options.index(this) + '):not(' + cp + csep + ', ' + cp + cpheader + ')').show();
if (highlight) {
$ps.each(function() {
$(cp + '-marker', this).contents().unwrap(); // remove previous selection
var mainSpan = $(cp + cmainspan, this)[0];
mainSpan.innerHTML = mainSpan.innerHTML.replace(re, '$1');
});
}
}
});
};
var t = this;
var delay = O.filterDelay;
if (!delay) {
doneTyping.call(t, e);
} else {
clearTimeout(typingTimer);
typingTimer = setTimeout(function() {
doneTyping.call(t, e);
}, delay);
}
});
this.on('keydown', cp + cdisplay, function(e) {
if ([38, 40, 13, 27, 9].indexOf(e.which) >= 0) {
if (e.which != 9) {
e.preventDefault();
}
var $combobox = $(this).closest(cp);
var $div = $combobox.children(cp + clist);
var $hovered = $(cp + chovered, $div[0]),
$curr, offset;
var $first = $('p:first', $div[0]);
var cycle = O.loopScrolling;
var notHeaderSelector = ':not(' + cp + csep + '):not(' + cp + cpheader + ')'; // don't put both classes in single parenthesis for old jQuery versions
} else {
return;
}
var fillOnArrow = O.mode == 'default' ? O.fillOnArrowPress : false; // always false for checkboxes mode
if ($div.is(':animated')) {
return; // keydown event is only for arrows, enter and escape
}
var v = this.value.trim();
v = (O.filterIgnoreCase) ? v.toLowerCase() : v;
var scrollTop = $div.scrollTop();
if (e.which == 40) { // arrdown
if ($div.is(':hidden')) {
slide.call($div, 'down');
return;
}
if ($hovered.length == 0) {
if ($first.is(':visible' + notHeaderSelector)) {
$curr = $first.addClass(pname + chovered);
} else {
$curr = $first.nextAll(':visible' + notHeaderSelector).first().addClass(pname + chovered);
}
} else {
if (!cycle) {
if (!$hovered.nextAll(':visible' + notHeaderSelector).first().length) {
return;
}
}
$curr = $hovered.removeClass(pname + chovered).nextAll(':visible' + notHeaderSelector).first().addClass(pname + chovered);
if ($curr.length == 0) {
if ($first.is(':visible')) {
$curr = $first.addClass(pname + chovered);
} else {
$curr = $first.nextAll(':visible' + notHeaderSelector).first().addClass(pname + chovered);
}
}
if ($curr.length == 0) {
$curr = $first;
}
offset = $curr.position().top - $div.position().top;
var currHeight = $curr.outerHeight();
if (offset + currHeight * 6 > $div.height()) { // keep 4 elements ahead
if ((offset + currHeight * 6) - $div.height() > currHeight * 1.5) { // $curr is under the visible bottom border
$div.scrollTop(scrollTop + offset);
} else { // no fix required
$div.scrollTop(scrollTop + currHeight); // incremental scrolltop
}
} else if (offset < 0) {
$div.scrollTop(scrollTop - -offset);
}
}
if (fillOnArrow) {
this.value = $curr.find(cp + cmainspan).text();
$combobox.children(cp + cdisplay).data('fillonarrow', true);
}
} else if (e.which == 38) { // arrup
if ($div.is(':visible')) {
if (!cycle && !$hovered.prevAll(':visible' + notHeaderSelector).first().length) {
return;
}
$curr = $hovered.removeClass(pname + chovered).prevAll(':visible' + notHeaderSelector).first().addClass(pname + chovered);
if ($curr.length == 0) {
$curr = $('p:visible' + notHeaderSelector + ':last', $div[0]).addClass(pname + chovered);
}
offset = $curr.position().top - $div.position().top;
currHeight = $curr.outerHeight();
if (offset < currHeight * 3) {
$div.scrollTop(scrollTop - -offset - currHeight * 3);
} else if (offset > $div.height() - currHeight * 3) {
$div.scrollTop(scrollTop + offset - currHeight * 3); // to the last (was $div[0].scrollHeight)
}
if (fillOnArrow) {
this.value = $curr.find(cp + cmainspan).text();
$combobox.children(cp + cdisplay).data('fillonarrow', true);
}
}
} else if (e.which == 13) { // enter
if (O.fillOnBlur) {
getFirstP($div).click();
return;
}
$div.children(cp + chovered).click();
if (O.mode == 'default') {
slide.call($div, 'up');
}
} else if (e.which == 27) { // escape
var $t = O.blurOnEscape ? $(this).blur() : $(this);
// If list is down, escape slides it up and doesn't propagate outward
if ($div.is(':visible')) {
slide.call($div, 'up');
e.stopPropagation();
}
} else if (e.which == 9) { // tab
if (O.fillOnTab) {
if (v) {
// Used to pick the first visible item in the dropdown
// Now pick the selected item (if any)
var $p = $div.children(cp + chovered);
if ($p.length) {
// e.preventDefault(); why not to go further?
$p.click();
}
}
}
}
});
this.on('change', 'select', function(e, checkboxesMode) { // someone triggered combobox select change
var $combo = $(this).closest(cp);
var dtext = $('option:selected', this).text();
$combo.children(cp + cdisplay).val(dtext).data('value', dtext);
var $valueInput = $combo.children(cp + cvalue);
if ($valueInput.data('changed')) {
$valueInput.data('changed', false);
return;
}
if (checkboxesMode) { // no slideup for checkboxes mode
updateValueInput.call($combo);
$valueInput.change();
return;
}
$valueInput.change();
slide.call($combo.children(cp + clist), 'up'); // can be triggered at the page load
});
this.on(pname + '-chupdate', cp + clist + ' p :checkbox', function(e, forRefresh) {
if (forRefresh) {
e.stopPropagation();
checkboxesModePClick.call($(this).parent(), e, true);
}
});
this.on('click', cp + clist + ' p', function(e) { // value selected by clicking
clearTimeout(blurTimer);
e.stopPropagation();
if ($(this).is(cp + csep + ', ' + cp + cpheader)) {
return;
}
$T.children(cp + cinvalid).removeClass(pname + cinvalid); // 100% it is not invalid now
$T.children(cp + cddback).removeClass(pname + cddback + cinvalid);
var $t = $(this),
$div = $t.parent(),
$ps = $div.children();
var index = $ps.index(this);
if ($T.data(pname).mode == 'checkboxes') {
checkboxesModePClick.call(this, e); // process checking
return;
}
var $select = $div.closest(cp).children('select');
$select.children('option').eq(index).prop('selected', true);
$select.siblings(cp + cvalue).val($select.val());
$select.change();
slide.call($t.parent(), 'up');
$t.addClass(pname + chovered).siblings().removeClass(pname + chovered);
});
this.on('blur', cp + cdisplay, function(e) {
// Need to do some stuff only when user moves off the scombobox.
// Try to do nothing in this handler if losing focus to another part of this
// combobox (e.g. the down/up button, or the list itself).
// IE needs this technique in addition to the timer one (see below) because
// clicking on the dropped-down div's scroller (if present) gives a blur
// but no suitable subsequent event with which to cancel the timer.
var $t = $(this);
var rt = $(e.relatedTarget).closest(cp);
if (rt.length > 0 && rt[0] === $t.closest(cp)[0]) {
return;
}
// The relatedTarget technique doesn't work on Chrome or on Firefox.
// So we start a 200ms timer when display element loses focus. In click
// handlers of control's other elements clearTimeout cancels the timer.
// If the timer isn't cancelled it will fire and do the necessary slide up.
// We can't defer all the blur processing with this timer as doing so would
// mean that a click event on a submit button could get an outdated value
// from the scombobox, because the click would precede the timer event.
//
// Note that the timer's function's bind() method is used to supply it with the correct 'this'
blurTimer = setTimeout(
function() {
var $t = $(this),
O = $T.data(pname);
if (this === document.activeElement) {
// Suppress autoexpand on next focus if this blur was actually the entire window losing focus
// rather than this element losing focus to another element on the same window
$t.data('silentfocus', true);
}
$t.data('fillonarrow', false); // Prevent the slide-up from resetting value
slide.call($t.closest(cp).children(cp + clist), 'up'); // Make sure the list closes when we're sure we've left the control
}.bind(this), 200
);
//Is this necessary here? Seems to cause issues when on Chrome (cannot select list items correctly.
//The usefulness of fillOnBlur is debated, see https://github.com/ivkremer/jquery-simple-combobox/issues/25
//Either remove it entirely, or move it into the setTimeout function above.
/*
if (O.fillOnBlur && !O.invalidAsValue) {
getFirstP($t.parent().children(cp + clist)).click();
return;
}
*/
var vOriginal = $t.val().trim();
var $valueInput = $t.siblings(cp + cvalue);
var previousV = $valueInput.val();
if (!vOriginal) { // if combo was emptied then set its value to '':
$valueInput.val('');
} else {
var value;
$t.siblings('select').find('option').each(function() {
if (O.filterIgnoreCase) {
if (vOriginal.toLowerCase() == $(this).text().trim().toLowerCase()) {
value = this.value;
}
} else {
if (vOriginal == $(this).text().trim()) {
value = this.value;
}
}
});
if (!value) { // value not found (invalid)
$valueInput.val(O.invalidAsValue ? vOriginal : '');
} else {
$valueInput.val(value);
}
}
if (previousV !== $valueInput.val()) {
$valueInput.change().data('changed', true);
}
});
this.on('focus', cp + cdisplay, function() {
// Check for indicator that focus shouldn't cause expansion
if ($(this).data('silentfocus')) {
$(this).data('silentfocus', false);
return;
}
if (!this.value.trim()) { // focusing in empty field
// should trigger full dropdown:
if (($T.data(pname).expandOnFocus) || ($(this).data('expandfocus'))) {
$(this).keyup();
}
} else { // input.display is not empty
if (($T.data(pname).expandOnFocusWithValue) || ($(this).data('expandfocus'))) {
if ($T[pname]('val')) { // if value is valid
var $listDiv = $T.children(cp + clist);
$listDiv.children().show();
slide.call($listDiv, 'down');
} else {
$(this).keyup(); // else start filtering
}
}
}
$(this).data('expandfocus', false);
});
this.on('click', cp + cdisplay + '-div', function() {
if ($T.data(pname).disabled) {
return;
}
slide.call($(this).siblings(cp + clist), 'down');
});
this.on('click', cp + cdisplay, function(e) {
var t = $(this).closest(cp)[0];
$(cp).each(function() { // close all other comboboxes
if (this != t) {
$(this)[pname]('close');
}
});
e.stopPropagation();
});
this.on('click', cp + cddarr, function(e) {
clearTimeout(blurTimer);
var $t = $(this),
$combo = $t.closest(cp);
var $div = $combo.children(cp + clist);
if ($div.is(':visible')) {
slide.call($div, 'up');
$combo.children(cp + cdisplay).data('silentfocus', true).focus();
} else {
$combo.children(cp + cdisplay).data('expandfocus', true).focus();
}
});
this.on('click', cp + cdiremove, function(e) {
clearTimeout(blurTimer);
e.stopPropagation();
var $t = $(this);
var $item = $t.parent(),
$div = $T.children(cp + clist);
$div.children('p').eq($t.data('index')).find(':checkbox').prop('checked', false);
$item.fadeOut(O.animation.duration);
$t.closest(cp).children('select').trigger('change', [true]);
});
// scroll listener is for ajax loading
if (O.autoLoad != $.noop) {
$(cp + clist, this).scroll(function() {
var $t = $(this),
$select = $T.children('select');
var currentScrollTop = $t.scrollTop();
var overhead = 50;
if (currentScrollTop > $t.data('scrollTop')) { // scrolling down
if (this.scrollHeight - currentScrollTop - overhead < $t.height()) {
if (!$T.data('pending')) {
$T.data('pending', true);
O.autoLoad.call($T, $select.find('option[value]:last').val(), 'bottom');
}
}
} else { // scrolling up
if (currentScrollTop < $t.height() / 2) {
if (!$T.data('pending')) {
$T.data('pending', true);
O.autoLoad.call($T, $select.find('option[value]:first').val(), 'top');
}
}
}
$t.data('scrollTop', currentScrollTop);
}).data('scrollTop', 0);
}
$(document).bind('click.' + pname, { thisIs: this }, function(e) {
slide.call($(e.data.thisIs).children(cp + clist), 'up');
});
this.data('listenersAdded', true);
}
/**
* Converts given data to final form in the most convenient way.
* @param {Array} data data given as options.data param
* @returns {Array|Boolean} array of data objects or false if no data were given
*/
function normalizeData(data) {
if (typeof data == 'string') { // json given
data = $.parseJSON(data);
if (data == null) { // null == empty array
return [];
}
}
if (!data) { // all falsy except empty string
return false;
}
if (!(data instanceof Array)) { // object (probably) was given, convert it to array
if (typeof data != 'object') {
return false;
}
if (typeof data.length == 'undefined') {
data.length = Object.keys(data).length;
}
data = [].slice.call(data);
}
return data; // array was given
}
function purifyData(data) {
for (var i = 0; i < data.length; i++) {
if ((!data[i].value || !data[i].text) && !(data[i].hasOwnProperty('separator'))) {
data.splice(i, 1);
}
}
}
function purifyOptions($options) {
for (var i = 0; i < $options.length; i++) {
if (!$options[i].value && !$($options[i]).hasClass(pname + csep) && $options[i].tagName.toLowerCase() != 'optgroup') { // if no value,
// but if it is a separator, then it is no matter if there is a not empty value
// if this is an optgroup tag, then it will be used as a separator
$($options[i]).remove();
}
}
}
function sortF(a, b) {
var aT = a.text.trim().toLowerCase(),
bT = b.text.trim().toLowerCase();
return aT > bT ? 1 : aT == bT ? 0 : -1;
}
function removeDups(a) {
for (var i = 0; i < a.length; i++) {
for (var j = i + 1; j < a.length; j++) {
if (!a[i] || !a[j])
continue;
if (a[i].value == a[j].value)
a.splice(i, 1);
}
}
}
function removeDupsjQ(a) {
for (var i = 0; i < a.length; i++) {
for (var j = i + 1; j < a.length; j++) {
if (!a[i] || !a[j])
continue;
if (a[i].value == a[j].value && a[i].tagName.toLowerCase() != 'optgroup') {
$(a[i]).remove();
}
}
}
}
/**
* `this` refers to combobox
*/
function checkForInvalid() {
var $display = this.children(cp + cdisplay),
$select = this.children('select'),
O = this.data(pname);
var value, v = $display.val().trim();
v = (O.filterIgnoreCase) ? v.toLowerCase() : v;
// check if such value exists in options
$select.find('option').each(function() {
var candidate = $(this).text().trim();
candidate = (O.filterIgnoreCase) ? candidate.toLowerCase() : candidate;
if (candidate == v) {
value = this.value;
}
});
var invalid = (!value && v);
if (invalid) {
if (O.forbidInvalid) {
$display.closest(cp).find(cp + cdisplay).val('').data('value', '');
} else {
// if highlightInvalid is enabled directly (default is null)
// or invalidAsValue is on and highlightInvalid is not its default:
// TODO refactor to make a more readable code:
if (O.highlightInvalid || (O.invalidAsValue ? (O.highlightInvalid) : O.highlightInvalid === null)) {
$display.addClass(pname + cinvalid).siblings(cp + cddback)
.addClass(pname + cddback + cinvalid);
}
}
if (!O.invalidAsValue) { // TODO check if this code affects anything
$display.siblings('select, ' + cp + cvalue).val('');
}
} else {
$display.removeClass(pname + cinvalid).siblings(cp + cddback).removeClass(pname + cddback + cinvalid);
}
}
/**
* Slides the div with a list. `this` refers to the list
* @param dir 'up' = collapse, 'down' = expand.
* @param backspace to fix backspace bug
*/ // TODO rename and comment backspace argument
function slide(dir, backspace) {
if (this.is(':animated') || !this.length) {
return;
}
if (dir == 'up' && this.is(':hidden') && this.length == 1) {
return; // todo put a comment: why? (one reason is probably optimization, but what is this.length == 1 for?)
}
var options = this.parent().data(pname).animation;
if (!$.easing[options.easing]) {
console.warn('no such easing: ' + options.easing);
options.easing = 'swing';
}
var $combobox = this.parent(),
O = $combobox.data(pname);
if (dir == 'up') {
O.beforeClose.call($combobox);
options.complete = function() {
if (O.mode != 'checkboxes') {
checkForInvalid.call($combobox);
}
O.afterClose.call($combobox);
};
this.slideUp(options).data('p-clicked-index', -1);
$combobox.children(cp + cddarr).removeClass(pname + cddarr + '-up');
} else {
O.beforeOpen.call($combobox);
options.complete = function() { O.afterOpen.call($combobox) };
this.slideDown(options);
$combobox.children(cp + cddarr).addClass(pname + cddarr + '-up');
// Every edit keystroke will call a slide down; use this opportunity to reset the list's display characteristics fully.
$combobox.find(cp + chovered).removeClass(pname + chovered); // remove previous selection
$(cp + '-marker', $combobox).contents().unwrap(); // remove previous highlight
// Reveal everything whenever we slide down, so that user gets to see all the options.
// If the slide down was triggered by entry of a character, filtering will immediately reduce the list
// to matching items. If the slide down was by clicking the down-button, or entry of cursor-down,
// all entries will remain displayed.
$combobox.children(cp + clist).children('p').show();
}
var $display = $combobox.children(cp + cdisplay); // code for fillOnArrowPress feature
$display.each(function() {
var $t = $(this);
if ($t.data('fillonarrow') && !backspace) { // fix backspace bug
$t.data('fillonarrow', false).val($t.data('value'));
}
// Highlight first full match when dropping down
if (dir == 'down') {
var search = this.value.trim();
if (O.filterIgnoreCase) {
search = search.toLowerCase();
}
var $selopts = $combobox.find('select option');
$selopts.each(function() {
var text = $(this).text().trim();
if (O.filterIgnoreCase) {
text = text.toLowerCase();
}
if (text == search) {
$combobox.children(cp + clist).children('p:eq(' + $selopts.index(this) + '):not(' + cp + csep + ', ' + cp + cpheader + ')').first().addClass(pname + chovered);
return false;
}
});
}
});
}
function checkboxesModePClick(e, forRefresh) { // this refers to paragraph dom element
var $t = $(this),
$combo = $t.closest(cp),
$div = $t.parent(),
$ps = $div.children('p'),
index = $ps.index(this),
duration = durations($div.parent().data(pname).animation.duration);
if (!forRefresh) {
var $chbox = $t.find(':checkbox');
// don't toggle prop('checked') if checkbox itself was clicked.
if (!$(e.target).is(':checkbox')) {
$chbox.prop('checked', !$chbox.prop('checked')); // avoid clicking, change prop instead
}
var choice = $chbox.prop('checked');
if (e.shiftKey) { // mark between last click and current
if ($div.data('p-clicked-index') >= 0) { // not for the first time
var f = $div.data('p-clicked-index');
var from = f < index ? f : index,
to = f < index ? index : f;
for (var i = from; i <= to; i++) {
$($ps[i]).find(':checkbox').prop('checked', choice);
}
}
}
}
var $dispDivHolder = $combo.find(cp + cdholder).prepend('');
$combo.find(cp + cdholder).fadeOut(duration / 5, function() {
$dispDivHolder.empty().show();
// get all selected properties
$ps.each(function(i) {
var $t = $(this);
if ($t.find(':checkbox').prop('checked')) {
$dispDivHolder.append(
$('').addClass(pname + cditem)
.append($('').addClass(pname + cditem + '-text').text($t.find(cp + cmainspan).text()))
.append($('').addClass(pname + cdiremove).text('×').data('index', i)).fadeIn(duration * 1.5)
.attr('title', $t.attr('title'))
);
}
});
$dispDivHolder.append('');
});
$div.data('p-clicked-index', index);
$t.closest(cp).children('select').trigger('change', [true]); // true for do not slideup the items div
}
/**
* @param items
* @param prepend flag if prepend instead of appending
*/
function renderItems(items, prepend) {
var settings = this.data(pname);
var $select = this.find('select'),
$div = this.find(cp + clist);
for (var i = 0; i < items.length; i++) {
if (items[i].hasOwnProperty('separator')) { // if separator given then
if (items[i].hasOwnProperty('header')) { // if header text also given then add only header
$p = $('').text(items[i].header);
} else { // else add separator itself
var $p = $('');
}
var $option = $('');
} else { // regular item
$option = $('').val(items[i].value).text(items[i].text).prop('selected', !!items[i].selected);
$p = settings.pFillFunc.call(this, items[i], settings);
if (settings.mode == 'checkboxes') {
$p.prepend('');
}
}
$p.data('value', items[i].value);
if (prepend) {
$select.prepend($option);
$div.prepend($p);
} else {
$select.append($option);
$div.append($p);
}
}
}
function getFirstP($clist) {
var $closestP = $clist.children(cp + chovered + ':visible');
if ($closestP.length == 0) {
$closestP = $clist.children(':visible:first');
}
return $closestP;
}
function toCamelCase(o) {
if (o == null) {
return null;
}
var keys = Object.keys(o);
for (var k = 0; k < keys.length; k++) {
var key = keys[k].replace(/-([a-z])/g, function(g) {
return g[1].toUpperCase() });
if (keys[k] != key) { // hyphened property
o[key] = o[keys[k]];
delete o[keys[k]];
}
if (typeof o[key] == 'object' && key != 'data') {
toCamelCase(o[key]);
}
}
return o;
}
/**
* The core.
* @param {Object|String} actOrOpts action (string) or options (object)
* @returns {Object|void} jQuery object on success. Throws error on undefined method.
*/
$.fn[pname] = function(actOrOpts) {
if (typeof actOrOpts == 'string') {
if (!this.length) { // method called on empty collection
$.error('Calling ' + pname + '.' + actOrOpts + '() method on empty collection');
}
if (this.data(pname + '-init') == null) { // it can be legally false, but not undefined
$.error('Calling ' + pname + '.' + actOrOpts + '() method prior to initialization');
}
var method = methods[actOrOpts];
if (!method) {
$.error('No such method: ' + actOrOpts + ' in jQuery.' + pname + '()');
}
} else if (['object', 'undefined'].indexOf(typeof actOrOpts) >= 0) {
var options = $.extend(true, {}, $.fn[pname].defaults, toCamelCase(actOrOpts));
} else {
$.error('Incorrect usage');
return this;
}
if (method) {
return method.apply(this, Array.prototype.slice.call(arguments, 1));
}
return this.each(function() {
var $t = $(this);
if ($t.parent().hasClass(pname)) {
return; // already initialized
}
if ($t.is('select')) {
$t.wrap('');
if (options.reassignId) {
$t.parent().attr('id', $t.attr('id'));
}
$t = $t.parent();
}
$t.data(pname, $.extend(true, {}, options)); // cloning object is required for cases like:
// $('multiple targets selector').combobox(settings)
// $('one of a bunch').combobox('options', propertiesToChange)
// If the options object is not cloned above,
// then changing properties will affect every target in the original set.
methods.init.apply($t);
});
};
$.fn[pname].defaults = {
/**
* If no data given combobox is filled relying on $('select option') list.
* By default (see pMarkup and pFillFunc) the data is an array of objects:
* {value: '', text: '', additional: '', selected: true/false, anyCustomOption: customValue}
* You can also provide json or object with enumerated properties:
* {0: {...}, 1: {...}, ...}
*/
data: null,
/**
* Whether combobox is empty by default (true) or has an original select value (usually it the first value,
* but can be changed by added a `selected` prop).
*/
empty: false,
/**
* Whether set required attribute.
*/
required: false,
/**
* Whether set combobox disabled.
*/
disabled: false,
/**
* Whether to sort options alphabetically or not
*/
sort: true,
/**
* false to sort descending
*/
sortAsc: true,
/**
* Whether to remove duplicates (regarding to values only).
* Not removing duplicated may cause an error, so be careful
*/
removeDuplicates: true,
/**
* Whether to match in any part of the option text or only start from the beginning of the text
*/
fullMatch: false,
/**
* By default highlighting is turned on when fullMatch is turned on.
* Set it strictly to false to disable it anyway or to any truthy value to set it always enabled
*/
highlight: null,
/**
* Whether to ignore case while filtering.
*/
filterIgnoreCase: true,
/**
* Whether to convert a needle and a haystack like 'Cajicá' or 'Hősök' to 'Cajica' and 'Hosok'.
*/
filterIgnoreAccents: false,
/**
* Whether to debounce search function, falsy value for no debounce.
*/
filterDelay: 0,
/**
* Hide separators when typing something in a combo.
*/
hideSeparatorsOnSearch: false,
/**
* When false options list does not drop down on focus (applies on an empty combobox).
* In this case you have to click on arrow to expand the list or start typing.
*/
expandOnFocus: true,
/**
* When false options list does not drop down on focus (applies on a filled combobox).
*/
expandOnFocusWithValue: true,
/**
* Set tabindex
*/
tabindex: null,
/**
* When true, invalid values are forbidden what means combobox search input empties on blur in case the value
* was not chosen and search field contained wrong text.
* When false, incorrect filled combobox search field will has invalid css class.
*/
forbidInvalid: false,
/**
* When true, then value from visible input will be a value returned by `$(combo).scombobox('val');`
*/
invalidAsValue: false,
/**
* Whether to mark a combobox with invalid value with red or not. By default it is turned on.
* When `invalidAsValue` option is set to true, `highlightInvalid` is considered false by default.
* If you want to enabled or disable it regardless to `invalidAsValue`, set it to a any truthy value or not null
* falsy value correspondingly.
*/
highlightInvalid: null,
/**
* If true id from select will be reassigned to the created combobox div when query target was select, like $('select').combobox()
*/
reassignId: true,
/**
* Combobox mode 'default' means it is looking like select box with input for searching.
* mode 'checkboxes' means every option has a checkbox. In checkboxes mode the value of
* combobox is an array of values which were checked.
*/
mode: 'default',
/**
* Don't forget to change pFillFunc if necessary when you change the markup.
* is required to use marker highlighting while typing. Highlighting is only working for the text
* in this span. That means filter does not apply to additional text. See data parameter.
*/
pMarkup: '${text}${additional}',
/**
* Change replacements lines in this function if necessary after changing pMarkup.
* this refers to combobox
* @param item {Object} item from data array
* @param options {Object} plugin instance properties
*/
pFillFunc: function(item, options) {
return $('').html(options.pMarkup
.replace('${text}', item.text)
.replace('${additional}', item.additional ? item.additional : '')
);
},
/**
* Animation settings.
*/
animation: {
duration: 'fast', // animation speed
easing: 'swing' // easing effect
},
/**
* Dropdown div max width
*/
listMaxWidth: window.screen.width / 2,
/**
* Use this to handle long text options lists.
* If true then long text options will take multiple lines. If false, then horizontal slider appears in list.
*/
wrap: true,
/**
* Items list div maximum height (css property)
*/
maxHeight: '',
/**
* Put main text in input while walking though the options with arrow keys
*/
fillOnArrowPress: true,
/**
* Select hovered or first matching option on blur
*/
fillOnBlur: false,
/**
* Blurs the search field on escape keypress
*/
blurOnEscape: false,
/**
* Whether to set the first visible item as a value on tab key press (works only if search input is not empty).
* If set to false then the default action is working (going to the next input on page).
*/
fillOnTab: true,
/**
* If set to true dropdown arrow appears in the right corner of combobox
*/
showDropDown: true,
/**
* Callback executes after finishing initialization.
*/
callback: {
func: $.noop, // this refers to combobox's div holder
args: [] // arguments
},
beforeOpen: $.noop,
beforeClose: $.noop,
afterOpen: $.noop,
afterClose: $.noop,
/**
* This option is for ajax loading (appending/prepending items). This function usage is:
* function(value, direction) {
* // value here is the edge value in the list (last for appending or first for prepending).
* // direction here is the scrolling direction, which can be either 'top' or 'bottom'
* // so you can do something like this:
* var $t = $(this);
* $.post('your url here' + (direction == 'top' ? '?prepend' : ''), {id: value}, function(res) {
* $t.scombobox('fill', res, direction == 'top' ? 2 : 1); // 1 for prepending, 2 for appending
* $t.data('pending', false); // this line is compulsory
* });
* }
*/
autoLoad: $.noop,
/**
* Enables infinite scrolling for up and down arrows keys.
* When autoLoad function provided then loopScrolling is set to false.
*/
loopScrolling: true,
/**
* Placeholder for search input.
*/
placeholder: ''
};
/**
* This function lets you override the default params without touching original plugin code.
* Usage: $().scombobox.extendDefaults(yourDefaults);
* @param options {Object} your custom defaults.
*/
$.fn[pname].extendDefaults = function(options) {
$.extend(true, $.fn[pname].defaults, options);
};
})(jQuery, document);PK ! L## includes/js/ai-adb.jsnu [ if (typeof ai_adb_action !== 'undefined') {
function ai_adb_process_content () {
// (function ($) {
// ***
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 1
// var ai_adb_debugging = false;
if (ai_adb_debugging) console.log ('');
if (ai_adb_debugging) console.log ("AI AD BLOCKING CONTENT PROCESSING", ai_adb_active);
// $(".AI_ADB_CONTENT_CSS_BEGIN_CLASS").each (function () {
// ***
document.querySelectorAll ('.' + ai_adb_content_css_begin_class).forEach ((el, index) => {
// var ai_adb_parent = $(this).parent ();
// ***
var ai_adb_parent = el.parentElement;
// if (ai_adb_parent.closest ('.ai-debug-block').length) {
// ***
if (ai_adb_parent.closest ('.ai-debug-block') != null) {
// ai_adb_parent = ai_adb_parent.parent ().parent ();
// ***
ai_adb_parent = ai_adb_parent.parentElement.parentElement;
}
// if (ai_adb_parent.closest ('.AI_FUNC_GET_BLOCK_CLASS_NAME') != null) {
if (ai_adb_parent.closest ('.' + ai_block_class) != null) {
// ai_adb_parent = ai_adb_parent.parent ();
// ***
ai_adb_parent = ai_adb_parent.parentElement;
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING parent", ai_adb_parent.prop ("tagName"), "id=\""+ ai_adb_parent.attr ("id")+"\"", "class=\""+ ai_adb_parent.attr ("class")+"\"");
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING parent", ai_adb_parent.tagName, ai_adb_parent.getAttribute ("id") != null ? "id=\""+ ai_adb_parent.getAttribute ("id")+"\"" :'', ai_adb_parent.getAttribute ("class") != null ? "class=\""+ ai_adb_parent.getAttribute ("class")+"\"":'');
// ***
var ai_adb_css = "display: none !important;";
if (typeof el.getAttribute ("data-css") != "undefined") {
// var ai_adb_css = $(this).data ("css");
// ***
ai_adb_css = el.dataset.css;
// if (typeof ai_adb_css == "undefined") ai_adb_css = "display: none !important;";
}
// var ai_adb_selectors = $(this).data ("selectors");
// if (typeof ai_adb_selectors == "undefined" || ai_adb_selectors == '') ai_adb_selectors = "p";
// ***
var ai_adb_selectors = "p";
if (el.getAttribute ("data-selectors") != null) {
var el_selectors = el.dataset.selectors;
if (el_selectors == '') el_selectors = "p";
ai_adb_selectors = el_selectors;
}
if (ai_adb_debugging) console.log ('AI AD BLOCKING CSS, css=\'' + ai_adb_css +'\'', "selectors='" + ai_adb_selectors + "'");
var ai_adb_action = false;
// $(ai_adb_parent).find ('.AI_ADB_CONTENT_CSS_BEGIN_CLASS, .AI_ADB_CONTENT_CSS_END_CLASS, ' + ai_adb_selectors).each (function () {
// ***
ai_adb_parent.querySelectorAll ('.' + ai_adb_content_css_begin_class +', .' + ai_adb_content_css_end_class + ', ' + ai_adb_selectors).forEach ((element, index) => {
// if ($(this).hasClass ("AI_ADB_CONTENT_CSS_BEGIN_CLASS")) {$(this).remove (); ai_adb_action = true;}
// ***
if (element.classList.contains (ai_adb_content_css_begin_class)) {element.remove (); ai_adb_action = true;}
// else if ($(this).hasClass ("AI_ADB_CONTENT_CSS_END_CLASS")) {$(this).remove (); ai_adb_action = false;}
// ***
else if (element.classList.contains (ai_adb_content_css_end_class)) {element.remove (); ai_adb_action = false;}
else if (ai_adb_action) {
// var ai_adb_style = $(this).attr ("style");
// ***
var ai_adb_style = element.getAttribute ("style");
if (ai_adb_style == null) ai_adb_style = "";
else {
ai_adb_style = ai_adb_style.trim ();
if (ai_adb_style != '' && ai_adb_style [ai_adb_style.length - 1] != ';') {
ai_adb_style = ai_adb_style + ';';
}
}
if (ai_adb_css != '') {
ai_adb_css = ' ' + ai_adb_css;
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING CSS:", $(this).prop ("tagName"), "id=\""+ $(this).attr ("id")+"\"", "class=\""+ $(this).attr ("class")+"\"");
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING CSS:", element.tagName, element.getAttribute ("id") != null ? "id=\""+ element.getAttribute ("id")+"\"":'', element.getAttribute ("class") != null ? "class=\""+ element.getAttribute ("class")+"\"":'');
// $(this).attr ("style", ai_adb_style + ' ' + ai_adb_css);
// ***
element.setAttribute ("style", ai_adb_style + ai_adb_css);
}
});
});
// $(".AI_ADB_CONTENT_DELETE_BEGIN_CLASS").each (function () {
// ***
document.querySelectorAll ('.' + ai_adb_content_delete_begin_class).forEach ((el, index) => {
// var ai_adb_parent = $(this).parent ();
// ***
var ai_adb_parent = el.parentElement;
// if (ai_adb_parent.closest ('.ai-debug-block').length) {
// ***
if (ai_adb_parent.closest ('.ai-debug-block') != null) {
// ai_adb_parent = ai_adb_parent.parent ().parent ();
// ***
ai_adb_parent = ai_adb_parent.parentElement.parentElement;
}
// if (ai_adb_parent.closest ('.AI_FUNC_GET_BLOCK_CLASS_NAME').length) {
// ***
if (ai_adb_parent.closest ('.' + ai_block_class) != null) {
// ai_adb_parent = ai_adb_parent.parent ();
// ***
ai_adb_parent = ai_adb_parent.parentElement;
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE, parent", ai_adb_parent.prop ("tagName"), "id=\""+ ai_adb_parent.attr ("id")+"\"", "class=\""+ ai_adb_parent.attr ("class")+"\"");
if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE, parent", ai_adb_parent.tagName, ai_adb_parent.getAttribute ("id") != null ? "id=\""+ ai_adb_parent.getAttribute ("id")+"\"":'', ai_adb_parent.getAttribute ("class") != null ? "class=\""+ ai_adb_parent.getAttribute ("class")+"\"":'');
// var ai_adb_selectors = $(this).data ("selectors");
// if (typeof ai_adb_selectors == "undefined" || ai_adb_selectors == '') ai_adb_selectors = "p";
// ***
var ai_adb_selectors = "p";
if (el.getAttribute ("data-selectors") != null) {
var el_selectors = el.dataset.selectors;
if (el_selectors == '') el_selectors = "p";
ai_adb_selectors = el_selectors;
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE, selectors='" + ai_adb_selectors + "'");
var ai_adb_action = false;
// $(ai_adb_parent).find ('.AI_ADB_CONTENT_DELETE_BEGIN_CLASS, .AI_ADB_CONTENT_DELETE_END_CLASS, ' + ai_adb_selectors).each (function () {
// ***
ai_adb_parent.querySelectorAll ('.' + ai_adb_content_delete_begin_class + ', .' + ai_adb_content_delete_end_class + ', ' + ai_adb_selectors).forEach ((element, index) => {
// if ($(this).hasClass ("AI_ADB_CONTENT_DELETE_BEGIN_CLASS")) {$(this).remove (); ai_adb_action = true;}
// ***
if (element.classList.contains (ai_adb_content_delete_begin_class)) {element.remove (); ai_adb_action = true;}
// else if ($(this).hasClass ("AI_ADB_CONTENT_DELETE_END_CLASS")) {$(this).remove (); ai_adb_action = false;}
// ***
else if (element.classList.contains (ai_adb_content_delete_end_class)) {element.remove (); ai_adb_action = false;}
else if (ai_adb_action) {
// if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE:", $(this).prop ("tagName"), "id=\""+ $(this).attr ("id")+"\"", "class=\""+ $(this).attr ("class")+"\"");
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE:", element.tagName, element.getAttribute ("id") != null ? "id=\""+ element.getAttribute ("id")+"\"":'', element.getAttribute ("class") != null ? "class=\""+ element.getAttribute ("class")+"\"":'');
// $(this).remove ();
// ***
element.remove ();
}
});
});
// $(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS").each (function () {
// ***
document.querySelectorAll ('.' + ai_adb_content_replace_begin_class).forEach ((el, index) => {
// var ai_adb_parent = $(this).parent ();
// ***
var ai_adb_parent = el.parentElement;
// if (ai_adb_parent.closest ('.ai-debug-block').length) {
// ***
if (ai_adb_parent.closest ('.ai-debug-block') != null) {
// ai_adb_parent = ai_adb_parent.parent ().parent ();
// ***
ai_adb_parent = ai_adb_parent.parentElement.parentElement;
}
// if (ai_adb_parent.closest ('.AI_FUNC_GET_BLOCK_CLASS_NAME').length) {
// ***
if (ai_adb_parent.closest ('.' + ai_block_class) != null) {
// ai_adb_parent = ai_adb_parent.parent ();
// ***
ai_adb_parent = ai_adb_parent.parentElement;
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE, parent", ai_adb_parent.prop ("tagName"), "id=\""+ ai_adb_parent.attr ("id")+"\"", "class=\""+ ai_adb_parent.attr ("class")+"\"");
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE, parent", ai_adb_parent.tagName, "id=\""+ ai_adb_parent.getAttribute ("id") != null ? ai_adb_parent.getAttribute ("id")+"\"":'', ai_adb_parent.getAttribute ("class") != null ? "class=\""+ ai_adb_parent.getAttribute ("class")+"\"":'');
// var ai_adb_text = $(this).data ("text");
// if (typeof ai_adb_text == "undefined") ai_adb_text = "";
// ***
var ai_adb_text = "";
if (el.getAttribute ("data-text") != null) {
ai_adb_text = el.dataset.text;
}
// var ai_adb_css = $(this).data ("css");
// if (typeof ai_adb_css == "undefined") ai_adb_css = "";
// ***
var ai_adb_css = "";
if (el.getAttribute ("data-css") != null) {
ai_adb_css = el.dataset.css;
}
// var ai_adb_selectors = $(this).data ("selectors");
// if (typeof ai_adb_selectors == "undefined" || ai_adb_selectors == '') ai_adb_selectors = "p";
// ***
var ai_adb_selectors = "p";
if (el.getAttribute ("data-selectors") != null) {
var el_selectors = el.dataset.selectors;
if (el_selectors == '') el_selectors = "p";
ai_adb_selectors = el_selectors;
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE, text=\'" + ai_adb_text + '\'', 'css=\'' + ai_adb_css +'\'', "selectors='" + ai_adb_selectors + "'");
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE, text=\'" + ai_adb_text + '\'', 'css=\'' + ai_adb_css +'\'', "selectors='" + ai_adb_selectors + "'");
var ai_adb_action = false;
// $(ai_adb_parent).find ('.AI_ADB_CONTENT_REPLACE_BEGIN_CLASS, .AI_ADB_CONTENT_REPLACE_END_CLASS, ' + ai_adb_selectors).each (function () {
ai_adb_parent.querySelectorAll ('.' + ai_adb_content_replace_begin_class + ', .' + ai_adb_content_replace_end_class + ', ' + ai_adb_selectors).forEach ((element, index) => {
// if ($(this).hasClass ("AI_ADB_CONTENT_REPLACE_BEGIN_CLASS")) {$(this).remove (); ai_adb_action = true;}
// ***
if (element.classList.contains (ai_adb_content_replace_begin_class)) {element.remove (); ai_adb_action = true;}
// else if ($(this).hasClass ("AI_ADB_CONTENT_REPLACE_END_CLASS")) {$(this).remove (); ai_adb_action = false;}
else if (element.classList.contains (ai_adb_content_replace_end_class)) {element.remove (); ai_adb_action = false;}
else if (ai_adb_action) {
if (ai_adb_text.length != 0) {
// var n = Math.round ($(this).text ().length / (ai_adb_text.length + 1));
// ***
var n = Math.round (element.innerText.length / (ai_adb_text.length + 1));
// $(this).text (Array(n + 1).join(ai_adb_text + ' ').trim ());
// ***
element.innerText = Array(n + 1).join(ai_adb_text + ' ').trim ();
// } else $(this).text ('');
// ***
} else element.innerText = '';
if (ai_adb_css != '') {
// var ai_adb_style = $(this).attr ("style");
// ***
var ai_adb_style = element.getAttribute ("style");
// if (typeof ai_adb_style == "undefined") ai_adb_style = "";
// ***
if (ai_adb_style == null) ai_adb_style = "";
else {
ai_adb_style = ai_adb_style.trim ();
if (ai_adb_style != '' && ai_adb_style [ai_adb_style.length - 1] != ';') {
ai_adb_style = ai_adb_style + ';';
}
}
if (ai_adb_css != '') {
ai_adb_css = ' ' + ai_adb_css;
}
// $(this).attr ("style", ai_adb_style + ai_adb_css);
// ***
element.setAttribute ("style", ai_adb_style + ai_adb_css);
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE:", $(this).prop ("tagName"), "id=\""+ $(this).attr ("id")+"\"", "class=\""+ $(this).attr ("class")+"\"");
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE:", element.tagName, element.getAttribute ("id") != null ? "id=\""+ element.getAttribute ("id")+"\"":'', element.getAttribute ("class") != null ? "class=\""+ element.getAttribute ("class")+"\"":'');
}
});
});
// }(jQuery));
// ***
}
function ai_adb_process_blocks (element) {
// (function ($) {
// ***
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 2
// var ai_adb_debugging = false;
if (typeof element == 'undefined') {
// element = $('body');
// ***
element = document.querySelector ('body');
if (ai_adb_debugging) console.log ('');
}
// Temp fix for jQuery elements
// ***
if (window.jQuery && window.jQuery.fn && element instanceof jQuery) {
if (element.hasOwnProperty ('0')) {
element = element [0];
} else element = [];
}
// if (window.jQuery && window.jQuery.fn && element instanceof jQuery) {
// // Convert jQuery object to array
// element = Array.prototype.slice.call (element);
// }
// var ai_adb_data = $(b64d ("Ym9keQ==")).attr (AI_ADB_ATTR_NAME);
// ***
var ai_adb_data = document.querySelector (b64d ("Ym9keQ==")).getAttribute (b64d (ai_adb_attribute));
if (typeof ai_adb_data === "string") {
var ai_adb_active = ai_adb_data == b64d ("bWFzaw==");
} else {
var ai_adb_active = null;
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions:", ai_adb_active, $(element).prop ("tagName") + '.' + $(element).attr ('class'));
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions:", ai_adb_active, element.tagName + element.getAttribute ('class') != null ? ('.' + element.getAttribute ('class')) : '');
if (typeof ai_adb_data === "string" && typeof ai_adb_active === "boolean") {
if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions checking");
if (ai_adb_active) {
var code_inserted = false;
do {
var code_insertion = false;
// Don't use data () as the value will be cached - wrong value for tracking
// $(".ai-adb-hide", element).each (function () {
// ***
element.querySelectorAll (".ai-adb-hide").forEach ((el, i) => {
// $(this).css ({"display": "none", "visibility": "hidden"});
// ***
el.style.display = 'none';
el.style.visibility = 'hidden';
// $(this).removeClass ('ai-adb-hide');
// ***
el.classList.remove ('ai-adb-hide');
// Disable tracking
// var wrapping_div = $(this).closest ('div[data-ai]');
// ***
var wrapping_div = el.closest ('div[data-ai]');
// if (typeof wrapping_div.attr ("data-ai") != "undefined") {
// ***
if (wrapping_div != null && el.hasAttribute ("data-ai")) {
// var data = JSON.parse (b64d (wrapping_div.attr ("data-ai")));
// ***
var data = JSON.parse (b64d (wrapping_div.getAttribute ("data-ai")));
if (typeof data !== "undefined" && data.constructor === Array) {
data [1] = "";
if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING ", b64d (wrapping_div.getAttribute ("data-ai")), ' <= ', JSON.stringify (data));
// wrapping_div.attr ("data-ai", b64e (JSON.stringify (data)));
// ***
wrapping_div.setAttribute ("data-ai", b64e (JSON.stringify (data)));
}
}
// ai_disable_processing ($(this));
ai_disable_processing (el);
if (ai_adb_debugging) {
// var debug_info = $(this).data ("ai-debug");
// console.log ("AI AD BLOCKING HIDE", typeof debug_info != "undefined" ? debug_info : "");
// ***
console.log ("AI AD BLOCKING HIDE", 'aiDebug' in el.dataset ? el.dataset.aiDebug : "");
}
});
// after hide to update tracking data on replace
// Don't use data () as the value will be cached - wrong value for tracking
// $(".ai-adb-show", element).each (function () {
// ***
element.querySelectorAll (".ai-adb-show").forEach ((el, i) => {
// $(this).css ({"display": "block", "visibility": "visible"});
// ***
el.style.display = 'block';
el.style.visibility = 'visible';
// $(this).removeClass ('ai-adb-show');
// ***
el.classList.remove ('ai-adb-show');
// if (typeof $(this).data ('code') != 'undefined') {
// ***
if ('code' in el.dataset) {
// var adb_code = b64d ($(this).data ('code'));
// ***
var adb_code = b64d (el.dataset.code);
if (ai_adb_debugging) console.log ('AI AD BLOCKING SHOW INSERT CODE');
if (ai_adb_debugging) console.log ('');
// $(this).append (adb_code);
el.innerHTML += adb_code;
code_insertion = true;
code_inserted = true;
// Process rotations to set versions before tracking data is set
if (typeof ai_process_elements == 'function') {
ai_process_elements ();
}
}
// var tracking_data = $(this).attr ('data-ai-tracking');
// if (typeof tracking_data != 'undefined') {
if (el.hasAttribute ('data-ai-tracking')) {
// ***
var tracking_data = el.getAttribute ('data-ai-tracking');
var wrapping_div = el.closest ('div[data-ai]');
// if (typeof wrapping_div.attr ("data-ai") != "undefined") {
// ***
if (wrapping_div.hasAttribute ("data-ai")) {
// if ($(this).hasClass ('ai-no-tracking')) {
// ***
if (el.classList.contains ('ai-no-tracking')) {
// var data = JSON.parse (b64d (wrapping_div.attr ("data-ai")));
// ***
var data = JSON.parse (b64d (wrapping_div.getAttribute ("data-ai")));
if (typeof data !== "undefined" && data.constructor === Array) {
data [1] = "";
tracking_data = b64e (JSON.stringify (data));
}
}
// if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING ", b64d (wrapping_div.attr ("data-ai")), ' <= ', b64d (tracking_data));
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING ", b64d (wrapping_div.getAttribute ("data-ai")), ' <= ', b64d (tracking_data));
// wrapping_div.attr ("data-ai", tracking_data);
// ***
wrapping_div.setAttribute ("data-ai", tracking_data);
}
}
if (ai_adb_debugging) {
// var debug_info = $(this).data ("ai-debug");
// console.log ("AI AD BLOCKING SHOW", typeof debug_info != "undefined" ? debug_info : "");
// ***
console.log ("AI AD BLOCKING SHOW", 'aiDebug' in el.dataset ? el.dataset.aiDebug : "");
}
});
} while (code_insertion);
setTimeout (function() {
if (typeof ai_process_impressions == 'function' && ai_tracking_finished == true) {
ai_process_impressions ();
}
if (typeof ai_install_click_trackers == 'function' && ai_tracking_finished == true) {
ai_install_click_trackers ();
}
}, 15);
setTimeout (ai_adb_process_content, 10);
} else {
// Prevent tracking if block was not displayed because of cookie
// $(".ai-adb-hide", element).each (function () {
// ***
element.querySelectorAll ('.ai-adb-hide').forEach ((el, index) => {
// if (ai_adb_debugging) console.log ('AI ai-adb-hide', $(this), $(this).outerHeight (), $(this).closest ('.ai-adb-show').length);
// ***
if (ai_adb_debugging) console.log ('AI ai-adb-hide', el, el.offsetHeight, el.closest ('.ai-adb-show') != null);
// $(this).removeClass ('ai-adb-hide');
// ***
el.classList.remove ('ai-adb-hide');
// if ($(this).outerHeight () == 0 && $(this).closest ('.ai-adb-show').length == 0) {
// ***
if (el.offsetHeight == 0 && el.closest ('.ai-adb-show') != null) {
// Top level (not nested) block
// var wrapper = $(this).closest ('div[data-ai]');
// ***
var wrapper = el.closest ('div[data-ai]');
// if (typeof wrapper.attr ("data-ai") != "undefined") {
// ***
if (wrapper.hetAttribute ("data-ai")) {
// var data = JSON.parse (b64d (wrapper.attr ("data-ai")));
// ***
var data = JSON.parse (b64d (wrapper.getAttribute ("data-ai")));
if (typeof data !== "undefined" && data.constructor === Array) {
data [1] = "";
// if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING DISABLED: ", b64d (wrapper.attr ("data-ai")), ' <= ', JSON.stringify (data));
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING DISABLED: ", b64d (wrapper.getAttribute ("data-ai")), ' <= ', JSON.stringify (data));
// wrapper.attr ("data-ai", b64e (JSON.stringify (data)));
// ***
wrapper.setAttribute ("data-ai", b64e (JSON.stringify (data)));
// Hide block (wrapping div with margin)
// wrapper.addClass ('ai-viewport-0').css ("display", "none");
// ***
wrapper.classList.add ('ai-viewport-0');
wrapper.style.display = 'none';
}
}
}
});
// $(".ai-adb-show", element).each (function () {
// ***
element.querySelectorAll ('.ai-adb-show').forEach ((el, index) => {
// ai_disable_processing ($(this));
// ***
ai_disable_processing (el);
// $(this).removeClass ('ai-adb-show');
// ***
el.classList.remove ('ai-adb-show');
// if (ai_adb_debugging) console.log ('AI AD BLOCKING SHOW disable processing', $(this).prop ("tagName") + '.' + $(this).attr ('class'));
// ***
if (ai_adb_debugging) console.log ('AI AD BLOCKING SHOW disable processing', el.tagName + el.getAttribute ('class') != null ? ('.' + el.getAttribute ('class')) : '');
});
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions END");
// }(jQuery));
// ***
}
ai_adb_detection_type_log = function (n) {
var type = ai_adb_detection_type (n);
// var ai_adb_events = jQuery('#ai-adb-events');
// ***
var ai_adb_events = document.querySelector ('#ai-adb-events');
// if (ai_adb_events.count != 0) {
// ***
if (ai_adb_events != null) {
// var message = ai_adb_events.text ();
// ***
var message = ai_adb_events.innerText;
if (message != '') message = message + ', '; else message = message + ', EVENTS: ';
message = message + n;
// ai_adb_events.text (message);
// ***
ai_adb_events.innerText = message;
}
return type;
}
ai_adb_detection_type = function (n) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 3
// var ai_adb_debugging = false;
if (ai_adb_debugging) {
switch (n) {
case 0:
return "0 debugging";
break;
case 1:
return "1 ads create element";
break;
case 2:
return "2 sponsors window var";
break;
case 3:
return "3 banner element";
break;
case 4:
return "4 custom selectors";
break;
case 5:
return "5 ga";
break;
case 6:
return "6 media.net";
break;
case 7:
return "7 adsense";
break;
case 8:
return "8 doubleclick.net";
break;
case 9:
return "9 fun adblock 3";
break;
case 10:
return "10 fun adblock 4";
break;
case 11:
return "11 banner js";
break;
case 12:
return "12 300x250 js";
break;
case 13:
return "13 amazon-adsystem";
break;
case 14:
return "14 quantserve.com";
break;
default:
return n;
break;
}
} else return '';
}
var ai_adb_detected = function (n) {
function waitForScript () {
// AiCookies might be defined in an external script loaded after adb code runs
if (typeof AiCookies !== "undefined"){
setTimeout (function () {
ai_adb_detected_actions (n);
}, 2);
} else {
setTimeout (waitForScript, 250);
}
}
// setTimeout (function() {
// ai_adb_detected_actions (n);
// }, 2);
waitForScript ();
}
var ai_disable_processing = function (element) {
// jQuery(element).find ('.ai-lazy').removeClass ('ai-lazy'); // Disable lazy loading
// jQuery(element).find ('.ai-manual').removeClass ('ai-manual'); // Disable manual loading
// jQuery(element).find ('.ai-rotate').removeClass ('ai-unprocessed').removeAttr ('data-info'); // Disable rotations
// jQuery(element).find ('.ai-list-data').removeClass ('ai-list-data'); // Disable lists
// jQuery(element).find ('.ai-ip-data').removeClass ('ai-ip-data'); // Disable IP lists
// jQuery(element).find ('[data-code]').removeAttr ('data-code'); // Disable insertions
// ***
document.querySelectorAll ('.ai-lazy').forEach ((el, index) => {el.classList.remove ('ai-lazy');}); // Disable lazy loading
document.querySelectorAll ('.ai-manual').forEach ((el, index) => {el.classList.remove ('ai-manual');}); // Disable manual loading
document.querySelectorAll ('.ai-rotate').forEach ((el, index) => {el.classList.remove ('ai-unprocessed'); el.removeAttribute ('data-info');}); // Disable rotations
document.querySelectorAll ('.ai-list-data').forEach ((el, index) => {el.classList.remove ('ai-list-data');}); // Disable lists
document.querySelectorAll ('.ai-ip-data').forEach ((el, index) => {el.classList.remove ('ai-ip-data');}); // Disable IP lists
document.querySelectorAll ('[data-code]').forEach ((el, index) => {el.removeAttribute ('data-code');}); // Disable insertions
}
var ai_adb_detected_actions = function (n) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 4
// var ai_adb_debugging = false;
// Temp fix for jQuery elements
// ***
if (window.jQuery && window.jQuery.fn && ai_adb_overlay instanceof jQuery) {
if (ai_adb_overlay.hasOwnProperty ('0')) {
ai_adb_overlay = ai_adb_overlay [0];
} else ai_adb_overlay = [];
}
if (ai_adb_message_window.hasOwnProperty ('0')) {
ai_adb_message_window = ai_adb_message_window [0];
}
if (ai_adb_debugging && n == 0) console.log ('');
if (ai_adb_debugging) console.log ("AI AD BLOCKING DETECTED", ai_adb_detection_type_log (n));
if (!ai_adb_active) {
ai_adb_active = true;
// jQuery(b64d ("Ym9keQ==")).attr (AI_ADB_ATTR_NAME, b64d ("bWFzaw=="));
// ***
document.querySelector (b64d ("Ym9keQ==")).setAttribute (b64d (ai_adb_attribute), b64d ("bWFzaw=="));
// (function ($) {
// ***
// $(window).ready(function () {
// ai_adb_process_blocks ();
//// if (code_inserted && typeof ai_process_elements == 'function') {
//// setTimeout (ai_process_elements, 20);
//// }
// });
// ***
function ai_ready_ProcessElements () {
ai_adb_process_blocks ();
// if (code_inserted && typeof ai_process_elements == 'function') {
// setTimeout (ai_process_elements, 20);
// }
}
ai_ready (ai_ready_ProcessElements);
if (ai_adb_debugging) console.log ("AI AD BLOCKING action check");
// AiCookies.remove (ai_adb_pgv_cookie_name, {path: "/"});
// Disable action for bots
if (typeof MobileDetect !== "undefined") {
var md = new MobileDetect (window.navigator.userAgent);
if (ai_adb_debugging) console.log ('AI AD BLOCKING IS BOT:', md.is ('bot'));
if (md.is ('bot')) {
ai_adb_action = 0;
}
}
if (ai_adb_page_views != '') {
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_views);
if (ai_adb_page_views.includes (',')) {
var ai_adb_page_view_parts = ai_adb_page_views.split (',');
var ai_adb_page_view_delay = parseInt (ai_adb_page_view_parts [0]);
var ai_adb_page_view_repeat = parseInt (ai_adb_page_view_parts [1]);
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_view_delay, "repeat:", ai_adb_page_view_repeat);
} else {
var ai_adb_page_view_delay = parseInt (ai_adb_page_views);
var ai_adb_page_view_repeat = 0
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_view_delay);
}
var ai_adb_page_view_counter = 1;
var cookie = AiCookies.get (ai_adb_pgv_cookie_name);
if (typeof cookie != "undefined") ai_adb_page_view_counter = parseInt (cookie) + 1;
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views cookie:", cookie, "- page view:", ai_adb_page_view_counter);
if (ai_adb_page_view_counter <= ai_adb_page_view_delay) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING", ai_adb_page_view_delay, "page views not reached, no action");
AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
window.ai_d1 = ai_adb_page_view_counter;
// window.AI_ADB_STATUS_MESSAGE=1;
ai_adb_message_code_1 ();
return;
}
if (ai_adb_page_view_repeat != 0) {
AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
if ((ai_adb_page_view_counter - ai_adb_page_view_delay - 1) % ai_adb_page_view_repeat != 0) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING every", ai_adb_page_view_repeat, "page views, no action");
window.ai_d1 = ai_adb_page_view_counter;
// window.AI_ADB_STATUS_MESSAGE=1;
ai_adb_message_code_1 ();
return;
}
}
}
if (ai_adb_message_cookie_lifetime != 0 && (ai_adb_action != 1 || !ai_adb_message_undismissible)) {
var cookie = AiCookies.get (ai_adb_act_cookie_name);
if (ai_adb_debugging) console.log ("AI AD BLOCKING cookie:", cookie);
if (typeof cookie != "undefined" && cookie == ai_adb_cookie_value) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING valid cookie detected, no action");
// window.AI_ADB_STATUS_MESSAGE=2;
ai_adb_message_code_2 ();
return;
}
else if (ai_adb_debugging) console.log ("AI AD BLOCKING invalid cookie");
AiCookies.set (ai_adb_act_cookie_name, ai_adb_cookie_value, {expires: ai_adb_message_cookie_lifetime, path: "/"});
} else
AiCookies.remove (ai_adb_act_cookie_name, {path: "/"});
if (ai_adb_debugging) console.log ("AI AD BLOCKING action", ai_adb_action);
if (ai_adb_action == 0) {
ai_dummy = 16; // Do not remove - to prevent optimization
// window.AI_ADB_STATUS_MESSAGE=6;
ai_adb_message_code_6 ();
ai_dummy ++; // Do not remove - to prevent optimization
} else {
// window.AI_ADB_STATUS_MESSAGE=3;
ai_adb_message_code_3 ();
ai_dummy = 13; // Do not remove - to prevent optimization
}
switch (ai_adb_action) {
case 1:
if (!ai_adb_message_undismissible) {
// ai_adb_overlay.click (function () {
// ***
ai_adb_overlay.addEventListener ('click', (event) => {
// $(this).remove();
// ***
ai_adb_overlay.remove ();
ai_adb_message_window.remove ();
});
// ai_adb_message_window.click (function () {
// ***
ai_adb_message_window.addEventListener ('click', (event) => {
// $(this).remove();
// ***
ai_adb_message_window.remove ();
ai_adb_overlay.remove ();
});
// window.onkeydown = function( event ) {
// ***
window.addEventListener ('keydown', (event) => {
if (event.keyCode === 27 ) {
ai_adb_overlay.click ();
ai_adb_message_window.click ();
}
});
if (ai_adb_debugging) console.log ("AI AD BLOCKING MESSAGE click detection installed");
} else {
// AiCookies.remove (ai_adb_act_cookie_name, {path: "/"});
// ai_adb_overlay.find ('[style*="cursor"]').css ("cursor", "no-drop");
// ai_adb_message_window.find ('[style*="cursor"]').css ("cursor", "no-drop");
// ***
ai_adb_overlay.querySelectorAll ('[style*="cursor"]').forEach ((el, index) => {
el.style.cursor = 'no-drop';
});
ai_adb_message_window.querySelectorAll ('[style*="cursor"]').forEach ((el, index) => {
el.style.cursor = 'no-drop';
});
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING MESSAGE");
// var body_children = $(b64d ("Ym9keQ==")).children ();
// body_children.eq (Math.floor (Math.random() * body_children.length)).after (ai_adb_overlay);
// body_children.eq (Math.floor (Math.random() * body_children.length)).after (ai_adb_message_window);
// ***
var body_children = document.querySelector (b64d ("Ym9keQ==")).children;
insertAfter (ai_adb_overlay, body_children.item (Math.floor (Math.random () * body_children.length)));
insertAfter (ai_adb_message_window, body_children.item (Math.floor (Math.random () * body_children.length)));
break;
case 2:
if (ai_adb_redirection_url != "") {
if (ai_adb_debugging) console.log ("AI AD BLOCKING REDIRECTION to", ai_adb_redirection_url);
var redirect = true;
if (ai_adb_redirection_url.toLowerCase().substring (0, 4) == "http") {
if (window.location.href == ai_adb_redirection_url) var redirect = false;
} else {
if (window.location.pathname == ai_adb_redirection_url) var redirect = false;
}
if (redirect) {
var cookie = AiCookies.get (ai_adb_page_redirection_cookie_name);
if (typeof cookie == "undefined") {
var date = new Date();
date.setTime (date.getTime() + (10 * 1000));
AiCookies.set (ai_adb_page_redirection_cookie_name, window.location.href, {expires: date, path: "/"});
if (ai_adb_redirection_url.substr (ai_adb_redirection_url.length - 1) == "?") {
ai_adb_redirection_url = ai_adb_redirection_url.slice (0, - 1);
ai_adb_redirection_url = ai_adb_redirection_url + location.search;
if (ai_adb_debugging) console.log ("AI AD BLOCKING redirection using query parameters:", location.search);
}
window.location.replace (ai_adb_redirection_url)
} else {
if (ai_adb_debugging) console.log ("AI AD BLOCKING no redirection, cookie:", cookie);
}
} else {
if (ai_adb_debugging) console.log ("AI AD BLOCKING already on page", window.location.href);
AiCookies.remove (ai_adb_page_redirection_cookie_name, {path: "/"});
}
}
break;
}
// }(jQuery));
// ***
}
}
var ai_adb_undetected = function (n) {
setTimeout (function() {
if (!ai_adb_active) {
ai_adb_undetected_actions (n);
}
}, 200);
}
var ai_adb_undetected_actions = function (n) {
ai_adb_counter ++;
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 5
// var ai_adb_debugging = false;
// if (ai_adb_debugging && n == 1) console.log ('');
if (ai_adb_debugging) console.log ("AI AD BLOCKING not detected:", '(' + ai_adb_counter + ')', ai_adb_detection_type (n));
if (!ai_adb_active && ai_adb_counter == 4) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING NOT DETECTED");
// jQuery(b64d ("Ym9keQ==")).attr (AI_ADB_ATTR_NAME, b64d ("Y2xlYXI="));
// ***
document.querySelector (b64d ("Ym9keQ==")).setAttribute (b64d (ai_adb_attribute), b64d ("Y2xlYXI="));
ai_dummy = 11; // Do not remove - to prevent optimization
// window.AI_ADB_STATUS_MESSAGE=4; // Check replacement code {}
ai_adb_message_code_4 ();
ai_dummy = 14; // Do not remove - to prevent optimization
// // Prevent tracking if block was not displayed because of cookie
// jQuery(".ai-adb-hide").each (function () {
// if (ai_adb_debugging) console.log ('AI ai-adb-hide', jQuery(this), jQuery(this).outerHeight (), jQuery(this).closest ('.ai-adb-show').length);
// if (jQuery(this).outerHeight () == 0 && jQuery(this).closest ('.ai-adb-show').length == 0) {
// // Top level (not nested) block
// var wrapper = jQuery(this).closest ('div[data-ai]');
// if (typeof wrapper.attr ("data-ai") != "undefined") {
// var data = JSON.parse (b64d (wrapper.attr ("data-ai")));
// if (typeof data !== "undefined" && data.constructor === Array) {
// data [1] = "";
// if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING DISABLED: ", b64d (wrapper.attr ("data-ai")), ' <= ', JSON.stringify (data));
// wrapper.attr ("data-ai", b64e (JSON.stringify (data)));
// // Hide block (wrapping div with margin)
// wrapper.addClass ('ai-viewport-0').css ("display", "none");
// }
// }
// }
// });
// jQuery(".ai-adb-show").each (function () {
// ai_disable_processing (jQuery (this));
// });
ai_adb_process_blocks ();
// var redirected_page = false;
// if (ai_adb_redirection_url.toLowerCase().substring (0, 4) == "http") {
// if (window.location.href == ai_adb_redirection_url) var redirected_page = true;
// } else {
// if (window.location.pathname == ai_adb_redirection_url) var redirected_page = true;
// }
// if (redirected_page) {
// //var cookie = jQuery.cookie (ai_adb_page_redirection_cookie_name);
// var cookie = AiCookies.get (ai_adb_page_redirection_cookie_name);
// if (typeof cookie != "undefined" && cookie.toLowerCase().substring (0, 4) == "http") {
// if (ai_adb_debugging) console.log ("AI AD BLOCKING returning to", cookie);
// //jQuery.removeCookie (ai_adb_page_redirection_cookie_name, {path: "/"});
// AiCookies.remove (ai_adb_page_redirection_cookie_name, {path: "/"});
// window.location.replace (cookie);
// }
// }
}
}
//if (AI_DBG_AI_DEBUG_AD_BLOCKING) jQuery (document).ready (function () {ai_adb_detected (0)});
// ***
if (AI_DBG_AI_DEBUG_AD_BLOCKING) ai_ready (function () {ai_adb_detected (0);});
//jQuery (document).ready (function ($) {
// $(window).ready (function () {
// ***
function ai_adb_checks () {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 6
// var ai_adb_debugging = false;
// var ai_debugging_active = typeof ai_adb_fe_dbg !== 'undefined';
ai_debugging_active = typeof ai_adb_fe_dbg !== 'undefined';
setTimeout (function () {
// $("#ai-adb-bar").click (function () {
// ***
if (document.querySelector ('#ai-adb-bar') != null)
document.querySelector ('#ai-adb-bar').addEventListener ('click', (event) => {
AiCookies.remove (ai_adb_act_cookie_name, {path: "/"});
AiCookies.remove (ai_adb_pgv_cookie_name, {path: "/"});
// window.AI_ADB_STATUS_MESSAGE=5;
ai_adb_message_code_5 ();
ai_dummy = 15; // Do not remove - to prevent optimization
});
}, 5);
// if (jQuery("#banner-advert-container").length) {
// if ($("#banner-advert-container img").length > 0) {
// if ($("#banner-advert-container img").outerHeight() === 0) {
// if (!ai_adb_active || ai_debugging_active) ai_adb_detected (3);
// } else ai_adb_undetected (3);
// $("#banner-advert-container img").remove();
// }
// }
if ((!ai_adb_active || ai_debugging_active) && ai_adb_selectors != "") {
var ai_adb_el_counter = 0;
var ai_adb_el_zero = 0;
var ai_adb_selector = ai_adb_selectors.split (",");
// $.each (ai_adb_selector, function (i) {
// ***
ai_adb_selector.forEach ((el, i) => {
ai_adb_selector [i] = ai_adb_selector [i].trim ();
if (ai_adb_debugging) console.log ("AI AD BLOCKING selector", ai_adb_selector [i]);
// if ($(ai_adb_selector [i]).length != 0) {
// ***
if (document.querySelector (ai_adb_selector [i]) != null) {
// $(ai_adb_selector [i]).each (function (n) {
// ***
// var document.querySelectorAll (ai_adb_selector [i]);
document.querySelectorAll (ai_adb_selector [i]).forEach ((el, index) => {
// var outer_height = $(this).outerHeight ();
// ***
var outer_height = el.offsetHeight;
// if (ai_adb_debugging) console.log ("AI AD BLOCKING element id=\"" + $(this).attr ("id") + "\" class=\"" + $(this).attr ("class") + "\" heights:", $(this).outerHeight (), $(this).innerHeight (), $(this).height ());
// ***
if (ai_adb_debugging) console.log ("AI AD BLOCKING element", el.getAttribute ("id") != null ? (" id=\"" + el.getAttribute ("id") + "\"") : '', el.getAttribute ("class") != null ? (" class=\"" + el.getAttribute ("class") + "\"") : '', "heights:", el.offsetHeight, el.clientHeight);
// var ai_attributes = $(this).find ('.ai-attributes');
// if (ai_attributes.length) {
// ai_attributes.each (function (){
// if (ai_adb_debugging) console.log ("AI AD BLOCKING attributes height:", $(this).outerHeight ());
// if (outer_height >= $(this).outerHeight ()) {
// outer_height -= $(this).outerHeight ();
// }
// });
// }
// ***
el.querySelectorAll ('.ai-attributes').forEach ((element, index) => {
if (ai_adb_debugging) console.log ("AI AD BLOCKING attributes height:", element.offsetHeight);
if (outer_height >= element.offsetHeight) {
outer_height -= element.offsetHeight;
}
});
if (ai_adb_debugging) console.log ("AI AD BLOCKING effective height:", outer_height);
ai_adb_el_counter ++;
if (outer_height === 0) {
// $ (document).ready (function () {if (!ai_adb_active || ai_debugging_active) ai_adb_detected (4)});
// ***
ai_ready (function () {if (!ai_adb_active || ai_debugging_active) ai_adb_detected (4)});
ai_adb_el_zero ++;
if (!ai_debugging_active) return false;
}
});
}
});
// if (ai_adb_el_counter != 0 && ai_adb_el_zero == 0) $(document).ready (function () {ai_adb_undetected (4)});
// ***
if (ai_adb_el_counter != 0 && ai_adb_el_zero == 0) ai_ready (function () {ai_adb_undetected (4)});
}
// });
//});
// ***
}
function ai_adb_get_script (ai_adb_script, ai_adb_action) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 7
// var ai_adb_debugging = false;
if (ai_adb_debugging) console.log ("AI AD BLOCKING loading script", ai_adb_script);
var script = document.createElement ('script');
var date = new Date();
script.src = 'ai-adb-url' + ai_adb_script + '.js?ver=' + date.getTime();
var head = document.getElementsByTagName ('head')[0],
done = false;
// Attach handlers for all browsers
script.onerror = function () {
if (ai_adb_debugging) console.log ("AI AD BLOCKING error loading script", ai_adb_script);
if (ai_adb_action) {
ai_adb_action ();
}
script.onerror = null;
head.removeChild (script);
}
script.onload = script.onreadystatechange = function () {
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
done = true;
if (ai_adb_debugging) console.log ("AI AD BLOCKING script loaded ", ai_adb_script);
if (ai_adb_action) {
ai_adb_action ();
}
script.onload = script.onreadystatechange = null;
head.removeChild (script);
};
};
head.appendChild (script);
};
//jQuery (window).on ('load', function () {
// ***
window.addEventListener ('load', (event) => {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 8
// var ai_adb_debugging = false;
if (typeof MobileDetect !== "undefined") {
var md = new MobileDetect (window.navigator.userAgent);
// ENABLED FOR_ALL_DEVICES
if (ai_adb_devices != 6) {
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICES:', ai_adb_devices);
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE desktop', !md.mobile ());
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE mobile', !!md.mobile ());
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE phone', !!md.phone ());
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE tablet', !!md.tablet ());
switch (ai_adb_devices) {
// ENABLED FOR DESKTOP_DEVICES
case 0:
if (!!md.mobile ()) return false;
break;
// ENABLED FOR MOBILE_DEVICES
case 1:
if (!md.mobile ()) return false;
break;
// ENABLED FOR TABLET_DEVICES
case 2:
if (!md.tablet ()) return false;
break;
// ENABLED FOR PHONE_DEVICES
case 3:
if (!md.phone ()) return false;
break;
// ENABLED FOR DESKTOP_TABLET_DEVICES
case 4:
if (!!md.phone ()) return false;
break;
// ENABLED FOR DESKTOP_PHONE_DEVICES
case 5:
if (!!md.tablet ()) return false;
break;
}
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING window load");
function ai_adb_1 () {
if (!document.getElementById (ai_adb_name_1)){
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (1);
} else {
ai_adb_undetected (1);
}
}
function ai_adb_2 () {
// if (typeof window.AI_CONST_AI_ADB_2_NAME == "undefined") {
if (typeof window [ai_adb_name_2] == "undefined") {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (2);
} else {
ai_adb_undetected (2);
}
}
function ai_adb_11 () {
if (typeof window.ad_banner == "undefined") {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (11);
} else {
ai_adb_undetected (11);
}
}
function ai_adb_12 () {
if (typeof window.ad_300x250 == "undefined") {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (12);
} else {
ai_adb_undetected (12);
}
}
function ai_adb_external_scripts () {
if (ai_adb_debugging) console.log ("AI AD BLOCKING check external scripts");
// var element = jQuery (b64d ("I2FpLWFkYi1nYQ=="));
// if (element.length) {
// ***
var element = document.querySelector (b64d ("I2FpLWFkYi1nYQ=="));
if (element != null) {
// if (!!(element.width () * element.height ())) {
// ***
if (!!(element.clientWidth * element.clientHeight)) {
ai_adb_undetected (5);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (5);
}
}
// var element = jQuery (b64d ("I2FpLWFkYi1tbg=="));
// if (element.length) {
// ***
var element = document.querySelector (b64d ("I2FpLWFkYi1tbg=="));
if (element != null) {
// if (!!(element.width () * element.height ())) {
// ***
if (!!(element.clientWidth * element.clientHeight)) {
ai_adb_undetected (6);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (6);
}
}
// var element = jQuery (b64d ("I2FpLWFkYi1kYmxjbGs="));
// if (element.length) {
// ***
var element = document.querySelector (b64d ("I2FpLWFkYi1kYmxjbGs="));
if (element != null) {
// if (!!(element.width () * element.height ())) {
// ***
if (!!(element.clientWidth * element.clientHeight)) {
ai_adb_undetected (8);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (8);
}
}
var element = document.querySelector (b64d ("I2FpLWFkYi1hbQ=="));
if (element != null) {
// if (!!(element.width () * element.height ())) {
// ***
if (!!(element.clientWidth * element.clientHeight)) {
ai_adb_undetected (13);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (13);
}
}
var element = document.querySelector (b64d ("I2FpLWFkYi1xdQ=="));
if (element != null) {
// if (!!(element.width () * element.height ())) {
// ***
if (!!(element.clientWidth * element.clientHeight)) {
ai_adb_undetected (14);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (14);
}
}
}
setTimeout (function() {
if (ai_adb_debugging) console.log ("AI AD BLOCKING delayed checks external scripts");
ai_adb_external_scripts ();
// Check again, result is delayed
setTimeout (function() {
if (!ai_adb_active) {
setTimeout (function() {
ai_adb_external_scripts ();
}, 400);
}
}, 5);
}, 1050);
setTimeout (function() {
var ai_debugging_active = typeof ai_adb_fe_dbg !== 'undefined';
if (ai_adb_debugging) console.log ("AI AD BLOCKING delayed checks 1, 2, 3, 11, 12");
// if (jQuery(b64d ("I2FpLWFkYi1hZHM=")).length) {
// ***
if (document.querySelector (b64d ("I2FpLWFkYi1hZHM=")) != null) {
if (!document.getElementById (ai_adb_name_1)) {
ai_adb_get_script ('ads', ai_adb_1);
} else ai_adb_1 ();
}
// if (jQuery(b64d ("I2FpLWFkYi1zcG9uc29ycw==")).length) {
// ***
if (document.querySelector (b64d ("I2FpLWFkYi1zcG9uc29ycw==")) != null) {
// if (typeof window.AI_CONST_AI_ADB_2_NAME == "undefined") {
if (typeof window [ai_adb_name_2] == "undefined") {
ai_adb_get_script ('sponsors', ai_adb_2);
} else ai_adb_2 ();
}
var banner_advert_container = b64d ("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVy");
var banner_advert_container_img = b64d ("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVyIGltZw==");
// if (jQuery(banner_advert_container).length) {
// ***
if (document.querySelector (banner_advert_container) != null) {
// if (jQuery(banner_advert_container_img).length > 0) {
// ***
if (document.querySelector (banner_advert_container_img) != null) {
// if (jQuery(banner_advert_container_img).outerHeight() === 0) {
// ***
if (document.querySelector (banner_advert_container_img).offsetHeight === 0) {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (3);
} else ai_adb_undetected (3);
// jQuery(banner_advert_container_img).remove();
// ***
document.querySelector (banner_advert_container_img).remove ();
}
}
// if (jQuery(b64d ("I2FpLWFkYi1iYW5uZXI=")).length) {
// ***
if (document.querySelector (b64d ("I2FpLWFkYi1iYW5uZXI=")) != null) {
ai_adb_11 ();
}
// if (jQuery(b64d ("I2FpLWFkYi0zMDB4MjUw")).length) {
// ***
if (document.querySelector (b64d ("I2FpLWFkYi0zMDB4MjUw")) != null) {
ai_adb_12 ();
}
}, 1150);
});
function ai_ready (fn) {
if (document.readyState === 'complete' || (document.readyState !== 'loading' && !document.documentElement.doScroll)) {
fn ();
} else {
document.addEventListener ('DOMContentLoaded', fn);
}
}
function insertAfter (newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
ai_ready (ai_adb_checks);
}
PK ! X.73 73 includes/js/ai-adb.min.jsnu [ if("undefined"!==typeof ai_adb_action){function q(){document.querySelectorAll("."+ai_adb_content_css_begin_class).forEach((b,c)=>{c=b.parentElement;null!=c.closest(".ai-debug-block")&&(c=c.parentElement.parentElement);null!=c.closest("."+ai_block_class)&&(c=c.parentElement);var d="display: none !important;";"undefined"!=typeof b.getAttribute("data-css")&&(d=b.dataset.css);var e="p";null!=b.getAttribute("data-selectors")&&(b=b.dataset.selectors,""==b&&(b="p"),e=b);var a=!1;c.querySelectorAll("."+ai_adb_content_css_begin_class+
", ."+ai_adb_content_css_end_class+", "+e).forEach((f,g)=>{f.classList.contains(ai_adb_content_css_begin_class)?(f.remove(),a=!0):f.classList.contains(ai_adb_content_css_end_class)?(f.remove(),a=!1):a&&(g=f.getAttribute("style"),null==g?g="":(g=g.trim(),""!=g&&";"!=g[g.length-1]&&(g+=";")),""!=d&&(d=" "+d),f.setAttribute("style",g+d))})});document.querySelectorAll("."+ai_adb_content_delete_begin_class).forEach((b,c)=>{c=b.parentElement;null!=c.closest(".ai-debug-block")&&(c=c.parentElement.parentElement);
null!=c.closest("."+ai_block_class)&&(c=c.parentElement);var d="p";null!=b.getAttribute("data-selectors")&&(b=b.dataset.selectors,""==b&&(b="p"),d=b);var e=!1;c.querySelectorAll("."+ai_adb_content_delete_begin_class+", ."+ai_adb_content_delete_end_class+", "+d).forEach((a,f)=>{a.classList.contains(ai_adb_content_delete_begin_class)?(a.remove(),e=!0):a.classList.contains(ai_adb_content_delete_end_class)?(a.remove(),e=!1):e&&a.remove()})});document.querySelectorAll("."+ai_adb_content_replace_begin_class).forEach((b,
c)=>{c=b.parentElement;null!=c.closest(".ai-debug-block")&&(c=c.parentElement.parentElement);null!=c.closest("."+ai_block_class)&&(c=c.parentElement);var d="";null!=b.getAttribute("data-text")&&(d=b.dataset.text);var e="";null!=b.getAttribute("data-css")&&(e=b.dataset.css);var a="p";null!=b.getAttribute("data-selectors")&&(b=b.dataset.selectors,""==b&&(b="p"),a=b);var f=!1;c.querySelectorAll("."+ai_adb_content_replace_begin_class+", ."+ai_adb_content_replace_end_class+", "+a).forEach((g,h)=>{g.classList.contains(ai_adb_content_replace_begin_class)?
(g.remove(),f=!0):g.classList.contains(ai_adb_content_replace_end_class)?(g.remove(),f=!1):f&&(g.innerText=0!=d.length?Array(Math.round(g.innerText.length/(d.length+1))+1).join(d+" ").trim():"",""!=e&&(h=g.getAttribute("style"),null==h?h="":(h=h.trim(),""!=h&&";"!=h[h.length-1]&&(h+=";")),""!=e&&(e=" "+e),g.setAttribute("style",h+e)))})})}function l(b){"undefined"==typeof b&&(b=document.querySelector("body"));window.jQuery&&window.jQuery.fn&&b instanceof jQuery&&(b=b.hasOwnProperty("0")?b[0]:[]);
var c=document.querySelector(b64d("Ym9keQ==")).getAttribute(b64d(ai_adb_attribute)),d="string"===typeof c?c==b64d("bWFzaw=="):null;if("string"===typeof c&&"boolean"===typeof d)if(d){do{var e=!1;b.querySelectorAll(".ai-adb-hide").forEach((a,f)=>{a.style.display="none";a.style.visibility="hidden";a.classList.remove("ai-adb-hide");f=a.closest("div[data-ai]");if(null!=f&&a.hasAttribute("data-ai")){var g=JSON.parse(b64d(f.getAttribute("data-ai")));"undefined"!==typeof g&&g.constructor===Array&&(g[1]="",
f.setAttribute("data-ai",b64e(JSON.stringify(g))))}ai_disable_processing(a)});b.querySelectorAll(".ai-adb-show").forEach((a,f)=>{a.style.display="block";a.style.visibility="visible";a.classList.remove("ai-adb-show");"code"in a.dataset&&(f=b64d(a.dataset.code),a.innerHTML+=f,e=!0,"function"==typeof ai_process_elements&&ai_process_elements());if(a.hasAttribute("data-ai-tracking")){f=a.getAttribute("data-ai-tracking");var g=a.closest("div[data-ai]");g.hasAttribute("data-ai")&&(a.classList.contains("ai-no-tracking")&&
(a=JSON.parse(b64d(g.getAttribute("data-ai"))),"undefined"!==typeof a&&a.constructor===Array&&(a[1]="",f=b64e(JSON.stringify(a)))),g.setAttribute("data-ai",f))}})}while(e);setTimeout(function(){"function"==typeof ai_process_impressions&&1==ai_tracking_finished&&ai_process_impressions();"function"==typeof ai_install_click_trackers&&1==ai_tracking_finished&&ai_install_click_trackers()},15);setTimeout(q,10)}else b.querySelectorAll(".ai-adb-hide").forEach((a,f)=>{a.classList.remove("ai-adb-hide");0==
a.offsetHeight&&null!=a.closest(".ai-adb-show")&&(a=a.closest("div[data-ai]"),a.hetAttribute("data-ai")&&(f=JSON.parse(b64d(a.getAttribute("data-ai"))),"undefined"!==typeof f&&f.constructor===Array&&(f[1]="",a.setAttribute("data-ai",b64e(JSON.stringify(f))),a.classList.add("ai-viewport-0"),a.style.display="none")))}),b.querySelectorAll(".ai-adb-show").forEach((a,f)=>{ai_disable_processing(a);a.classList.remove("ai-adb-show")})}ai_adb_detection_type_log=function(b){var c=ai_adb_detection_type(b),d=
document.querySelector("#ai-adb-events");if(null!=d){var e=d.innerText;d.innerText=(""!=e?e+", ":e+", EVENTS: ")+b}return c};ai_adb_detection_type=function(b){return""};var ai_adb_detected=function(b){function c(){"undefined"!==typeof AiCookies?setTimeout(function(){ai_adb_detected_actions(b)},2):setTimeout(c,250)}c()},ai_disable_processing=function(b){document.querySelectorAll(".ai-lazy").forEach((c,d)=>{c.classList.remove("ai-lazy")});document.querySelectorAll(".ai-manual").forEach((c,d)=>{c.classList.remove("ai-manual")});
document.querySelectorAll(".ai-rotate").forEach((c,d)=>{c.classList.remove("ai-unprocessed");c.removeAttribute("data-info")});document.querySelectorAll(".ai-list-data").forEach((c,d)=>{c.classList.remove("ai-list-data")});document.querySelectorAll(".ai-ip-data").forEach((c,d)=>{c.classList.remove("ai-ip-data")});document.querySelectorAll("[data-code]").forEach((c,d)=>{c.removeAttribute("data-code")})},ai_adb_detected_actions=function(b){window.jQuery&&window.jQuery.fn&&ai_adb_overlay instanceof jQuery&&
(ai_adb_overlay=ai_adb_overlay.hasOwnProperty("0")?ai_adb_overlay[0]:[]);ai_adb_message_window.hasOwnProperty("0")&&(ai_adb_message_window=ai_adb_message_window[0]);if(!ai_adb_active){ai_adb_active=!0;document.querySelector(b64d("Ym9keQ==")).setAttribute(b64d(ai_adb_attribute),b64d("bWFzaw=="));k(function(){l()});"undefined"!==typeof MobileDetect&&(new MobileDetect(window.navigator.userAgent)).is("bot")&&(ai_adb_action=0);if(""!=ai_adb_page_views){if(ai_adb_page_views.includes(",")){var c=ai_adb_page_views.split(",");
b=parseInt(c[0]);c=parseInt(c[1])}else b=parseInt(ai_adb_page_views),c=0;var d=1,e=AiCookies.get(ai_adb_pgv_cookie_name);"undefined"!=typeof e&&(d=parseInt(e)+1);if(d<=b){AiCookies.set(ai_adb_pgv_cookie_name,d,{expires:365,path:"/"});window.ai_d1=d;ai_adb_message_code_1();return}if(0!=c&&(AiCookies.set(ai_adb_pgv_cookie_name,d,{expires:365,path:"/"}),0!=(d-b-1)%c)){window.ai_d1=d;ai_adb_message_code_1();return}}if(0==ai_adb_message_cookie_lifetime||1==ai_adb_action&&ai_adb_message_undismissible)AiCookies.remove(ai_adb_act_cookie_name,
{path:"/"});else{e=AiCookies.get(ai_adb_act_cookie_name);if("undefined"!=typeof e&&e==ai_adb_cookie_value){ai_adb_message_code_2();return}AiCookies.set(ai_adb_act_cookie_name,ai_adb_cookie_value,{expires:ai_adb_message_cookie_lifetime,path:"/"})}0==ai_adb_action?(ai_dummy=16,ai_adb_message_code_6(),ai_dummy++):(ai_adb_message_code_3(),ai_dummy=13);switch(ai_adb_action){case 1:ai_adb_message_undismissible?(ai_adb_overlay.querySelectorAll('[style*="cursor"]').forEach((a,f)=>{a.style.cursor="no-drop"}),
ai_adb_message_window.querySelectorAll('[style*="cursor"]').forEach((a,f)=>{a.style.cursor="no-drop"})):(ai_adb_overlay.addEventListener("click",a=>{ai_adb_overlay.remove();ai_adb_message_window.remove()}),ai_adb_message_window.addEventListener("click",a=>{ai_adb_message_window.remove();ai_adb_overlay.remove()}),window.addEventListener("keydown",a=>{27===a.keyCode&&(ai_adb_overlay.click(),ai_adb_message_window.click())}));b=document.querySelector(b64d("Ym9keQ==")).children;m(ai_adb_overlay,b.item(Math.floor(Math.random()*
b.length)));m(ai_adb_message_window,b.item(Math.floor(Math.random()*b.length)));break;case 2:""!=ai_adb_redirection_url&&(b=!0,"http"==ai_adb_redirection_url.toLowerCase().substring(0,4)?window.location.href==ai_adb_redirection_url&&(b=!1):window.location.pathname==ai_adb_redirection_url&&(b=!1),b?(e=AiCookies.get(ai_adb_page_redirection_cookie_name),"undefined"==typeof e&&(b=new Date,b.setTime(b.getTime()+1E4),AiCookies.set(ai_adb_page_redirection_cookie_name,window.location.href,{expires:b,path:"/"}),
"?"==ai_adb_redirection_url.substr(ai_adb_redirection_url.length-1)&&(ai_adb_redirection_url=ai_adb_redirection_url.slice(0,-1),ai_adb_redirection_url+=location.search),window.location.replace(ai_adb_redirection_url))):AiCookies.remove(ai_adb_page_redirection_cookie_name,{path:"/"}))}}},ai_adb_undetected=function(b){setTimeout(function(){ai_adb_active||ai_adb_undetected_actions(b)},200)},ai_adb_undetected_actions=function(b){ai_adb_counter++;ai_adb_active||4!=ai_adb_counter||(document.querySelector(b64d("Ym9keQ==")).setAttribute(b64d(ai_adb_attribute),
b64d("Y2xlYXI=")),ai_dummy=11,ai_adb_message_code_4(),ai_dummy=14,l())};AI_DBG_AI_DEBUG_AD_BLOCKING&&k(function(){ai_adb_detected(0)});function n(b,c){var d=document.createElement("script");d.src="ai-adb-url"+b+".js?ver="+(new Date).getTime();var e=document.getElementsByTagName("head")[0],a=!1;d.onerror=function(){c&&c();d.onerror=null;e.removeChild(d)};d.onload=d.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,c&&c(),d.onload=d.onreadystatechange=
null,e.removeChild(d))};e.appendChild(d)}window.addEventListener("load",b=>{function c(){document.getElementById(ai_adb_name_1)?ai_adb_undetected(1):ai_adb_active&&!ai_debugging_active||ai_adb_detected(1)}function d(){"undefined"==typeof window[ai_adb_name_2]?(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(2):ai_adb_undetected(2)}function e(){var a=document.querySelector(b64d("I2FpLWFkYi1nYQ=="));null!=a&&(a.clientWidth*a.clientHeight?ai_adb_undetected(5):(!ai_adb_active||ai_debugging_active)&&
ai_adb_detected(5));a=document.querySelector(b64d("I2FpLWFkYi1tbg=="));null!=a&&(a.clientWidth*a.clientHeight?ai_adb_undetected(6):(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(6));a=document.querySelector(b64d("I2FpLWFkYi1kYmxjbGs="));null!=a&&(a.clientWidth*a.clientHeight?ai_adb_undetected(8):(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(8));a=document.querySelector(b64d("I2FpLWFkYi1hbQ=="));null!=a&&(a.clientWidth*a.clientHeight?ai_adb_undetected(13):(!ai_adb_active||ai_debugging_active)&&
ai_adb_detected(13));a=document.querySelector(b64d("I2FpLWFkYi1xdQ=="));null!=a&&(a.clientWidth*a.clientHeight?ai_adb_undetected(14):(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(14))}if("undefined"!==typeof MobileDetect&&(b=new MobileDetect(window.navigator.userAgent),6!=ai_adb_devices))switch(ai_adb_devices){case 0:if(b.mobile())return!1;break;case 1:if(!b.mobile())return!1;break;case 2:if(!b.tablet())return!1;break;case 3:if(!b.phone())return!1;break;case 4:if(b.phone())return!1;break;
case 5:if(b.tablet())return!1}setTimeout(function(){e();setTimeout(function(){ai_adb_active||setTimeout(function(){e()},400)},5)},1050);setTimeout(function(){var a="undefined"!==typeof ai_adb_fe_dbg;null!=document.querySelector(b64d("I2FpLWFkYi1hZHM="))&&(document.getElementById(ai_adb_name_1)?c():n("ads",c));null!=document.querySelector(b64d("I2FpLWFkYi1zcG9uc29ycw=="))&&("undefined"==typeof window[ai_adb_name_2]?n("sponsors",d):d());var f=b64d("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVy"),g=b64d("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVyIGltZw==");
null!=document.querySelector(f)&&null!=document.querySelector(g)&&(0===document.querySelector(g).offsetHeight?(!ai_adb_active||a)&&ai_adb_detected(3):ai_adb_undetected(3),document.querySelector(g).remove());null!=document.querySelector(b64d("I2FpLWFkYi1iYW5uZXI="))&&("undefined"==typeof window.ad_banner?(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(11):ai_adb_undetected(11));null!=document.querySelector(b64d("I2FpLWFkYi0zMDB4MjUw"))&&("undefined"==typeof window.ad_300x250?(!ai_adb_active||
ai_debugging_active)&&ai_adb_detected(12):ai_adb_undetected(12))},1150)});function k(b){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?b():document.addEventListener("DOMContentLoaded",b)}function m(b,c){c.parentNode.insertBefore(b,c.nextSibling)}k(function(){ai_debugging_active="undefined"!==typeof ai_adb_fe_dbg;setTimeout(function(){null!=document.querySelector("#ai-adb-bar")&&document.querySelector("#ai-adb-bar").addEventListener("click",e=>
{AiCookies.remove(ai_adb_act_cookie_name,{path:"/"});AiCookies.remove(ai_adb_pgv_cookie_name,{path:"/"});ai_adb_message_code_5();ai_dummy=15})},5);if((!ai_adb_active||ai_debugging_active)&&""!=ai_adb_selectors){var b=0,c=0,d=ai_adb_selectors.split(",");d.forEach((e,a)=>{d[a]=d[a].trim();null!=document.querySelector(d[a])&&document.querySelectorAll(d[a]).forEach((f,g)=>{var h=f.offsetHeight;f.querySelectorAll(".ai-attributes").forEach((p,r)=>{h>=p.offsetHeight&&(h-=p.offsetHeight)});b++;if(0===h&&
(k(function(){ai_adb_active&&!ai_debugging_active||ai_adb_detected(4)}),c++,!ai_debugging_active))return!1})});0!=b&&0==c&&k(function(){ai_adb_undetected(4)})}})};
PK ! includes/js/ai-ads-data.jsnu [ var ai_adsense_ad_names = [];
var ai_preview_window = typeof ai_preview !== 'undefined';
var ai_ajax_url = 'AI_AJAXURL';
var ai_nonce = 'AI_NONCE';
PK ! jsp includes/js/ai-sidebar-data.jsnu [ var sticky_widget_mode = AI_FUNC_GET_STICKY_WIDGET_MODE;
var sticky_widget_margin = AI_FUNC_GET_STICKY_WIDGET_MARGIN;
var ai_block_class_def = 'AI_FUNCT_GET_BLOCK_CLASS_NAME';
PK ! d~S S ! includes/js/jquery.quicksearch.jsnu [ (function($, window, document, undefined) {
$.fn.quicksearch = function (target, opt) {
var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({
delay: 100,
selector: null,
stripeRows: null,
loader: null,
noResults: '',
matchedResultsCount: 0,
bind: 'keyup',
onBefore: function () {
return;
},
onAfter: function () {
return;
},
show: function () {
this.style.display = "";
},
hide: function () {
this.style.display = "none";
},
prepareQuery: function (val) {
return val.toLowerCase().split(' ');
},
testQuery: function (query, txt, _row) {
for (var i = 0; i < query.length; i += 1) {
if (txt.indexOf(query[i]) === -1) {
return false;
}
}
return true;
}
}, opt);
this.go = function () {
var i = 0,
numMatchedRows = 0,
noresults = true,
query = options.prepareQuery(val),
val_empty = (val.replace(' ', '').length === 0);
for (var i = 0, len = rowcache.length; i < len; i++) {
if (val_empty || options.testQuery(query, cache[i], rowcache[i])) {
options.show.apply(rowcache[i]);
noresults = false;
numMatchedRows++;
} else {
options.hide.apply(rowcache[i]);
}
}
if (noresults) {
this.results(false);
} else {
this.results(true);
this.stripe();
}
this.matchedResultsCount = numMatchedRows;
this.loader(false);
options.onAfter();
return this;
};
/*
* External API so that users can perform search programatically.
* */
this.search = function (submittedVal) {
val = submittedVal;
e.trigger();
};
/*
* External API to get the number of matched results as seen in
* https://github.com/ruiz107/quicksearch/commit/f78dc440b42d95ce9caed1d087174dd4359982d6
* */
this.currentMatchedResults = function() {
return this.matchedResultsCount;
};
this.stripe = function () {
if (typeof options.stripeRows === "object" && options.stripeRows !== null)
{
var joined = options.stripeRows.join(' ');
var stripeRows_length = options.stripeRows.length;
jq_results.not(':hidden').each(function (i) {
$(this).removeClass(joined).addClass(options.stripeRows[i % stripeRows_length]);
});
}
return this;
};
this.strip_html = function (input) {
var output = input.replace(new RegExp('<[^<]+\>', 'g'), "");
output = $.trim(output.toLowerCase());
return output;
};
this.results = function (bool) {
if (typeof options.noResults === "string" && options.noResults !== "") {
if (bool) {
$(options.noResults).hide();
} else {
$(options.noResults).show();
}
}
return this;
};
this.loader = function (bool) {
if (typeof options.loader === "string" && options.loader !== "") {
(bool) ? $(options.loader).show() : $(options.loader).hide();
}
return this;
};
this.cache = function () {
jq_results = $(target);
if (typeof options.noResults === "string" && options.noResults !== "") {
jq_results = jq_results.not(options.noResults);
}
var t = (typeof options.selector === "string") ? jq_results.find(options.selector) : $(target).not(options.noResults);
cache = t.map(function () {
return e.strip_html(this.innerHTML);
});
rowcache = jq_results.map(function () {
return this;
});
/*
* Modified fix for sync-ing "val".
* Original fix https://github.com/michaellwest/quicksearch/commit/4ace4008d079298a01f97f885ba8fa956a9703d1
* */
val = val || this.val() || "";
return this.go();
};
this.trigger = function () {
this.loader(true);
options.onBefore();
window.clearTimeout(timeout);
timeout = window.setTimeout(function () {
e.go();
}, options.delay);
return this;
};
this.cache();
this.results(true);
this.stripe();
this.loader(false);
return this.each(function () {
/*
* Changed from .bind to .on.
* */
$(this).on(options.bind, function () {
val = $(this).val();
e.trigger();
});
});
};
}(jQuery, this, document));
PK ! Vg includes/js/ai-select.min.jsnu [ if("undefined"!=typeof ai_selection_block){function u(a,b){for(;b;){if((b.nodeName||b.tagName).toLowerCase()===a.toLowerCase())return b;b=b.parentNode}return null}function l(a){var b=a.nodeName.toLowerCase();a.hasAttribute("id")&&""!=a.id&&(b=b+"#"+a.id);a.className&&(classes=a.className.replace(/ai-selected|ai-highlighted/g,"").trim())&&(b=b+"."+classes.replace(/\s{2,}/g," ").trim().replace(/ /g,"."));return b}function m(a){for(var b=[];null!=a.parentNode;){for(var c=0,d=0,n=0,f=0;f'+a+""}function p(a){var b=[];a.forEach(function(c){b.push(e(c))});return b}function q(){document.querySelectorAll(".ai-html-element").forEach(function(a){a.addEventListener("click",b=>{b=a.innerText;document.getElementById("ai-selector-element").innerHTML=e(b);document.querySelector(".ai-selected").classList.remove("ai-selected");document.querySelector(b).classList.add("ai-selected");document.querySelectorAll("#ai-selector-data "+
b).forEach(function(c){c.classList.remove("ai-selected")});document.getElementById("ai-selector").value=b})})}function r(a){if(null!=window.opener&&!window.opener.closed){var b=window.opener.document,c=document.getElementById("ai-selector").value;a&&(a=b.querySelector(ai_settings_input).value.trim(),a=h(a),""!=a&&(a+=", "),c=a+c);b.querySelector(ai_settings_input).value=c}}function t(){ctrl_pressed?(document.getElementById("ai-use-button").style.display="none",document.getElementById("ai-add-button").style.display=
"block"):(document.getElementById("ai-use-button").style.display="block",document.getElementById("ai-add-button").style.display="none")}var ctrl_pressed=!1,selected_element=null,current_element=null;document.onclick=function(a){a=a||event;var b=u("a",a.target||a.srcElement);if(b&&(a.preventDefault(),!ctrl_pressed)){a={html_element_selection:ai_selection_block,selector:document.getElementById("ai-selector").value,input:ai_settings_input};var c=document.createElement("form");c.setAttribute("method",
"post");c.setAttribute("action",b.href);c.setAttribute("target","_self");for(var d in a)a.hasOwnProperty(d)&&(b=document.createElement("input"),b.type="hidden",b.name=d,b.value=encodeURI(a[d]),c.appendChild(b));document.body.appendChild(c);c.submit();document.body.removeChild(c)}};document.addEventListener("keydown",a=>{"17"==a.which&&(ctrl_pressed=!0,t(),null!=current_element&&"A"==current_element.tagName&&(a=new Event("mouseover",{bubbles:!0,cancelable:!0}),current_element.dispatchEvent(a)))});
document.addEventListener("keyup",a=>{ctrl_pressed=!1;t();null!=current_element&&"A"==current_element.tagName&&(a=new Event("mouseout",{bubbles:!0,cancelable:!0}),current_element.dispatchEvent(a))});document.querySelector("body").style.userSelect="none";document.querySelector("body").style.marginTop="140px";var selection_ui='
'+ai_front.element+'
"+ai_front.path+'
"+ai_front.selector+'
",range=document.createRange(),fragment_ok=!0;try{var fragment=range.createContextualFragment(selection_ui)}catch(a){fragment_ok=!1,console.error("AI SELECTION",
"range.createContextualFragment ERROR:",a)}fragment_ok&&document.querySelector("body").prepend(fragment);function k(a){var b=a.target,c=m(b);if(-1==c.join(" > ").indexOf("ai-selector-data")&&!b.classList.contains("ai-html-element"))switch(a.type){case "click":if("A"!=b.tagName||ctrl_pressed)selected_element=b,document.getElementById("ai-selector-element").innerHTML=e(l(b)),document.getElementById("ai-selector-path").innerHTML=p(c).join(" > "),q(),document.querySelectorAll(".ai-highlighted").forEach(function(d){d.classList.remove("ai-highlighted")}),
document.querySelectorAll(".ai-selected").forEach(function(d){d.classList.remove("ai-selected")}),b.classList.add("ai-selected"),document.getElementById("ai-selector").value=v(c).join(" > ");break;case "mouseover":current_element=b;("A"!=b.tagName||ctrl_pressed)&&b.classList.add("ai-highlighted");break;case "mouseout":b.classList.remove("ai-highlighted")}}document.querySelector("body").addEventListener("mouseover",a=>{k(a)});document.querySelector("body").addEventListener("mouseout",a=>{k(a)});document.querySelector("body").addEventListener("click",
a=>{k(a)});document.getElementById("ai-selector").addEventListener("input",a=>{document.querySelectorAll(".ai-highlighted").forEach(function(c){c.classList.remove("ai-highlighted")});document.querySelectorAll(".ai-selected").forEach(function(c){c.classList.remove("ai-selected")});a=h(document.getElementById("ai-selector").value);if(""!=a){try{document.querySelectorAll(a).forEach(function(c){c.classList.add("ai-selected")})}catch(c){return}var b=a.split(",");b.forEach(function(c){document.querySelectorAll("#ai-selector-data "+
c).forEach(function(d){d.classList.remove("ai-selected")})});1==b.length&&""!=a&&1==document.querySelectorAll(a).length?(selected_element=document.querySelector(b[0]),document.getElementById("ai-selector-element").innerHTML=e(l(selected_element)),document.getElementById("ai-selector-path").innerHTML=p(m(selected_element)).join(" > "),q()):(selected_element=null,document.getElementById("ai-selector-element").innerText="",document.getElementById("ai-selector-path").innerText="")}});window.onkeydown=
function(a){27===a.keyCode&&window.close()};(function(){if(null!=window.opener&&!window.opener.closed){document.getElementById("ai-selector").value=h(ai_settings_selector);var a=new Event("input",{bubbles:!0,cancelable:!0});document.getElementById("ai-selector").dispatchEvent(a)}})();document.getElementById("ai-cancel-button").addEventListener("click",a=>{window.close()});document.getElementById("ai-parent-button").addEventListener("click",a=>{"BODY"!=selected_element.tagName&&(selected_element=selected_element.parentElement,
a=new Event("click",{bubbles:!0,cancelable:!0}),selected_element.dispatchEvent(a))});document.getElementById("ai-use-button").addEventListener("click",a=>{r(!1);window.close()});document.getElementById("ai-add-button").addEventListener("click",a=>{r(!0);window.close()})};
PK ! ahW W includes/js/ai-cookie-data.jsnu [ var ai_cookie_js = true;
var ai_block_class_def = 'AI_FUNCT_GET_BLOCK_CLASS_NAME';
PK ! 楌
includes/js/missed.jsnu [ // add missing native JS stuff if needed
if (!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, '');
};
}
if (typeof console == 'undefined') {
(function() {
var methods = ['log', 'info', 'warn', 'error', 'debug', 'group', 'groupCollapsed', 'groupEnd', 'dir', 'time', 'timeEnd', 'trace'];
window.console = new Object();
for (var i in methods) {
window.console[methods[i]] = function(){};
}
})();
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
return -1;
}
var n = 0;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n != n) { // shortcut for verifying if it's NaN
n = 0;
} else if (n != 0 && n != Infinity && n != -Infinity) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
if (n >= len) {
return -1;
}
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
for (; k < len; k++) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
}
}
if (!Object.keys) {
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
dontEnumsLength = dontEnums.length;
return function (obj) {
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
throw new TypeError('Object.keys called on non-object');
}
var result = [], prop, i;
for (prop in obj) {
if (hasOwnProperty.call(obj, prop)) {
result.push(prop);
}
}
if (hasDontEnumBug) {
for (i = 0; i < dontEnumsLength; i++) {
if (hasOwnProperty.call(obj, dontEnums[i])) {
result.push(dontEnums[i]);
}
}
}
return result;
};
}());
}PK ! includes/js/ai-adb.q.jsnu [ function ai_adb_process_content () {
(function ($) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 1
// var ai_adb_debugging = false;
if (ai_adb_debugging) console.log ('');
if (ai_adb_debugging) console.log ("AI AD BLOCKING CONTENT PROCESSING", ai_adb_active);
$('.' + ai_adb_content_css_begin_class).each (function () {
var ai_adb_parent = $(this).parent ();
if (ai_adb_parent.closest ('.ai-debug-block').length) {
ai_adb_parent = ai_adb_parent.parent ().parent ();
}
if (ai_adb_parent.closest ('.' + ai_block_class).length) {
ai_adb_parent = ai_adb_parent.parent ();
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING parent", ai_adb_parent.prop ("tagName"), "id=\""+ ai_adb_parent.attr ("id")+"\"", "class=\""+ ai_adb_parent.attr ("class")+"\"");
var ai_adb_css = $(this).data ("css");
if (typeof ai_adb_css == "undefined") ai_adb_css = "display: none !important;";
var ai_adb_selectors = $(this).data ("selectors");
if (typeof ai_adb_selectors == "undefined" || ai_adb_selectors == '') ai_adb_selectors = "p";
if (ai_adb_debugging) console.log ('AI AD BLOCKING CSS, css=\'' + ai_adb_css +'\'', "selectors='" + ai_adb_selectors + "'");
var ai_adb_action = false;
$(ai_adb_parent).find ('.' + ai_adb_content_css_begin_class + ', .' + ai_adb_content_css_end_class + ', ' + ai_adb_selectors).each (function () {
if ($(this).hasClass (ai_adb_content_css_begin_class)) {$(this).remove (); ai_adb_action = true;}
else if ($(this).hasClass (ai_adb_content_css_end_class)) {$(this).remove (); ai_adb_action = false;}
else if (ai_adb_action) {
var ai_adb_style = $(this).attr ("style");
if (typeof ai_adb_style == "undefined") ai_adb_style = "";
else {
ai_adb_style = ai_adb_style.trim ();
if (ai_adb_style != '' && ai_adb_style [ai_adb_style.length - 1] != ';') {
ai_adb_style = ai_adb_style + ';';
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING CSS:", $(this).prop ("tagName"), "id=\""+ $(this).attr ("id")+"\"", "class=\""+ $(this).attr ("class")+"\"");
$(this).attr ("style", ai_adb_style + ' ' + ai_adb_css);
}
});
});
$('.' + ai_adb_content_delete_begin_class).each (function () {
var ai_adb_parent = $(this).parent ();
if (ai_adb_parent.closest ('.ai-debug-block').length) {
ai_adb_parent = ai_adb_parent.parent ().parent ();
}
if (ai_adb_parent.closest ('.' + ai_block_class).length) {
ai_adb_parent = ai_adb_parent.parent ();
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE, parent", ai_adb_parent.prop ("tagName"), "id=\""+ ai_adb_parent.attr ("id")+"\"", "class=\""+ ai_adb_parent.attr ("class")+"\"");
var ai_adb_selectors = $(this).data ("selectors");
if (typeof ai_adb_selectors == "undefined" || ai_adb_selectors == '') ai_adb_selectors = "p";
if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE, selectors='" + ai_adb_selectors + "'");
var ai_adb_action = false;
$(ai_adb_parent).find ('.' + ai_adb_content_delete_begin_class + ', .' + ai_adb_content_delete_end_class + ', ' + ai_adb_selectors).each (function () {
if ($(this).hasClass (ai_adb_content_delete_begin_class)) {$(this).remove (); ai_adb_action = true;}
else if ($(this).hasClass (ai_adb_content_delete_end_class)) {$(this).remove (); ai_adb_action = false;}
else if (ai_adb_action) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING DELETE:", $(this).prop ("tagName"), "id=\""+ $(this).attr ("id")+"\"", "class=\""+ $(this).attr ("class")+"\"");
$(this).remove ();
}
});
});
$('.' + ai_adb_content_replace_begin_class).each (function () {
var ai_adb_parent = $(this).parent ();
if (ai_adb_parent.closest ('.ai-debug-block').length) {
ai_adb_parent = ai_adb_parent.parent ().parent ();
}
if (ai_adb_parent.closest ('.' + ai_block_class).length) {
ai_adb_parent = ai_adb_parent.parent ();
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE, parent", ai_adb_parent.prop ("tagName"), "id=\""+ ai_adb_parent.attr ("id")+"\"", "class=\""+ ai_adb_parent.attr ("class")+"\"");
var ai_adb_text = $(this).data ("text");
if (typeof ai_adb_text == "undefined") ai_adb_text = "";
var ai_adb_css = $(this).data ("css");
if (typeof ai_adb_css == "undefined") ai_adb_css = "";
var ai_adb_selectors = $(this).data ("selectors");
if (typeof ai_adb_selectors == "undefined" || ai_adb_selectors == '') ai_adb_selectors = "p";
if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE, text=\'" + ai_adb_text + '\'', 'css=\'' + ai_adb_css +'\'', "selectors='" + ai_adb_selectors + "'");
var ai_adb_action = false;
$(ai_adb_parent).find ('.' + ai_adb_content_replace_begin_class + ', .' + ai_adb_content_replace_end_class + ', ' + ai_adb_selectors).each (function () {
if ($(this).hasClass (ai_adb_content_replace_begin_class)) {$(this).remove (); ai_adb_action = true;}
else if ($(this).hasClass (ai_adb_content_replace_end_class)) {$(this).remove (); ai_adb_action = false;}
else if (ai_adb_action) {
if (ai_adb_text.length != 0) {
var n = Math.round ($(this).text ().length / (ai_adb_text.length + 1));
$(this).text (Array(n + 1).join(ai_adb_text + ' ').trim ());
} else $(this).text ('');
if (ai_adb_css != '') {
var ai_adb_style = $(this).attr ("style");
if (typeof ai_adb_style == "undefined") ai_adb_style = "";
else {
ai_adb_style = ai_adb_style.trim ();
if (ai_adb_style != '' && ai_adb_style [ai_adb_style.length - 1] != ';') {
ai_adb_style = ai_adb_style + ';';
}
}
if (ai_adb_css != '') {
ai_adb_css = ' ' + ai_adb_css;
}
$(this).attr ("style", ai_adb_style + ai_adb_css);
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING REPLACE:", $(this).prop ("tagName"), "id=\""+ $(this).attr ("id")+"\"", "class=\""+ $(this).attr ("class")+"\"");
}
});
});
}(jQuery));
}
function ai_adb_process_blocks (element) {
(function ($) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 2
// var ai_adb_debugging = false;
if (typeof element == 'undefined') {
element = $('body');
if (ai_adb_debugging) console.log ('');
}
// var ai_adb_data = $(b64d ("Ym9keQ==")).attr (AI_ADB_ATTR_NAME);
var ai_adb_data = $(b64d ("Ym9keQ==")).attr (b64d (ai_adb_attribute));
if (typeof ai_adb_data === "string") {
var ai_adb_active = ai_adb_data == b64d ("bWFzaw==");
} else {
var ai_adb_active = null;
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions:", ai_adb_active, $(element).prop ("tagName") + '.' + $(element).attr ('class'));
if (typeof ai_adb_data === "string" && typeof ai_adb_active === "boolean") {
if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions checking");
if (ai_adb_active) {
var code_inserted = false;
do {
var code_insertion = false;
// Don't use data () as the value will be cached - wrong value for tracking
$(".ai-adb-hide", element).each (function () {
$(this).css ({"display": "none", "visibility": "hidden"});
$(this).removeClass ('ai-adb-hide');
// Disable tracking
var wrapping_div = $(this).closest ('div[data-ai]');
if (typeof wrapping_div.attr ("data-ai") != "undefined") {
var data = JSON.parse (b64d (wrapping_div.attr ("data-ai")));
if (typeof data !== "undefined" && data.constructor === Array) {
data [1] = "";
if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING ", b64d (wrapping_div.attr ("data-ai")), ' <= ', JSON.stringify (data));
wrapping_div.attr ("data-ai", b64e (JSON.stringify (data)));
}
}
ai_disable_processing ($(this));
if (ai_adb_debugging) {
var debug_info = $(this).data ("ai-debug");
console.log ("AI AD BLOCKING HIDE", typeof debug_info != "undefined" ? debug_info : "");
}
});
// after hide to update tracking data on replace
// Don't use data () as the value will be cached - wrong value for tracking
$(".ai-adb-show", element).each (function () {
$(this).css ({"display": "block", "visibility": "visible"});
$(this).removeClass ('ai-adb-show');
if (typeof $(this).data ('code') != 'undefined') {
var adb_code = b64d ($(this).data ('code'));
if (ai_adb_debugging) console.log ('AI AD BLOCKING SHOW INSERT CODE');
if (ai_adb_debugging) console.log ('');
$(this).append (adb_code);
code_insertion = true;
code_inserted = true;
// Process rotations to set versions before tracking data is set
if (typeof ai_process_elements == 'function') {
ai_process_elements ();
}
}
var tracking_data = $(this).attr ('data-ai-tracking');
if (typeof tracking_data != 'undefined') {
var wrapping_div = $(this).closest ('div[data-ai]');
if (typeof wrapping_div.attr ("data-ai") != "undefined") {
if ($(this).hasClass ('ai-no-tracking')) {
var data = JSON.parse (b64d (wrapping_div.attr ("data-ai")));
if (typeof data !== "undefined" && data.constructor === Array) {
data [1] = "";
tracking_data = b64e (JSON.stringify (data));
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING ", b64d (wrapping_div.attr ("data-ai")), ' <= ', b64d (tracking_data));
wrapping_div.attr ("data-ai", tracking_data);
}
}
if (ai_adb_debugging) {
var debug_info = $(this).data ("ai-debug");
console.log ("AI AD BLOCKING SHOW", typeof debug_info != "undefined" ? debug_info : "");
}
});
} while (code_insertion);
setTimeout (function() {
if (typeof ai_process_impressions == 'function' && ai_tracking_finished == true) {
ai_process_impressions ();
}
if (typeof ai_install_click_trackers == 'function' && ai_tracking_finished == true) {
ai_install_click_trackers ();
}
}, 15);
setTimeout (ai_adb_process_content, 10);
} else {
// Prevent tracking if block was not displayed because of cookie
$(".ai-adb-hide", element).each (function () {
if (ai_adb_debugging) console.log ('AI ai-adb-hide', $(this), $(this).outerHeight (), $(this).closest ('.ai-adb-show').length);
$(this).removeClass ('ai-adb-hide');
if ($(this).outerHeight () == 0 && $(this).closest ('.ai-adb-show').length == 0) {
// Top level (not nested) block
var wrapper = $(this).closest ('div[data-ai]');
if (typeof wrapper.attr ("data-ai") != "undefined") {
var data = JSON.parse (b64d (wrapper.attr ("data-ai")));
if (typeof data !== "undefined" && data.constructor === Array) {
data [1] = "";
if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING DISABLED: ", b64d (wrapper.attr ("data-ai")), ' <= ', JSON.stringify (data));
wrapper.attr ("data-ai", b64e (JSON.stringify (data)));
// Hide block (wrapping div with margin)
wrapper.addClass ('ai-viewport-0').css ("display", "none");
}
}
}
});
$(".ai-adb-show", element).each (function () {
ai_disable_processing ($(this));
$(this).removeClass ('ai-adb-show');
if (ai_adb_debugging) console.log ('AI AD BLOCKING SHOW disable processing', $(this).prop ("tagName") + '.' + $(this).attr ('class'));
});
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING block actions END");
}(jQuery));
}
ai_adb_detection_type_log = function (n) {
var type = ai_adb_detection_type (n);
var ai_adb_events = jQuery('#ai-adb-events');
if (ai_adb_events.count != 0) {
var message = ai_adb_events.text ();
if (message != '') message = message + ', '; else message = message + ', EVENTS: ';
message = message + n;
ai_adb_events.text (message);
}
return type;
}
ai_adb_detection_type = function (n) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 3
// var ai_adb_debugging = false;
if (ai_adb_debugging) {
switch (n) {
case 0:
return "0 debugging";
break;
case 1:
return "1 ads create element";
break;
case 2:
return "2 sponsors window var";
break;
case 3:
return "3 banner element";
break;
case 4:
return "4 custom selectors";
break;
case 5:
return "5 ga";
break;
case 6:
return "6 media.net";
break;
case 7:
return "7 adsense";
break;
case 8:
return "8 doubleclick.net";
break;
case 9:
return "9 fun adblock 3";
break;
case 10:
return "10 fun adblock 4";
break;
case 11:
return "11 banner js";
break;
case 12:
return "12 300x250 js";
break;
case 13:
return "13 amazon-adsystem";
break;
case 14:
return "14 quantserve.com";
break;
default:
return n;
break;
}
} else return '';
}
var ai_adb_detected = function (n) {
function waitForScript () {
// AiCookies might be defined in an external script loaded after adb code runs
if (typeof AiCookies !== "undefined"){
setTimeout (function () {
ai_adb_detected_actions (n);
}, 2);
} else {
setTimeout (waitForScript, 250);
}
}
// setTimeout (function() {
// ai_adb_detected_actions (n);
// }, 2);
waitForScript ();
}
var ai_disable_processing = function (element) {
jQuery(element).find ('.ai-lazy').removeClass ('ai-lazy'); // Disable lazy loading
jQuery(element).find ('.ai-manual').removeClass ('ai-manual'); // Disable manual loading
jQuery(element).find ('.ai-rotate').removeClass ('ai-unprocessed').removeAttr ('data-info'); // Disable rotations
jQuery(element).find ('.ai-list-data').removeClass ('ai-list-data'); // Disable lists
jQuery(element).find ('.ai-ip-data').removeClass ('ai-ip-data'); // Disable IP lists
jQuery(element).find ('[data-code]').removeAttr ('data-code'); // Disable insertions
}
var ai_adb_detected_actions = function(n) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 4
// var ai_adb_debugging = false;
if (ai_adb_debugging && n == 0) console.log ('');
if (ai_adb_debugging) console.log ("AI AD BLOCKING DETECTED", ai_adb_detection_type_log (n));
if (!ai_adb_active) {
ai_adb_active = true;
// jQuery(b64d ("Ym9keQ==")).attr (AI_ADB_ATTR_NAME, b64d ("bWFzaw=="));
jQuery(b64d ("Ym9keQ==")).attr (b64d (ai_adb_attribute), b64d ("bWFzaw=="));
(function ($) {
$(window).ready(function () {
ai_adb_process_blocks ();
// if (code_inserted && typeof ai_process_elements == 'function') {
// setTimeout (ai_process_elements, 20);
// }
});
if (ai_adb_debugging) console.log ("AI AD BLOCKING action check");
// AiCookies.remove (ai_adb_pgv_cookie_name, {path: "/"});
// Disable action for bots
if (typeof MobileDetect !== "undefined") {
var md = new MobileDetect (window.navigator.userAgent);
if (ai_adb_debugging) console.log ('AI AD BLOCKING IS BOT:', md.is ('bot'));
if (md.is ('bot')) {
ai_adb_action = 0;
}
}
if (ai_adb_page_views != '') {
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_views);
if (ai_adb_page_views.includes (',')) {
var ai_adb_page_view_parts = ai_adb_page_views.split (',');
var ai_adb_page_view_delay = parseInt (ai_adb_page_view_parts [0]);
var ai_adb_page_view_repeat = parseInt (ai_adb_page_view_parts [1]);
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_view_delay, "repeat:", ai_adb_page_view_repeat);
} else {
var ai_adb_page_view_delay = parseInt (ai_adb_page_views);
var ai_adb_page_view_repeat = 0
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_view_delay);
}
var ai_adb_page_view_counter = 1;
var cookie = AiCookies.get (ai_adb_pgv_cookie_name);
if (typeof cookie != "undefined") ai_adb_page_view_counter = parseInt (cookie) + 1;
if (ai_adb_debugging) console.log ("AI AD BLOCKING page views cookie:", cookie, "- page view:", ai_adb_page_view_counter);
if (ai_adb_page_view_counter <= ai_adb_page_view_delay) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING", ai_adb_page_view_delay, "page views not reached, no action");
AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
window.ai_d1 = ai_adb_page_view_counter;
// window.AI_ADB_STATUS_MESSAGE=1;
ai_adb_message_code_1 ();
return;
}
if (ai_adb_page_view_repeat != 0) {
AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
if ((ai_adb_page_view_counter - ai_adb_page_view_delay - 1) % ai_adb_page_view_repeat != 0) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING every", ai_adb_page_view_repeat, "page views, no action");
window.ai_d1 = ai_adb_page_view_counter;
// window.AI_ADB_STATUS_MESSAGE=1;
ai_adb_message_code_1 ();
return;
}
}
}
if (ai_adb_message_cookie_lifetime != 0 && (ai_adb_action != 1 || !ai_adb_message_undismissible)) {
var cookie = AiCookies.get (ai_adb_act_cookie_name);
if (ai_adb_debugging) console.log ("AI AD BLOCKING cookie:", cookie);
if (typeof cookie != "undefined" && cookie == ai_adb_cookie_value) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING valid cookie detected, no action");
// window.AI_ADB_STATUS_MESSAGE=2;
ai_adb_message_code_2 ();
return;
}
else if (ai_adb_debugging) console.log ("AI AD BLOCKING invalid cookie");
AiCookies.set (ai_adb_act_cookie_name, ai_adb_cookie_value, {expires: ai_adb_message_cookie_lifetime, path: "/"});
} else
AiCookies.remove (ai_adb_act_cookie_name, {path: "/"});
if (ai_adb_debugging) console.log ("AI AD BLOCKING action", ai_adb_action);
if (ai_adb_action == 0) {
ai_dummy = 16; // Do not remove - to prevent optimization
// window.AI_ADB_STATUS_MESSAGE=6;
ai_adb_message_code_6 ();
ai_dummy ++; // Do not remove - to prevent optimization
} else {
// window.AI_ADB_STATUS_MESSAGE=3;
ai_adb_message_code_3 ();
ai_dummy = 13; // Do not remove - to prevent optimization
}
switch (ai_adb_action) {
case 1:
if (!ai_adb_message_undismissible) {
$(ai_adb_overlay).click (function () {
$(this).remove();
$(ai_adb_message_window).remove();
});
$(ai_adb_message_window).click (function () {
$(this).remove();
$(ai_adb_overlay).remove();
});
window.onkeydown = function( event ) {
if (event.keyCode === 27 ) {
$(ai_adb_overlay).click ();
$(ai_adb_message_window).click ();
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING MESSAGE click detection installed");
} else {
// AiCookies.remove (ai_adb_act_cookie_name, {path: "/"});
$(ai_adb_overlay).find ('[style*="cursor"]').css ("cursor", "no-drop");
$(ai_adb_message_window).find ('[style*="cursor"]').css ("cursor", "no-drop");
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING MESSAGE");
var body_children = $(b64d ("Ym9keQ==")).children ();
body_children.eq (Math.floor (Math.random() * body_children.length)).after ($(ai_adb_overlay));
body_children.eq (Math.floor (Math.random() * body_children.length)).after ($(ai_adb_message_window));
break;
case 2:
if (ai_adb_redirection_url != "") {
if (ai_adb_debugging) console.log ("AI AD BLOCKING REDIRECTION to", ai_adb_redirection_url);
var redirect = true;
if (ai_adb_redirection_url.toLowerCase().substring (0, 4) == "http") {
if (window.location.href == ai_adb_redirection_url) var redirect = false;
} else {
if (window.location.pathname == ai_adb_redirection_url) var redirect = false;
}
if (redirect) {
var cookie = AiCookies.get (ai_adb_page_redirection_cookie_name);
if (typeof cookie == "undefined") {
var date = new Date();
date.setTime (date.getTime() + (10 * 1000));
AiCookies.set (ai_adb_page_redirection_cookie_name, window.location.href, {expires: date, path: "/"});
if (ai_adb_redirection_url.substr (ai_adb_redirection_url.length - 1) == "?") {
ai_adb_redirection_url = ai_adb_redirection_url.slice (0, - 1);
ai_adb_redirection_url = ai_adb_redirection_url + location.search;
if (ai_adb_debugging) console.log ("AI AD BLOCKING redirection using query parameters:", location.search);
}
window.location.replace (ai_adb_redirection_url)
} else {
if (ai_adb_debugging) console.log ("AI AD BLOCKING no redirection, cookie:", cookie);
}
} else {
if (ai_adb_debugging) console.log ("AI AD BLOCKING already on page", window.location.href);
AiCookies.remove (ai_adb_page_redirection_cookie_name, {path: "/"});
}
}
break;
}
}(jQuery));
}
}
var ai_adb_undetected = function (n) {
setTimeout (function() {
if (!ai_adb_active) {
ai_adb_undetected_actions (n);
}
}, 200);
}
var ai_adb_undetected_actions = function (n) {
ai_adb_counter ++;
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 5
// var ai_adb_debugging = false;
// if (ai_adb_debugging && n == 1) console.log ('');
if (ai_adb_debugging) console.log ("AI AD BLOCKING not detected:", '(' + ai_adb_counter + ')', ai_adb_detection_type (n));
if (!ai_adb_active && ai_adb_counter == 4) {
if (ai_adb_debugging) console.log ("AI AD BLOCKING NOT DETECTED");
// jQuery(b64d ("Ym9keQ==")).attr (AI_ADB_ATTR_NAME, b64d ("Y2xlYXI="));
jQuery(b64d ("Ym9keQ==")).attr (b64d (ai_adb_attribute), b64d ("Y2xlYXI="));
ai_dummy = 11; // Do not remove - to prevent optimization
// window.AI_ADB_STATUS_MESSAGE=4; // Check replacement code {}
ai_adb_message_code_4 ();
ai_dummy = 14; // Do not remove - to prevent optimization
// // Prevent tracking if block was not displayed because of cookie
// jQuery(".ai-adb-hide").each (function () {
// if (ai_adb_debugging) console.log ('AI ai-adb-hide', jQuery(this), jQuery(this).outerHeight (), jQuery(this).closest ('.ai-adb-show').length);
// if (jQuery(this).outerHeight () == 0 && jQuery(this).closest ('.ai-adb-show').length == 0) {
// // Top level (not nested) block
// var wrapper = jQuery(this).closest ('div[data-ai]');
// if (typeof wrapper.attr ("data-ai") != "undefined") {
// var data = JSON.parse (b64d (wrapper.attr ("data-ai")));
// if (typeof data !== "undefined" && data.constructor === Array) {
// data [1] = "";
// if (ai_adb_debugging) console.log ("AI AD BLOCKING TRACKING DISABLED: ", b64d (wrapper.attr ("data-ai")), ' <= ', JSON.stringify (data));
// wrapper.attr ("data-ai", b64e (JSON.stringify (data)));
// // Hide block (wrapping div with margin)
// wrapper.addClass ('ai-viewport-0').css ("display", "none");
// }
// }
// }
// });
// jQuery(".ai-adb-show").each (function () {
// ai_disable_processing (jQuery (this));
// });
ai_adb_process_blocks ();
// var redirected_page = false;
// if (ai_adb_redirection_url.toLowerCase().substring (0, 4) == "http") {
// if (window.location.href == ai_adb_redirection_url) var redirected_page = true;
// } else {
// if (window.location.pathname == ai_adb_redirection_url) var redirected_page = true;
// }
// if (redirected_page) {
// //var cookie = jQuery.cookie (ai_adb_page_redirection_cookie_name);
// var cookie = AiCookies.get (ai_adb_page_redirection_cookie_name);
// if (typeof cookie != "undefined" && cookie.toLowerCase().substring (0, 4) == "http") {
// if (ai_adb_debugging) console.log ("AI AD BLOCKING returning to", cookie);
// //jQuery.removeCookie (ai_adb_page_redirection_cookie_name, {path: "/"});
// AiCookies.remove (ai_adb_page_redirection_cookie_name, {path: "/"});
// window.location.replace (cookie);
// }
// }
}
}
if (AI_DBG_AI_DEBUG_AD_BLOCKING) jQuery (document).ready (function () {ai_adb_detected (0)});
jQuery (document).ready (function ($) {
$(window).ready (function () {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 6
// var ai_adb_debugging = false;
// var ai_debugging_active = typeof ai_adb_fe_dbg !== 'undefined';
ai_debugging_active = typeof ai_adb_fe_dbg !== 'undefined';
setTimeout (function() {
$("#ai-adb-bar").click (function () {
AiCookies.remove (ai_adb_act_cookie_name, {path: "/"});
AiCookies.remove (ai_adb_pgv_cookie_name, {path: "/"});
// window.AI_ADB_STATUS_MESSAGE=5;
ai_adb_message_code_5 ();
ai_dummy = 15; // Do not remove - to prevent optimization
});
}, 2);
// if (jQuery("#banner-advert-container").length) {
// if ($("#banner-advert-container img").length > 0) {
// if ($("#banner-advert-container img").outerHeight() === 0) {
// if (!ai_adb_active || ai_debugging_active) ai_adb_detected (3);
// } else ai_adb_undetected (3);
// $("#banner-advert-container img").remove();
// }
// }
if ((!ai_adb_active || ai_debugging_active) && ai_adb_selectors != "") {
var ai_adb_el_counter = 0;
var ai_adb_el_zero = 0;
var ai_adb_selector = ai_adb_selectors.split (",");
$.each (ai_adb_selector, function (i) {
ai_adb_selector [i] = ai_adb_selector [i].trim ();
if (ai_adb_debugging) console.log ("AI AD BLOCKING selector", ai_adb_selector [i]);
if ($(ai_adb_selector [i]).length != 0) {
$(ai_adb_selector [i]).each (function (n) {
var outer_height = $(this).outerHeight ();
if (ai_adb_debugging) console.log ("AI AD BLOCKING element id=\"" + $(this).attr ("id") + "\" class=\"" + $(this).attr ("class") + "\" heights:", $(this).outerHeight (), $(this).innerHeight (), $(this).height ());
var ai_attributes = $(this).find ('.ai-attributes');
if (ai_attributes.length) {
ai_attributes.each (function (){
if (ai_adb_debugging) console.log ("AI AD BLOCKING attributes height:", $(this).outerHeight ());
if (outer_height >= $(this).outerHeight ()) {
outer_height -= $(this).outerHeight ();
}
});
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING effective height:", outer_height);
ai_adb_el_counter ++;
if (outer_height === 0) {
$ (document).ready (function () {if (!ai_adb_active || ai_debugging_active) ai_adb_detected (4)});
ai_adb_el_zero ++;
if (!ai_debugging_active) return false;
}
});
}
});
if (ai_adb_el_counter != 0 && ai_adb_el_zero == 0) $(document).ready (function () {ai_adb_undetected (4)});
}
});
});
function ai_adb_get_script (ai_adb_script, ai_adb_action) {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 7
// var ai_adb_debugging = false;
if (ai_adb_debugging) console.log ("AI AD BLOCKING loading script", ai_adb_script);
var script = document.createElement ('script');
var date = new Date();
script.src = 'ai-adb-url' + ai_adb_script + '.js?ver=' + date.getTime();
var head = document.getElementsByTagName ('head')[0],
done = false;
// Attach handlers for all browsers
script.onerror = function () {
if (ai_adb_debugging) console.log ("AI AD BLOCKING error loading script", ai_adb_script);
if (ai_adb_action) {
ai_adb_action ();
}
script.onerror = null;
head.removeChild (script);
}
script.onload = script.onreadystatechange = function () {
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
done = true;
if (ai_adb_debugging) console.log ("AI AD BLOCKING script loaded ", ai_adb_script);
if (ai_adb_action) {
ai_adb_action ();
}
script.onload = script.onreadystatechange = null;
head.removeChild (script);
};
};
head.appendChild (script);
};
jQuery (window).on ('load', function () {
var ai_adb_debugging = typeof ai_debugging !== 'undefined'; // 8
// var ai_adb_debugging = false;
if (typeof MobileDetect !== "undefined") {
var md = new MobileDetect (window.navigator.userAgent);
// ENABLED FOR_ALL_DEVICES
if (ai_adb_devices != 6) {
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICES:', ai_adb_devices);
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE desktop', !md.mobile ());
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE mobile', !!md.mobile ());
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE phone', !!md.phone ());
if (ai_adb_debugging) console.log ('AI AD BLOCKING DEVICE tablet', !!md.tablet ());
switch (ai_adb_devices) {
// ENABLED FOR DESKTOP_DEVICES
case 0:
if (!!md.mobile ()) return false;
break;
// ENABLED FOR MOBILE_DEVICES
case 1:
if (!md.mobile ()) return false;
break;
// ENABLED FOR TABLET_DEVICES
case 2:
if (!md.tablet ()) return false;
break;
// ENABLED FOR PHONE_DEVICES
case 3:
if (!md.phone ()) return false;
break;
// ENABLED FOR DESKTOP_TABLET_DEVICES
case 4:
if (!!md.phone ()) return false;
break;
// ENABLED FOR DESKTOP_PHONE_DEVICES
case 5:
if (!!md.tablet ()) return false;
break;
}
}
}
if (ai_adb_debugging) console.log ("AI AD BLOCKING window load");
function ai_adb_1 () {
if (!document.getElementById (ai_adb_name_1)){
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (1);
} else {
ai_adb_undetected (1);
}
}
function ai_adb_2 () {
if (typeof window [ai_adb_name_2] == "undefined") {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (2);
} else {
ai_adb_undetected (2);
}
}
function ai_adb_11 () {
if (typeof window.ad_banner == "undefined") {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (11);
} else {
ai_adb_undetected (11);
}
}
function ai_adb_12 () {
if (typeof window.ad_300x250 == "undefined") {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (12);
} else {
ai_adb_undetected (12);
}
}
function ai_adb_external_scripts () {
if (ai_adb_debugging) console.log ("AI AD BLOCKING check external scripts");
var element = jQuery (b64d ("I2FpLWFkYi1nYQ=="));
if (element.length) {
if (!!(element.width () * element.height ())) {
ai_adb_undetected (5);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (5);
}
}
var element = jQuery (b64d ("I2FpLWFkYi1tbg=="));
if (element.length) {
if (!!(element.width () * element.height ())) {
ai_adb_undetected (6);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (6);
}
}
var element = jQuery (b64d ("I2FpLWFkYi1kYmxjbGs="));
if (element.length) {
if (!!(element.width () * element.height ())) {
ai_adb_undetected (8);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (8);
}
}
var element = jQuery (b64d ("I2FpLWFkYi1hbQ=="));
if (element.length) {
if (!!(element.width () * element.height ())) {
ai_adb_undetected (13);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (13);
}
}
var element = jQuery (b64d ("I2FpLWFkYi1xdQ=="));
if (element.length) {
if (!!(element.width () * element.height ())) {
ai_adb_undetected (14);
} else {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (14);
}
}
}
setTimeout (function() {
if (ai_adb_debugging) console.log ("AI AD BLOCKING delayed checks external scripts");
ai_adb_external_scripts ();
// Check again, result is delayed
setTimeout (function() {
if (!ai_adb_active) {
setTimeout (function() {
ai_adb_external_scripts ();
}, 400);
}
}, 5);
}, 1050);
setTimeout (function() {
var ai_debugging_active = typeof ai_adb_fe_dbg !== 'undefined';
if (ai_adb_debugging) console.log ("AI AD BLOCKING delayed checks 1, 2, 3, 11, 12");
if (jQuery(b64d ("I2FpLWFkYi1hZHM=")).length) {
if (!document.getElementById (ai_adb_name_1)) {
ai_adb_get_script ('ads', ai_adb_1);
} else ai_adb_1 ();
}
if (jQuery(b64d ("I2FpLWFkYi1zcG9uc29ycw==")).length) {
if (typeof window [ai_adb_name_2] == "undefined") {
ai_adb_get_script ('sponsors', ai_adb_2);
} else ai_adb_2 ();
}
var banner_advert_container = b64d ("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVy");
var banner_advert_container_img = b64d ("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVyIGltZw==");
if (jQuery(banner_advert_container).length) {
if (jQuery(banner_advert_container_img).length > 0) {
if (jQuery(banner_advert_container_img).outerHeight() === 0) {
if (!ai_adb_active || ai_debugging_active) ai_adb_detected (3);
} else ai_adb_undetected (3);
jQuery(banner_advert_container_img).remove();
}
}
if (jQuery(b64d ("I2FpLWFkYi1iYW5uZXI=")).length) {
ai_adb_11 ();
}
if (jQuery(b64d ("I2FpLWFkYi0zMDB4MjUw")).length) {
ai_adb_12 ();
}
}, 1150);
});
PK ! m8 8 # includes/js/ai-mobile-detect.min.jsnu [ ;!function(a,b){a(function(){"use strict";function a(a,b){return null!=a&&null!=b&&a.toLowerCase()===b.toLowerCase()}function c(a,b){var c,d,e=a.length;if(!e||!b)return!1;for(c=b.toLowerCase(),d=0;d=0&&(c=c.substring(0,j)+"([\\w._\\+]+)"+c.substring(j+5)),b[e]=new RegExp(c,"i");k.props[a]=b}d(k.oss),d(k.phones),d(k.tablets),d(k.uas),d(k.utils),k.oss0={WindowsPhoneOS:k.oss.WindowsPhoneOS,WindowsMobileOS:k.oss.WindowsMobileOS}}(),g.findMatch=function(a,b){for(var c in a)if(i.call(a,c)&&a[c].test(b))return c;return null},g.findMatches=function(a,b){var c=[];for(var d in a)i.call(a,d)&&a[d].test(b)&&c.push(d);return c},g.getVersionStr=function(a,b){var c,d,e,f,h=g.mobileDetectRules.props;if(i.call(h,a))for(c=h[a],e=c.length,d=0;d1&&(a=b[0]+".",b.shift(),a+=b.join("")),Number(a)},g.isMobileFallback=function(a){return g.detectMobileBrowsers.fullPattern.test(a)||g.detectMobileBrowsers.shortPattern.test(a.substr(0,4))},g.isTabletFallback=function(a){return g.detectMobileBrowsers.tabletPattern.test(a)},g.prepareDetectionCache=function(a,c,d){if(a.mobile===b){var e,h,i;return(h=g.findMatch(g.mobileDetectRules.tablets,c))?(a.mobile=a.tablet=h,void(a.phone=null)):(e=g.findMatch(g.mobileDetectRules.phones,c))?(a.mobile=a.phone=e,void(a.tablet=null)):void(g.isMobileFallback(c)?(i=f.isPhoneSized(d),i===b?(a.mobile=g.FALLBACK_MOBILE,a.tablet=a.phone=null):i?(a.mobile=a.phone=g.FALLBACK_PHONE,a.tablet=null):(a.mobile=a.tablet=g.FALLBACK_TABLET,a.phone=null)):g.isTabletFallback(c)?(a.mobile=a.tablet=g.FALLBACK_TABLET,a.phone=null):a.mobile=a.tablet=a.phone=null)}},g.mobileGrade=function(a){var b=null!==a.mobile();return a.os("iOS")&&a.version("iPad")>=4.3||a.os("iOS")&&a.version("iPhone")>=3.1||a.os("iOS")&&a.version("iPod")>=3.1||a.version("Android")>2.1&&a.is("Webkit")||a.version("Windows Phone OS")>=7||a.is("BlackBerry")&&a.version("BlackBerry")>=6||a.match("Playbook.*Tablet")||a.version("webOS")>=1.4&&a.match("Palm|Pre|Pixi")||a.match("hp.*TouchPad")||a.is("Firefox")&&a.version("Firefox")>=12||a.is("Chrome")&&a.is("AndroidOS")&&a.version("Android")>=4||a.is("Skyfire")&&a.version("Skyfire")>=4.1&&a.is("AndroidOS")&&a.version("Android")>=2.3||a.is("Opera")&&a.version("Opera Mobi")>11&&a.is("AndroidOS")||a.is("MeeGoOS")||a.is("Tizen")||a.is("Dolfin")&&a.version("Bada")>=2||(a.is("UC Browser")||a.is("Dolfin"))&&a.version("Android")>=2.3||a.match("Kindle Fire")||a.is("Kindle")&&a.version("Kindle")>=3||a.is("AndroidOS")&&a.is("NookTablet")||a.version("Chrome")>=11&&!b||a.version("Safari")>=5&&!b||a.version("Firefox")>=4&&!b||a.version("MSIE")>=7&&!b||a.version("Opera")>=10&&!b?"A":a.os("iOS")&&a.version("iPad")<4.3||a.os("iOS")&&a.version("iPhone")<3.1||a.os("iOS")&&a.version("iPod")<3.1||a.is("Blackberry")&&a.version("BlackBerry")>=5&&a.version("BlackBerry")<6||a.version("Opera Mini")>=5&&a.version("Opera Mini")<=6.5&&(a.version("Android")>=2.3||a.is("iOS"))||a.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||a.version("Opera Mobi")>=11&&a.is("SymbianOS")?"B":(a.version("BlackBerry")<5||a.match("MSIEMobile|Windows CE.*Mobile")||a.version("Windows Mobile")<=5.2,"C")},g.detectOS=function(a){return g.findMatch(g.mobileDetectRules.oss0,a)||g.findMatch(g.mobileDetectRules.oss,a)},g.getDeviceSmallerSide=function(){return window.screen.width