1
+ import * as params from '@params' ;
1
2
document . addEventListener ( 'DOMContentLoaded' , function ( ) {
2
- Coveo . SearchEndpoint . configureCloudV2Endpoint ( "" , 'xx79df1e1f-11e4-4da5-8ea8-2ed7e24cca6a' ) ; // Prod API key
3
- // Coveo.SearchEndpoint.configureCloudV2Endpoint("", 'xxe1e9046f-585c-4518-a14a-6b986a5efffd'); // test API key
4
- const root = document . getElementById ( "search" ) ;
5
- const searchBoxRoot = document . getElementById ( "searchbox" ) ;
6
- Coveo . initSearchbox ( searchBoxRoot , "/search.html" ) ;
7
- var resetbtn = document . querySelector ( '#reset_btn' ) ;
8
- if ( resetbtn ) {
9
- resetbtn . onclick = function ( ) {
10
- document . querySelector ( '.coveo-facet-header-eraser' ) . click ( ) ;
11
- } ;
12
- }
13
- Coveo . $$ ( root ) . on ( "querySuccess" , function ( e , args ) {
14
- resetbtn . style . display = "block" ;
15
- } ) ;
16
- Coveo . $$ ( root ) . on ( 'afterComponentsInitialization' , function ( e , data ) {
17
- setTimeout ( function ( ) {
18
- document . querySelector ( '.CoveoOmnibox input' ) . value = Coveo . state ( root , 'q' ) ;
19
- } , 1000 ) ;
20
- } ) ;
21
- Coveo . $ ( '#search' ) . on ( "newResultsDisplayed" , function ( e , args ) {
22
- for ( var i = 0 ; i < e . target . lastChild . children . length ; i ++ ) {
23
- //Remove the title for tooltip box
24
- Coveo . $ ( '.CoveoResultLink' ) . removeAttr ( 'title' ) ;
3
+ Coveo . SearchEndpoint . configureCloudV2Endpoint ( "" , params . coveokey ) ;
4
+ const root = document . getElementById ( "search" ) ;
5
+ const searchBoxRoot = document . getElementById ( "searchbox" ) ;
6
+ Coveo . initSearchbox ( searchBoxRoot , "/search.html" ) ;
7
+ var resetbtn = document . querySelector ( '#reset_btn' ) ;
8
+ if ( resetbtn ) {
9
+ resetbtn . onclick = function ( ) {
10
+ document . querySelector ( '.coveo-facet-header-eraser' ) . click ( ) ;
11
+ } ;
25
12
}
26
- } ) ;
27
- Coveo . init ( root , {
28
- f5_product_module : {
29
- dependsOn : "@f5_product" ,
30
- dependsOnCondition : ( parentFacet ) => {
31
- const id = parentFacet . options . id ;
32
- const value = "NGINX Management Suite" ;
33
- const selected = parentFacet . queryStateModel . get ( `f:${ id } ` )
34
- return selected . includes ( value ) ;
13
+ Coveo . $$ ( root ) . on ( "querySuccess" , function ( e , args ) {
14
+ resetbtn . style . display = "block" ;
15
+ } ) ;
16
+ Coveo . $$ ( root ) . on ( 'afterComponentsInitialization' , function ( e , data ) {
17
+ setTimeout ( function ( ) {
18
+ document . querySelector ( '.CoveoOmnibox input' ) . value = Coveo . state ( root , 'q' ) ;
19
+ } , 1000 ) ;
20
+ } ) ;
21
+ Coveo . $ ( '#search' ) . on ( "newResultsDisplayed" , function ( e , args ) {
22
+ for ( var i = 0 ; i < e . target . lastChild . children . length ; i ++ ) {
23
+ //Remove the title for tooltip box
24
+ Coveo . $ ( '.CoveoResultLink' ) . removeAttr ( 'title' ) ;
35
25
}
36
- }
37
- } ) ;
38
- } )
39
-
26
+ } ) ;
27
+ Coveo . init ( root , {
28
+ f5_product_module : {
29
+ dependsOn : "@f5_product" ,
30
+ dependsOnCondition : ( parentFacet ) => {
31
+ const id = parentFacet . options . id ;
32
+ const value = "NGINX Management Suite" ;
33
+ const selected = parentFacet . queryStateModel . get ( `f:${ id } ` )
34
+ return selected . includes ( value ) ;
35
+ }
36
+ }
37
+ } ) ;
38
+ } )
39
+
40
+
0 commit comments