PageSourceSearch

https://www.exploros.com/assets/js/mb-ghost-slider.js?v=2fe01a8464

js exploros.com collected 2026-10-02 18:23:41 UTC 7,157 bytes, 235 lines download raw bytes

1//by Maciej Bobrowski v2.2:)
2
3(function($){
4    "use strict"
5
6    function MBSlider(pElem, pLink)
7    {
8        this.imageArray = pElem;
9        this.element = [];
10        this.counterM = 0;
11        this.link = pLink;
12        this.leftArrow = jQuery("<div></div>");
13        this.rightArrow = jQuery("<div></div>");
14        this.sliderBlock = jQuery("");
15
16
17        this.buildSliderHTML();
18
19        var height = "";
20        var $contentForHeight = this.sliderBlock.find(".inner-container");
21
22        jQuery(window).resize(function(event)
23        {
24            event.preventDefault();
25            var counter = this.counterM;
26
27
28            height = $contentForHeight[counter].clientHeight + "px";
29            this.sliderBlock.find(".mbSliderContent").css("height", height);
30
31            return false;
32
33        }.bind(this));
34
35        jQuery(window).load(function(event)
36        {
37            event.preventDefault();
38
39            height = $contentForHeight[0].clientHeight + "px";
40
41            this.sliderBlock.find(".mbSliderContent").css("height", height);
42
43            return false;
44
45        }.bind(this));
46
47
48        this.sliderBlock.find(".inner-container")[this.counterM].classList.add("mbContentShow");
49        this.sliderBlock.find(".inner-container")[this.counterM].classList.remove("mbContentHide");
50
51
52
53        this.rightArrow.click(function(event)
54        {
55
56            event.preventDefault();
57            var counter = this.counterM;
58
59            var $innerContainer = this.sliderBlock.find(".inner-container");
60            $innerContainer.siblings().each( function (index) {
61                if(index == counter)
62                {
63                    jQuery(this).addClass("mbContentHide").removeClass("mbContentShow");
64                }
65            });
66
67            this.next();
68
69            counter = this.counterM;
70
71            height = $contentForHeight[counter].clientHeight + "px";
72            this.sliderBlock.find(".mbSliderContent").css("height", height);
73
74            $innerContainer.siblings().each( function (index) {
75
76                if(index == counter)
77                {
78                    jQuery(this).addClass("mbContentShow").removeClass("mbContentHide");
79                }
80            });
81
82            return false;
83        }.bind(this));
84
85        this.leftArrow.click(function(event)
86        {
87            event.preventDefault();
88            var counter = this.counterM;
89
90            var $innerContainer = this.sliderBlock.find(".inner-container");
91            $innerContainer.siblings().each( function (index) {
92                if(index == counter)
93                {
94                    jQuery(this).addClass("mbContentHide").removeClass("mbContentShow");
95                }
96            });
97
98            this.prev();
99
100            counter = this.counterM;
101
102            height = $contentForHeight[counter].clientHeight + "px";
103            this.sliderBlock.find(".mbSliderContent").css("height", height);
104
105            $innerContainer.siblings().each( function (index) {
106
107                if(index == counter)
108                {
109                    jQuery(this).addClass("mbContentShow").removeClass("mbContentHide");
110                }
111            });
112
113            return false;
114        }.bind(this));
115    }
116
117
118    MBSlider.prototype.buildElementHTML = function()
119    {
120        for(var i = 0; i < this.imageArray.length; ++i)
121        {
122            var innerContainer = jQuery("<div></div>", {class: "inner-container mbContentHide"});
123            if(this.link == null || (this.imageArray[i].tagName).toUpperCase() === "IFRAME")
124            {
125                innerContainer.append(this.imageArray[i]);
126            }
127            else{
128                var link = jQuery("<a></a>").attr("href", this.link);
129                link.append(this.imageArray[i]);
130                innerContainer.append(link);
131            }
132
133            this.element.push(innerContainer);
134        }
135    };
136
137    MBSlider.prototype.buildSliderHTML = function()
138    {
139        this.buildElementHTML();
140
141        this.sliderBlock = jQuery("<div></div>", {class: "mbSlider-main-container"});
142        this.leftArrow.addClass("left arrow");
143        this.rightArrow.addClass("right arrow");
144
145
146        this.sliderBlock.append(this.leftArrow).append($("<div></div>", {class: "mbSliderContent"})).append(this.rightArrow);
147
148        this.sliderBlock.find(".mbSliderContent").append(this.element);
149
150    };
151
152    MBSlider.prototype.next = function()
153    {
154        ++this.counterM;
155
156        if(this.counterM >= this.element.length)
157        {
158            this.counterM = 0;
159        }
160    };
161
162    MBSlider.prototype.prev = function()
163    {
164        --this.counterM;
165        if(this.counterM < 0)
166        {
167            this.counterM = this.element.length -1;
168        }
169    };
170
171
172/////////////////////////////////////////////////////////
173
174
175    jQuery(document).ready(function()
176    {
177        if(jQuery("body").hasClass("post-template"))
178        {
179            jQuery("article").each(function(){
180                if(jQuery(this).find(".mbslider").length > 0)
181                {
182                    var $elements = jQuery(this).find(".mbslider-source p");
183
184                    $elements.each(function()
185                    {
186                        var $paragraf = $(this).find("img");
187                        if($paragraf.length > 1)
188                        {
189                            var elem = $paragraf;
190                            $paragraf.remove();
191                            var obj = new MBSlider(elem, null);
192
193                            jQuery(this).prepend(obj.sliderBlock);
194                        }
195
196                    });
197                }
198            });
199        }
200        else
201        {
202            jQuery("article").each(function(){
203                if(jQuery(this).find(".mbslider").length > 0)
204                {
205                    var isIframe = jQuery(this).find(".mbslider-source > :first-child").first();
206
207                    if(isIframe.prop("tagName").toUpperCase() == "IFRAME")
208                    {
209                        return;
210                    }
211                    var $elements = jQuery(this).find(".mbslider-source p:first-of-type > img");
212
213                    if($elements.length > 1)
214                    {
215                        var link = null;
216                        var $linkToPost = jQuery(this).find(".mbslider > a");
217                        if($linkToPost.length > 0)
218                        {
219                            link = $linkToPost.attr("href");
220                        }
221
222                        $linkToPost.remove();
223                        var $mbSliderTarget = jQuery(this).find('.mbslider');
224                        var e = $elements;
225
226                        $elements.remove();
227                        var obj = new MBSlider(e, link);
228
229                        jQuery($mbSliderTarget).prepend(obj.sliderBlock);
230                    }
231                }
232            });
233        }
234    });
235}(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.