PageSourceSearch

https://newtopiafilm.com/modules/lite-banners/global.js?1771569068

js newtopiafilm.com collected 2026-10-05 20:51:43 UTC 2,541 bytes, 67 lines download raw bytes

1// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
2
3Jsw.namespace('PleskExt.LiteBanners');
4
5PleskExt.LiteBanners.init = function (promoUrl) {
6    promoUrl = promoUrl || 'https://go.plesk.com/upgrade/web-admin-se';
7
8    let addBanner = function () {
9        let pageContent = document.querySelector('.page-content, .pul-layout__main-inner');
10        let prevBanner = document.getElementById('pleskLiteBanner');
11        if (!pageContent || prevBanner) {
12            return;
13        }
14
15        let pLeft = pageContent.getStyle('paddingLeft');
16        let pRight = pageContent.getStyle('paddingRight');
17        let pTop = pageContent.getStyle('paddingTop');
18        let pathPrefix = '/modules/lite-banners/images/';
19        let banners = [
20            'banner-v1',
21            'banner-v2-1',
22            'banner-v3',
23        ];
24
25        let currentBannerIndex = parseInt(Math.random() * banners.length);
26        let currentBanner = banners[currentBannerIndex];
27        let path = pathPrefix + currentBanner + '.png';
28        let link = promoUrl + (promoUrl.indexOf('?') === -1 ? '?' : '&')
29            + 'utm_source=web-admin-se&utm_medium=referral&utm_campaign=' + currentBanner;
30
31        pageContent.insert({
32            top: (
33                '<div class="plesk-ext-notice pul-page-header" id="pleskLiteBanner" style="margin: -' + pTop + ' -' + pLeft + ' ' + pTop + ' -' + pRight + '">'+
34                    '<a class="plesk-ext-notice__banner" target="_blank" href="' + link + '">' +
35                        '<img class="plesk-ext-notice__banner-image" src="' + path + '" alt="">' +
36                    '</a>' +
37                '</div>'
38            ),
39        });
40    };
41
42    let waitForThePageContentChange = function (cb) {
43        let contentFirstChildEl = document.getElementById('main').firstElementChild;
44        let attempt = 0;
45        let fn = function () {
46            attempt++;
47            let newContentFirstChildEl = document.getElementById('main').firstElementChild;
48            if (contentFirstChildEl !== newContentFirstChildEl) {
49                cb();
50            } else if (attempt < 30) {
51                setTimeout(fn, 500);
52            }
53        };
54        setTimeout(fn, 500);
55    };
56
57    let history = window.history;
58    let pushState = history.pushState;
59    history.pushState = function () {
60        pushState.apply(history, arguments);
61        addBanner();
62    }
63    window.addEventListener('popstate', function () {
64        waitForThePageContentChange(addBanner);
65    });
66    addBanner();
67};

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.