PageSourceSearch

https://www.ozone.bg/js/amasty/amlabel/amlabel_height.js

js ozone.bg collected 2026-10-02 05:42:48 UTC 1,685 bytes, 51 lines download raw bytes

1var correctFontSize = true;
2amLabelSetCorrectHeight = function () {
3    $$('.amlabel-txt2').each(function(item){
4        imageSrc = $(item).getStyle('background-image')
5            .replace(/url\((['"])?(.*?)\1\)/gi, '$2')
6            .split(',')[0];
7        if (imageSrc === 'none') {
8            return true;
9        }
10        var image = new Image();
11        image.src = imageSrc;
12
13        var width = image.width,
14            height = image.height;
15        if (width && height) {
16            var percent = item.getWidth() / width;
17            var heightNew = percent * height;
18            if (heightNew) {
19                $(item).setStyle({
20                    'height' : heightNew + 'px'
21                });
22            }
23
24            if (correctFontSize && !$(item).select('.amlabel-txt br').length && item.getWidth()) {//disable if <br> exists
25                var textElement =  $(item).select('.amlabel-txt')[0];
26                if (textElement.getAttribute('style').indexOf('font-size') == -1) {
27                    var flag = 1;
28                    textElement.setStyle({
29                        'position' : 'absolute'
30                    });
31                    while(textElement.getWidth() > 0.9 * item.getWidth() && flag++ < 15) {
32                        textElement.setStyle({
33                            'fontSize' : (100 - flag * 5) + '%'
34                        });
35                    }
36                    textElement.setStyle({
37                        'position' : 'initial'
38                    });
39                }
40            }
41        }
42    });
43
44};
45
46Event.observe(window, 'load', function() {
47	jQuery(".amlabel-txt2").show();
48	amLabelSetCorrectHeight();
49});
50
51

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.