-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
317 lines (284 loc) · 14.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Coveo Atomic</title>
<script type="module" src="https://static.cloud.coveo.com/atomic/v3/atomic.esm.js"></script>
<link rel="stylesheet" href="https://static.cloud.coveo.com/atomic/v3/themes/coveo.css">
<script>
(async () => {
await customElements.whenDefined("atomic-search-interface");
const searchInterface = document.querySelector("atomic-search-interface");
// Initialization
await searchInterface.initialize({
accessToken: "xx564559b1-0045-48e1-953c-3addd1ee4457",
organizationId: "searchuisamples"
});
// Trigger a first search
searchInterface.executeFirstSearch();
// Add/modify a translation
// searchInterface.i18n.addResourceBundle('en', 'translation', {
// search: 'Make me feel lucky!'
// });
// Change the language of the interface dynamically
// searchInterface.language = 'fr';
// Interact with the engine
// searchInterface.engine.dispatch(...);
// Get all translated strings for a language/namespace
// const allStrings = searchInterface.i18n.getResourceBundle('en', 'translation');
// Add field value captions, using caption-[field]
// searchInterface.i18n.addResourceBundle('en', 'caption-author', {
// 'BBC News': 'The BBC',
// amoreau: 'Alexandre Moreau',
// });
searchInterface.i18n.addResourceBundle("en", "caption-filetype", {
".html": "html",
});
})();
</script>
<style>
/* Example on how to customize CSS variables */
/* :root {
--atomic-primary: red;
--atomic-font-family: "Comic Sans MS", "Comic Sans", cursive;
} */
/* Example on how to customize result templates CSS parts */
/* atomic-result::part(result-link):hover {
color: orange;
} */
/* Example on how to customize the color facet */
atomic-color-facet::part(value-dynamicscrmitem) {
background-image: url("/build/assets/mail.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
atomic-color-facet::part(value-lithiumuser) {
background-image: url("/build/assets/folder.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
atomic-color-facet::part(value-YouTubeVideo) {
background-image: url("build/assets/video.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
atomic-color-facet::part(value-lithiummessage) {
background-image: url("build/assets/kb.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
atomic-color-facet::part(value-lithiumthread) {
background-image: url("build/assets/salesforce-standard-post.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
atomic-color-facet::part(value-html) {
background-image: url("build/assets/webpage.svg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
</style>
<style>
body {
margin: 0;
}
.header-bg {
background-color: var(--atomic-neutral-light);
grid-area: 1 / -1 / 1 / 1;
}
atomic-search-layout {
row-gap: var(--atomic-layout-spacing-y);
}
</style>
</head>
<body>
<atomic-aria-live></atomic-aria-live>
<atomic-search-interface fields-to-include='["snrating","sncost"]'>
<atomic-search-layout>
<div class="header-bg"></div>
<atomic-layout-section section="search">
<atomic-search-box></atomic-search-box>
</atomic-layout-section>
<atomic-layout-section section="facets">
<atomic-facet-manager>
<atomic-category-facet field="geographicalhierarchy" label="World Atlas" with-search>
</atomic-category-facet>
<atomic-facet field="author" label="Authors"></atomic-facet>
<atomic-facet field="language" label="Language"></atomic-facet>
<atomic-facet field="objecttype" label="Type" display-values-as="link"></atomic-facet>
<atomic-facet field="year" label="Year" display-values-as="box"></atomic-facet>
<atomic-numeric-facet field="ytviewcount" label="Youtube Views" with-input="integer"></atomic-numeric-facet>
<atomic-numeric-facet field="ytlikecount" label="Youtube Likes" display-values-as="link">
<atomic-numeric-range start="0" end="1000" label="Unpopular"></atomic-numeric-range>
<atomic-numeric-range start="1000" end="8000" label="Well liked"></atomic-numeric-range>
<atomic-numeric-range start="8000" end="100000" label="Popular"></atomic-numeric-range>
<atomic-numeric-range start="100000" end="999999999" label="Treasured"></atomic-numeric-range>
</atomic-numeric-facet>
<atomic-numeric-facet field="sncost" label="Cost">
<atomic-format-currency currency="CAD"></atomic-format-currency>
</atomic-numeric-facet>
<atomic-timeframe-facet label="Timeframe" with-date-picker>
<atomic-timeframe unit="hour"></atomic-timeframe>
<atomic-timeframe unit="day"></atomic-timeframe>
<atomic-timeframe unit="week"></atomic-timeframe>
<atomic-timeframe unit="month"></atomic-timeframe>
<atomic-timeframe unit="quarter"></atomic-timeframe>
<atomic-timeframe unit="year"></atomic-timeframe>
</atomic-timeframe-facet>
<atomic-rating-facet field="snrating" label="Rating" number-of-intervals="5">
</atomic-rating-facet>
<atomic-rating-range-facet facet-id="snrating_range" field="snrating" label="Rating Range" number-of-intervals="5">
</atomic-rating-range-facet>
<atomic-color-facet field="filetype" label="Files" number-of-values="6" sort-criteria="occurrences"></atomic-color-facet>
</atomic-facet-manager>
</atomic-layout-section>
<atomic-layout-section section="main">
<atomic-layout-section section="status">
<atomic-breadbox></atomic-breadbox>
<atomic-query-summary></atomic-query-summary>
<atomic-refine-toggle></atomic-refine-toggle>
<atomic-sort-dropdown>
<atomic-sort-expression label="relevance" expression="relevancy"></atomic-sort-expression>
<atomic-sort-expression label="most-recent" expression="date descending"></atomic-sort-expression>
</atomic-sort-dropdown>
<atomic-did-you-mean></atomic-did-you-mean>
</atomic-layout-section>
<atomic-layout-section section="results">
<atomic-result-list>
<atomic-result-template>
<template>
<style>
.field {
display: inline-flex;
white-space: nowrap;
align-items: center;
}
.field-label {
font-weight: bold;
margin-right: 0.25rem;
}
.thumbnail {
display: none;
width: 100%;
height: 100%;
}
.icon {
display: none;
}
.result-root.image-small .thumbnail,
.result-root.image-large .thumbnail {
display: inline-block;
}
.result-root.image-icon .icon {
display: inline-block;
}
atomic-result-section-badges {
display: flex;
}
atomic-result-section-badges > atomic-field-condition {
display: inline-block;
height: 100%;
}
.salesforce-badge::part(result-badge-element) {
background-color: #44a1da;
color: white;
}
</style>
<atomic-result-section-visual>
<atomic-result-icon class="icon"></atomic-result-icon>
<img src="https://picsum.photos/350" class="thumbnail">
</atomic-result-section-visual>
<atomic-result-section-badges>
<atomic-field-condition must-match-sourcetype="Salesforce">
<atomic-result-badge label="Salesforce" class="salesforce-badge"></atomic-result-badge>
</atomic-field-condition>
<atomic-field-condition class="field" if-defined="language">
<atomic-result-badge
icon="https://raw.githubusercontent.com/Rush/Font-Awesome-SVG-PNG/master/black/svg/language.svg"
>
<atomic-result-multi-value-text field="language"></atomic-result-multi-value-text>
</atomic-result-badge>
</atomic-field-condition>
</atomic-result-section-badges>
<atomic-result-section-title><atomic-result-link></atomic-result-link></atomic-result-section-title>
<atomic-result-section-title-metadata>
<atomic-field-condition class="field" if-defined="snrating">
<atomic-result-rating field="snrating"></atomic-result-rating>
</atomic-field-condition>
<atomic-field-condition class="field" if-not-defined="snrating">
<atomic-result-printable-uri max-number-of-parts="3"></atomic-result-printable-uri>
</atomic-field-condition>
</atomic-result-section-title-metadata>
<atomic-result-section-excerpt><atomic-result-text field="excerpt"></atomic-result-text></atomic-result-section-excerpt>
<atomic-result-section-bottom-metadata>
<atomic-result-fields-list>
<atomic-field-condition class="field" if-defined="author">
<span class="field-label"><atomic-text value="author"></atomic-text>:</span>
<atomic-result-text field="author"></atomic-result-text>
</atomic-field-condition>
<atomic-field-condition class="field" if-defined="source">
<span class="field-label"><atomic-text value="source"></atomic-text>:</span>
<atomic-result-text field="source"></atomic-result-text>
</atomic-field-condition>
<atomic-field-condition class="field" if-defined="language">
<span class="field-label"><atomic-text value="language"></atomic-text>:</span>
<atomic-result-multi-value-text field="language"></atomic-result-multi-value-text>
</atomic-field-condition>
<atomic-field-condition class="field" if-defined="filetype">
<span class="field-label"><atomic-text value="fileType"></atomic-text>:</span>
<atomic-result-text field="filetype"></atomic-result-text>
</atomic-field-condition>
<atomic-field-condition class="field" if-defined="sncost">
<span class="field-label">Cost:</span>
<atomic-result-number field="sncost">
<atomic-format-currency currency="CAD"></atomic-format-currency>
</atomic-result-number>
</atomic-field-condition>
<span class="field">
<span class="field-label">Date:</span>
<atomic-result-date></atomic-result-date>
</span>
</atomic-result-fields-list>
</atomic-result-section-bottom-metadata>
<atomic-table-element label="Description">
<atomic-result-link field="title"></atomic-result-link>
<atomic-result-text field="excerpt"></atomic-result-text>
</atomic-table-element>
<atomic-table-element label="author">
<atomic-result-text field="author"></atomic-result-text>
</atomic-table-element>
<atomic-table-element label="source">
<atomic-result-text field="source"></atomic-result-text>
</atomic-table-element>
<atomic-table-element label="language">
<atomic-result-multi-value-text field="language"></atomic-result-multi-value-text>
</atomic-table-element>
<atomic-table-element label="file-type">
<atomic-result-text field="filetype"></atomic-result-text>
</atomic-table-element>
</template>
</atomic-result-template>
</atomic-result-list>
<atomic-query-error></atomic-query-error>
<atomic-no-results></atomic-no-results>
</atomic-layout-section>
<atomic-layout-section section="pagination">
<atomic-load-more-results></atomic-load-more-results>
<!-- Alternative pagination
<atomic-pager></atomic-pager>
<atomic-results-per-page></atomic-results-per-page>
-->
</atomic-layout-section>
</atomic-layout-section>
</atomic-search-layout>
</atomic-search-interface>
</body>
</html>