PageSourceSearch

https://blaze.today/js/search.min.js

js blaze.today collected 2026-10-01 10:34:19 UTC 6,645 bytes, 112 lines download raw bytes

1(function(){let j=`#search-results {
2  position: absolute;
3  top: 40px;
4  left: -60px;
5  width: 452px;
6  height: 400px;
7  z-index: 10000;
8  background-color: #fdfeff;
9  box-shadow: 0 2px 5px 0 rgba(0,0,0,.2), 0 3px 6px 2px rgba(0,0,0,.1);
10  border: 1px solid #ddd;
11  overflow: auto;
12  border-radius: 4px;
13  box-sizing: border-box;
14  padding-top: 4px;
15  outline: none;
16}
17
18@media (max-width: 840px) {
19	#search-results {
20    position: fixed !important;
21    top: initial;
22    width: auto;
23    left: 0px;
24    right: 0px;
25    bottom: 0px;
26  }
27}
28
29#search-results a {
30  width: 100%;
31  box-sizing: border-box;
32  text-decoration: none !important;
33  display: inline-block;
34  outline: none;
35}
36
37#search-results .item {
38  padding: 12px;
39  box-sizing: border-box;
40}
41
42#search-results .item:hover {
43  background-color: #ffeeec;
44}
45
46#search-results .item .title { 
47  font-size: 15px;
48  font-weight: bold;
49  color: #222;
50  margin-bottom: 4px;
51  overflow: hidden;
52  display: flex;
53  align-items: center;
54}
55
56#search-results .item .title .title-label {
57  white-space: nowrap;
58  text-overflow: ellipsis;
59  overflow: hidden;
60}
61
62#search-results .item .content { 
63  word-break: break-word;
64  font-size: 13px;
65  color: #888;
66  display: -webkit-box;
67  -webkit-line-clamp: 2;
68  -webkit-box-orient: vertical;  
69  overflow: hidden;
70}
71
72#search-results .item .category { 
73  display: inline-block;
74  border-radius: 4px;
75  margin-left: 8px;
76  color: white;
77  background-color: #999;
78  text-transform: uppercase;
79  padding: 1px 5px;
80  font-size: 11px;
81  font-weight: lighter;
82  vertical-align: middle;
83  white-space: nowrap;
84}
85
86#search-results .item .icon {
87  margin-right: 12px;
88  border-radius: 100px;
89  vertical-align: middle;
90}
91
92.search-results__header {
93  border-bottom: 1px solid #ddd;
94  margin-top: 8px;
95  margin-bottom: 4px;
96  padding: 4px 0px;
97  font-size: 1em;
98  color: #33363d;
99  font-family: inherit;
100  margin-right: 12px;
101  margin-lefT: 12px;
102  font-weight: lighter;
103}
104
105
106#search-results .no-results {
107  font-size: 13px;
108  color: #888;
109  text-align: center;
110  margin-top: 18px;
111  margin-bottom: 18px;
112}`,k=document.head||document.getElementsByTagName('head')[0],g=document.createElement('style');k.appendChild(g),g.appendChild(document.createTextNode(j));let d,i=!0,b=document.getElementById('site-search'),c=document.getElementById('search-results');b?.addEventListener('focus',()=>{i?(h(),i=!1):b.value.trim()&&(c.style.display='inline-block')});let e=!1;b?.addEventListener('blur',()=>{e||(c.style.display='none'),e=!1}),c?.addEventListener('mousedown',()=>{e=!0}),c?.addEventListener('mouseup',()=>{b?.focus()}),b?.addEventListener('keydown',function(a){a.keyCode===27&&(c.style.display='none',b.value='')}),b&&(b.onkeyup=function(){let a=this.value;setTimeout(()=>{a===this.value&&l(a)},50)});let f;async function h(){return f||(f=new Promise(c=>{d=new Worker('/js/searchWorker.js'),d.addEventListener('message',function(f){let c=f.data.result;if(f.data.term!==b.value)return;const j=window.location.origin,k=j+'/blog/',l=window.location.href.startsWith(j+'/datablaze/');window.location.href.startsWith(k)||(c=c.filter(a=>!a.item.permalink.startsWith(k))),c.length?(document.getElementById('docs-result').style.display='block',document.getElementById('docs-no-result').style.display='none'):(document.getElementById('docs-result').style.display='none',document.getElementById('docs-no-result').style.display='block');const g=c.filter(a=>a.item.searchCategory==="DataBlaze");c=c.filter(a=>a.item.searchCategory!=="DataBlaze");const h=c.length&&g.length,i=h?4:6;let d='';for(let b of c.slice(0,i)){let e=b.item.categories&&b.item.categories[0];d=d+'<a href="'+a(b.item.permalink)+'" tabindex="0"><div class="item"><div class="title"><div class="title-label">'+a(b.item.title)+'</div>'+(e?'<div class="category">'+a(e)+'</div>':'')+'</div><div class="content">'+(b.item.ytvideo?'<div style="float: right; margin-left: 4px; position: relative;"><img style="height: 38px" src="https://i1.ytimg.com/vi/'+b.item.ytvideo+'/default.jpg" /><img style="width: 20px; position: absolute; top: 9px; left: 15px " src="/images/youtube.svg" /></div>':'')+(b.item.description?a(b.item.description)+' ':'')+a(b.item.contents.slice(0,200))+'</div></div></a>'}d?(document.getElementById('tb-results').style.display='block',document.getElementById('tb-docs').innerHTML=d):document.getElementById('tb-results').style.display='none';let e='';for(let b of g.slice(0,i)){let c=b.item.categories&&b.item.categories[0];e=e+'<a href="'+a(b.item.permalink)+'" tabindex="0"><div class="item"><div class="title"><div class="title-label">'+a(b.item.title)+'</div>'+(c?'<div class="category">'+a(c)+'</div>
112':'')+'</div><div class="content">'+(b.item.ytvideo?'<div style="float: right; margin-left: 4px; position: relative;"><img style="height: 38px" src="https://i1.ytimg.com/vi/'+b.item.ytvideo+'/default.jpg" /><img style="width: 20px; position: absolute; top: 9px; left: 15px " src="/images/youtube.svg" /></div>':'')+(b.item.description?a(b.item.description)+' ':'')+a(b.item.contents.slice(0,200))+'</div></div></a>'}e?(document.getElementById('db-results').style.display='block',document.getElementById('db-docs').innerHTML=e):document.getElementById('db-results').style.display='none',h&&l&&document.getElementById('docs-result').insertBefore(document.getElementById('db-results'),document.getElementById('tb-results'))}),d.addEventListener('error',function(a){console.error(a)}),c()})),f}function a(a){return a.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#039;')}async function l(e){if(e.trim()===''){c.style.display='none';return}c.style.display='inline-block',setTimeout(()=>{b.value===e&&fetch('https://community.blaze.today/search.json?q='+encodeURIComponent(e)+'%20min_post_count%3A2').then(c=>c.json().then(c=>{if(e!==b.value)return;let f=[];for(let a=0;a<Math.min(c.posts.length,3);a++)f.push({post:c.posts[a],topic:c.topics[a]});let d='';for(let b of f)d=d+'<a href="https://community.blaze.today/t/'+a(b.topic.slug)+'/'+ +b.topic.id+'" tabindex="0"><div class="item" style="display: flex; align-items: center;"><img class="icon" width=48 height=48 src="https://community.blaze.today'+a(b.post.avatar_template).replace('{size}',48)+'"/><div style="flex: 1; overflow: hidden;"><div class="title"><div class="title-label">'+a(b.topic.title)+'</div></div><div class="content">'+a(b.post.blurb.slice(0,200))+'</div></div></div></a>';document.getElementById('posts').innerHTML=d||'<div class="no-results">No search results'+(e.length<3?' (type some more)':'')+'</div>'}))},200),await h(),d.postMessage({type:'search',term:e})}})()

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.