mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #2501 from overleaf/as-unvendor-algoliasearch
Unvendor Algolia search client GitOrigin-RevId: ad0ea56c66a516bd8a26a76d454cbc8d0594a03f
This commit is contained in:
@@ -6,7 +6,6 @@ define([
|
||||
'libs/angular-autocomplete/angular-autocomplete',
|
||||
'libs/ui-bootstrap',
|
||||
'libs/ng-context-menu-0.1.4',
|
||||
'libs/algolia-2.5.2',
|
||||
'libs/jquery.storage',
|
||||
'libs/angular-cookie',
|
||||
'libs/passfield',
|
||||
|
||||
@@ -95,6 +95,9 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
|
||||
|
||||
return algoliaSearch.searchWiki(
|
||||
query,
|
||||
{
|
||||
hitsPerPage: $scope.config_hits_per_page
|
||||
},
|
||||
function(err, response) {
|
||||
$scope.processingSearch = false
|
||||
if (response.hits.length === 0) {
|
||||
@@ -103,9 +106,6 @@ define(['base', 'directives/mathjax', 'services/algolia-search'], function(
|
||||
const hits = _.map(response.hits, buildHitViewModel)
|
||||
return updateHits(hits, response.nbHits)
|
||||
}
|
||||
},
|
||||
{
|
||||
hitsPerPage: $scope.config_hits_per_page
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
define(['base', 'libs/algolia-2.5.2'], function(App, algolia) {
|
||||
define(['base', 'algoliasearch'], function(App, AlgoliaSearch) {
|
||||
App.factory('Institutions', () =>
|
||||
new AlgoliaSearch(
|
||||
AlgoliaSearch(
|
||||
window.algolia.institutions.app_id,
|
||||
window.algolia.institutions.api_key
|
||||
).initIndex('institutions')
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
define(['base'], App =>
|
||||
define(['base', 'algoliasearch'], (App, AlgoliaSearch) =>
|
||||
App.factory('algoliaSearch', function() {
|
||||
let kbIdx, wikiIdx
|
||||
if (
|
||||
@@ -24,7 +24,7 @@ define(['base'], App =>
|
||||
x => x.wiki
|
||||
) != null
|
||||
) {
|
||||
const client = new AlgoliaSearch(
|
||||
const client = AlgoliaSearch(
|
||||
window.sharelatex.algolia != null
|
||||
? window.sharelatex.algolia.app_id
|
||||
: undefined,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user