PageSourceSearch

https://www.onlinejyotish.com/assets/js/public-services.js?v=97cd446306c3

js onlinejyotish.com collected 2026-09-24 09:49:05 UTC 2,825 bytes, 32 lines download raw bytes

1'use strict';
2(()=>{
3 const node=document.getElementById('oj-public-service-config');if(!node)return;
4 const cfg=JSON.parse(node.textContent),hosts=new Set([location.hostname,'onlinejyotish.com','www.onlinejyotish.com']);
5 function decorate(root){root.querySelectorAll('a[href]').forEach(a=>{
6   if(a.hasAttribute('download')||a.getAttribute('href').startsWith('#'))return;
7   let url;try{url=new URL(a.getAttribute('href'),document.baseURI);}catch{return;}
8   if(!/^https?:$/.test(url.protocol)||!hosts.has(url.hostname))return;
9   let path=url.pathname;if(cfg.reviewRoot&&path.startsWith(cfg.reviewRoot+'/site/'))path=path.slice((cfg.reviewRoot+'/site').length);
10   const language=a.getAttribute('hreflang')||a.getAttribute('lang')||a.closest('[data-oj-language]')?.getAttribute('data-oj-language');
11   const requested=url.searchParams.get('language')||url.searchParams.get('lang');
12   // Only shared tools explicitly opt in to current-language routing. Native
13   // menus, article links, breadcrumbs and language choices keep their paths.
14   const localize=a.closest('[data-oj-localize],.oj-mega-parent')&&!language&&(!requested||requested===cfg.language);
15   const target=localize?(cfg.links[path]||cfg.links[path.replace(/\/index\.php$/,'/')]):null;
16   if(!target){
17     let changed=false;
18     if(language&&/^[a-z]{2,3}(?:-[a-z0-9]+)*$/i.test(language)){url.searchParams.set('language',language);url.searchParams.set('lang',language);changed=true;}
19     if(cfg.reviewRoot&&!url.pathname.startsWith(cfg.reviewRoot+'/site/')){url.host=location.host;url.protocol=location.protocol;url.pathname=cfg.reviewRoot+'/site'+path;changed=true;}
20     if(changed)a.href=url.href;return;
21   }
22   const next=new URL((cfg.reviewRoot?cfg.reviewRoot+'/site':'')+target,location.origin);
23   for(const [key,value]of url.searchParams)if(!['language','lang'].includes(key)&&!next.searchParams.has(key))next.searchParams.set(key,value);
24   const context=new URL(location.href).searchParams.get('ojctx');if(['telugu','pwa'].includes(context))next.searchParams.set('ojctx',context);
25   if(!next.searchParams.has('language'))next.searchParams.set('language',cfg.language);
26   if(!next.searchParams.has('lang'))next.searchParams.set('lang',cfg.language);
27   next.hash=url.hash;a.href=next.href;
28 });}
29 decorate(document);
30 document.addEventListener('click',e=>{const a=e.target.closest('a[href]');if(a&&a.parentElement)decorate(a.parentElement);},true);
31 document.querySelectorAll('[data-service-search]').forEach(input=>{const list=document.getElementById(input.getAttribute('aria-controls'));if(!list)return;input.addEventListener('input',()=>{const query=input.value.trim().toLocaleLowerCase(cfg.language);list.querySelectorAll('li').forEach(item=>{item.hidden=!item.textContent.toLocaleLowerCase(cfg.language).includes(query);});});});
32})();

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.