PageSourceSearch

https://www.raspberrypi.org/assets/controllers/rating_controller-f…e0f62bc50c8a0f953aede70f9dd246d89db08843.js

js raspberrypi.org collected 2026-09-24 06:43:21 UTC 1,353 bytes, 1 lines download raw bytes

1import{Controller}from"stimulus";export default class extends Controller{static targets=["page","ratingId"];retrievedRatingId="";async onRating(t){t.preventDefault();try{const e=await fetch(t.target.href,{method:"POST",headers:{"X-CSRF-Token":document.querySelector('[name="csrf-token"]').content},credentials:"include"}).then(t=>t.json()).then(t=>t).catch(t=>console.error("Error:",t));this.assignId(e.rating_id),this.showPage(1)}catch(t){console.error("Error:",t)}}onQuality(t){t.preventDefault();const e=t.target.closest("form");document.getElementById("quality_input").value=t.target.dataset.value,this.submit(e.action,new FormData(e)),this.showPage(2)}onConfidence(t){t.preventDefault();const e=t.target.closest("form");document.getElementById("confidence_input").value=t.target.dataset.value,this.submit(e.action,new FormData(e)),this.showPage(3)}onComment(t){t.preventDefault(),this.submit(t.target.action,new FormData(t.target)),this.showPage(4)}showPage(t){this.index=t,this.pageTargets.forEach((e,a)=>{e.classList.toggle("rating_page--current",t==a)})}assignId(t){this.retrievedRatingId=t,this.ratingIdTargets.forEach(e=>e.value=t)}submit(t,e){fetch(t,{method:"POST",body:e,headers:{"X-CSRF-Token":document.querySelector('[name="csrf-token"]').content},credentials:"include"}).then(t=>t.json()).then(t=>t).catch(t=>console.error("Error:",t))}}

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.