PageSourceSearch

https://www.renta-leasing.de/wp-content/plugins/halfdata-green-popups-tabs/js/lepopuptab.js?ver=2.01

js renta-leasing.de collected 2026-10-06 22:07:02 UTC 17,266 bytes, 373 lines download raw bytes

1"use strict";
2var lepopuptab_vars = {};
3var lepopuptab_vertical_indent = 50;
4var lepopuptab_horizontal_indent = 50;
5var lepopuptab_open_before;
6var lepopuptab_close_after;
7if (typeof lepopuptab == typeof undefined) var lepopuptab = new Array();
8if (window.jQuery) {
9	jQuery(document).ready(function() {
10		if (typeof lepopup_ajax_url != typeof undefined) {
11			lepopuptab_vars["mode"] = "local";
12			lepopuptab_vars["ajax-url"] = lepopup_ajax_url;
13			if (typeof lepopuptab_preview != typeof undefined && lepopuptab_preview == "on") lepopuptab_vars["preview"] = "on";
14			else lepopuptab_vars["preview"] = "off";
15		} else {
16			lepopuptab_vars["mode"] = "remote";
17			if (jQuery("#lepopuptab-remote").length == 0 || !jQuery("#lepopuptab-remote").attr("data-handler")) {
18				alert('Make sure that you properly included lepopuptab.js. Currently you did not.');
19			}
20			if (jQuery("#lepopuptab-remote").attr("data-preview") == "on") lepopuptab_vars["preview"] = "on";
21			else lepopuptab_vars["preview"] = "off";
22			lepopuptab_vars["ajax-url"] = jQuery("#lepopuptab-remote").attr("data-handler");
23			jQuery('head').append("<style>#lepopuptab-ready{display:none;width:0px;height:0px;}</style>");
24			jQuery('body').append("<div id='lepopuptab-ready'></div>");
25		}
26		var slug = window.location.hash;
27		var idx = slug.indexOf("#lepopuptab-");
28		if (idx >= 0) {
29			slug = slug.substr(idx+12);
30			if (slug.length > 0) {
31				lepopuptab = new Array(slug);
32			}
33		}
34		var tabs = new Array();
35		var tabs_mobile = new Array();
36		var temp;
37		for (var i=0; i<lepopuptab.length; i++) {
38			temp = lepopuptab[i].split("*");
39			if (temp.length == 1) {
40				if (temp[0] != "") {
41					tabs.push(temp[0]);
42					tabs_mobile.push(temp[0]);
43				}
44			} else {
45				if (temp[0] != "") tabs.push(temp[0]);
46				if (temp[1] != "") tabs_mobile.push(temp[1]);
47			}
48		}
49		
50		jQuery.ajax({
51			url		: 	lepopuptab_vars['ajax-url'],
52			data	: 	{"action" : "lepopuptab-init", "tabs" : (lepopup_mobile ? tabs_mobile.join(',') : tabs.join(',')), "preview" : lepopuptab_vars["preview"], "hostname" : window.location.hostname},
53			method	:	(lepopuptab_vars["mode"] == "remote" ? "get" : "post"),
54			dataType:	(lepopuptab_vars["mode"] == "remote" ? "jsonp" : "json"),
55			async	:	true,
56			success	: function(return_data) {
57				try {
58					var data, temp;
59					if (typeof return_data == 'object') data = return_data;
60					else data = jQuery.parseJSON(return_data);
61					if (data.status == "OK") {
62						if (lepopuptab_vars["mode"] == "local") {
63							jQuery('body').append(data.html);
64							lepopuptab_show_tabs();
65							jQuery(window).resize(function() {
66								lepopuptab_tab_position();
67							});
68						} else {
69							if (typeof data["resources"]["css"] != typeof undefined) {
70								for (var i=0; i<(data["resources"]["css"]).length; i++){
71									jQuery('head').append("<link href='"+(data["resources"]["css"])[i]+"' rel='stylesheet' type='text/css' media='all' />");
72								}
73							}
74							var counter = 50;
75							var ready = function() {
76								counter--;
77								if (counter == 0) {
78									console.log("Can't load style.css.");
79									return;
80								}
81								var width =  jQuery("#lepopuptab-ready").width();
82								if (width == 1) {
83									jQuery('body').append(data.html);
84									lepopuptab_show_tabs();
85									jQuery(window).resize(function() {
86										lepopuptab_tab_position();
87									});
88								} else {
89									setTimeout(ready, 200);
90								}
91							}
92							ready();
93						}
94					}
95				} catch(error) {
96					console.log(error);
97				}
98			},
99			error	: 	function(XMLHttpRequest, textStatus, errorThrown) {
100				console.log(errorThrown);
101			}
102		});
103	});
104} else {
105	alert('lepopuptab.js requires jQuery to be loaded. Please include jQuery library above lepopup.js. Do not use "defer" or "async" option to load jQuery.');
106}
107
108function lepopuptab_show_tabs() {
109	lepopuptab_tab_position();
110	jQuery(".lepopuptab").each(function() {
111		var tab = this;
112		var tab_width = parseInt(jQuery(tab).width(), 10);
113		var tab_height = parseInt(jQuery(tab).height(), 10);
114		//jQuery(tab).width(tab_width);
115		jQuery(tab).show();
116		if (jQuery(tab).hasClass("lepopuptab-bottom-left") || jQuery(tab).hasClass("lepopuptab-bottom-center") || jQuery(tab).hasClass("lepopuptab-bottom-right")) {
117			jQuery(tab).css({"bottom" : "-"+tab_height+"px"});
118			jQuery(tab).animate({"bottom" : "0px"}, 500);
119		} else if (jQuery(tab).hasClass("lepopuptab-top-left") || jQuery(tab).hasClass("lepopuptab-top-center") || jQuery(tab).hasClass("lepopuptab-top-right")) {
120			jQuery(tab).css({"top" : "-"+tab_height+"px"});
121			jQuery(tab).animate({"top" : "0px"}, 500);
122		} else if (jQuery(tab).hasClass("lepopuptab-left-top") || jQuery(tab).hasClass("lepopuptab-left-middle") || jQuery(tab).hasClass("lepopuptab-left-bottom")) {
123			jQuery(tab).css({"left" : "-"+tab_height+"px"});
124			jQuery(tab).animate({"left" : "0px"}, 500);
125		} else if (jQuery(tab).hasClass("lepopuptab-right-top") || jQuery(tab).hasClass("lepopuptab-right-middle") || jQuery(tab).hasClass("lepopuptab-right-bottom")) {
126			jQuery(tab).css({"right" : "-"+tab_height+"px"});
127			jQuery(tab).animate({"right" : "0px"}, 500);
128		}
129	});
130}
131function lepopuptab_tab_position() {
132	var sizes = {
133		width : {
134			right_top : 	lepopuptab_vertical_indent,
135			right_middle : 	-10,
136			right_bottom :	lepopuptab_vertical_indent,
137			left_top : 		lepopuptab_vertical_indent,
138			left_middle : 	-10,
139			left_bottom :	lepopuptab_vertical_indent,
140			bottom_left :	lepopuptab_horizontal_indent,
141			bottom_center :	-10,
142			bottom_right :	lepopuptab_horizontal_indent,
143			top_left :	lepopuptab_horizontal_indent,
144			top_center :	-10,
145			top_right :	lepopuptab_horizontal_indent
146		},
147		height : {
148			right_top : 	lepopuptab_vertical_indent,
149			right_middle : 	-10,
150			right_bottom :	lepopuptab_vertical_indent,
151			left_top : 		lepopuptab_vertical_indent,
152			left_middle : 	-10,
153			left_bottom :	lepopuptab_vertical_indent
154		},
155	};
156	var viewport = {
157		width: Math.max(240, jQuery(window).width()),
158		height: Math.max(240, jQuery(window).height())
159	};
160	jQuery(".lepopuptab").removeClass("lepopuptab-icon-only");
161	jQuery(".lepopuptab").each(function() {
162		if (jQuery(this).hasClass("lepopuptab-right-top")) {
163			sizes.width.right_top += parseInt(jQuery(this).outerWidth(), 10) + 10;
164			sizes.height.right_top += 44 + 10; //parseInt(jQuery(this).height(), 10) + 10;
165		} else if (jQuery(this).hasClass("lepopuptab-right-middle")) {
166			sizes.width.right_middle += parseInt(jQuery(this).outerWidth(), 10) + 10;
167			sizes.height.right_middle += 44 + 10; //parseInt(jQuery(this).height(), 10) + 10;
168		} else if (jQuery(this).hasClass("lepopuptab-right-bottom")) {
169			sizes.width.right_bottom += parseInt(jQuery(this).outerWidth(), 10) + 10;
170			sizes.height.right_bottom += 44 + 10; //parseInt(jQuery(this).height(), 10) + 10;
171		} else if (jQuery(this).hasClass("lepopuptab-left-top")) {
172			sizes.width.left_top += parseInt(jQuery(this).outerWidth(), 10) + 10;
173			sizes.height.left_top += 44 + 10; //parseInt(jQuery(this).height(), 10) + 10;
174		} else if (jQuery(this).hasClass("lepopuptab-left-middle")) {
175			sizes.width.left_middle += parseInt(jQuery(this).outerWidth(), 10) + 10;
176			sizes.height.left_middle += 44 + 10; //parseInt(jQuery(this).height(), 10) + 10;
177		} else if (jQuery(this).hasClass("lepopuptab-left-bottom")) {
178			sizes.width.left_bottom += parseInt(jQuery(this).outerWidth(), 10) + 10;
179			sizes.height.left_bottom += 44 + 10; //parseInt(jQuery(this).height(), 10) + 10;
180		} else if (jQuery(this).hasClass("lepopuptab-bottom-left")) sizes.width.bottom_left += parseInt(jQuery(this).outerWidth(), 10) + 10;
181		else if (jQuery(this).hasClass("lepopuptab-bottom-center")) sizes.width.bottom_center += parseInt(jQuery(this).outerWidth(), 10) + 10;
182		else if (jQuery(this).hasClass("lepopuptab-bottom-right")) sizes.width.bottom_right += parseInt(jQuery(this).outerWidth(), 10) + 10;
183		else if (jQuery(this).hasClass("lepopuptab-top-left")) sizes.width.top_left += parseInt(jQuery(this).outerWidth(), 10) + 10;
184		else if (jQuery(this).hasClass("lepopuptab-top-center")) sizes.width.top_center += parseInt(jQuery(this).outerWidth(), 10) + 10;
185		else if (jQuery(this).hasClass("lepopuptab-top-right")) sizes.width.top_right += parseInt(jQuery(this).outerWidth(), 10) + 10;
186	});
187	var top_position;
188	var left_position;
189	// Right edge
190	var icons_only = false;
191	if (sizes.width.right_top > lepopuptab_vertical_indent && sizes.width.right_middle > -10) {
192		if (sizes.width.right_top + sizes.width.right_middle/2 >
192 viewport.height/2) icons_only = true;
193	}
194	if (sizes.width.right_bottom > lepopuptab_vertical_indent && sizes.width.right_middle > -10) {
195		if (sizes.width.right_bottom + sizes.width.right_middle/2 > viewport.height/2) icons_only = true;
196	}
197	if (sizes.width.right_bottom > lepopuptab_vertical_indent && sizes.width.right_top > lepopuptab_vertical_indent) {
198		if (sizes.width.right_top + sizes.width.right_bottom > viewport.height) icons_only = true;
199	}
200	if (sizes.width.right_top > viewport.height || sizes.width.right_middle > viewport.height || sizes.width.right_bottom > viewport.height) icons_only = true;
201	var set_top = function(object) {
202		var tab_size = {
203			width	: parseInt(jQuery(object).outerWidth(), 10),
204			height	: parseInt(jQuery(object).outerHeight(), 10)
205		};
206		if (icons_only || jQuery(object).hasClass("lepopuptab-no-turn")) {
207			jQuery(object).addClass("lepopuptab-icon-only");
208			tab_size = {
209				width	: parseInt(jQuery(object).outerWidth(), 10),
210				height	: parseInt(jQuery(object).outerHeight(), 10)
211			};
212			jQuery(object).css({"top" : (top_position - tab_size.height)+"px", "margin-top" : "0"});
213			top_position -= tab_size.height + 10;
214		} else {
215			jQuery(object).outerWidth(tab_size.width);
216			jQuery(object).css({"top" : (top_position - tab_size.width)+"px", "margin-top" : "-"+tab_size.height+"px"});
217			top_position -= tab_size.width + 10;
218		}
219	};
220	
221	if (icons_only) top_position = parseInt((viewport.height + sizes.height.right_middle)/2, 10);
222	else top_position = parseInt((viewport.height + sizes.width.right_middle)/2, 10);
223	jQuery(".lepopuptab-right-middle").each(function() {set_top(this);});
224	
225	top_position = viewport.height - lepopuptab_vertical_indent;
226	jQuery(".lepopuptab-right-bottom").each(function() {set_top(this);});
227	
228	if (icons_only) top_position = sizes.height.right_top;
229	else top_position = sizes.width.right_top;
230	jQuery(".lepopuptab-right-top").each(function() {set_top(this);});
231	
232	// Left edge
233	icons_only = false;
234	if (sizes.width.left_top > lepopuptab_vertical_indent && sizes.width.left_middle > -10) {
235		if (sizes.width.left_top + sizes.width.left_middle/2 > viewport.height/2) icons_only = true;
236	}
237	if (sizes.width.left_bottom > lepopuptab_vertical_indent && sizes.width.left_middle > -10) {
238		if (sizes.width.left_bottom + sizes.width.left_middle/2 > viewport.height/2) icons_only = true;
239	}
240	if (sizes.width.left_bottom > lepopuptab_vertical_indent && sizes.width.left_top > lepopuptab_vertical_indent) {
241		if (sizes.width.left_top + sizes.width.left_bottom > viewport.height) icons_only = true;
242	}
243	if (sizes.width.left_top > viewport.height || sizes.width.left_middle > viewport.height || sizes.width.left_bottom > viewport.height) icons_only = true;
244	set_top = function(object) {
245		var tab_size = {
246			width	: parseInt(jQuery(object).outerWidth(), 10),
247			height	: parseInt(jQuery(object).outerHeight(), 10)
248		};
249		if (icons_only || jQuery(object).hasClass("lepopuptab-no-turn")) {
250			jQuery(object).addClass("lepopuptab-icon-only");
251			tab_size = {
252				width	: parseInt(jQuery(object).outerWidth(), 10),
253				height	: parseInt(jQuery(object).outerHeight(), 10)
254			};
255			jQuery(object).css({"top" : (top_position - tab_size.height)+"px"});
256			top_position -= tab_size.height + 10;
257		} else {
258			jQuery(object).css({"top" : (top_position)+"px"});
259			top_position -= tab_size.width + 10;
260		}
261	
262	};
263	
264	if (icons_only) top_position = parseInt((viewport.height + sizes.height.left_middle)/2, 10);
265	else top_position = parseInt((viewport.height + sizes.width.left_middle)/2, 10);
266	jQuery(".lepopuptab-left-middle").each(function() {set_top(this);});
267	
268	top_position = viewport.height - lepopuptab_vertical_indent;
269	jQuery(".lepopuptab-left-bottom").each(function() {set_top(this);});
270	
271	if (icons_only) top_position = sizes.height.left_top;
272	else top_position = sizes.width.left_top;
273	jQuery(".lepopuptab-left-top").each(function() {set_top(this);});
274
275	// Bottom edge
276	icons_only = false;
277	if (sizes.width.bottom_left > lepopuptab_horizontal_indent && sizes.width.bottom_center > -10) {
278		if (sizes.width.bottom_left + sizes.width.bottom_center/2 > viewport.width/2) icons_only = true;
279	}
280	if (sizes.width.bottom_right > lepopuptab_horizontal_indent && sizes.width.bottom_center > -10) {
281		if (sizes.width.bottom_right + sizes.width.bottom_center/2 > viewport.width/2) icons_only = true;
282	}
283	if (sizes.width.bottom_left > lepopuptab_horizontal_indent && sizes.width.bottom_right > lepopuptab_horizontal_indent) {
284		if (sizes.width.bottom_left + sizes.width.bottom_right > viewport.width) icons_only = true;
285	}
286	if (sizes.width.bottom_left > viewport.width || sizes.width.bottom_right > viewport.width || sizes.width.bottom_center > viewport.width) icons_only = true;
287	
288	if (icons_only) {
289		jQuery(".lepopuptab-bottom-left, .lepopuptab-bottom-center, .lepopuptab-bottom-right").addClass("lepopuptab-icon-only");
290		sizes.width.bottom_left = lepopuptab_horizontal_indent;
291		sizes.width.bottom_center = -10;
292		sizes.width.bottom_right = lepopuptab_horizontal_indent;
293		jQuery(".lepopuptab-bottom-left, .lepopuptab-bottom-center, .lepopuptab-bottom-right").each(function() {
294			if (jQuery(this).hasClass("lepopuptab-bottom-left")) sizes.width.bottom_left += parseInt(j
294Query(this).outerWidth(), 10) + 10;
295			else if (jQuery(this).hasClass("lepopuptab-bottom-center")) sizes.width.bottom_center += parseInt(jQuery(this).outerWidth(), 10) + 10;
296			else if (jQuery(this).hasClass("lepopuptab-bottom-right")) sizes.width.bottom_right += parseInt(jQuery(this).outerWidth(), 10) + 10;
297		});
298	}
299	
300	var set_left = function(object) {
301		var tab_size = {
302			width	: parseInt(jQuery(object).outerWidth(), 10),
303			height	: parseInt(jQuery(object).outerHeight(), 10)
304		};
305		jQuery(object).css({"left" : left_position+"px"});
306		left_position += tab_size.width + 10;
307	};
308	
309	left_position = parseInt((viewport.width - sizes.width.bottom_center)/2, 10);
310	jQuery(".lepopuptab-bottom-center").each(function() {set_left(this);});
311	
312	left_position = viewport.width - sizes.width.bottom_right;
313	jQuery(".lepopuptab-bottom-right").each(function() {set_left(this);});
314	
315	left_position = lepopuptab_horizontal_indent;
316	jQuery(".lepopuptab-bottom-left").each(function() {set_left(this);});
317
318	// Top edge
319	icons_only = false;
320	if (sizes.width.top_left > lepopuptab_horizontal_indent && sizes.width.top_center > -10) {
321		if (sizes.width.top_left + sizes.width.top_center/2 > viewport.width/2) icons_only = true;
322	}
323	if (sizes.width.top_right > lepopuptab_horizontal_indent && sizes.width.top_center > -10) {
324		if (sizes.width.top_right + sizes.width.top_center/2 > viewport.width/2) icons_only = true;
325	}
326	if (sizes.width.top_left > lepopuptab_horizontal_indent && sizes.width.top_right > lepopuptab_horizontal_indent) {
327		if (sizes.width.top_left + sizes.width.top_right > viewport.width) icons_only = true;
328	}
329	if (sizes.width.top_left > viewport.width || sizes.width.top_right > viewport.width || sizes.width.top_center > viewport.width) icons_only = true;
330	
331	if (icons_only) {
332		jQuery(".lepopuptab-top-left, .lepopuptab-top-center, .lepopuptab-top-right").addClass("lepopuptab-icon-only");
333		sizes.width.top_left = lepopuptab_horizontal_indent;
334		sizes.width.top_center = -10;
335		sizes.width.top_right = lepopuptab_horizontal_indent;
336		jQuery(".lepopuptab-top-left, .lepopuptab-top-center, .lepopuptab-top-right").each(function() {
337			if (jQuery(this).hasClass("lepopuptab-top-left")) sizes.width.top_left += parseInt(jQuery(this).outerWidth(), 10) + 10;
338			else if (jQuery(this).hasClass("lepopuptab-top-center")) sizes.width.top_center += parseInt(jQuery(this).outerWidth(), 10) + 10;
339			else if (jQuery(this).hasClass("lepopuptab-top-right")) sizes.width.top_right += parseInt(jQuery(this).outerWidth(), 10) + 10;
340		});
341	}
342	
343	left_position = parseInt((viewport.width - sizes.width.top_center)/2, 10);
344	jQuery(".lepopuptab-top-center").each(function() {set_left(this);});
345	
346	left_position = viewport.width - sizes.width.top_right;
347	jQuery(".lepopuptab-top-right").each(function() {set_left(this);});
348	
349	left_position = lepopuptab_horizontal_indent;
350	jQuery(".lepopuptab-top-left").each(function() {set_left(this);});
351}
352if (typeof lepopupext_open_before == 'function') { 
353	lepopuptab_open_before = lepopupext_open_before;
354}
355lepopupext_open_before = function(id) {
356	if (typeof lepopuptab_open_before == 'function') { 
357		lepopuptab_open_before(id);
358	}
359	jQuery(".lepopuptab-"+id).each(function() {
360		jQuery(this).fadeOut(500);
361	});
362}
363if (typeof lepopupext_close_after == 'function') { 
364	lepopuptab_close_after = lepopupext_close_after;
365}
366lepopupext_close_after = function(id) {
367	if (typeof lepopuptab_close_after == 'function') { 
368		lepopuptab_close_after(id);
369	}
370	jQuery(".lepopuptab-"+id).each(function() {
371		jQuery(this).fadeIn(500);
372	});
373}

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.