PageSourceSearch

https://matras73.ru/js/splited_size_selector_reg.js

js matras73.ru collected 2026-09-28 23:15:23 UTC 2,859 bytes, 131 lines download raw bytes

1 
2class CatalogGoodItemSelectDialog extends TextAjaxSelectDialog
3{
4    constructor(selector) 
5    {
6        super($(selector).closest('.good-layout'));
7    }
8        
9    getSizeIntValue()
10    {
11        return $('input[name="size"]', this.context).val();
12    }
13    
14    getAjaxUrl()
15    {
16        return `/shop/good_ajax.php?id=${this.context.attr('data-id')}&sizes=${this.getSizeIntValue()}&json=splited-selector`;
17    }
18    
19    onSizeSelected(size)
20    {
21        good_dropdown_set_size(this.context, size.size);
22
23        showCatalogSplitedSelector(null, true, size.id);
24    }
25}
26
27
28class ListcartItemSelectDialog extends TextAjaxSelectDialog
29{
30    constructor(selector, oi_id, id, size) 
31    {
32        super($(selector).closest('.cart-item'));
33        
34        this.oi_id = oi_id;
35        this.idgood = id;
36        this.size = size;
37    }
38        
39    getSizeIntValue()
40    {
41        return this.size;
42    }
43    
44    getAjaxUrl()
45    {
46        return `/shop/good_ajax.php?id=${this.idgood}&sizes=${this.getSizeIntValue()}&json=splited-selector`;
47    }
48    
49    onSizeSelected(size)
50    {
51        ItemChangeSize(this.oi_id, size.id);
52    }
53}
54
55
56class ListorderItemSelectDialog extends TextAjaxSelectDialog
57{
58    constructor(selector, oi_id) 
59    {
60        super(selector);
61        this.oi_id = oi_id;
62
63        this.idgood = $(selector).attr('data-idgood');
64    }
65    
66    getSizeIntValue()
67    {
68        return $('input', this.context).val();
69    }
70        
71    getAjaxUrl()
72    {
73        return `/shop/good_ajax.php?id=${this.idgood}&sizes=${this.getSizeIntValue()}&json=splited-selector`;
74    }
75    
76    onSizeSelected(size)
77    {
78        if(super.onSizeSelected(size))
79        {
80            $('input', this.context).val(size.id);
81            
82            $(this.context).closest('.lo-good-row')
83                .find('.lo-size-name').html(size.name);
84            
85            loUpdateOrderItem(this.oi_id );
86        }
87    }
88}
89
90class CatalogSizeSelectDialog extends SimpleSelectDialog
91{
92    initialize()
93    {
94        super.initialize();
95        
96        const _ = this;
97         
98        $('body').on('catalog_ajax_updated', function()
99        {
100            _.prepareData(___sizes_json);
101            
102            _.setupOverlay($('.catalog-splited-size'));
103        });
104    }
105    
106    onSizeSelected(size)
107    {
108        if(super.onSizeSelected(size))
109        {
110            location = size.size.url;
111        }
112    }
113}
114
115class VpSizeSelectDialog extends SimpleSelectDialog
116{
117    constructor(selector, context) 
118    {
119        super(selector);
120        
121        this.context = context;
122    }
123    
124    onSizeSelected(size)
125    {
126        if(super.onSizeSelected(size))
127        {
128            location = size.size.url;
129        }
130    }
131}

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.