PageSourceSearch

https://www.natursidan.se/app/themes/hopp/assets/javascript/chunks/comments-controller.889707ee.js

js natursidan.se collected 2026-10-01 12:16:40 UTC 2,366 bytes, 1 lines download raw bytes

1var y=Object.defineProperty;var T=(s,n,e)=>n in s?y(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e;var r=(s,n,e)=>T(s,typeof n!="symbol"?n+"":n,e);import{C as f,t as F,r as d,c as E}from"../application.c7cadb36.js";const C="footer";class g extends f{constructor(){super(...arguments);r(this,"id",null);r(this,"replyingTo",null);r(this,"replyForm",null);r(this,"replyFooter",null)}initialize(){this.onToggleClick=this.onToggleClick.bind(this),this.onHashChange=this.onHashChange.bind(this)}connect(){const{toggleTarget:e,contentTarget:t}=this;this.replyFormTemplate=F(this.replyFormTemplateTarget.innerHTML);const o=e.id||`comments-toggle-${d(10)}`,i=t.id||`comments-content-${d(10)}`;e.id=o,e.setAttribute("aria-controls",i),t.id=i,t.setAttribute("aria-labelledby",o),e.addEventListener("click",this.onToggleClick,!1),window.addEventListener("hashchange",this.onHashChange,!1),requestAnimationFrame(()=>{this.toggle(this.hashTargetInElement()?!1:this.hiddenValue)})}disconnect(){window.removeEventListener("hashchange",this.onHashChange,!1)}hashTargetInElement(e=window.location.hash){const{element:t}=this;return!!e&&(t.matches(e)||!!t.querySelector(e))}onHashChange(e){const{hash:t}=new URL(e.newURL);this.hashTargetInElement(t)&&requestAnimationFrame(()=>{this.toggle(!1)})}toggle(e){const{toggleTarget:t,contentTarget:o}=this,i=o.matches('[aria-hidden="true"]'),a=e!==void 0?e:!i;t.setAttribute("aria-expanded",!a),o.setAttribute("aria-hidden",a)}onToggleClick(){requestAnimationFrame(()=>{this.toggle()})}reply({target:e,params:{id:t,replyTarget:o,name:i}}){if(this.replyingTo===t)return;const a=e.closest(`#${o}`),p=this.replyFormTemplate({replyCommentId:t,replyCommentName:i}).trim(),m=document.createElement("div");m.innerHTML=p;const l=m.firstChild;this.cancelReply(),this.replyingTo=t;const h=E();document.body.prepend(h),h.focus(),requestAnimationFrame(()=>{const c=a.querySelector(C);this.replyForm=l,this.replyFooter=c,a.insertBefore(l,c),c.hidden=!0,Array.from(l.querySelectorAll("input")).find(u=>!!u.offsetParent).focus(),h.remove()})}cancelReply(){const{replyForm:e,replyFooter:t}=this;e&&requestAnimationFrame(()=>{e.remove(),t.hidden=!1,this.replyingTo=null,this.replyForm=null,this.replyFooter=null})}}r(g,"targets",["toggle","content","replyFormTemplate"]),r(g,"values",{hidden:{type:Boolean,default:!1}});export{g as default};

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.