PageSourceSearch

https://doktver.ru/modules/mod_jlcontentfieldsfilter/assets/javasc…?4527b8906cc204bf9c547cbb9152d067

js doktver.ru collected 2026-09-28 22:54:28 UTC 4,908 bytes, 124 lines download raw bytes

1var JlContentFieldsFilter = {
2    params: [],
3    init: function (data) {
4        var id = data.form_identifier;
5        this.params[id] = {
6            autho_send: typeof data.autho_send !== 'undefined' ? data.autho_send : 0,
7            ajax: typeof data.ajax !== 'undefined' ? data.ajax : 0,
8            ajax_selector: typeof data.ajax_selector !== 'undefined' ? data.ajax_selector : '#content',
9            ajax_loader: typeof data.ajax_loader !== 'undefined' && data.ajax_loader != '' ? data.ajax_loader : '/modules/mod_jlcontentfieldsfilter/assets/images/ajax_loader.gif',
10            ajax_loader_width: typeof data.ajax_loader_width !== 'undefined' ? data.ajax_loader_width : 32
11        };
12        var $this = this;
13        var params = this.params[id];
14        jQuery(document).ready(function () {
15            
16			if (params.autho_send === 1) {
17                var sendTimeoutID = 0;
18                jQuery('input[type="radio"], input[type="checkbox"], select', '#' + id)
19                    .on('change', function () {
20                        params.ajax === 1 ? $this.loadData(id) : jQuery(this).parents('form').submit();
21                    });
22                jQuery('input[type="text"]', '#' + id)
23                    .on('keyup', function () {
24                        var input = jQuery(this);
25                        clearTimeout(sendTimeoutID);
26                        sendTimeoutID = setTimeout(function () {
27                            params.ajax === 1 ? $this.loadData(id) : input.parents('form').submit();
28                        }, 500);
29                    });
30            }
31            else if (params.ajax === 1) {
32                jQuery('input[type="submit"]', '#' + id).on('click', function (event) {
33                    event.preventDefault();
34                    $this.loadData(id);
35                });
36            }
37        });
38    },
39    clearForm: function (element) {
40        var form = jQuery(element).parents('form');
41        var id = form.attr('id');
42        var params = this.params[id];
43		
44
45        form.find(':checked, :selected, select')
46            .not('[type="button"], [type="submit"], [type="reset"], [type="hidden"]')
47            .removeAttr('checked')
48            .removeAttr('selected');
49        form.find('input[type="text"]').val('');
50        form.find('select').prop('selectedIndex', 0);
51        if (params.ajax === 1 && params.autho_send === 1) {
52            this.loadData(id);
53        }
54        else if (params.autho_send === 1) {
55			jQuery(id).submit();
56			
57        }
58        return false;
59    },
60    clearRadio: function (element) {
61        var form = jQuery(element).parents('form');
62        var id = form.attr('id');
63        var params = this.params[id];
64        jQuery(element).parent().find('input[type="radio"]:checked').removeAttr('checked');
65        if (params.autho_send === 1) {
66            if (params.ajax === 1) {
67                this.loadData(id);
68            }
69            else {
70                jQuery(element).parents('form').submit();
71            }
72        }
73    },
74    loadData: function (id) {
75        var $this = this;
76        var params = this.params[id];
77        var form = jQuery('#' + id);
78        $this.ShowLoadingScreen(id);
79        jQuery.ajax({
80            type: 'POST',
81            url: form.attr('action'),
82            cache: 'false',
83            data: form.serialize() + '&tmpl=jlcomponent_ajax',
84            dataType: 'html',
85            success: function (data) {
86                jQuery(params.ajax_selector).html(data);
87                $this.HideLoadingScreen();
88            }
89        });
90    },
91    ShowLoadingScreen: function (id) {
92        var params = this.params[id];
93        jQuery("body").css("cursor", "wait");
94
95        var fade_div = jQuery("#id_admin_forms_fade");
96
97        if (fade_div.length == 0) {
98            // Создаем div
99            fade_div = jQuery('<div></div>')
100                .appendTo(document.body)
101                .hide()
102                .attr('id', "id_admin_forms_fade")
103                .attr('className', "shadowed")
104                .css('z-index', "1500")
105                .css('position', "absolute")
106                .css('left', "50%")
107                .css('top', "50%")
108                .append('<img src="' + params.ajax_loader + '" id="id_fade_div_img" />')
109                .css('width', params.ajax_loader_width);
110        }
111
112        fade_div
113            .show()
114            .css('top', (jQuery(window).height() - fade_div.outerHeight(true)) / 2 + jQuery(window).scrollTop())
115            .css('left', (jQuery(window).width() - fade_div.outerWidth(true)) / 2 + jQuery(window).scrollLeft());
116    },
117    HideLoadingScreen: function () {
118        jQuery("body").css("cursor", "auto");
119        jQuery("#id_admin_forms_fade").css('display', 'none');
120    }
121};
122
123
124

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.