PageSourceSearch

https://cdn.mediamart.vn/lib-modules/gallery/banner.js?v=26_9_2

js mediamart.vn collected 2026-09-25 19:09:31 UTC 6,738 bytes, 206 lines download raw bytes

1/*global jQuery, window*/
2$(document).ready(function () {
3    /*Func popup trang chu */
4    if ($("#popup-allpage .banner-list").length) {
5
6        var popupCookie = "_popupAllPageDisable";
7
8        /*MMC_setCookie(popupCookie, 1, 0.01);*/
9        var getCookie = MMC_getCookie(popupCookie);
10        //console.log("WV: " + ($(window).width()) + ". PP getCookie " + getCookie);
11
12        if (getCookie == 1 || getCookie == undefined) {
13            $("#popup-allpage").addClass("popup-allpage-active");
14
15            fPopupAllPage();
16
17            $("#popup-allpage").css("display", "block");
18
19            MMC_setCookie(popupCookie, 1, 0.01);
20            //var getCookieNew = MMC_getCookie(popupCookie);
21            //console.log("WV: " + ($(window).width()) + ". PP getCookieNew " + getCookieNew);
22        }
23        else {
24            $("#popup-allpage").removeClass("popup-allpage-active");
25            //MMC_setCookie(popupCookie, 0, 0.01);
26        }
27    }
28
29    /*Func popup chan trang */
30    if ($("#popup-footer .banner-list").length) {
31
32        $("#popup-footer").css("display", "block");
33
34        var popupCookieFooter = "_popupFooterDisable";
35
36        /*MMC_setCookie(popupCookie, 1, 0.01);*/
37        var getCookie = MMC_getCookie(popupCookieFooter);
38        //console.log("WV: " + ($(window).width()) + ". PP getCookie " + getCookie);
39
40        if (getCookie == 1 || getCookie == undefined) {
41            $("#popup-footer").removeClass("popup-footer-hide");
42
43            MMC_setCookie(popupCookieFooter, 1, 0.01);
44            //var getCookieNew = MMC_getCookie(popupCookie);
45            //console.log("WV: " + ($(window).width()) + ". PP getCookieNew " + getCookieNew);
46        }
47        else {
48            $("#popup-footer").addClass("popup-footer-hide");
49            //MMC_setCookie(popupCookie, 0, 0.01);
50        }
51
52        var _popupFooter = $(".popup-footer");
53        var _popupFooterClose = $(".popup-footer .popup-footer-close");
54        var _popupFooterShow = $(".popup-footer .popup-footer-show");
55
56        $(_popupFooterClose).click(function () {
57            $("#popup-footer").addClass("popup-footer-hide");
58            MMC_setCookie(popupCookieFooter, 0, 0.01);
59        });
60
61        $(_popupFooterShow).click(function () {
62            $("#popup-footer").removeClass("popup-footer-hide");
63            MMC_setCookie(popupCookieFooter, 1, 0.01);
64        });
65    }
66
67    /*
68       setTimeout(function () {
69           $(".wrapbox-getBanners").each(function () {
70               var _this = $(this);
71               fValid_GetBanners(_this);
72           });
73       }, 500);
74    */
75});
76
77function fPopupAllPage() {
78
79    var popupCookie = "_popupAllPageDisable";
80
81    var _popupAllpage = $(".popup-allpage");
82    var _popupAllpageItem = $(".popup-allpage .popup-allpage-item");
83    var _popupAllpageImage = $(".popup-allpage .popup-allpage-item img");
84    var _popupAllpageClose = $(".popup-allpage .popup-allpage-close");
85
86    var _widthSite = $(window).width();
87    var _heightSite = $(window).height();
88    //console.log("_widthSite: " + _widthSite + "-" + _heightSite)
89
90    var _widthBoxImage = $(_popupAllpageImage).width();
91    var _heightBoxImage = $(_popupAllpageImage).height();
92    //console.log("_widthBoxImage: " + _widthBoxImage + "-" + _heightBoxImage)
93
94    if (_widthBoxImage < 100) _widthBoxImage = 600;
95    if (_heightBoxImage < 100) _heightBoxImage = 400;
96
97    if (_widthSite <= 640) {
98        _widthBoxImage = 300;
99        _heightBoxImage = 400;
100    }
101
102    $(_popupAllpageItem).css({
103        "width": "" + _widthBoxImage + "px"
104        , "height": "" + _heightBoxImage + "px"
105        , "left": "" + (_widthSite - _widthBoxImage) / 2 + "px"
106        , "top": "" + (_heightSite - _heightBoxImage) / 2 + "px"
107    });
108
109    setTimeout(function () {
110        $(_popupAllpage).removeClass("popup-allpage-active");
111    }, 10000);
112
113    $(_popupAllpage).click(function () {
114        $(_popupAllpage).removeClass("popup-allpage-active");
115    });
116
117    $(_popupAllpageClose).click(function () {
118        $(_popupAllpage).removeClass("popup-allpage-active");
119        MMC_setCookie(popupCookie, 0, 0.01);
120    });
121
122    $("html").keyup(function (e) {
123        if (_popupAllpage != null)
124            if (e.which == 27) {
125                $(_popupAllpage).removeClass("popup-allpage-active");
126
127                _popupAllpage = null;
128
129                MMC_setCookie(popupCookie, 0, 0.01);
130            }
131    });
132};
133
134/*Lấy nhận cookie*/
135function MMC_getCookie(cname) {
136    var name = cname + "=";
137    var ca = document.cookie.split(';');
138    for (var i = 0; i < ca.length; i++) {
139        var c = ca[i];
140        while (c.charAt(0) == ' ') c = c.substring(1);
141        if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
142    }
143    return undefined;
144}
145/*Ghi nhận, cài đặt thời gian lưu cookie*/
146function MMC_setCookie(key, value, e) {
147    var d = new Date();
148    d.setTime(d.getTime() + (e * 24 * 60 * 60 * 1000));
149    var ee = "expires=" + d.toUTCString();
150    document.cookie = key + "=" + value + "; " + ee + "; path=/";
151}
152
153/*fActive_GetBanners*/
154function fActive_GetBanners(objParent) {
155    var _this = objParent.find(".wrapbox-getBanners");
156    fValid_GetBanners(_this);
157};
158
159/*fValid_GetBanners*/
160function fValid_GetBanners(objThis) {
161    var _id = parseFloat(objThis.attr('data-id'));
162    /*console.log("banners: " + _id);*/
163    if (_id > 0) {
164        fGetBanners(objThis);
165    }
166};
167
168/*fGetBanners*/
169function fGetBanners(objThis) {
170    var apiVm = {
171        "Id": parseFloat(objThis.attr('data-id')),
172        "Id1": parseFloat(objThis.attr('data-cid')),
173        "Limit": parseFloat(objThis.attr('data-limit'))
174    };
175    /*console.log("banners: " + JSON.stringify(apiVm));*/
176    $.ajax({
177        type: 'POST',
178        url: '/api/galleries/banners',
179        data: JSON.stringify(apiVm),
180        contentType: "application/json"
181    }).done(function (data) {
182        /*console.log(data);*/
183        objThis.html(data);
184
185        /*Owl*/
186        if (objThis.hasClass("notOwl")) {
187            /*
188            if ($(window).width() < 768) {
189                fOwlCarousel_Item3(objThis);
190            }
191            */
192        }
193        else {
194            if (objThis.hasClass("owl1")) {
195                fOwlCarousel_Item1(objThis.find(".banner-list"));
196            }
197            else if (objThis.hasClass("owl2")) {
198                fOwlCarousel_Item2(objThis.find(".banner-list"));
199            }
200            else {
201                fOwlCarousel_Item3(objThis.find(".banner-list"));
202            }
203        }
204    });
205};
206

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.