forked from emilyntest/braze-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathonboarding_faq.html
279 lines (243 loc) · 8.1 KB
/
onboarding_faq.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
---
layout: default
hide_toc: true
hide_bottom_nav: false
hide_breadcrumb: false
---
{%- comment -%} Assigned variables first by page, then by layout {%- endcomment -%}
{%- assign hide_nav = page.hide_nav -%}
{%- assign hide_bottom_nav = page.hide_bottom_nav -%}
{%- assign hide_breadcrumb = page.hide_breadcrumb -%}
{%- assign hide_feedback = page.hide_feedback -%}
{%- assign hide_toc = page.hide_toc -%}
{%- unless hide_nav -%}
{%- assign hide_nav = layout.hide_nav -%}
{%- endunless -%}
{%- unless hide_toc -%}
{%- assign hide_toc = layout.hide_toc -%}
{%- endunless -%}
{%- unless hide_bottom_nav -%}
{%- assign hide_bottom_nav = layout.hide_bottom_nav -%}
{%- endunless -%}
{%- unless hide_breadcrumb -%}
{%- assign hide_breadcrumb = layout.hide_breadcrumb -%}
{%- endunless -%}
{%- unless hide_feedback -%}
{%- assign hide_feedback = layout.hide_feedback -%}
{%- endunless -%}
{% unless hide_nav %}
<!-- button id="sidebar_toggle" class="btn btn-info d-print-none" data-toggle="collapse" aria-expanded="true" href="#nav_bar" >
<i class="fas"></i>
</button -->
<script type="text/javascript">
$(document).ready(function() {
function string_to_slug(str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
str = str.replace(/[\(\)]/g, '') // remove parenthsis
.replace(/[^a-z0-9 -]/g, '-') // remove invalid chars
.replace(/\s+/g, '-') // collapse whitespace and replace by -
.replace(/-+/g, '-'); // collapse dashes
return str;
}
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
var alltags = {}
function matchterms(searchterm, items) {
var found = false;
if (Array.isArray(items)) {
for (var i = 0; i < items.length; i++ ) {
if (Array.isArray(searchterm)) {
for (var j = 0; j < searchterm.length; j++ ) {
if (items[i].trim().toLowerCase() == searchterm[j].trim().toLowerCase()) {
found = true
}
}
}
else {
if (items[i].trim().toLowerCase() == searchterm.trim().toLowerCase()) {
found = true
}
}
}
}
else {
if (Array.isArray(searchterm)) {
for (var j = 0; j < searchterm.length; j++ ) {
if (items.trim().toLowerCase() == searchterm[j].trim().toLowerCase()) {
found = true
}
}
}
else {
if (items.trim().toLowerCase().indexOf(searchterm.trim().toLowerCase()) > -1) {
found = true
}
}
}
return found;
}
function find_tags(){
var api_tags = $('.api_tags');
var alltags = {};
api_tags.each(function(k,v){
var curtag = $(this);
var tag_list = curtag.attr('data-tags').split(',');
for (var i = 0; i < tag_list.length; i++) {
var trimtag = tag_list[i].trim();
if (trimtag.toLowerCase() != 'all') {
alltags[trimtag.toLowerCase()] = trimtag;
}
}
});
return alltags;
}
function set_tags(alltags) {
var tag_div = $('#api_filter_list');
var sorted_tags = []
$.each(alltags, function(k,v){
sorted_tags.push(k)
});
sorted_tags.sort();
$.each(sorted_tags,function(k,v){
var filter_slug = string_to_slug(v);
var filter_div = $('<div>').addClass('api_filter_div');
var filter_label = $('<label>').attr('for','api_' + filter_slug);
var filter_cb = $('<input>').attr('id','api_' + filter_slug).attr('type','checkbox').attr('name','filter_' + filter_slug).val(v)
filter_label.append(filter_cb).append(' ' + alltags[v]);
filter_div.append(filter_label);
tag_div.append(filter_div);
})
}
function search_apis(api_hash) {
var result_cnt = 0;
$('#results_msg').hide();
var api_div = $('#api_list .api_div');
var search_str = $('#api_search').val().toLowerCase();
var selected_vals = [];
$('.api_filter_div input[type="checkbox"]:checked').each(function(k,v){
selected_vals.push($(this).val());
})
var showall = true;
if (selected_vals.length || search_str) {
showall = false;
}
api_div.each(function(k,v){
var filtered = false;
var curdiv = $(this);
curdiv.show();
if (!showall) {
var curtag = curdiv.find('.api_tags').first();
var apitags = []
if (curtag) {
apitags = curtag.attr('data-tags-lower').split(',');
}
if (selected_vals.length) {
// api doesn't have an all tag filter explicitly
if (apitags.indexOf('all') == -1) {
// check if tag
if (!matchterms(selected_vals, apitags) && !filtered) {
filtered = true;
}
}
}
if (!filtered && search_str) {
var curcontent = curdiv.text().replace(/(\n|\r\n|\r)\d+/g,"").toLowerCase().replace(/\s\s+/g, ' ');
if (curcontent.indexOf(search_str) < 0) {
filtered = true
}
}
if (filtered) {
curdiv.hide();
}
else {
curdiv.show();
result_cnt++;
}
}
})
if (!result_cnt && !showall) {
$('#results_msg').html('<p>No results matching these filters</p>');
$('#results_msg').show();
}
};
function initialize() {
alltags = find_tags();
set_tags(alltags);
var query_str = getUrlParameter('tags').toLowerCase().split(',');
$('.api_filter_div input[type="checkbox"]').each(function(e){
$(this).on('click', function(e){
search_apis();
});
if (matchterms($(this).val(), query_str)) {
$(this).prop('checked',true);
}
});
if (query_str.length) {
search_apis();
}
$('#api_search').on('keyup',function(e){
search_apis();
});
if (location.hash && $(location.hash.replace('%20','-').replace('+','-')).offset()) {
// Scroll to generated hash
$('html, body').animate({
scrollTop: $(location.hash).offset().top
});
}
};
initialize();
});
</script>
<div class="col-sm-12 col-md-3 col-lg-3 col-xl-2 d-print-none collapse d-md-block" id="nav_bar" >
<div id="nav_col" class=" ">
{% include left_nav_menu.html %}
</div>
</div>
{% endunless %}
<div class="col d-print-block " id="main_content" >
<div id="api-main">
<div id="content_start"></div>
<h1> Braze FAQ </h1>
<p class="api_text">Take a look through our collection of frequently asked questions, outlined by category. Use the search bar or the checkboxes below to find answers to your questions. </p>
<div id="api_filter">
<input id="api_search" type="search" placeholder="Search" />
<div id="api_filter_list"></div>
</div>
<div id="api_list" class="flex mx-auto api_div">
{{content}}
</div>
<div id="results_msg"></div>
</div>
{%- unless hide_bottom_nav -%}
<div id="bottom_nav" >
{%- unless hide_feedback -%}
{% include feedback.html %}
{%- endunless -%}
<!-- div class="gradient-line" ></div -->
<div id="bottom_page_nav">
<a id="page_prev_link"><div id="page_prev" ></div></a>
<a id="page_next_link"><div id="page_next" ></div></a>
</div>
</div>
{%- endunless -%}
{% include footer.html class="footer_api" %}
</div>
{%- unless hide_toc -%}
<!-- button id="toc_toggle" class="btn btn-info collapsed notoc d-print-none" data-toggle="collapse" aria-expanded="false" href="#toc_col" >
<i class="fas"></i>
</button -->
<div class="d-none d-lg-block col-lg-2 d-print-none" id="toc_col">
<div id="toc" ></div>
</div>
{%- endunless -%}