PageSourceSearch

https://polki.pl/assets/bundles/publisherrates/js/controllers/rate_controller-1axakjU.js

js polki.pl collected 2026-10-02 04:49:37 UTC 1,222 bytes, 1 lines download raw bytes

1import{Controller}from"@hotwired/stimulus";export default class extends Controller{static values={submitUrl:String,containerClass:String};preview(e){const t=e.target.closest("svg[data-rate]");if(!t||!this.element.contains(t))return;const n=Number(t.dataset.rate),s=t.parentElement?Array.from(t.parentElement.children):[];s.forEach((e,t)=>{e.classList.toggle("color",n>=t+1)})}clear(){this.element.querySelectorAll(".rate .color").forEach(e=>{e.classList.remove("color")})}rate(e){const t=e.target.closest("svg[data-rate]");if(!t||!this.element.contains(t)||!this.hasSubmitUrlValue)return;e.preventDefault();const n=Number(t.dataset.rate);if(!n)return;fetch(`${this.submitUrlValue}?rate=${n}`,{method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(e=>{this.replaceContainers(e)})}replaceContainers(e){const t=this.hasContainerClassValue?`.${this.containerClassValue}`:null,s=t?Array.from(document.querySelectorAll(t)):[this.element];s.forEach(t=>{t.outerHTML=e});const n=document.getElementById("js-rate-title");if(n&&(n.style.display="none"),!t)return;document.querySelectorAll(`${t} .js-rate-points`).forEach(e=>{e.style.display="block"})}}

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.