PageSourceSearch

https://rvtssor.no/inc/js2020/script.js

js rvtssor.no collected 2026-10-02 06:26:06 UTC 8,670 bytes, 130 lines download raw bytes

1/* dragscroll v0.0.8, MIT, http://github.com/asvd/dragscroll */ !function(e,n){"function"==typeof define&&define.amd?define(["exports"],n):"undefined"!=typeof exports?n(exports):n(e.dragscroll={})}(this,function(e){var n,t,o=window,r=document,i=[],l=function(e,l){for(e=0;e<i.length;)(l=(l=i[e++]).container||l).removeEventListener("mousedown",l.md,0),o.removeEventListener("mouseup",l.mu,0),o.removeEventListener("mousemove",l.mm,0);for(i=[].slice.call(r.getElementsByClassName("dragscroll")),e=0;e<i.length;)!function(e,i,l,s,d,m){(m=e.container||e).addEventListener("mousedown",m.md=function(n){e.hasAttribute("nochilddrag")&&r.elementFromPoint(n.pageX,n.pageY)!=m||(s=1,i=n.clientX,l=n.clientY,n.preventDefault())},0),o.addEventListener("mouseup",m.mu=function(){s=0},0),o.addEventListener("mousemove",m.mm=function(o){s&&((d=e.scroller||e).scrollLeft-=n=-i+(i=o.clientX),d.scrollTop-=t=-l+(l=o.clientY),e==r.body&&((d=r.documentElement).scrollLeft-=n,d.scrollTop-=t))},0)}(i[e++])};"complete"==r.readyState?l():o.addEventListener("load",l,0),e.reset=l});
2
3/* fitty v2.3.0, MIT, https://rikschennink.github.io/fitty/ */ !function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.fitty=n.exports}}(this,function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};t.default=function(n){if(n){var r={IDLE:0,DIRTY_CONTENT:1,DIRTY_LAYOUT:2,DIRTY:3},i=[],e=null,o="requestAnimationFrame"in n?function(){n.cancelAnimationFrame(e),e=n.requestAnimationFrame(function(){return u(i.filter(function(e){return e.dirty&&e.active}))})}:function(){},t=function(t){return function(){i.forEach(function(e){return e.dirty=t}),o()}},u=function(e){e.filter(function(e){return!e.styleComputed}).forEach(function(e){e.styleComputed=s(e)}),e.filter(f).forEach(d);var t=e.filter(c);t.forEach(l),t.forEach(function(e){d(e),a(e)}),t.forEach(p)},a=function(e){return e.dirty=r.IDLE},l=function(e){e.availableWidth=e.element.parentNode.clientWidth,e.currentWidth=e.element.scrollWidth,e.previousFontSize=e.currentFontSize,e.currentFontSize=Math.min(Math.max(e.minSize,e.availableWidth/e.currentWidth*e.previousFontSize),e.maxSize),e.whiteSpace=e.multiLine&&e.currentFontSize===e.minSize?"normal":"nowrap"},c=function(e){return e.dirty!==r.DIRTY_LAYOUT||e.dirty===r.DIRTY_LAYOUT&&e.element.parentNode.clientWidth!==e.availableWidth},s=function(e){var t=n.getComputedStyle(e.element,null);e.currentFontSize=parseInt(t.getPropertyValue("font-size"),10),e.display=t.getPropertyValue("display"),e.whiteSpace=t.getPropertyValue("white-space")},f=function(e){var t=!1;return!e.preStyleTestCompleted&&(/inline-/.test(e.display)||(t=!0,e.display="inline-block"),"nowrap"!==e.whiteSpace&&(t=!0,e.whiteSpace="nowrap"),e.preStyleTestCompleted=!0,t)},d=function(e){e.originalStyle||(e.originalStyle=e.element.getAttribute("style")||""),e.element.style.cssText=e.originalStyle+";white-space:"+e.whiteSpace+";display:"+e.display+";font-size:"+e.currentFontSize+"px"},p=function(e){e.element.dispatchEvent(new CustomEvent("fit",{detail:{oldValue:e.previousFontSize,newValue:e.currentFontSize,scaleFactor:e.currentFontSize/e.previousFontSize}}))},v=function(e,t){return function(){e.dirty=t,e.active&&o()}},m=function(e){b(e),e.newbie=!0,e.dirty=!0,i.push(e)},y=function(t){return function(){i=i.filter(function(e){return e.element!==t.element}),t.observeMutations&&t.observer.disconnect(),t.element.style.cssText=t.originalStyle}},h=function(e){return function(){e.active||(e.active=!0,o())}},S=function(e){return function(){return e.active=!1}},b=function(e){e.observeMutations&&(e.observer=new MutationObserver(v(e,r.DIRTY_CONTENT)),e.observer.observe(e.element,e.observeMutations))},w={minSize:16,maxSize:512,multiLine:!0,observeMutations:"MutationObserver"in n&&{subtree:!0,childList:!0,characterData:!0}},T=null,z=function(){n.clearTimeout(T),T=n.setTimeout(t(r.DIRTY_LAYOUT),D.observeWindowDelay)},F=["resize","orientationchange"];return Object.defineProperty(D,"observeWindow",{set:function(e){var t=(e?"add":"remove")+"EventListener";F.forEach(function(e){n[t](e,z)})}}),D.observeWindow=!0,D.observeWindowDelay=100,D.fitAll=t(r.DIRTY),D}function g(e,t){var n=E({},w,t),i=e.map(function(e){var t=E({},n,{element:e,active:!0});return m(t),{element:e,fit:v(t,r.DIRTY),unfreeze:h(t),freeze:S(t),unsubscribe:y(t)}});return o(),i}function D(e){var t,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e?g((t=document.querySelectorAll(e),[].slice.call(t)),n):g([e],n)[0]}}("undefined"==typeof window?null:window),e.exports=t.default});
4
5
6$(document).ready(function() {
7	
8  function tabbing(e) {
9		if (e.keyCode === 9) {
10			document.body.classList.add('tabbing');
11			window.removeEventListener('keydown', tabbing);
12		}
13	}
14  window.addEventListener('keydown', tabbing);
15
16  $(document).on('click', 'a[href^="#"]', function(e) {
17    var id = $(this).attr('href');
18    var $id = $(id);
19    if ($id.length === 0) {
20        return;
21    }
22    e.preventDefault();
23    var pos = $id.offset().top;
24    $('body, html').animate({scrollTop: pos});
25  });
26  
27  $('.burger').on('click', function () {
28    $('body').toggleClass('noscroll');
29    $('#meny').toggle();
30    $('#meny').scrollTop(0);
31    $('.aniBurger').toggleClass('open');
32    $('.burger').toggleClass('skygge');
33    $('.burger').toggleClass('aapnet');
34    // var logo = ($('#logo img').attr('src') === 'inc/img/rvtssor.svg') ? 'inc/img/rvtssor-hvit.svg' : 'inc/img/rvtssor.svg';$('#logo img').attr('src', logo);
35  });
36
37  fitty('.fit', {minSize:1});
38
39  $('#epostsjekk').on("cut copy paste",function(e) {
40    e.preventDefault();
41  });
42  $('input[type=radio]').on("change", function() {
43    if ($(this).val() == "Bedrift") {
44      $('.bedriftfaktura').show();
45    } else {
46      $('.bedriftfaktura').hide();
47    }
48  });
49
50  var postnummer = document.getElementById('postnr');
51	if(typeof(postnummer) != 'undefined' && postnummer != null){
52		postnummer.onblur = function(){
53			var query = new URLSearchParams;
54			query.append("clientUrl", "https://rvtssor.no");
55			query.append("pnr", this.value);
56			var url = "https://api.bring.com/shippingguide/api/postalCode.json?" + query.toString();
57			var xhr = new XMLHttpRequest();
58			xhr.open('GET', url, true);
59			xhr.onload = function(){
60			  document.getElementById("poststed").value = JSON.parse(this.response).result;
61			};
62			xhr.send();
63		};
64		document.getElementById('poststed').onfocus = function(){
65			var query = new URLSearchParams;
66			query.append("clientUrl", "https://rvtssor.no");
67			query.append("pnr", postnummer.value);
68			var url = "https://api.bring.com/shippingguide/api/postalCode.json?" + query.toString();
69			var xhr = new XMLHttpRequest();
70			xhr.open('GET', url, true);
71			xhr.onload = function(){
72			  document.getElementById("poststed").value = JSON.parse(this.response).result;
73			};
74			xhr.send();
75		};
76  };
77
78  var orgnr = document.getElementById('orgnr');
79	if(typeof(orgnr) != 'undefined' && orgnr != null){
80    orgnr.onblur = function(){
81      $(this).val(function(_, v){
82        return v.replace(/[^0-9]/g, '');
83      });
84      var orgnr = $('#orgnr').val();
85      //var url = 'https://data.brreg.no/enhetsregisteret/enhet/' + orgnr + '.json';
86      var url = 'https://data.brreg.no/enhetsregisteret/api/enheter/' + orgnr; 
87      $.getJSON(url,function(json){
88        JSON.stringify(json);
89        if($('#bedrift').val() == ''){$('#bedrift').val(json.navn)};
90      });
91    };
92  };
93  
94  $('#refleksjonsbok').on('shown.bs.modal', function () {
95	  $('#myText').focus();
96	});
97
98	$('input[type="radio"]#lisens1').click(function() {
99	  $('#lisenskode').show();    
100	});
101	$('input[type="radio"]#lisens2').click(function() {
102	  $('#lisenskode').hide();    
103	});
104
105  var fylkeValg = document.getElementById('fylkeValg');
106	if(typeof(fylkeValg) != 'undefined' && fylkeValg != null){
107		$("#fylkeValg").change(function(){
108			var deptid = $(this).val();
109			if(deptid != 21 && deptid != 99){
110				$.ajax({
111					url: 'kommune.php',
112					type: 'post',
113					data: {f:deptid},
114					dataType: 'json',
115					success:function(response){
116						var len = response.length;
117						$("#kommuneValg").empty();
118						for( var i = 0; i<len; i++){
119							var id = response[i]['id'];
120							var name = response[i]['name'];
121							$("#kommuneValg").append("<option value='"+id+"'>"+name+"</option>");
122						}
123					}
124				});
125			  $("#kommuneValg").prop("disabled", false);
126			}
127		});
128	};
129
130});

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.