mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
change format of algolia settings
This commit is contained in:
parent
8f6dac77d0
commit
55d20e8abd
2 changed files with 11 additions and 6 deletions
|
@ -85,10 +85,15 @@ html(itemscope, itemtype='http://schema.org/Product')
|
||||||
};
|
};
|
||||||
|
|
||||||
script.
|
script.
|
||||||
window.sharelatex = {
|
window.sharelatex = {}
|
||||||
algolia: !{JSON.stringify(settings.algolia)}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
- if (typeof(settings.algolia) != "undefined")
|
||||||
|
script.
|
||||||
|
window.sharelatex.algolia = {
|
||||||
|
app_id:'#{settings.algolia.app_id}',
|
||||||
|
api_key:'#{settings.algolia.read_only_api_key}',
|
||||||
|
indexes:!{JSON.stringify(settings.algolia.indexes)}
|
||||||
|
}
|
||||||
|
|
||||||
- if (typeof(settings.apis) != "undefined" && typeof(settings.apis.templates_api) != "undefined")
|
- if (typeof(settings.apis) != "undefined" && typeof(settings.apis.templates_api) != "undefined")
|
||||||
script.
|
script.
|
||||||
|
|
|
@ -17,9 +17,9 @@ define [
|
||||||
|
|
||||||
|
|
||||||
app.factory "algolia", ->
|
app.factory "algolia", ->
|
||||||
if window?.sharelatex?.algolia?.appId?
|
if window?.sharelatex?.algolia?.app_id?
|
||||||
client = new AlgoliaSearch(window.sharelatex.algolia?.templates?.appId, window.sharelatex.algolia?.templates?.secret)
|
client = new AlgoliaSearch(window.sharelatex.algolia?.app_id, window.sharelatex.algolia?.api_key)
|
||||||
index = client.initIndex(window.sharelatex.algolia?.templates?.indexName)
|
index = client.initIndex(window.sharelatex.algolia?.indexes?.templates)
|
||||||
return index
|
return index
|
||||||
|
|
||||||
app.controller "SearchController", ($scope, algolia, _) ->
|
app.controller "SearchController", ($scope, algolia, _) ->
|
||||||
|
|
Loading…
Reference in a new issue