PageSourceSearch

https://www.klpeiendom.no/_/asset/com.klp.enonic.cms:000001a0a55099b0/js/feedback.js

js klpeiendom.no collected 2026-10-02 20:13:41 UTC 2,420 bytes, 1 lines download raw bytes

1"use strict";(function(){function a(a,b){b&&0<b.length?k(a,n.inputHasValue):l(a,n.inputHasValue)}function b(a){B.isPositive=a,f(s),a?(l(t,n.hidden),k(u,n.hidden)):(k(t,n.hidden),l(u,n.hidden)),v.focus()}function c(b){return b&&a(v,b.target.value),h(v,w,i)}async function d(a,b){const c=window.location.href,{userAgent:d}=window.navigator,e=window.innerWidth+"x"+window.innerHeight,f={isPositive:b,feedback:a,url:c,windowSize:e,userAgent:d},g=await fetch(m,{method:"POST",body:JSON.stringify(f),headers:{"Content-Type":"text/plain; charset=utf-8"}});if(-1===[200,201].indexOf(g.status))throw new Error(g.statusText)}function f(a){k(C,n.hidden),l(a,n.hidden),C=a}function g(a){k(a,n.hidden),setTimeout(function(){f(p)},6e3)}function h(a,b,c){const{value:d}=a,e=c(d);return e?(l(a,n.inputInvalid),l(b,n.showError)):(k(a,n.inputInvalid),k(b,n.showError)),e}function i(a){return 0<a.trim().length}async function j(a){if(!D){D=!0;try{await a()}catch(a){console.error(a),f(A)}D=!1}}const k=function(a,b){try{a.classList.add(b)}catch(b){a&&!a.classList?console.error("Error: Element of type "+typeof a+" doesn't have a class list"):console.error(b)}},l=function(a,b){try{a.classList.remove(b)}catch(b){a&&!a.classList?console.error("Error: Element of type "+typeof a+" doesn't have a class list"):console.error(b)}},m=function b(a){const c=window.cmsUrl?window.cmsUrl:"/";return"/"===c[c.length-1]?c+a:c+"/"+a}("_/service/com.klp.enonic.cms/feedback"),n={hidden:"klp-display-hidden",inputInvalid:"klp-input--invalid",inputHasValue:"klp-input--has-value",showError:"klp-input__error-msg--show"},o=function(a){const b=document.getElementById("xpFeedback_"+a);if(null===b&&window.xpFeedbackFormShadowRoot){const b=window.xpFeedbackFormShadowRoot.getElementById("xpFeedback_"+a);if(null!==b)return b}return b},p=o("stepOne"),q=o("yesButton"),r=o("noButton");if(void 0===p||null===p)return;q.addEventListener("click",function(){return b(!0)}),r.addEventListener("click",function(){return b(!1)});const s=o("stepTwo"),t=o("yesHeader"),u=o("noHeader"),v=o("textArea"),w=o("textAreaError"),x=o("sendButton"),y=o("cancelButton");v.addEventListener("change",c),x.addEventListener("click",function a(){j(async function(){if(c()){const{value:a}=v;await d(a,B.isPositive),f(z),setTimeout(function(){g(z)},3e3)}})}),y.addEventListener("click",function a(){f(p)});const z=o("stepThree"),A=o("errorStep"),B={isPositive:void 0};let C=p,D=!1})();

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.