PageSourceSearch

https://www.bentleywashingtondc.com/wp-content/themes/aanWordpress…/inventory_detailed.js?20240529204501

js bentleywashingtondc.com collected 2026-10-05 22:25:33 UTC 11,074 bytes, 401 lines download raw bytes

1let total_images = 0,
2limit = 0,
3offset = 0,
4offset1 = 0,
5listing_tags = [
6	{ name: 'og:title', value: ''},
7	{ name: 'og:description', value: ''},
8	{ name: 'og:image', value: ''},
9	{ name: 'og:image:type', value: ''},
10	{ name: 'og:url', value: ''},
11],
12listing_title_tag = '',
13getDetailed = (id) => {
14 	vid = id.match(/-c-(\d*)\//)[1];
15
16	$('#header').addClass('sticky');
17
18	var t = $(window).scrollTop();
19
20 	$('#page').fadeTo('slow', 0);
21	
22 	$('html').css({overflow: 'hidden'});
23
24 	$('#detailed_page_wrapper').css('display', 'block');
25    $('#detailed_page').show("slow"); 
26	// $('#detailed_page').show("slow").html(spin_gif);
27
28// return;	
29	$.get( "/isapi_xml.php?module=detailed&action=getPage&vid="+ vid ).done( function( text ) {
30        let detailed_title_tags = text.split("\n")[0],
31		tags = JSON.parse(detailed_title_tags);
32        text = text.replace(detailed_title_tags, '');
33
34  		$('#detailed_page').html(text).ready(() => {
35			is_listing_page = false;		
36			let new_hash = id;
37			loc_tion = current_listing;
38			loc_tion = loc_tion.split('/'),
39			url = loc_tion[0] +"//"+ loc_tion[2] + new_hash;
40			
41			$('#breadCrump').html( loc_tion[3].replace(/-/g, ' '));
42
43			if (new_hash.match(/^xxx/) == null) {
44                window.history.pushState( {}, null, loc_tion[0] +"//"+ loc_tion[2] + new_hash);
45
46				listing_tags.map((val, k) => {
47					let tag_value = val.name == 'og:url' ? url : tags[val.name];
48					listing_tags[k].value = $('meta[property="'+ val.name +'"]').attr('content');
49					$('meta[property="'+ val.name +'"]').attr('content', tag_value);
50					if (val.name == 'og:description') {
51						$('meta[name="description"]').attr('content', tag_value);
52					}
53				})
54                $('link[rel="canonical"]').attr('href', url);
55            }
56 			document.title = tags['og:title'];
57			datailedInit();
58		});
59
60	});
61},
62datailedInit = () => {
63    let set_accordable = () => {
64        $('#option-list').accordable({
65            openPanel: [1]
66        });
67    }
68    if ($.isFunction($.fn.accordable) == false) {
69        ((callback) => {
70            let js = document.createElement("script");
71            js.type = "text/javascript";
72            js.src = '/wp-content/themes/aanWordpress/assets/js/jquery.accordable.min.js';
73            js.onload = () => {
74                callback();
75            }
76            document.body.appendChild(js);
77        })(() => {
78            set_accordable();
79        })
80    } else
81        set_accordable();
82
83	$('.element.questions  input').on('click', function(){
84			$('#inquery_extra').slideDown();
85	});
86	
87	$(".optionToggle").click(function(){
88		$(this).next(".optionBlock").slideToggle("fast");
89	});
90	
91	$(".contactUs").click(function(e){
92		e.preventDefault();
93		$(".ui-tabs-anchor[href='#contact']").click();
94	});
95	
96	$("div.inventory-detailed-section .detail .btnBox a.view").on("click", function(e){
97		e.preventDefault();
98		$("a.contact").trigger("click");
99		$('html, body').animate({
100			scrollTop: $("#contact").offset().top
101		}, 500);
102	});
103	
104	$.fancybox.defaults.buttons = [
105			'fullScreen',
106			'slideShow',
107			'thumbs',
108			'close'
109		];
110	
111	$("[data-fancybox]").fancybox({
112		fullScreen: {
113			autoStart: true
114		},
115		afterShow: function( instance, slide ) {
116			$(".fancybox-is-zoomable .fancybox-slide--current").click();
117		},
118	});
119	
120/* full screen photo viewer */
121	var fullscreen = false;
122	$( '.fullscreen-photos').on( 'click', function( e ){
123		e.preventDefault();
124		var elem = $( 'section.fullscreen-photos-container' ).get(0);
125		if (elem.requestFullscreen) {
126			elem.requestFullscreen();
127		} else if (elem.msRequestFullscreen) {
128			elem.msRequestFullscreen();
129		} else if (elem.mozRequestFullScreen) {
130			elem.mozRequestFullScreen();
131		} else if (elem.webkitRequestFullscreen) {
132			elem.webkitRequestFullscreen();
133		}
134		$( 'section.fullscreen-photos-container' ).show();
135
136		fullscreen = true;
137	});
138	$( 'section.fullscreen-photos-container .exit' ).on( 'click', function( e ){
139		e.preventDefault();
140		var elem = document;
141		if (elem.exitFullscreen) {
142			elem.exitFullscreen();
143		} else if (elem.msExitFullscreen) {
144			elem.msExitFullscreen();
145		} else if (elem.mozExitFullScreen) {
146			elem.mozExitFullScreen();
147		} else if (document.mozCancelFullScreen) {
148			elem.mozCancelFullScreen();
149		} else if (elem.webkitExitFullscreen) {
150			elem.webkitExitFullscreen();
151		}
152		fullscreen = false;
153		$( 'section.fullscreen-photos-container' ).hide();
154	});
155	$( document ).bind('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', function(e) {
156		var IFS =
157			(typeof document.isFullScreen != "undefined") ? document.isFullScreen :
158			(typeof document.webkitIsFullScreen != "undefined") ? document.webkitIsFullScreen :
159			(typeof document.mozIsFullScreen != "undefined") ? document.mozIsFullScreen :
160			(typeof document.msIsFullScreen != "undefined") ? document.msIsFullScreen : 
161			false;
162		if( !IFS && !fullscreen ) {
163			$( 'section.fullscreen-photos-container' ).hide();
164			fullscreen = false;
165		}
166		if( fullscreen ) {
167			fullscreen = false;
168		}
169	});
170
171	$(".featureItem b").click(function(){
172		$(this).toggleClass("active").next("div").slideToggle();
173	});
174	$(".featureItem b").eq(0).click();
175	
176	//-----Lower set of images-------------
177	offset1 = parseInt(limit),
178	hasmoreimages = parseInt(total_images) > parseInt(limit) ? true : false;
179
180	$('#detailed_page_wrapper').css('height', window.innerHeight - $('#header').innerHeight());
181
182	// if (parseInt(total_images) > 1) {
183	// 	document.getElementById('first_image').addEventListener('load', getImages, false);
184	// }
185	
186	$('#detailed_page').scroll(function() {
187
188		if ($('#detailed_page').scrollTop() + $(window).height() > $('.inventory-detailed-section').height() - 2000 && hasmoreimages) {
189			hasmoreimages = false;
190			$.get( "/isapi_xml.php?module=detailed&action=getImages&vid="+ vid +"&limit="+ limit +"&offset="+ offset1 +"&size=f" ).done( function( text ) {
191
192				text = JSON.parse(text);
193				offset1 = parseInt(offset1) + parseInt(limit);
194			
195				for (var i in text) {
196
197					$('#photos').append('\
198								<div class="photo col-md-6 col-lg-4 mb-3" onclick="openFancybox('+ (parseInt(i) + parseInt(offset1) - parseInt(limit)) +')">\
199									<img class="full img-fluid w-100" src="'+ text[i].url +'" alt="'+ text[i].alt +'" />\
200								</div>');
201				}
202				hasmoreimages = total_images > offset1 ? true : false;
203			});
204		}
205	});
206	checkPinned();
207    getImages();
208},
209openFancybox = (i) => {
210	$('#fancypic_'+ i).click();
211},
212loading = true,
213getImages = () => {
214
215	loading = true;
216
217	$.get( "/isapi_xml.php?module=detailed&action=getImages&vid="+ vid +"&limit="+ limit +"&offset="+offset +"&size=l" ).done( function( text ) {
218		text = JSON.parse(text);
219
220		for (var i in text) {
221			if (offset == 0) {
222				if (i < 1) continue;
223				$('.mainSlider').append('\
224						<div class="photo" onclick="openFancybox('+ i +')">\
225								<img class="full" src="'+ text[i].url +'" alt="'+ text[i].alt +'" />\
226						</div>');
227			} else {
228				$('.mainSlider').slick('slickAdd', '\
229						<div class="photo" onclick="openFancybox('+ i +')">\
230								<img class="full" src="'+ text[i].url +'" alt="'+ text[i].alt +'" />\
231						</div>');
232			
233			}
234		}
235		
236		loading = false;
237		
238		if (offset == 0) {
239			$(".frame .mainSlider").slick( {
240				initialSlide: offset,
241				fade: false,
242				autoplay: false,
243				autoplaySpeed: 5000,
244				speed: 1500,
245				arrows: true,
246				dots: false,
247				slidesToShow: 1,
248				slidesToScroll: 1,
249				pauseOnHover: false,
250				pauseOnDotsHover: true,
251				adaptiveHeight: true,
252				responsive: [
253				{
254					breakpoint: 768,
255					settings: {
256					slidesToShow: 1,
257					slidesToScroll: 1,
258					arrows: false,
259					dots: false,
260					}
261				},]
262			});
263		}
264		offset = parseInt(offset) + parseInt(limit);
265
266		$('.slick-next').on('click', function() {
267            loadNext();
268		});
269	});
270},
271moveToContcts = () => {
272	$('#detailed_page').animate({
273        scrollTop: $('#tabs').offset().top - 100
274    }, 1000);
275
276	$('.contact').trigger('click');
277},
278count = 0,
279loadNext = () => {
280    count++;
281
282	if (!loading && count >= limit - 1) {
283		count = 0;
284		getImages();
285	}
286},
287backToListing = () => {
288    if ($('#container').text().trim().length < 50)
289        getSearchResults();
290    
291	if (current_listing == '')
292		location.href='inventory';
293    
294 	$('#page').css({opacity: '1'});
295
296 	$('html').css({overflow: 'auto'});
297
298 	$('#detailed_page_wrapper').css('display', 'none');
299	$('#detailed_page').hide().html('');
300	is_listing_page = true;
301	
302// 	stickyHeader();
303	
304	window.history.pushState( {}, null, current_listing);
305
306	listing_tags.map((val, k) => {
307		$('meta[property="'+ val.name +'"]').attr('content', val.value);
308		if (val.name == 'og:description') {
309			$('meta[name="description"]').attr('content', val.value);
310		}
311	})
312    $('link[rel="canonical"]').attr('href', current_listing);
313    document.title = listing_title_tag;
314},
315toggleOptions = (obj) => {
316	
317	if (obj.innerHTML == 'Open All') {
318		$('.featureItem').find('b').addClass('active');
319		$('.featureItem >
319 div:not(.clearfix)').show('slow');
320		obj.innerHTML = 'Close All';
321	} else {
322		$('.featureItem').find('b').removeClass('active');
323		$('.featureItem > div:not(.clearfix)').hide('slow');
324		obj.innerHTML = 'Open All';
325	}
326},
327showSticker = (vid) => {
328    $.post('https://reseller.aansupport.com/controlpanel/vms/build_sticker.php?cid='+ vid, 
329        {
330            db: 'woodburyautosal', 
331            dblogin: 'wdbrytsls'
332            
333        }, function (data) {
334        var w = window.open('about:blank');
335        w.document.open();
336        w.document.write(data);
337        w.document.close();
338    });
339}
340
341$(document).ready(function(e) {
342
343	if (vid > 0)
344		getDetailed('xxx-c-'+ vid +'/', true);
345	else {
346        current_listing = window.location.href;
347        listing_title_tag = document.title;
348    }
349/* Tabs with exceptions */    
350	let tabs = $('#tabs').tabs({
351		hide: {
352			effect: "slideUp",
353			duration: 700
354		},
355		show:{
356			effect: "slideDown",
357			duration: 700
358		},
359		collapsible: true,
360		active: true,
361		activate: function (event, ui) {
362			if (ui.newPanel.selector == '#video') $('#video > div >  iframe').attr('src', videourl );
363			else  $('#video > div > iframe').attr('src', '');
364							   
365			if (ui.newPanel.selector == '#photos') {
366				$('html, body').animate({
367						scrollTop: $($(".mkScrollTo").attr( 'href')).offset().top
368				}, 500);
369			}
370		}
371	});
372	$("#tabs li a").eq(0).click();
373
374	$(".optionToggle").click(function(e){
375		e.preventDefault();
376		$("#tabs li a").eq(0).click();
377		$(this).next(".optionBlock").slideToggle("fast");
378	});
379	
380	$(".contactUs").click(function(e){
381		e.preventDefault();
382		$(".ui-tabs-anchor[href='#contact']").click();
383	});
384	
385	$("div.inventory-detailed-section .detail .btnBox a.view").on("click", function(e){
386		e.preventDefault();
387		$("a.contact").trigger("click");
388		$('html, body').animate({
389			scrollTop: $("#contact").offset().top
390		}, 500);
391	});
392});
393window.onpopstate = function (event) {
394	var loc = document.location.href.match(/-c-(\d*)\//);
395	if (loc != null) {
396		getDetailed(document.location.href);
397	} else if (is_listing_page) { 
398		readHash();
399		getSearchResults();
400	} else backToListing();
401};

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.