PageSourceSearch

https://www.dunstan.co.nz/edit/modules/imageboxes/imageboxes.js?version=1.0.10

js dunstan.co.nz collected 2026-10-08 07:13:06 UTC 2,207 bytes, 99 lines download raw bytes

1// Image Boxes JavaScript Document
2
3	$(document).ready(function() {
4		"use strict";
5	
6	
7		// Check for match height class (matchheight)
8		if($.fn.matchHeight && $(".imagebox-matchheight").length > 0) {
9			//
10			$(".imagebox-matchheight").matchHeight({
11				byRow: true,
12				property: "height",
13			});
14		}
15		
16		// Check for match height class (matchheight)
17		if($.fn.matchHeight && $(".imageboxes.textabove .module-text").length > 0) {
18			//
19			$(".imageboxes.textabove .module-text").matchHeight({
20				byRow: true,
21				property: "height",
22			});
23		}
24	
25		// Check for owl carousel
26		if($.fn.owlCarousel) {
27			
28			var items = $('.owl-carousel').data("items");
29			
30			var moreOptions;
31			var owlOptions = {
32				items: items,
33				margin: 40,
34				loop: true,
35				itemElement: 'div',
36				nav: true,
37				dots: true,
38				navText: [$(".owl-carousel-prev").html(),$(".owl-carousel-next").html()],
39				};
40				
41			//
42			switch(items) {
43				case 7 :
44				case 6 : {
45					moreOptions = {
46						responsive:{
47							0:{items:1,nav:false},
48							680:{items:3,nav:false,margin:20},
49							1200:{items:5,nav:true,margin:20}
50						}
51					};
52					break;
53				}
54				case 5 :
55				case 4 : {
56					moreOptions = {
57						responsive:{
58							0:{items:1,nav:false},
59							680:{items:3,nav:false,margin:20},
60							1200:{nav:true,margin:30}
61						}
62					};
63					break;
64				}
65				default : {
66					moreOptions = {
67						responsive:{
68							0:{items:1,nav:false},
69							680:{items:2,nav:false,margin:20},
70							1200:{nav:true}
71						}
72					};
73					break;
74				}
75			}
76			
77			// Join options
78			owlOptions = merge_options(owlOptions,moreOptions);
79			
80			//
81			if($('.owl-carousel').length > 0) {
82				$('.owl-carousel').owlCarousel(owlOptions);
83			}
84		}
85	});
86	
87	
88	/**
89 * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1
90 * @param obj1
91 * @param obj2
92 * @returns obj3 a new object based on obj1 and obj2
93 */
94function merge_options(obj1,obj2) {
95    var obj3 = {};
96    for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
97    for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
98    return obj3;
99}

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.