PageSourceSearch

https://www.endocrincentr.ru/sites/all/modules/bylight/by_impaired/uhpv-full.min.js?tlt5f2

js endocrincentr.ru collected 2026-09-24 19:06:16 UTC 12,129 bytes, 320 lines download raw bytes

1var changeBgIndex = null,
2    changeFontSize = null,
3    toggleImgVisibility = null,
4    toggleImpiredMode = null,
5    impiredCookieMode = null,
6    inspiredToolbarWidth = 0;
7
8var timg = '', otherMarkup = '', width = '', ac = 0, toolbarPosition = '', lgs = {};
9
10jQuery(function () {
11    (function ($) {
12
13        const POSITION_HIDDEN = 3;
14        const POSITION_FIXED = 2;
15        const POSITION_NOT_FIXED = 1;
16
17        const DEFAULT_BG_INDEX = 1;
18        const DEFAULT_IMAGE_STATUS = false;
19        const DEFAULT_FONT_SIZE_INDEX = 1;
20
21        var currentBgIdx = DEFAULT_BG_INDEX;
22        var currentFontSize = 15;
23
24        var runImpiredMode;
25
26        impiredCookieMode = getCookieValue('mode') ? "on" : "off";
27
28        /**
29         * Переключатель режима
30         */
31        toggleImpiredMode = function () {
32            if (getCookieValue('mode')) {
33
34                // Включено!, отключает
35                resetCookie('mode');
36                $(document).trigger("toggleImpiredMode", "off");
37                $("body").removeClass("impaired-mode");
38                window.location.reload();
39
40            } else {
41
42                // Отключено!, включает
43                setCookieValue('mode', 'inspired');
44                runImpiredMode(modeOn);
45                $("body").addClass("impaired-mode");
46                $(document).trigger("toggleImpiredMode", "on");
47            }
48        }
49
50        runImpiredMode = function (modeOn) {
51            if (modeOn) {
52                setCookieValue('mode', 'inspired');
53            }
54
55            if(getCookieValue('mode')){
56                $("body").addClass("impaired-mode");
57            }
58
59            if (inspiredToolbarPosition && getCookieValue('mode')) {
60
61                currentFontSize = getCookieValue('fSize') ? getCookieValue('fSize') :  fonts[DEFAULT_FONT_SIZE_INDEX];
62
63                currentBgIdx = getCookieValue('bg_index') ? getCookieValue('bg_index') : DEFAULT_BG_INDEX ;
64
65                if (inspiredToolbarPosition !== 1) {
66                    toolbarPosition = 'fixed';
67                }
68
69                if (inspiredToolbarWidth) {
70                    width = inspiredToolbarWidth + 'px';
71                } else {
72                    width = '100%';
73                }
74                var markup = "";
75                if (inspiredToolbarPosition == POSITION_NOT_FIXED || inspiredToolbarPosition == POSITION_FIXED) {
76                    markup =
77                        '<div id="hpvgd" style="position:' + toolbarPosition + ';">' +
78                        '<div id="impaired-toolbar-inner" class="h-mdiv" style="width:' + width + ';">' +
79                        '<div style="display:table-cell;" id="uhvv">' +
80                        '<div id="impaired-font-size-div" class="h-ldiv">' + localizedString(lng, 3) + ' </div>' +
81                        '<div id="impaired-bg-color-div" class="h-ldiv" style="display:none;">' + localizedString(lng, 5) + ' </div>' +
82                        '<div id="vimg" class="h-ldiv" style="display:none;">' + localizedString(lng, 4) + ' </div>' +
83                        '<div id="vch" class="h-rdiv" style="display:none;">' +
84                        '<a href="javascript:toggleImpiredMode()" class="runImpiredMode-l" id="maf">' + localizedString(lng, 6) + '</a>' +
85                        '</div>' +
86                        '</div>' +
87                        '</div>' +
88                        '</div>' +
89                        '<div id="h-f"></div>';
90                } else if (inspiredToolbarPosition == POSITION_HIDDEN) {
91                    markup = "";
92                }
93
94                if (!$('#impaired-toolbar-inner').text()) {
95
96                    $('body').prepend(markup)
97                    for (var i = 0, isLast = false; i < fonts.length; i++) {
98                        isLast = (i == fonts.length - 1);
99
100                        var currentClass = '';
101                        if (fonts[i] == currentFontSize) {
102                            currentClass = 'fsize-current'
103                        }
104
105                        $('#impaired-font-size-div')
106                            .append('<a href="javascript://" onclick="changeFontSize(' + fonts[i] + ',this)" id="maf" style="font-size:' + fonts[i] + 'px !important;" class="fsize-changer ' + currentClass + '">' + localizedString(lng, 7) + '</a> ');
107
108
109                        if (isLast) {
110                            $('#impaired-toolbar-inner').show();
111                        }
112                    }
113
114                    if (toggleImg) {
115                        if(!DEFAULT_IMAGE_STATUS)
116                            setCookieValue('imgHidden', 1);
117
118                        if (getCookieValue('imgHidden')) {
119                            timm = localizedString(lng, 1);
120                            $('img:visible').addClass('h-ni');
121                            $("body").addClass("impaired-img-off");
122                        } else {
123                            timm = localizedString(lng, 2);
124                        }
125
126                        timg = '<a href="javascript://" onclick="toggleImgVisibility()" class="runImpiredMode-l hvit" id="maf">' + timm + '</a>';
127
128                        $('#vimg').append(timg);
129                        $('#vimg').show()
130                    }
131
132                    if (chooseBg) {
133                        if (bgColors.length) {
134                            var markup = "";
135                            for (var i = 0; i < bgColors.length; i++) {
136
137                                var currentClass = "";
138                                if (bgColors[i] == currentBgIdx) {
139                                    currentClass = ' h-ab';
140                                }
141
142                                markup += '<a href="javascript://" onclick="changeBgIndex(' + bgColors[i] + ',this)" class="h-background-' + bgColors[i] + ' h-fi' + currentClass + '" id="maf">' + localizedString(lng, 7) + '</a>';
143                            }
144
145                            markup += '<a href="javascript://" onclick="changeBgIndex(0,this)" id="maf" class="hcmaf">' + localizedString(lng, 8) + '</a>';
146
147                            $('#impaired-bg-color-div').append(markup);
148                            $('#impaired-bg-color-div').show();
149                        }
150                    }
151
152                    if (!modeOn) {
153                        $('#vch').show();
154                    }
155                }
156
157                if (inspiredToolbarWidth < 1200) {
158                    mhw = 1200;
159                } else {
160                    mhw = $('#impaired-toolbar-inner').width();
161                }
162
163                if ($(window).width() < mhw) {
164                    $('.h-ldiv,.h-rdiv').css({
165                        'float': 'none',
166                        'text-align': 'left',
167                        'position': 'static',
168                        'padding-left': '5px'
169                    });
170                    $('.hswm').hide();
171                }
172
173                $('body,table,div,tr,td,ul,li,span,a[id!=maf],p').css({'fontSize': currentFontSize + 'px'});
174                $('.h-mdiv,.h-ldiv,.h-rdiv,.h-fdiv,.runImpiredMode-l,.hswm').css('fontSize', fonts[fonts.length - 1] + 'px');
175
176                setTimeout(function () {
177
178                    if (currentBgIdx > 0) {
179                        $('body,table,div[id!=impaired-toolbar-inner][id!=impaired-font-size-div][id!=vimg][id!=impaired-bg-color-div][id!=hpvgd][id!=uhvv][id!=vch],tr,td,ul,li,span[class!=hswm],a[id!=maf],p,b').addClass('h-background-' + currentBgIdx);
180                        $('#impired-toolbar-target-container .h-background-' + currentBgIdx).removeClass('h-background-' + currentBgIdx);
181                    }
182
183                    if (!inspiredToolbarWidth) {
184                        $('#impaired-font-size-div').css('padding-left', '15px');
185                        $('#vch').css('padding-right', '15px');
186                    }
187                }, 1);
188
189                if (inspiredToolbarPosition == POSITION_FIXED) {
190                    $('#h-f').height($('#impaired-toolbar-inner').height());
191                }
192
193                if (inspiredToolbarPosition == POSITION_HIDDEN) {
194                    $('#hpvgd2').css('top', (($(window).height() - Number(200)) / 2) + 'px');
195                }
196            }
197        }
198
199        function localizedString(lang, strIndex) {
200            return lgs[lang][strIndex];
201        }
202
203        changeFontSize = function (f, t) {
204
205            setCookieValue("fSize", f);
206
207            $('.fsize-changer').removeClass('fsize-current');
208            $(t).addClass('fsize-current');
209
210            runImpiredMode(modeOn);
211        }
212
213        toggleImgVisibility = function () {
214            if (getCookieValue('imgHidden')) {
215
216                resetCookie('imgHidden');
217                $("body").removeClass("impaired-img-off");
218                $('.h-ni').removeClass('h-ni');
219
220                $('.hvit').text(localizedString(lng, 2));
221
222            } else {
223                setCookieValue('imgHidden', 1);
224                $("body").addClass("impaired-img-off");
225
226                $('img:visible').addClass('h-ni');
227                $('.hvit').text(localizedString(lng, 1));
228            }
229        }
230
231        changeBgIndex = function (n, t) {
232            $('.h-ab').removeClass('h-ab');
233            $(t).addClass('h-ab');
234
235            if (getCookieValue('bg_index')) {
236                b = getCookieValue('bg_index')
237            } else {
238                b = 1
239            }
240
241            if (n == 0) {
242                setCookieValue('bg_index', 0);
243                $('.h-background-' + b + '[id!=maf]').removeClass('h-background-' + b);
244            } else {
245                setCookieValue('bg_index', n);
246                if (b) {
247                    $('.h-background-' + b + '[id!=maf]').removeClass('h-background-' + b);
248                }
249
250                $('body,table,div[id!=impaired-toolbar-inner][id!=impaired-font-size-div][id!=vimg][id!=impaired-bg-color-div][id!=vch][id!=hpvgd][id!=uhvv],tr,td,ul,li,span[class!=hswm],a[id!=maf],p,b').addClass('h-background-' + n);
251
252                setTimeout(function () {
253                    $('#impired-toolbar-target-container .h-background-' + n).removeClass('h-background-' + n)
254                }, 1);
255            }
256        }
257
258        function setCookieValue(name, value) {
259            document.cookie = name + "=" + escape(value) + ";expires=Mon,01-Jan-2025 00:00:00 GMT;path=/"
260        }
261
262        function getCookieValue(fcm) {
263            var results = document.cookie.match('(^|;) ?' + fcm + '=([^;]*)(;|$)');
264            if (results) {
265                return (unescape(results[2]));
266            } else {
267                return null;
268            }
269        }
270
271        function resetCookie(key) {
272            var cookie_date = new Date();
273            cookie_date.setTime(cookie_date.getTime() - 1);
274
275            document.cookie = key += "=;expires=" + cookie_date.toGMTString() + ";path=/"
276        };
277
278        $(window).resize(function () {
279            runImpiredMode(modeOn);
280            $(document).trigger("toggleImpiredMode", modeOn ? "on" : "off");
281        });
282
283        lgs['ru'] = {
284            1: 'показать',
285            2: 'отключить',
286            3: 'Размер шрифтов:',
287            4: 'Изображения:',
288            5: 'Фон:',
289            6: 'Выключить',
290            7: 'A',
291            8: 'X'
292        };
293        lgs['en'] = {
294            1: 'show',
295            2: 'disable',
296            3: 'Font Size:',
297            4: 'Images:',
298            5: 'Background:',
299            6: 'Switch off',
300            7: 'A',
301            8: 'X'
302        };
303        lgs['ua'] = {
304            1: 'показати',
305            2: 'відключити',
306            3: 'Розмір шрифтів:',
307            4: 'Зображення:',
308            5: 'Фон:',
309            6: 'Вимкнути',
310            7: 'A',
311            8: 'X'
312        }
313    })(jQuery);
314
315    (function ($) {
316        $(document).on("impaired_toggle", function () {
317            toggleImpiredMode();
318        });
319    })(jQuery);
320});

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.