PageSourceSearch

https://gtsenter.no/wp-content/themes/dentalia/dev-js/orion-svg.js?ver=bf46dc6ea677721c147a9392c07c787b

js gtsenter.no collected 2026-10-02 23:13:30 UTC 7,069 bytes, 180 lines download raw bytes

1"use strict";
2
3jQuery(function($) {
4
5	var orionSvgs = new Object();
6
7
8	orionSvgs.svg_1 = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1440 36"><path fill="{{svgBgColor}}" d="M1437,0h-7H758c-1.65,0-3.955,0.955-5.121,2.121L722.12,32.879c-1.167,1.167-3.076,1.166-4.242,0	L687.121,2.122C685.955,0.955,683.65,0,682,0H10H3H0v3v30v3h3h7h1420h7h3v-3V3V0H1437z"/></svg>';
9	orionSvgs.svg_13 = '<?xml version="1.0" encoding="UTF-8"?><svg enable-background="new 0 0 1440 72" version="1.1" viewBox="0 0 1440 72" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="{{svgBgColor}}"><path d="m360 11.993c120 0 240 10.085 360 30.251 34.031 5.344 68.06 9.904 102.09 13.731 85.97 9.673 171.94 14.536 257.91 14.536 111.63 0 223.26-8.164 334.89-24.473 8.37-1.222 16.743-2.48 25.113-3.795v-12.18s-18.02 2.781-27.041 4.099c-110.55 16.151-222.61 24.341-333.06 24.341-84.943 0-171.24-4.865-256.5-14.458-34.062-3.831-68.206-8.423-101.49-13.649-120.04-20.17-241.77-30.396-361.81-30.396-119.47 0-240.61 10.134-360.1 30.113v12.131c120-20.166 240-30.251 360-30.251z" opacity=".3"/><path d="m1080 70.512c-85.971 0-171.94-4.863-257.91-14.536-34.031-3.828-68.06-8.388-102.09-13.732-120-20.166-240-30.251-360-30.251s-240 10.085-360 30.251v29.756h1440v-29.756c-8.37 1.314-16.743 2.573-25.113 3.795-111.63 16.309-223.26 24.473-334.89 24.473z"/></g></svg>';
10	/*check if is hex color */
11	function is_hexadecimal(str) {
12		var regexp = /^[0-9a-fA-F]+$/;
13	    if (regexp.test(str)) {
14	        return true;
15	    } else {
16	        return false;
17	    }
18	}
19
20	/* create a row with separator */
21	$.fn.createSvgFile = function(position, fileName, color){
22		var row = $(this);
23		var datatypeAttr = '';
24		var separator = '';
25		var placement = '';
26		var svg = '';
27		var zIndexAttr = '';
28		var zIndexAttribute = ' style="z-index:2;"';
29		
30		var SvgPath = orionColors.svg_path;
31
32		var dataType = $(this).attr('data-stretch-type');
33		if (dataType != undefined) {
34			if (dataType == 'full') {
35				dataType = 'full-stretched';
36			}
37			datatypeAttr = 'data-stretch-type="'+ dataType + '"';
38		}
39
40		var zIndex = $(this).attr('data-z-index');
41		if (zIndex != undefined) {
42			zIndexAttribute = ' style="z-index:'+ (parseInt(zIndex) + 1) + '"';
43		}
44
45		if (position == 'bottom-svg-inside' || position == 'bottom-svg-outside') {
46			placement = 'bottom';
47		} else {
48			placement = 'top';
49		}
50
51		var classList = $(this).attr('class').split(/\s+/);
52		if (placement == 'bottom') {
53			var newClassList = classList.filter(function (item) {
54   				return item.indexOf("top-") !== 0;
55   			});
56		} else {
57			var newClassList = classList.filter(function (item) {
58	   			return item.indexOf("bottom-") !== 0;
59			});			
60		}
61		newClassList = newClassList.filter(function(e) { return e !== 'middle_align' });
62		newClassList = newClassList.filter(function(e) { return e !== 'bottom_align' });
63		newClassList = newClassList.filter(function(e) { return e !== 'orion-equal-height' });
64		newClassList = newClassList.filter(function(e) { return e !== 'full-screen-row' });
65		newClassList = newClassList.join(' ');		
66
67		// get svg object property
68		var svgProperty = fileName.replace('-', '_');
69		// console.log(svgProperty);
70		if (orionSvgs.hasOwnProperty(svgProperty)) {
71
72			separator = orionSvgs[svgProperty];
73			if (separator.includes("{{svgBgColor}}")) {
74				separator = separator.replace(/{{svgBgColor}}/g, color);
75			}
76			if (placement == 'top') {
77				var svg = '<div class="' + newClassList + ' svg-wrap-animate svg-wrap wrap-top"' + datatypeAttr + zIndexAttribute + '><div class="svg-w">' + separator + '</div></div>';
78				row.before(svg);
79			} else {
80				var svg = '<div class="' + newClassList + ' svg-wrap-animate svg-wrap wrap-bottom"' + datatypeAttr + zIndexAttribute + '><div class="svg-w">' + separator + '</div></div>';
81				row.after(svg);
82			}
83
84		} else {
85			var file = SvgPath + fileName + '.svg';
86			// console.log(fileName);
87			jQuery.get(file, function(separator) {
88
89				if (separator.includes("{{svgBgColor}}")) {
90					separator = separator.replace(/{{svgBgColor}}/g, color);
91				}
92				if (placement == 'top') {
93					var svg = '<div class="' + newClassList + ' svg-wrap-animate svg-wrap wrap-top"' + datatypeAttr + zIndexAttribute + '><div class="svg-w">' + separator + '</div></div>';
94					// $(svg).css('z-index', zIndexSeparator);
95					row.before(svg);
96				} else {
97					var svg = '<div class="' + newClassList + ' svg-wrap-animate svg-wrap wrap-bottom"' + datatypeAttr + zIndexAttribute + '><div class="svg-w">' + separator + '</div></div>';
98					// $(svg).css('z-index', zIndexSeparator);
99					row.after(svg);
100				}
101			},'text');
102		}
103	}
104
105
106	function getSvgColor(color) {
107		/* returns hex color value */
108		if(color == 'bg-content-bg' || color == undefined) {
109			// check the site bg color
110			var siteContentBgAtt = $('body').attr("data-site-content-bg");
111			if (typeof siteContentBgAtt !== typeof undefined && siteContentBgAtt !== false) {
112			    color = siteContentBgAtt;
113			} else {
114				color = '#fff';
115			}
116		}
117		if ( ! is_hexadecimal(color)) {
118			if (color in orionColors) {
119				color = orionColors[color];
120			}
121		}
122		return color;
123	}
124
125	$( document ).ready(function() {
126		var oSeparator = $('.orion-separator:not(.svg-wrap)');
127		var oSeparatorLength = oSeparator.length;
128
129		$('.orion-separator:not(.svg-wrap)').each(function(index, element){
130			var fileName = '';
131			var position = '';
132			var color = '';
133			
134			var classList = this.className.split(' ');
135			var classArray = $(this).prop("classList");
136
137			// top SVGs
138			if (classList.includes("top-svg-inside") || classList.includes("top-svg-outside")) {
139				var startsWithTop = classList.filter(/./.test.bind(/^top-svg-[0-9]/));
140
141				var htmlClass = startsWithTop[0];
142				var fileName = htmlClass.replace('top-','');
143				if (classList.includes("top-svg-inside")) {
144					position = 'top-svg-inside';
145				} else {
146					position = 'top-svg-outside';
147				}
148				var color = $(this).data('svgTopColor');
149				var hex = getSvgColor(color);
150				$(this).createSvgFile(position, fileName, hex);
151			}
152			// bottom SVGs
153			if (classList.includes("bottom-svg-inside") || classList.includes("bottom-svg-outside")) {
154				var startsWithTop = classList.filter(/./.test.bind(/^bottom-svg-[0-9]/));
155				var htmlClass = startsWithTop[0];
156				var fileName = htmlClass.replace('bottom-','');
157				if (classList.includes("bottom-svg-inside")) {
158					position = 'bottom-svg-inside';
159				} else {
160					position = 'bottom-svg-outside';
161				}			
162				var color = $(this).data('svgBottomColor');
163				var hex = getSvgColor(color);
164				$(this).createSvgFile(position, fileName, hex);
165				
166			}
167			if (index === (oSeparatorLength - 1)) { 
168				// we need to trigger resize and wait for page builder to set their streched rows.
169				setTimeout(function() {
170				 	$('.svg-wrap-animate').removeClass('svg-wrap-animate');
171				 	$(window).trigger('resize');			
172		   	   	}, 100);
173		   	   	setTimeout(function() {
174				 	$('.svg-wrap-animate').removeClass('svg-wrap-animate');
175				 	$(window).trigger('resize');			
176		   	   	}, 600);
177	        }
178		})
179	})
180})

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.