PageSourceSearch

https://mcherem.ru/bitrix/templates/corp_services_gray/dist/scripts/bvi.js

js mcherem.ru collected 2026-10-08 18:46:33 UTC 53,955 bytes, 1,171 lines download raw bytes

1/*!
2 * Button visually impaired v1.0.6
3 */
4(function($) {
5    var method = {
6        BviConsoleLog: function (setting, fun, param) {
7            if (setting == 1 ) {
8                $.each(param, function (id, value) {
9                    console.log('console.log.bvi - ' + fun + ' | [' + id + ' - (' + value + ')]');
10                });
11
12            } else {
13                console.log('Bvi [console.log.bvi - off]');
14            }
15        },
16        Init: function(setting, selector) {
17            var selector = '.bvi-panel-open, '+selector;
18
19
20            var setting = $.extend({
21                BviPanel: 1,
22                BviPanelActive: 0,
23                BviPanelBg: "white",
24                BviPanelFontFamily: "default",
25                BviPanelFontSize: "12",
26                BviPanelLetterSpacing: "normal",
27                BviPanelLineHeight: "normal",
28                BviPanelImg: 1,
29                BviPanelImgXY: 1,
30                BviPanelReload: 0,
31                BviPanelText: 'Версия для слабовидящих',
32                BviPanelCloseText: 'Обычная версия сайта',
33                BviCloseClassAndId: '',
34                BviFixPanel: 1,
35                BviPlay: 0,
36                BviFlash: 0,
37                BviConsoleLog: 1,
38                BviPanelHide: 0
39            }, setting);
40
41            console.log('Button visually impaired v1.0.6');
42
43            function BviOn() {
44
45                if (Cookies.get("bvi-panel") == '1') {
46                    $('*').each(function () {
47                        if (!$(this).attr('data-bvi-original')) $(this).attr('data-bvi-original', $(this).attr('style'));
48                    });
49                    BviPanel();
50                    method.Bvi(setting);
51                }
52            }
53
54            BviOn();
55
56            function BviPanel() {
57                $(selector).addClass('bvi-hide');
58                $('.bvi-panel-open-menu').addClass('bvi-hide');
59                $(selector).after($('<a href="#" class="bvi-panel-close" title="'+setting.BviPanelCloseText+'"><i class="bvi-glyphicon bvi-glyphicon-eye-close"></i> '+setting.BviPanelCloseText+'</a>'));
60                $('.bvi-panel-open-menu').after($('<li class="bvi-panel-close"><a href="#" class="bvi-panel-close" title="'+setting.BviPanelCloseText+'"> '+setting.BviPanelCloseText+'</a></li>'));
61                $(setting.BviCloseClassAndId).hide();
62                $('body').wrapInner('<div class="bvi-body"></div>');//wrapInner
63                $('<div class="bvi-panel"></div>').prependTo("body");
64                var scroll = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
65                if (setting.BviFixPanel == '1') {
66                    if (scroll > 99) {
67                        $(".bvi-panel").addClass("bvi-panel-fixed");
68                    }
69
70                    $(window).scroll(function () {
71                        if ($(this).scrollTop() >= 99) {
72                            $(".bvi-panel").addClass("bvi-panel-fixed");
73                            $(".bvi-panel").css({
74                                "left": 0,
75                                "top": 0,
76                                "right": 0,
77                                "margin-left": "auto",
78                                "margin-right": "auto",
79                                "position": "fixed",
80                                "z-index": 999999,
81                                "margin-bottom": "20px"
82                            });
83                            $('.bvi-title').hide();
84                            $('#bvi-color-text').hide();
85                            $('#bvi-img-text').hide();
86                            $('#bvi-size-text').hide();
87                            $('#bvi-size-number').hide();
88                        } else {
89                            $(".bvi-panel").removeClass("bvi-panel-fixed");
90                            $(".bvi-panel").removeAttr("style");
91                            $('.bvi-title').show();
92                            $('#bvi-color-text').show();
93                            $('#bvi-img-text').show();
94                            $('#bvi-size-text').show();
95                            $('#bvi-size-number').show();
96                        }
97                    });
98                }
99
100                $('<div class="bvi-container">'+
101                    '<div class="bvi-row">'+
102                    '<div class="bvi-panel-menu">'+
103                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-12 bvi-bg bvi-animated bvi-slideInDown">'+
104                    '<div class="bvi-row">'+
105                    '<div class="bvi-col-xs-6 bvi-col-sm-6 bvi-col-md-2 bvi-col-lg-2 bvi-vertical">'+
106                    '<div class="bvi-rows">'+
107                    '<div class="bvi-title-header">Размер шрифта</div>'+
108                    '<div class="bvi-btn-group">'+
109                    '<a href="#" id="bvi-font-size-minus" class="bvi-btn bvi-btn-default" title="Уменьшить шрифт"><i class="bvi-glyphicon bvi-glyphicon-font"></i><b>-</b></a>'+
110                    '<a href="#" id="bvi-font-size-plus" class="bvi-btn bvi-btn-default" title="Увеличить шрифт"><i class="bvi-glyphicon bvi-glyphicon-font"></i><b>+</b></a>'+
111                    '</div>'+
112                    '<div class="bvi-title-text"><span id="bvi-size-number"></span> <span id="bvi-size-text"></span></div>'+
113                    '</div>'+
114                    '</div>'+
115                    '<div class="bvi-col-xs-6 bvi-col-sm-6 bvi-col-md-4 bvi-col-lg-3 bvi-vertical">'+
116                    '<div class="bvi-rows">'+
117                    '<div class="bvi-title-header">Цвета сайта</div>'+
118                    '<div class="bvi-btn-group">'+
119                    '<a href="#" id="bvi-color-white" class="bvi-btn bvi-btn-white" title="Цвет сайта: Черным по белому"><i class="bvi-glyphicon bvi-glyphicon-font"></i></a>'+
120                    '<a href="#" id="bvi-color-black" class="bvi-btn bvi-btn-black" title="Цвет сайта: Белым по черному"><i class="bvi-glyphicon bvi-glyphicon-font"></i></a>'+
121                    '<a href="#" id="bvi-color-blue" class="bvi-btn bvi-btn-blue" title="Цвет сайта: Темно-синим по голубому"><i class="bvi-glyphicon bvi-glyphicon-font"></i></a>'+
122                    '<a href="#" id="bvi-color-brown" class="bvi-btn bvi-btn-brown" title="Цвет сайта: Коричневым по бежевому"><i class="bvi-glyphicon bvi-glyphicon-font"></i></a>'+
123                    '<a href="#" id="bvi-color-green" class="bvi-btn bvi-btn-green" title="Цвет сайта: Зеленым по темно-коричневому"><i class="bvi-glyphicon bvi-glyphicon-font"></i></a>'+
124                    '</div>'+
125                    '<div class="bvi-title-text"><span id="bvi-color-text"></span></div>'+
126                    '</div>'+
127                    '</div>'+
128                    '<div class="bvi-col-xs-6 bvi-col-sm-6 bvi-col-md-3 bvi-col-lg-3 bvi-vertical">'+
129                    '<div class="bvi-rows">'+
130                    '<div class="bvi-title-header">Изображения</div>'+
131                    '<div class="bvi-btn-group">'+
132                    '<a href="#" id="bvi-img-on" class="bvi-btn bvi-btn-default" title="Включить" style="color: green"><i class="bvi-glyphicon bvi-glyphicon-picture"></i></a>'+
133                    '<a href="#" id="bvi-img-off" class="bvi-btn bvi-btn-default" title="Выключить" style="color: red"><i class="bvi-glyphicon bvi-glyphicon-picture"></i></a>'+
134                    '<a href="#" id="bvi-img-grayscale" class="bvi-btn bvi-btn-default" title="Черно-белые"><i class="bvi-glyphicon bvi-glyphicon-adjust"></i></a>'+
135                    '</div>'+
136                    '<div class="bvi-title-text"><span id="bvi-img-text"></span></div>'+
137                    '</div>'+
138                    '</div>'+
139                    '<div class="bvi-col-xs-6 bvi-col-sm-6 bvi-col-md-4 bvi-col-lg-4">'+
140                    '<div class="bvi-rows">'+
141                    '<div class="bvi-title-header">Дополнительно</div>'+
142                    '<div class="bvi-btn-group">'+
143                    //'<div class="bvi-btn-toolbar">'+
144                    '<a href="#" id="bvi-voice-off" class="bvi-btn bvi-btn-default" title="Синтез речи"><i class="bvi-glyphicon bvi-glyphicon-volume-off"></i></a>'+
145                    '<a href="#" id="bvi-voice-on" class="bvi-btn bvi-btn-default" title="Синтез речи"><i class="bvi-glyphicon bvi-glyphicon-volume-up"></i></a>'+
146                    ///'</div>'+
147                    '<a href="#" id="bvi-settings" class="bvi-btn bvi-btn-default" title="Настройки"><i class="bvi-glyphicon bvi-glyphicon-cog"></i> Настройки</a>'+
148                    '<a href="#" id="bvi-close" class="bvi-btn bvi-btn-default" title="Обычная версия сайта"><i class="bvi-glyphicon bvi-glyphicon-eye-close"></i></a>'+
149                    '<a href="#" id="bvi-panel-hide" class="bvi-btn bvi-btn-default" title="Свернуть панель для слабовидящих"><i class="bvi-glyphicon bvi-glyphicon-arrow-up"></i></a>'+
150                    '</div>'+
151                    '</div>'+
152                    '</div>'+
153                    '</div>'+
154                    '<div class="bvi-row">'+
155                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-12">'+
156                    '<div class="bvi-settings">'+
157                    '<hr>'+
158                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-4">'+
159                    '<div class="bvi-rows">'+
160                    '<div class="bvi-title-header">Кернинг</div>'+
161                    '<div class="bvi-btn-group">'+
162                    '<a href="#" id="bvi-letter-spacing-normal" class="bvi-btn bvi-btn-default" title="Стандартный">Стандартный</a>'+
163                    '<a href="#" id="bvi-letter-spacing-average" class="bvi-btn bvi-btn-default" title="Средний">Средний</a>'+
164                    '<a href="#" id="bvi-letter-spacing-big" class="bvi-btn bvi-btn-default" title="Большой">Большой</a>'+
165                    '</div>'+
166                    '</div>'+
167                    '</div>'+
168                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-4">'+
169                    '<div class="bvi-rows">'+
170                    '<div class="bvi-title-header">Интервал</div>'+
171                    '<div class="bvi-btn-group">'+
172                    '<a href="#" id="bvi-line-height-normal" class="bvi-btn bvi-btn-default" title="Одинарный">Одинарный</a>'+
173                    '<a href="#" id="bvi-line-height-average" class="bvi-btn bvi-btn-default" title="Полуторный">Полуторный</a>'+
174                    '<a href="#" id="bvi-line-height-big" class="bvi-btn bvi-btn-default" title="Двойной">Двойной</a>'+
175                    '</div>'+
176                    '</div>'+
177                    '</div>'+
178                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-4">'+
179                    '<div class="bvi-rows">'+
180                    '<div class="bvi-title-header">Гарнитура</div>'+
181                    '<div class="bvi-btn-group">'+
182                    '<a href="#" id="bvi-font-family-default" class="bvi-btn bvi-btn-default" title="Без засечек">Без засечек</a>'+
183                    //'<a href="#" id="bvi-font-family-arial" class="bvi-btn bvi-btn-default" title="Без засечек">Без засечек</a>'+
184                    '<a href="#" id="bvi-font-family-times-new-roman" class="bvi-btn bvi-btn-default" title="С засечками">С засечками</a>'+
185                    '</div>'+
186                    '</div>'+
187                    '</div>'+
188                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-12">'+
189                    '<div class="bvi-rows">'+
190                    '<div class="bvi-btn-toolbar bvi-left">'+
191                    '<a href="#" id="bvi-flash-on" class="bvi-btn bvi-btn-default" title="Включить Фрейм"><i class="bvi-glyphicon bvi-glyphicon-flash"></i> Включить Фрейм</a>'+
192                    '<a href="#" id="bvi-flash-off" class="bvi-btn bvi-btn-default" title="Отключить Фрейм"><i class="bvi-glyphicon bvi-glyphicon-flash"></i> Выключить Фрейм</a>'+
193                    '<a href="#" id="bvi-settings-default" class="bvi-btn bvi-btn-default" title="Вернуть стандартные настройки"><i class="bvi-glyphicon bvi-glyphicon-refresh"></i> Вернуть стандартные настройки</a>'+
194                    '<a href="#" id="bvi-close" class="bvi-btn bvi-btn-default" title="Обычная версия сайта"><i class="bvi-glyphicon bvi-glyphicon-eye-close"></i> Обычная версия сайта</a>'+
195                    '</div>'+
196                    '<div class="bvi-btn-toolbar bvi-right">'+
197                    '<a href="#" id="bvi-settings-close" class="bvi-btn bvi-btn-default" title="Закрыть"><i class="bvi-glyphicon bvi-glyphicon-remove"></i> Закрыть</a>'+
198                    '</div>'+
199                    '</div>'+
200                    '</div>'+
201                    '<div class="bvi-col-xs-12 bvi-col-sm-12 bvi-col-md-12 bvi-col-lg-12">'+
202                    '<div class="bvi-rows">'+
203                    '<div class="bvi-copy"><a href="http://bvi.isvek.ru/" target="_blank" title="isvek.ru Версия для слабовидящих">isvek.ru Версия для слабовидящих</a><sup>v1.0.6</sup></div>'+
204                    '</div>'+
205                    '</div>'+
206                    '</div>'+
207                    '</div>'+
208                    '</div>'+
209                    '</div>'+
210                    '</div>'+
211                    '<div class="bvi-panel-show"><a href="#" id="bvi-panel-show" class="bvi-btn-panel-show" title="Показать панель для слабовидящих"><i class="bvi-glyphicon bvi-glyphicon-eye"></i></a></div>'+
212                    '</div>'+
213                    '</div>').appendTo(".bvi-panel");
214            }
215
216            if (setting.BviPanelActive == 0 ) {
217                $('.bvi-panel-open-menu,'+selector).click( function () {
218                    Cookies.set("bvi-selector", selector, {
219                        path: "/"
220                    });
221                    Cookies.set("bvi-panel", setting.BviPanel, {
222                        path: "/"
223                    });
224                    Cookies.set("bvi-bgcolor", setting.BviPanelBg, {
225                        path: "/"
226                    });
227                    Cookies.set("bvi-font-size", setting.BviPanelFontSize, {
228                        path: "/"
229                    });
230                    Cookies.set("bvi-letter-spacing", setting.BviPanelLetterSpacing, {
231                        path: "/"
232                    });
233                    Cookies.set("bvi-line-height", setting.BviPanelLineHeight, {
234                        path: "/"
235                    });
236                    Cookies.set("bvi-font-family", setting.BviPanelFontFamily, {
237                        path: "/"
238                    });
239                    Cookies.set("bvi-img", setting.BviPanelImg, {
240                        path: "/"
241                    });
242                    Cookies.set("bvi-reload", setting.BviPanelReload, {
243                        path: "/"
244                    });
245                    Cookies.set("bvi-img-XY", setting.BviPanelImgXY, {
246                        path: "/"
247                    });
248                    Cookies.set("bvi-reload", setting.BviPanelReload, {
249                        path: "/"
250                    });
251                    Cookies.set("bvi-voice", setting.BviPlay, {
252                        path: "/"
253                    });
254                    Cookies.set("bvi-flash", setting.BviFlash, {
255                        path: "/"
256                    });
257                    Cookies.set("bvi-console-log", setting.BviConsoleLog, {
258                        path: "/"
259                    });
260                    Cookies.set("bvi-panel-hide", setting.BviPanelHide, {
261                        path: "/"
262                    });
263                    if (Cookies.get("bvi-voice") == '1') {
264                        responsiveVoice.speak("Версия сайта для слабовидящих", "Russian Female");
265                    }
266                    BviOn();
267                    return false;
268                });
269            }
270        },
271        Bvi: function (setting) {
272            function BviBgColor() {
273                if (Cookies.get("bvi-bgcolor") == 'white') {
274                    $('.bvi-body').addClass('bvi-color-white');
275                    $('.bvi-btn-white').addClass('active');
276                    BviReturnSet({
277                        backgroundcolor: "#ffffff",
278                        color: "#000000"
279                    });
280                    $('#bvi-color-text').html('Черным по белому');
281                } else {
282                    $('.bvi-body').removeClass('bvi-color-white');
283                    $('.bvi-btn-white').removeClass('active');
284                }
285
286                if (Cookies.get("bvi-bgcolor") == 'black') {
287                    $('.bvi-body').addClass('bvi-color-black');
288                    $('.bvi-btn-black').addClass('active');
289                    BviReturnSet({
290                        backgroundcolor: "#000000",
291                        color: "#ffffff"
292                    });
293                    $('#bvi-color-text').html('Белым по черному');
294                } else {
295                    $('.bvi-body').removeClass('bvi-color-black');
296                    $('.bvi-btn-black').removeClass('active');
297                }
298
299                if (Cookies.get("bvi-bgcolor") == 'blue') {
300                    $('.bvi-body').addClass('bvi-color-blue');
301                    $('.bvi-btn-blue').addClass('active');
302                    BviReturnSet({
303                        backgroundcolor: "#9DD1FF",
304                        color: "#063462"
305                    });
306                    $('#bvi-color-text').html('Темно-синим по голубому');
307                } else {
308                    $('.bvi-body').removeClass('bvi-color-blue');
309                    $('.bvi-btn-blue').removeClass('active');
310                }
311
312                if (Cookies.get("bvi-bgcolor") == 'brown') {
313                    $('.bvi-body').addClass('bvi-color-brown');
314                    $('.bvi-btn-brown').addClass('active');
315                    BviReturnSet({
316                        backgroundcolor: "#f7f3d6",
317                        color: "#4d4b43"
318                    });
319                    $('#bvi-color-text').html('Коричневым по бежевому');
320                } else {
321                    $('.bvi-body').removeClass('bvi-color-brown');
322                    $('.bvi-btn-brown').removeClass('active');
323                }
324
325                if (Cookies.get("bvi-bgcolor") == 'green') {
326                    $('.bvi-body').addClass('bvi-color-green');
327                    $('.bvi-btn-green').addClass('active');
328                    BviReturnSet({
329                        backgroundcolor: "#3B2716",
330                        color: "#A9E44D"
331                    });
332                    $('#bvi-color-text').html('Зеленым по темно-коричневому');
333                } else {
334                    $('.bvi-body').removeClass('bvi-color-green');
335                    $('.bvi-btn-green').removeClass('active');
336                }
337            }
338
339            function BviPanelHide() {
340                if (Cookies.get("bvi-panel-hide") == '1') {
341                    $('.bvi-panel-menu').hide();//slideToggle("slow");
342                    $('#bvi-panel-hide').show();
343                    $('#bvi-panel-show').show();
344                } else {
345                    $('.bvi-panel-menu').show();
346                    $('#bvi-panel-show').hide();
347                }
348
349            }
350            function BviFontSize() {
351                size = Cookies.get("bvi-font-size");
352                if (size <= 100){
353                    BviReturnSet({
354                        fontsize: size
355                    });
356                }
357            }
358
359            function BviLetterSpacing() {
360                if (Cookies.get("bvi-letter-spacing") === "normal") {
361                    $("#bvi-letter-spacing-normal").addClass("active");
362                    BviReturnSet({
363                        letterspacing: "0px"
364                    })
365                } else {
366                    $("#bvi-letter-spacing-normal").removeClass("active")
367                }
368                if (Cookies.get("bvi-letter-spacing") === "average") {
369                    $("#bvi-letter-spacing-average").addClass("active");
370                    BviReturnSet({
371                        letterspacing: "2px"
372                    })
373                } else {
374                    $("#bvi-letter-spacing-average").removeClass("active")
375                }
376                if (Cookies.get("bvi-letter-spacing") === "big") {
377                    $("#bvi-letter-spacing-big").addClass("active");
378                    BviReturnSet({
379                        letterspacing: "4px"
380                    })
381                } else {
382                    $("#bvi-letter-spacing-big").removeClass("active")
383                }
384            }
385
386            function BviLineHeight() {
387                if (Cookies.get("bvi-line-height") === "normal") {
388                    $("#bvi-line-height-normal").addClass("active");
389                    BviReturnSet({
390                        lineheight: "1.5"
391                    })
392                } else {
393                    $("#bvi-line-height-normal").removeClass("active")
394                }
395                if (Cookies.get("bvi-line-height") === "average") {
396                    $("#bvi-line-height-average").addClass("active");
397                    BviReturnSet({
398                        lineheight: "2"
399                    })
400                } else {
401                    $("#bvi-line-height-average").removeClass("active")
402                }
403                if (Cookies.get("bvi-line-height") === "big") {
404                    $("#bvi-line-height-big").addClass("active");
405                    BviReturnSet({
406                        lineheight: "2.5"
407                    })
408                } else {
409                    $("#bvi-line-height-big").removeClass("active")
410                }
411            }
412
413            function BviFontFamily() {
414                if (Cookies.get("bvi-font-family") == "arial") {
415                    $("#bvi-font-family-arial").addClass("active");
416                    BviReturnSet({
417                        fontfamily: "Arial, sans-serif"
418                    })
419                } else {
420                    $("#bvi-font-family-arial").removeClass("active")
421                }
422                if (Cookies.get("bvi-font-family") == "times") {
423                    $("#bvi-font-family-times-new-roman").addClass("active");
424                    BviReturnSet({
425                        fontfamily: 'Times New roman'
426                    })
427                } else {
428                    $("#bvi-font-family-times-new-roman").removeClass("active")
429                }
430                if (Cookies.get("bvi-font-family") == "default") {
431                    $("#bvi-font-family-default").addClass("active");
432                    BviReturnSet({
433                        fontfamily: ''
434                    })
435                } else {
436                    $("#bvi-font-family-default").removeClass("active")
437                }
438            }
439
440            function BviFlash() {
441                if (Cookies.get("bvi-flash") == 1) {
442                    $('#bvi-flash-off').show();
443                    $('#bvi-flash-on').hide();
444                    $('iframe,video').show();
445                } else {
446                    $('#bvi-flash-on').show();
447                    $('#bvi-flash-off').hide();
448                    $('iframe,video').hide();
449                }
450            }
451
452            function BviReturnSet(setting) {
453                $("body, body *").not(".bvi-panel, .bvi-panel *, .fa, .glyphicon, .dashicons, .bvi-glyphicon").each(function () {
454                    $(this).css({
455                        "font-family": setting.fontfamily,
456                        "background-color": setting.backgroundcolor,
457                        "background-image": "none",
458                        "color": setting.color,
459                        "font-size": setting.fontsize + 'pt',
460                        "box-shadow": "none",
461                        "text-shadow": "none",
462                        "letter-spacing": setting.letterspacing,
463                        "border-color": setting.color,
464                        "line-height": setting.lineheight
465                    });
466                });
467                $("body").css({
468                    "margin": "0px",
469                    "padding": "0px"
470                });
471
472                var numbers = String(setting.fontsize);
473                var numbers = numbers.charAt(numbers.length-1);
474                var numbers = parseInt(numbers, 10);
475
476                if (numbers == 1) {
477                    var _numbers = 'пункт';
478                } else if ((numbers > 1) && (numbers < 5)) {
479                    var _numbers = 'пункта';
480                } else {
481                    var _numbers = 'пунктов';
482                }
483
484                $('#bvi-size-number').text(setting.fontsize);
485                $('#bvi-size-text').text(_numbers);
486
487            }
488            
489            function BviImg() {
490                if (Cookies.get("bvi-img") == '1') {
491
492                    $("#bvi-img-on").addClass('active');
493                    $("#bvi-img-grayscale").removeClass('active');
494                    $("#bvi-img-off").removeClass('active');
495
496                    $(".bvi-img-grayscale").remove();
497                    $(".bvi-img-off").remove();
498                    $(".bvi-img-on").remove();
499
500                    $("img").each(function() {
501                        $(".bvi-img-grayscale").remove();
502                        $(".bvi-img-off").remove();
503                        $(this).show();
504                    });
505                    $('#bvi-img-text').html('Включены');
506                } else if (Cookies.get("bvi-img") == '0') {
507
508                    $("#bvi-img-off").addClass('active');
509                    $("#bvi-img-grayscale").removeClass('active');
510                    $("#bvi-img-on").removeClass('active');
511
512                    $(".bvi-img-on").remove();
513                    $(".bvi-img-off").remove();
514                    $(".bvi-img-grayscale").remove();
515
516                    $("img").each(function() {
517                        var alt = this.alt || 'Нет описания к изображению';
518                        var imgClass = $(this).attr("class") || '';
519                        var imgId = $(this).attr("id") || 'bvi-img-off';
520                        $(this).hide();
521                        if (Cookies.get("bvi-img-XY") == '1') {
522                            $(this).after($('<div class="bvi-img-off '+imgClass+'" id="'+imgId+'" style="width: ' + $(this).width() + "px; height: " + $(this).height() + 'px">').html(alt))
523                        } else {
524                            $(this).after($('<div class="bvi-img-off">').text(alt))
525                        }
526                    });
527                    $('#bvi-img-text').html('Выключены');
528                } else if (Cookies.get("bvi-img") == 'grayScale') {
529
530                    $("#bvi-img-grayscale").addClass('active');
531                    $("#bvi-img-off").removeClass('active');
532                    $("#bvi-img-on").removeClass('active');
533
534                    $(".bvi-img-on").remove();
535                    $(".bvi-img-off").remove();
536                    $(".bvi-img-grayscale").remove();
537
538                    $("img").each(function() {
539                        var alt = this.alt || 'Нет описания к изображению';
540                        var src = this.src;
541                        var imgClass = $(this).attr("class") || 'bvi-class';
542                        var imgId = $(this).attr("id") || 'bvi-img-off';
543
544                        $(this).hide();
545                        $(this).after($('<img src="'+src+'" alt="'+alt+'" id="bvi-img-grayscale '+imgId+'" class="bvi-img-grayscale '+imgClass+'">'));
546                    });
547
548                    $('#bvi-img-text').html('Черно-белые');
549                } else {
550                    $("img").each(function() {
551                        $(".bvi-img-grayscale").remove();
552                        $(".bvi-img-off").remove();
553                        $(this).show();
554                    });
555                }
556            }
557
558            function BviVoice() {
559                if (Cookies.get("bvi-voice") === '1') {
560                    $('#bvi-voice-on').hide();
561                    $('#bvi-voice-off').show();
562                    function getSelectionText() {
563                        var text = "";
564                        if (window.getSelection) {
565                            text = window.getSelection().toString();
566                        } else if (document.selection && document.selection.type != "Control") {
567                            text = document.selection.createRange().text;
568                        }
569                        return text;
570                    }
571                    /*
572                    $(document).mouseup(function () {
573                        setTimeout(function () {
574                            responsiveVoice.cancel();
575                            responsiveVoice.speak(getSelectionText(), "Russian Female");
576                        }, 1);
577                        return false;
578                    });
579                    */
580                } else {
581                    responsiveVoice.cancel();
582                    $('#bvi-voice-on').show();
583                    $('#bvi-voice-off').hide();
584                }
585            }
586
587            $("#bvi-close, .bvi-panel-close").click(function() {
588                if (Cookies.get("bvi-voice") == '1') {
589                    responsiveVoice.speak("Обычная версия сайта", "Russian Female");
590                }
591
592                $('.bvi-animated').removeClass('bvi-slideInDown').addClass('bvi-fadeOutUp');
593
594                $('*').each(function(){
595                    $(this).removeAttr("style",'font-family');
596                    $(this).removeAttr("style",'background-color');
597                    $(this).removeAttr("style",'background-image');
598                    $(this).removeAttr("style",'color');
599                    $(this).removeAttr("style",'font-size');
600                    $(this).removeAttr("style",'box-shadow');
601                    $(this).removeAttr("style",'text-shadow');
602                    $(this).removeAttr("style",'letter-spacing');
603                    $(this).removeAttr("style",'border-color');
604                    $(this).attr("style",$(this).attr('data-bvi-original'));
605                    $(this).removeAttr('data-bvi-original');
606                });
607
608                $(setting.BviCloseClassAndId).show();
609                $('.bvi-panel-open-menu').removeClass('bvi-hide');
610                $(Cookies.get("bvi-selector")).removeClass('bvi-hide');
611                $(".bvi-panel, .bvi-panel-close").remove();
612                $(".bvi-img-off").remove();
613                $(".bvi-img-grayscale").remove();
614                $('body > .bvi-body').contents().unwrap();
615
616                if (Cookies.get("bvi-reload") == "1") {
617                    document.location.reload(true);
618                }
619
620                Cookies.remove("bvi-selector", {
621                    path: "/"
622                });
623
624                Cookies.remove("bvi-panel", {
625                    path: "/"
626                });
627
628                Cookies.remove("bvi-bgcolor", {
629                    path: "/"
630                });
631
632                Cookies.remove("bvi-font-size", {
633                    path: "/"
634                });
635
636                Cookies.remove("bvi-letter-spacing", {
637                    path: "/"
638                });
639
640                Cookies.remove("bvi-line-height", {
641                    path: "/"
642                });
643
644                Cookies.remove("bvi-font-family", {
645                    path: "/"
646                });
647
648                Cookies.remove("bvi-img", {
649                    path: "/"
650                });
651
652                Cookies.remove("bvi-img-XY", {
653                    path: "/"
654                });
655
656                Cookies.remove("bvi-reload", {
657                    path: "/"
658                });
659
660                Cookies.remove("bvi-voice", {
661                    path: "/"
662                });
663
664                Cookies.remove("bvi-flash", {
665                    path: "/"
666                });
667
668                Cookies.remove("bvi-panel-hide", {
669                    path: "/"
670                });
671                BviBgColor();
672                BviFontSize();
673                BviLetterSpacing();
674                BviLineHeight();
675                BviFontFamily();
676                BviImg();
677                BviVoice();
678                BviFlash();
679                BviPanelHide();
680                responsiveVoice.cancel();
681                $('iframe,video').show();
682                return false;
683            });
684
685            $("#bvi-flash-on").click(function() {
686                Cookies.set("bvi-flash", "1", {
687                    path: "/"
688                });
689                if (Cookies.get("bvi-voice") == '1') {
690                    responsiveVoice.speak("Включить фрейм", "Russian Female");
691                }
692                BviFlash();
693                return false;
694            });
695
696            $("#bvi-flash-off").click(function() {
697                Cookies.set("bvi-flash", "0", {
698                    path: "/"
699                });
700                if (Cookies.get("bvi-voice") == '1') {
701                    responsiveVoice.speak("Выключить фрейм", "Russian Female");
702                }
703                BviFlash();
704                return false;
705            });
706
707            $("#bvi-letter-spacing-normal").click(function() {
708                Cookies.set("bvi-letter-spacing", "normal", {
709                    path: "/"
710                });
711                if (Cookies.get("bvi-voice") == '1') {
712                    responsiveVoice.speak("Кернинг: Стандартный", "Russian Female");
713                }
714                BviLetterSpacing();
715                return false;
716            });
717
718            $("#bvi-letter-spacing-average").click(function() {
719                Cookies.set("bvi-letter-spacing", "average", {
720                    path: "/"
721                });
722                if (Cookies.get("bvi-voice") == '1') {
723                    responsiveVoice.speak("Кернинг: Средний", "Russian Female");
724                }
725                BviLetterSpacing();
726                return false;
727            });
728
729            $("#bvi-letter-spacing-big").click(function() {
730                Cookies.set("bvi-letter-spacing", "big", {
731                    path: "/"
732                });
733                if (Cookies.get("bvi-voice") == '1') {
734                    responsiveVoice.speak("Кернинг: Большой", "Russian Female");
735                }
736                BviLetterSpacing();
737                return false;
738            });
739
740            $("#bvi-font-size-minus").click(function() {
741                size = parseFloat(Cookies.get("bvi-font-size")) - 1;
742                $(this).addClass('active');
743                $('#bvi-font-size-plus').removeClass('active');
744
745                if (size >= 0) {
746                    Cookies.set("bvi-font-size", size, {
747                        path: "/"
748                    });
749
750                    BviFontSize();
751                    var numbers = String(size);
752                    var numbers = numbers.charAt(numbers.length-1);
753                    var numbers = parseInt(numbers, 10);
754
755                    if (numbers == 1) {
756                        var _numbers = 'пункт';
757                    } else if ((numbers > 1) && (numbers < 5)) {
758                        var _numbers = 'пункта';
759                    } else {
760                        var _numbers = 'пунктов';
761                    }
762
763                    method.BviConsoleLog(setting.BviConsoleLog, "click", {"bvi-font-size[]":"Размер шрифта: "+ size +" "+ _numbers});
764                    if (Cookies.get("bvi-voice") == '1') {
765                        responsiveVoice.speak("Размер шрифта: " + size +" "+ _numbers, "Russian Female");
766                    }
767                }
768                return false;
769            });
770
771            $("#bvi-font-size-plus").click(function() {
772                $(this).addClass('active');
773                $('#bvi-font-size-minus').removeClass('active');
774                size = parseFloat(Cookies.get("bvi-font-size")) + 1;
775
776                if (size <= 50) {
777                    Cookies.set("bvi-font-size", size, {
778                        path: "/"
779                    });
780
781                    BviFontSize();
782                    var numbers = String(size);
783                    var numbers = numbers.charAt(numbers.length-1);
784                    var numbers = parseInt(numbers, 10);
785
786                    if (numbers == 1) {
787                        var _numbers = 'пункт';
788                    } else if ((numbers > 1) && (numbers < 5)) {
789                        var _numbers = 'пункта';
790                    } else {
791                        var _numbers = 'пунктов';
792                    }
793
794                    method.BviConsoleLog(setting.BviConsoleLog, "click", {"bvi-font-size[]":"Размер шрифта: "+ size +" "+ _numbers});
795                    if (Cookies.get("bvi-voice") == '1') {
796                        responsiveVoice.speak("Размер шрифта: " + size +" "+ _numbers, "Russian Female");
797                    }
798                }
799                return false;
800            });
801
802            $("#bvi-voice-on").click(function() {
803                Cookies.set("bvi-voice", "1", {
804                    path: "/"
805                });
806                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-voice[1]':'Синтез речи включён'});
807                if (Cookies.get("bvi-voice") == '1') {
808                    responsiveVoice.speak("Синтез речи включён", "Russian Female");
809                }
810                BviVoice();
811                return false;
812            });
813
814            $("#bvi-voice-off").click(function() {
815                Cookies.set("bvi-voice", "0", {
816                    path: "/"
817                });
818                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-voice[0]':'Синтез речи выключен'});
819                if (Cookies.get("bvi-voice") == '1') {
820                    responsiveVoice.speak("Синтез речи выключен", "Russian Female");
821                }
822                BviVoice();
823                return false;
824            });
825
826            $("#bvi-color-white").click(function() {
827                Cookies.set("bvi-bgcolor", "white", {
828                    path: "/"
829                });
830                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-bgcolor[white]':'Цвет сайта: Черным по белому'});
831                if (Cookies.get("bvi-voice") == '1') {
832                    responsiveVoice.speak("Цвет сайта: Черным по белому", "Russian Female");
833                }
834                BviBgColor();
835                return false;
836            });
837
838            $("#bvi-color-black").click(function() {
839                Cookies.set("bvi-bgcolor", "black", {
840                    path: "/"
841                });
842                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-bgcolor[black]':'Цвет сайта: Белым по черному'});
843                if (Cookies.get("bvi-voice") == '1') {
844                    responsiveVoice.speak("Цвет сайта: Белым по черному", "Russian Female");
845                }
846                BviBgColor();
847                return false;
848            });
849
850            $("#bvi-color-blue").click(function() {
851                Cookies.set("bvi-bgcolor", "blue", {
852                    path: "/"
853                });
854                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-bgcolor[blue]':'Цвет сайта: Темно-синим по голубому'});
855                if (Cookies.get("bvi-voice") == '1') {
856                    responsiveVoice.speak("Цвет сайта: Темно-синим по голубому", "Russian Female");
857                }
858                BviBgColor();
859                return false;
860            });
861
862            $("#bvi-color-brown").click(function() {
863                Cookies.set("bvi-bgcolor", "brown", {
864                    path: "/"
865                });
866                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-bgcolor[brown]':'Цвет сайта: Коричневым по бежевому'});
867                if (Cookies.get("bvi-voice") == '1') {
868                    responsiveVoice.speak("Цвет сайта: Коричневым по бежевому", "Russian Female");
869                }
870                BviBgColor();
871                return false;
872            });
873
874            $("#bvi-color-green").click(function() {
875                Cookies.set("bvi-bgcolor", "green", {
876                    path: "/"
877                });
878                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-bgcolor[green]':'Цвет сайта: Зеленым по темно-коричневому'});
879                if (Cookies.get("bvi-voice") == '1') {
880                    responsiveVoice.speak("Цвет сайта: Зеленым по темно-коричневому", "Russian Female");
881                }
882                BviBgColor();
883                return false;
884            });
885
886            $("#bvi-img-on").click(function() {
887                Cookies.set("bvi-img", "1", {
888                    path: "/"
889                });
890                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-img[1]':'Изображения включены'});
891                if (Cookies.get("bvi-voice") == '1') {
892                    responsiveVoice.speak("Изображения включены", "Russian Female");
893                }
894                BviImg();
895                return false;
896            });
897
898            $("#bvi-img-off").click(function() {
899                Cookies.set("bvi-img", "0", {
900                    path: "/"
901                });
902                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-img[0]':'Изображения выключены'});
903                if (Cookies.get("bvi-voice") == '1') {
904                    responsiveVoice.speak("Изображения выключены", "Russian Female");
905                }
906                BviImg();
907                return false;
908            });
909
910            $("#bvi-img-grayscale").click(function() {
911                Cookies.set("bvi-img", "grayScale", {
912                    path: "/"
913                });
914                method.BviConsoleLog(setting.BviConsoleLog, 'click', {'bvi-img[grayScale]':'Изображения черно-белые'});
915                if (Cookies.get("bvi-voice") == '1') {
916                    responsiveVoice.speak("Изображения черно-белые", "Russian Female");
917                }
918                BviImg();
919                return false;
920            });
921
922            $("#bvi-settings, #bvi-settings-close").click(function() {
923                $(".bvi-settings").slideToggle("slow");
924                $("#bvi-settings").toggleClass('active');
925                return false;
926            });
927
928            $("#bvi-line-height-normal").click(function() {
929                Cookies.set("bvi-line-height", "normal", {
930                    path: "/"
931                });
932                if (Cookies.get("bvi-voice") == '1') {
933                    responsiveVoice.speak("Интервал: Одинарный", "Russian Female");
934                }
935                BviLineHeight();
936                return false;
937            });
938
939            $("#bvi-line-height-average").click(function() {
940                Cookies.set("bvi-line-height", "average", {
941                    path: "/"
942                });
943                if (Cookies.get("bvi-voice") == '1') {
944                    responsiveVoice.speak("Интервал: Полуторный", "Russian Female");
945                }
946                BviLineHeight();
947                return false;
948            });
949
950            $("#bvi-line-height-big").click(function() {
951                Cookies.set("bvi-line-height", "big", {
952                    path: "/"
953                });
954                if (Cookies.get("bvi-voice") == '1') {
955                    responsiveVoice.speak("Интервал: Двойной", "Russian Female");
956                }
957                BviLineHeight();
958                return false;
959            });
960
961            $("#bvi-font-family-arial").click(function() {
962                Cookies.set("bvi-font-family", "arial", {
963                    path: "/"
964                });
965                if (Cookies.get("bvi-voice") == '1') {
966                    responsiveVoice.speak("Гарнитура: Без засечек", "Russian Female");
967                }
968                BviFontFamily();
969                return false;
970            });
971
972            $("#bvi-font-family-times-new-roman").click(function() {
973                Cookies.set("bvi-font-family", "times", {
974                    path: "/"
975                });
976                if (Cookies.get("bvi-voice") == '1') {
977                    responsiveVoice.speak("Гарнитура: С засечками", "Russian Female");
978                }
979                BviFontFamily();
980                return false;
981            });
982
983            $("#bvi-font-family-default").click(function() {
984                Cookies.set("bvi-font-family", "default", {
985                    path: "/"
986                });
987                if (Cookies.get("bvi-voice") == '1') {
988                    responsiveVoice.speak("Гарнитура: Без засечек", "Russian Female");
989                }
990                BviFontFamily();
991                return false;
992            });
993
994            $('#bvi-panel-hide').click(function () {
995                Cookies.set("bvi-panel-hide", "1", {
996                    path: "/"
997                });
998                BviPanelHide();
999                return false;
1000            });
1001
1002            $('#bvi-panel-show').click(function () {
1003                Cookies.set("bvi-panel-hide", "0", {
1004                    path: "/"
1005                });
1006                BviPanelHide();
1007                return false;
1008            });
1009
1010            $("#bvi-settings-default").click(function() {
1011                Cookies.set("bvi-panel", setting.BviPanel, {
1012                    path: "/"
1013                });
1014
1015                Cookies.set("bvi-bgcolor", setting.BviPanelBg, {
1016                    path: "/"
1017                });
1018
1019                Cookies.set("bvi-font-size", setting.BviPanelFontSize, {
1020                    path: "/"
1021                });
1022
1023                Cookies.set("bvi-letter-spacing", setting.BviPanelLetterSpacing, {
1024                    path: "/"
1025                });
1026
1027                Cookies.set("bvi-line-height", setting.BviPanelLineHeight, {
1028                    path: "/"
1029                });
1030                Cookies.set("bvi-font-family", setting.BviPanelFontFamily, {
1031                    path: "/"
1032                });
1033
1034                Cookies.set("bvi-img", setting.BviPanelImg, {
1035                    path: "/"
1036                });
1037
1038                Cookies.set("bvi-reload", setting.BviPanelReload, {
1039                    path: "/"
1040                });
1041
1042                Cookies.set("bvi-img-XY", setting.BviPanelImgXY, {
1043                    path: "/"
1044                });
1045
1046                Cookies.set("bvi-voice", setting.BviPlay, {
1047                    path: "/"
1048                });
1049
1050                Cookies.set("bvi-flash", setting.BviFlash, {
1051                    path: "/"
1052                });
1053
1054                Cookies.set("bvi-console-log)", setting.BviConsoleLog, {
1055                    path: "/"
1056                });
1057
1058                Cookies.set("bvi-panel-hide)", setting.BviPanelHide, {
1059                    path: "/"
1060                });
1061
1062                if (Cookies.get("bvi-voice") == '1') {
1063                    responsiveVoice.speak("Стандартные настройки", "Russian Female");
1064                }
1065                BviBgColor();
1066                BviFontSize();
1067                BviLetterSpacing();
1068                BviLineHeight();
1069                BviFontFamily();
1070                BviImg();
1071                BviVoice();
1072                BviFlash();
1073                BviPanelHide();
1074                return false;
1075            });
1076
1077            BviBgColor();
1078            BviFontSize();
1079            BviLetterSpacing();
1080            BviLineHeight();
1081            BviFontFamily();
1082            BviImg();
1083            BviVoice();
1084            BviFlash();
1085            BviPanelHide();
1086        },
1087        Active: function (setting) {
1088            var selector = $(this).selector;
1089            var setting = $.extend({
1090                BviPanel: 1,
1091                BviPanelActive: 0,
1092                BviPanelBg: "white",
1093                BviPanelFontFamily: "default",
1094                BviPanelFontSize: "12",
1095                BviPanelLetterSpacing: "normal",
1096                BviPanelLineHeight: "normal",
1097                BviPanelImg: 1,
1098                BviPanelImgXY: 1,
1099                BviPanelReload: 0,
1100                BviPanelText: 'Версия для слабовидящих',
1101                BviPanelCloseText: 'Обычная версия сайта',
1102                BviCloseClassAndId: '',
1103                BviFixPanel: 1,
1104                BviPlay: 0,
1105                BviFlash: 0,
1106                BviConsoleLog: 1,
1107                BviPanelHide: 0
1108            }, setting);
1109
1110            Cookies.set("bvi-selector", selector, {
1111                path: "/"
1112            });
1113            Cookies.set("bvi-panel", setting.BviPanel, {
1114                path: "/"
1115            });
1116            Cookies.set("bvi-bgcolor", setting.BviPanelBg, {
1117                path: "/"
1118            });
1119            Cookies.set("bvi-font-size", setting.BviPanelFontSize, {
1120                path: "/"
1121            });
1122            Cookies.set("bvi-letter-spacing", setting.BviPanelLetterSpacing, {
1123                path: "/"
1124            });
1125            Cookies.set("bvi-line-height", setting.BviPanelLineHeight, {
1126                path: "/"
1127            });
1128            Cookies.set("bvi-font-family", setting.BviPanelFontFamily, {
1129                path: "/"
1130            });
1131            Cookies.set("bvi-img", setting.BviPanelImg, {
1132                path: "/"
1133            });
1134            Cookies.set("bvi-reload", setting.BviPanelReload, {
1135                path: "/"
1136            });
1137            Cookies.set("bvi-img-XY", setting.BviPanelImgXY, {
1138                path: "/"
1139            });
1140            Cookies.set("bvi-reload", setting.BviPanelReload, {
1141                path: "/"
1142            });
1143            Cookies.set("bvi-voice", setting.BviPlay, {
1144                path: "/"
1145            });
1146            Cookies.set("bvi-flash", setting.BviFlash, {
1147                path: "/"
1148            });
1149            Cookies.set("bvi-flash", setting.BviConsoleLog, {
1150                path: "/"
1151            });
1152            Cookies.set("bvi-panel-hide", setting.BviPanelHide, {
1153                path: "/"
1154            });
1155            method.Init(setting);
1156            $('#bvi-close,.bvi-panel-open').hide();
1157        }
1158    };
1159
1160    $.fn.bvi = function(setting) {
1161        if (method[setting]) {
1162            return method[setting].apply(this, Array.prototype.slice.call(arguments, 1))
1163        } else {
1164            if (typeof setting === "object" || !setting) {
1165                return method.init.apply(this, arguments)
1166            } else {
1167                b.error("Метод с именем " + c + " не существует для jQuery.bvi")
1168            }
1169        }
1170    }
1171})(jQuery);

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.