PageSourceSearch

http://mahabadcity.ir/JavaScripts/Modules/SlideShowPlus/SlideShowPlus.js

js mahabadcity.ir collected 2026-10-02 23:45:49 UTC 6,667 bytes, 216 lines download raw bytes

1var DouranPortalSlideShowPlus = function() {
2	var handel = null;
3	var owlConfig = {};
4	var owlItems = {};
5
6
7
8    this.CreateOwlCarousel = function () { 
9
10
11		var target = ["", "_blank", "_self", "_parent", "_top", "framename"];
12        this.owlConfig.responsive = {};
13        this.owlConfig.responsive["0"] = { items: 1 };
14        this.owlConfig.responsive["580"] = { items: 2 };
15        this.owlConfig.responsive["768"] = { items: 3 };
16        this.owlConfig.responsive["960"] = { items: this.owlConfig.items };
17        
18
19        var _handleWidth = parseInt($(this.handel).parents("div[type='pane']").width());
20        if (_handleWidth <= 500) {
21            this.owlConfig.responsive["0"] = { items: 1 };
22            this.owlConfig.responsive["580"] = { items: 1 };
23            this.owlConfig.responsive["768"] = { items: 1 };
24            this.owlConfig.responsive["960"] = { items: 1 };
25        }
26
27		for (i = 0; i < this.owlItems.length; i++) {
28
29            
30			a = $("<a>");
31			a.addClass("item");
32
33			img = $("<img>");
34			var imgSrc = this.owlItems[i].imageURL;
35			var arrScr = imgSrc.split(";");
36			if (arrScr.length == 1) {
37				img.attr("src", this.owlItems[i].imageURL);
38				img.addClass("owl-user-image");
39				if (!this.owlConfig.autoHeight) {
40					img.css("height", this.owlConfig.HeightImages + "px");
41				}
42				a.append(img);
43			} else {
44                img.attr("src", arrScr[0]);
45				img.addClass("owl-user-image owl-normal-image");
46
47				imgHover = $("<img>");
48				imgHover.attr("src", arrScr[1]);
49				imgHover.addClass("owl-user-image owl-hover-image");
50				var divImages = $("<div/>");
51				divImages.append(img);
52				divImages.append(imgHover);
53				if (!this.owlConfig.autoHeight) {
54					img.css("height", this.owlConfig.HeightImages + "px");
55					imgHover.css("height", this.owlConfig.HeightImages + "px");
56					divImages.css("height", this.owlConfig.HeightImages + "px");
57				}
58				divImages.addClass("div-images");
59				/*if (this.owlConfig.AnimationHover != "none")
60				{	
61					divImages.addClass(this.owlConfig.AnimationHover);
62				}*/
63				a.append(divImages);
64			}
65			img.attr("title", this.owlItems[i].TITLE);
66			if (arrScr.length > 1) {
67				imgHover.attr("title", this.owlItems[i].TITLE);
68            }
69
70			// adds alter attribute to images of slides.
71			var alterText = '';
72			if (this.owlItems[i].TITLE != '') {
73				alterText = this.owlItems[i].TITLE;
74			} else if (this.owlItems[i].imageURL != '') {
75				alterText = imgSrc.substr(imgSrc.lastIndexOf('/')+1);
76			}
77			img.attr("alt", alterText);
78
79			var alterTextHover = '';
80			if (arrScr.length > 1) {
81				if (this.owlItems[i].TITLE != '') {
82					alterTextHover = this.owlItems[i].TITLE + "_" ;
83				}
84				else if (arrScr[1] != '') {
85					alterTextHover += arrScr[1].substr(arrScr[1].lastIndexOf('/') + 1);
86				}
87				imgHover.attr("alt", alterTextHover);
88			}
89						
90			a.attr("title", this.owlItems[i].TITLE);
91			if (this.owlConfig.lightBox) {
92				a.attr("data-uk-lightbox", "{group:'group1'}");
93				var src = this.owlItems[i].imageURL;
94				var arrSrc = src.split(";");
95				if (arrScr.length == 2)
96					a.attr("href", arrScr[0]);
97				else
98					a.attr("href", src);
99			} else {
100				if (this.owlItems[i].Link != "")
101				{
102					a.attr("target", target[this.owlItems[i].LinkTargetType]);
103					a.attr("href", this.owlItems[i].Link);
104				}
105			}
106			
107			if (this.owlConfig.TitleType > 0)
108			{
109				switch(this.owlConfig.TitleType)
110				{
111					case 1:
112						var txt = $("<div>");
113						a.append(txt);
114						txt.html(this.owlItems[i].TITLE);
115						txt.addClass("owl-image-title uk-panel uk-animation-fade");
116						txt.addClass("uk-animation-hover");
117						break;
118					case 2:
119						var txt = $("<div>");
120						a.append(txt);
121						txt.html(this.owlItems[i].DESCRIPTION);
122						txt.addClass("owl-image-title uk-panel uk-animation-fade");
123						txt.addClass("uk-animation-hover");
124						break;
125					case 3:
126						var txt = $("<div>");
127						var _title = $("<p>");
128						var _txt = $("<p>");
129						txt.append(_title);
130						txt.append(_txt);
131						txt.addClass("owl-image-title uk-panel uk-animation-fade");
132						txt.addClass("uk-animation-hover");
133						a.append(txt);
134						_title.addClass("owl-image-title uk-panel uk-animation-fade");
135						_title.html(this.owlItems[i].TITLE);
136						_txt.html(this.owlItems[i].DESCRIPTION);
137						break;
138				}
139			}
140			
141			if (this.owlConfig.AnimationHover != "none")
142			{	
143				img.addClass(this.owlConfig.AnimationHover);
144				a.addClass("uk-animation-hover");
145			}
146			
147			this.handel.append(a);
148		}
149		if (this.owlConfig.mouseWheel) {
150			var h = this;
151			//	For Chorome, IE
152			this.handel.on('mousewheel', '.owl-stage', function (e) {
153				var wheelY = (e.originalEvent.wheelDelta) ? e.originalEvent.wheelDelta : e.originalEvent.deltaY;
154				
155				if (wheelY > 0) {
156					h.handel.trigger('next.owl.carousel');
157				} else {
158					h.handel.trigger('prev.owl.carousel');
159				}
160			
161				e.preventDefault();
162			});
163			//	For Firefox, Chorome
164			this.handel.on('wheel', '.owl-stage', function (e) {
165				var wheelY = (e.originalEvent.wheelDelta) ? e.originalEvent.wheelDelta : e.originalEvent.deltaY;
166				
167				if (wheelY > 0) {
168					h.handel.trigger('next.owl.carousel');
169				} else {
170					h.handel.trigger('prev.owl.carousel');
171				}
172			
173				e.preventDefault();
174			});
175		}
176
177		var H = this;
178        
179        $(this.handel).width($(this.handel).parents("div[type='pane']").width() * (this.owlConfig.WidthContaner / 100));//.dp-module-content
180        
181
182        this.owlConfig.boxWidth = $(this.handel).width();
183
184		this.handel.owlCarousel(this.owlConfig);
185
186		$(window).on("resize", function() {
187			owlResize(H);
188		});
189
190		var strStyle = "";
191		var customStyle = JSON.stringify(this.customStyle).replace(/,/g, ";").replace(/"/g, "");
192		var customHoverStyle = JSON.stringify(this.customHoverStyle).replace(/,/g, " !important;").replace(/"/g, "");
193		strStyle += this.handel.selector + " div.owl-image-title" + customStyle;
194		strStyle += this.handel.selector + " .owl-item:hover div.owl-image-title" + customHoverStyle;
195		strStyle = "<style>" + strStyle + "</style>";
196        $(this.handel).append(strStyle);
197
198            
199    
200	}
201
202
203	function owlResize(h) {
204		$(h.handel).hide();
205		var Width = h.owlConfig.boxWidth;
206        $(h.handel).width($(h.handel).parents("div[type='pane']").width() * (h.owlConfig.WidthContaner / 100));//.dp-module-content
207        
208		var newWidth = $(h.handel).width();
209		
210		$(h.handel).show();
211        h.handel.owlCarousel(h.owlConfig);
212    }
213
214
215    
216}

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.