HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/woolentor-addons/includes/admin/assets/js/woolentor-condition.js
// Fields Conditions System
;( function ( $ ) {
	"use strict";

    $.fn.woolentor_conditions = function() {
        return this.each( function() {
    
            var $this   = $(this),
                $fields = $this.children('[data-controller]');
    
            if( $fields.length ) {
    
                var condition_ruleset = $.woolentor_deps.createRuleset(),
                    all_conditions = [];
    
                $fields.each( function() {
    
                    var $field      = $(this),
                        controllers = $field.data('controller').split('|'),
                        conditions  = $field.data('condition').split('|'),
                        values      = $field.data('value').toString().split('|'),
                        ruleset     = condition_ruleset;
    
                    $.each( controllers, function( index, depend_id ) {
    
                        var value     = values[index] || '',
                            condition = conditions[index] || conditions[0];
                        
                        ruleset = ruleset.createRule('[data-depend-id="'+ depend_id +'"]', condition, value );
    
                        ruleset.include( $field );
    
                        all_conditions.push( depend_id );
    
                    });
    
                });
    
                if ( all_conditions.length ) {
                    $.woolentor_deps.enable($this, condition_ruleset, all_conditions);
                }
    
            }
    
        });
    };
})(jQuery);