mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
14 lines
No EOL
496 B
CoffeeScript
14 lines
No EOL
496 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.factory "algoliaSearch", ->
|
|
if window.sharelatex?.algolia? and window.sharelatex.algolia?.indexes?.wiki?
|
|
client = new AlgoliaSearch(window.sharelatex.algolia?.app_id, window.sharelatex.algolia?.api_key)
|
|
wikiIdx = client.initIndex(window.sharelatex.algolia?.indexes?.wiki)
|
|
kbIdx = client.initIndex(window.sharelatex.algolia?.indexes?.kb)
|
|
|
|
service =
|
|
searchWiki: wikiIdx.search.bind(wikiIdx)
|
|
searchKB: kbIdx.search.bind(kbIdx)
|
|
|
|
return service |