"Fossies" - the Fresh Open Source Software Archive

Member "angular-1.7.9/docs/js/search-worker.min.js.map" (26 Nov 2019, 2416 Bytes) of package /linux/www/angular-1.7.9.zip:


{"version":3,"sources":["js/search-worker.js"],"names":["importScripts","index","lunr","this","ref","field","boost","searchData","searchDataRequest","XMLHttpRequest","onload","JSON","parse","responseText","forEach","page","add","self","postMessage","e","open","send","onmessage","oEvent","q","data","hits","search","results","hit","push","d"],"mappings":"AAAA,YAMAA,eAAA,uCAIA,IAAAC,OAAAC,KAAA,WACAC,KAAAC,IAAA,QACAD,KAAAE,MAAA,cAAAC,MAAA,KACAH,KAAAE,MAAA,WAAAC,MAAA,KACAH,KAAAE,MAAA,YAAAC,MAAA,OAIAC,cACAC,kBAAA,GAAAC,eACAD,mBAAAE,OAAA,WAGAH,WAAAI,KAAAC,MAAAT,KAAAU,cAEAN,WAAAO,QAAA,SAAAC,GACAd,MAAAe,IAAAD,KAEAE,KAAAC,aAAAC,EAAA,iBAEAX,kBAAAY,KAAA,MAAA,oBACAZ,kBAAAa,OAGAJ,KAAAK,UAAA,SAAAC,GACA,GAAAC,GAAAD,EAAAE,KAAAD,EACAE,EAAAzB,MAAA0B,OAAAH,GACAI,IAEAF,GAAAZ,QAAA,SAAAe,GACAD,EAAAE,KAAAD,EAAAzB,OAGAa,KAAAC,aAAAC,EAAA,cAAAK,EAAAA,EAAAO,EAAAH","file":"search-worker.min.js","sourcesContent":["'use strict';\n\n/* eslint-env worker */\n/* global importScripts, lunr */\n\n// Load up the lunr library\nimportScripts('../components/lunr-0.7.2/lunr.min.js');\n\n// Create the lunr index - the docs should be an array of object, each object containing\n// the path and search terms for a page\nvar index = lunr(/** @this */function() {\n  this.ref('path');\n  this.field('titleWords', {boost: 50});\n  this.field('members', {boost: 40});\n  this.field('keywords', {boost: 20});\n});\n\n// Retrieve the searchData which contains the information about each page to be indexed\nvar searchData = {};\nvar searchDataRequest = new XMLHttpRequest();\nsearchDataRequest.onload = function() {\n\n  // Store the pages data to be used in mapping query results back to pages\n  searchData = JSON.parse(this.responseText);\n  // Add search terms from each page to the search index\n  searchData.forEach(function(page) {\n    index.add(page);\n  });\n  self.postMessage({e: 'index-ready'});\n};\nsearchDataRequest.open('GET', 'search-data.json');\nsearchDataRequest.send();\n\n// The worker receives a message everytime the web app wants to query the index\nself.onmessage = function(oEvent) {\n  var q = oEvent.data.q;\n  var hits = index.search(q);\n  var results = [];\n  // Only return the array of paths to pages\n  hits.forEach(function(hit) {\n    results.push(hit.ref);\n  });\n  // The results of the query are sent back to the web app via a new message\n  self.postMessage({e: 'query-ready', q: q, d: results});\n};\n"]}