wai-website-theme 0.1.6 → 1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/_includes/backtotop.html +1 -0
  3. data/_includes/body-class.html +1 -1
  4. data/_includes/box.html +2 -0
  5. data/_includes/different.html +1 -0
  6. data/_includes/doc-note-msg.html +10 -0
  7. data/_includes/excol.html +13 -12
  8. data/_includes/external.html +1 -0
  9. data/_includes/feedback-box.html +62 -0
  10. data/_includes/footer.html +55 -27
  11. data/_includes/head.html +8 -9
  12. data/_includes/header.html +127 -30
  13. data/_includes/icon.html +6 -6
  14. data/_includes/img.html +1 -1
  15. data/_includes/menuitem.html +13 -0
  16. data/_includes/navlist.html +9 -21
  17. data/_includes/path.html +6 -0
  18. data/_includes/prevnext.html +18 -16
  19. data/_includes/resources.html +3 -3
  20. data/_includes/secondarynav.html +70 -0
  21. data/_includes/sidenav.html +42 -48
  22. data/_includes/sitemap.html +29 -0
  23. data/_includes/video-link.html +5 -0
  24. data/_includes/video-player.html +12 -10
  25. data/_layouts/default.html +30 -10
  26. data/_layouts/home.html +17 -4
  27. data/_layouts/news.html +26 -8
  28. data/_layouts/policy.html +23 -9
  29. data/_layouts/sidenav.html +28 -9
  30. data/_layouts/sidenavsidebar.html +29 -9
  31. data/assets/css/style.css +1 -4407
  32. data/assets/css/style.css.map +1 -1
  33. data/assets/fonts/notosans-bold-subset.woff +0 -0
  34. data/assets/fonts/notosans-bold-subset.woff2 +0 -0
  35. data/assets/fonts/notosans-bolditalic-subset.woff +0 -0
  36. data/assets/fonts/notosans-bolditalic-subset.woff2 +0 -0
  37. data/assets/fonts/notosans-italic-subset.woff +0 -0
  38. data/assets/fonts/notosans-italic-subset.woff2 +0 -0
  39. data/assets/fonts/notosans-regular-subset.woff +0 -0
  40. data/assets/fonts/notosans-regular-subset.woff2 +0 -0
  41. data/assets/images/icons.svg +36 -1
  42. data/assets/images/social-sharing-default.jpg +0 -0
  43. data/assets/images/video-mask-16-9.svg +1 -0
  44. data/assets/images/video-mask-4-3.svg +1 -0
  45. data/assets/images/video-still-accessibility-intro-16-9.jpg +0 -0
  46. data/assets/scripts/details4everybody.js +153 -0
  47. data/assets/scripts/main.js +279 -64
  48. data/assets/search/tipuesearch.js +608 -0
  49. data/assets/search/tipuesearch_content.js +85 -0
  50. data/assets/search/tipuesearch_set.js +74 -0
  51. metadata +29 -6
  52. data/assets/images/.DS_Store +0 -0
  53. data/assets/images/teaser-image@1x.jpg +0 -0
  54. data/assets/images/teaser-image@2x.jpg +0 -0
@@ -0,0 +1,608 @@
1
+
2
+ /*
3
+ Tipue Search 6.1
4
+ Copyright (c) 2017 Tipue
5
+ Tipue Search is released under the MIT License
6
+ http://www.tipue.com/search
7
+ */
8
+
9
+
10
+ (function($) {
11
+
12
+ $.fn.tipuesearch = function(options) {
13
+
14
+ var set = $.extend( {
15
+
16
+ 'contentLocation' : 'tipuesearch/tipuesearch_content.json',
17
+ 'contextBuffer' : 60,
18
+ 'contextLength' : 60,
19
+ 'contextStart' : 90,
20
+ 'debug' : false,
21
+ 'descriptiveWords' : 25,
22
+ 'highlightTerms' : true,
23
+ 'liveContent' : '*',
24
+ 'liveDescription' : '*',
25
+ 'minimumLength' : 3,
26
+ 'mode' : 'static',
27
+ 'newWindow' : false,
28
+ 'show' : 9,
29
+ 'showContext' : true,
30
+ 'showRelated' : true,
31
+ 'showTime' : true,
32
+ 'showTitleCount' : true,
33
+ 'showURL' : false,
34
+ 'wholeWords' : true
35
+
36
+ }, options);
37
+
38
+ return this.each(function() {
39
+
40
+ var tipuesearch_in = {
41
+ pages: []
42
+ };
43
+ $.ajaxSetup({
44
+ async: false
45
+ });
46
+ var tipuesearch_t_c = 0;
47
+
48
+ $('#tipue_search_content').hide().html('<div class="tipue_search_spinner"><div class="tipue_search_rect1"></div><div class="tipue_search_rect2"></div><div class="rect3"></div></div>').show();
49
+
50
+ if (set.mode == 'live')
51
+ {
52
+ for (var i = 0; i < tipuesearch_pages.length; i++)
53
+ {
54
+ $.get(tipuesearch_pages[i]).done(function(html)
55
+ {
56
+ var cont = $(set.liveContent, html).text();
57
+ cont = cont.replace(/\s+/g, ' ');
58
+ var desc = $(set.liveDescription, html).text();
59
+ desc = desc.replace(/\s+/g, ' ');
60
+
61
+ var t_1 = html.toLowerCase().indexOf('<title>');
62
+ var t_2 = html.toLowerCase().indexOf('</title>', t_1 + 7);
63
+ if (t_1 != -1 && t_2 != -1)
64
+ {
65
+ var tit = html.slice(t_1 + 7, t_2);
66
+ }
67
+ else
68
+ {
69
+ var tit = tipuesearch_string_1;
70
+ }
71
+
72
+ tipuesearch_in.pages.push(
73
+ {
74
+ "title": tit,
75
+ "text": desc,
76
+ "tags": cont,
77
+ "url": tipuesearch_pages[i]
78
+ });
79
+ });
80
+ }
81
+ }
82
+
83
+ if (set.mode == 'json')
84
+ {
85
+ $.getJSON(set.contentLocation).done(function(json)
86
+ {
87
+ tipuesearch_in = $.extend({}, json);
88
+ });
89
+ }
90
+
91
+ if (set.mode == 'static')
92
+ {
93
+ tipuesearch_in = $.extend({}, tipuesearch);
94
+ }
95
+
96
+ var tipue_search_w = '';
97
+ if (set.newWindow)
98
+ {
99
+ tipue_search_w = ' target="_blank"';
100
+ }
101
+
102
+ function getURLP(name)
103
+ {
104
+ var _locSearch = location.search;
105
+ var _splitted = (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(_locSearch)||[,""]);
106
+ var searchString = _splitted[1].replace(/\+/g, '%20');
107
+ try
108
+ {
109
+ searchString = decodeURIComponent(searchString);
110
+ }
111
+ catch(e)
112
+ {
113
+ searchString = unescape(searchString);
114
+ }
115
+ return searchString || null;
116
+ }
117
+
118
+ if (getURLP('q'))
119
+ {
120
+ $('#tipue_search_input').val(getURLP('q'));
121
+ getTipueSearch(0, true);
122
+ }
123
+
124
+ $(this).keyup(function(event)
125
+ {
126
+ if(event.keyCode == '13')
127
+ {
128
+ getTipueSearch(0, true);
129
+ }
130
+ });
131
+
132
+
133
+ function getTipueSearch(start, replace)
134
+ {
135
+ var out = '';
136
+ var show_replace = false;
137
+ var show_stop = false;
138
+ var standard = true;
139
+ var c = 0;
140
+ found = [];
141
+
142
+ var d_o = $('#tipue_search_input').val();
143
+ var d = d_o.toLowerCase();
144
+ d = $.trim(d);
145
+
146
+ if ((d.match("^\"") && d.match("\"$")) || (d.match("^'") && d.match("'$")))
147
+ {
148
+ standard = false;
149
+ }
150
+
151
+ var d_w = d.split(' ');
152
+
153
+ if (standard)
154
+ {
155
+ d = '';
156
+ for (var i = 0; i < d_w.length; i++)
157
+ {
158
+ var a_w = true;
159
+ for (var f = 0; f < tipuesearch_stop_words.length; f++)
160
+ {
161
+ if (d_w[i] == tipuesearch_stop_words[f])
162
+ {
163
+ a_w = false;
164
+ show_stop = true;
165
+ }
166
+ }
167
+ if (a_w)
168
+ {
169
+ d = d + ' ' + d_w[i];
170
+ }
171
+ }
172
+ d = $.trim(d);
173
+ d_w = d.split(' ');
174
+ }
175
+ else
176
+ {
177
+ d = d.substring(1, d.length - 1);
178
+ }
179
+
180
+ if (d.length >= set.minimumLength)
181
+ {
182
+ if (standard)
183
+ {
184
+ if (replace)
185
+ {
186
+ var d_r = d;
187
+ for (var i = 0; i < d_w.length; i++)
188
+ {
189
+ for (var f = 0; f < tipuesearch_replace.words.length; f++)
190
+ {
191
+ if (d_w[i] == tipuesearch_replace.words[f].word)
192
+ {
193
+ d = d.replace(d_w[i], tipuesearch_replace.words[f].replace_with);
194
+ show_replace = true;
195
+ }
196
+ }
197
+ }
198
+ d_w = d.split(' ');
199
+ }
200
+
201
+ var d_t = d;
202
+ for (var i = 0; i < d_w.length; i++)
203
+ {
204
+ for (var f = 0; f < tipuesearch_stem.words.length; f++)
205
+ {
206
+ if (d_w[i] == tipuesearch_stem.words[f].word)
207
+ {
208
+ d_t = d_t + ' ' + tipuesearch_stem.words[f].stem;
209
+ }
210
+ }
211
+ }
212
+ d_w = d_t.split(' ');
213
+
214
+ for (var i = 0; i < tipuesearch_in.pages.length; i++)
215
+ {
216
+ var score = 0;
217
+ var s_t = tipuesearch_in.pages[i].text;
218
+ for (var f = 0; f < d_w.length; f++)
219
+ {
220
+ if (set.wholeWords)
221
+ {
222
+ var pat = new RegExp('\\b' + d_w[f] + '\\b', 'gi');
223
+ }
224
+ else
225
+ {
226
+ var pat = new RegExp(d_w[f], 'gi');
227
+ }
228
+ if (tipuesearch_in.pages[i].title.search(pat) != -1)
229
+ {
230
+ var m_c = tipuesearch_in.pages[i].title.match(pat).length;
231
+ score += (20 * m_c);
232
+ }
233
+ if (tipuesearch_in.pages[i].text.search(pat) != -1)
234
+ {
235
+ var m_c = tipuesearch_in.pages[i].text.match(pat).length;
236
+ score += (20 * m_c);
237
+ }
238
+
239
+ if (tipuesearch_in.pages[i].tags.search(pat) != -1)
240
+ {
241
+ var m_c = tipuesearch_in.pages[i].tags.match(pat).length;
242
+ score += (10 * m_c);
243
+ }
244
+
245
+ if (tipuesearch_in.pages[i].url.search(pat) != -1)
246
+ {
247
+ score += 20;
248
+ }
249
+
250
+ if (score != 0)
251
+ {
252
+ for (var e = 0; e < tipuesearch_weight.weight.length; e++)
253
+ {
254
+ if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url)
255
+ {
256
+ score += tipuesearch_weight.weight[e].score;
257
+ }
258
+ }
259
+ }
260
+
261
+ if (d_w[f].match('^-'))
262
+ {
263
+ pat = new RegExp(d_w[f].substring(1), 'i');
264
+ if (tipuesearch_in.pages[i].title.search(pat) != -1 || tipuesearch_in.pages[i].text.search(pat) != -1 || tipuesearch_in.pages[i].tags.search(pat) != -1)
265
+ {
266
+ score = 0;
267
+ }
268
+ }
269
+ }
270
+
271
+ if (score != 0)
272
+ {
273
+ found.push(
274
+ {
275
+ "score": score,
276
+ "title": tipuesearch_in.pages[i].title,
277
+ "desc": s_t,
278
+ "url": tipuesearch_in.pages[i].url
279
+ });
280
+ c++;
281
+ }
282
+ }
283
+ }
284
+ else
285
+ {
286
+ for (var i = 0; i < tipuesearch_in.pages.length; i++)
287
+ {
288
+ var score = 0;
289
+ var s_t = tipuesearch_in.pages[i].text;
290
+ var pat = new RegExp(d, 'gi');
291
+ if (tipuesearch_in.pages[i].title.search(pat) != -1)
292
+ {
293
+ var m_c = tipuesearch_in.pages[i].title.match(pat).length;
294
+ score += (20 * m_c);
295
+ }
296
+ if (tipuesearch_in.pages[i].text.search(pat) != -1)
297
+ {
298
+ var m_c = tipuesearch_in.pages[i].text.match(pat).length;
299
+ score += (20 * m_c);
300
+ }
301
+
302
+ if (tipuesearch_in.pages[i].tags.search(pat) != -1)
303
+ {
304
+ var m_c = tipuesearch_in.pages[i].tags.match(pat).length;
305
+ score += (10 * m_c);
306
+ }
307
+
308
+ if (tipuesearch_in.pages[i].url.search(pat) != -1)
309
+ {
310
+ score += 20;
311
+ }
312
+
313
+ if (score != 0)
314
+ {
315
+ for (var e = 0; e < tipuesearch_weight.weight.length; e++)
316
+ {
317
+ if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url)
318
+ {
319
+ score += tipuesearch_weight.weight[e].score;
320
+ }
321
+ }
322
+ }
323
+
324
+ if (score != 0)
325
+ {
326
+ found.push(
327
+ {
328
+ "score": score,
329
+ "title": tipuesearch_in.pages[i].title,
330
+ "desc": s_t,
331
+ "url": tipuesearch_in.pages[i].url
332
+ });
333
+ c++;
334
+ }
335
+ }
336
+ }
337
+
338
+ if (c != 0)
339
+ {
340
+ if (set.showTitleCount && tipuesearch_t_c == 0)
341
+ {
342
+ var title = document.title;
343
+ document.title = '(' + c + ') ' + title;
344
+ tipuesearch_t_c++;
345
+ }
346
+
347
+ if (show_replace)
348
+ {
349
+ out += '<div id="tipue_search_warning">' + tipuesearch_string_2 + ' ' + d + '. ' + tipuesearch_string_3 + ' <a id="tipue_search_replaced">' + d_r + '</a></div>';
350
+ }
351
+ if (c == 1)
352
+ {
353
+ out += '<div id="tipue_search_results_count">' + tipuesearch_string_4;
354
+ }
355
+ else
356
+ {
357
+ c_c = c.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
358
+ out += '<div id="tipue_search_results_count">' + c_c + ' ' + tipuesearch_string_5;
359
+ }
360
+ if (set.showTime)
361
+ {
362
+ var endTimer = new Date().getTime();
363
+ var time = (endTimer - startTimer) / 1000;
364
+ out += ' (' + time.toFixed(2) + ' ' + tipuesearch_string_14 + ')';
365
+ set.showTime = false;
366
+ }
367
+ out += '</div>';
368
+ out += '<ul class="search-results">';
369
+
370
+ found.sort(function(a, b) { return b.score - a.score } );
371
+
372
+ var l_o = 0;
373
+ for (var i = 0; i < found.length; i++)
374
+ {
375
+ if (l_o >= start && l_o < set.show + start)
376
+ {
377
+ out += '<li><h2 class="format-level-5"><a href="' + found[i].url + '"' + tipue_search_w + '>' + found[i].title + '</a></h2>';
378
+
379
+ if (set.debug)
380
+ {
381
+ out += '<p class="tipue_search_content_debug">Score: ' + found[i].score + '</p>';
382
+ }
383
+
384
+ if (set.showURL)
385
+ {
386
+ var s_u = found[i].url.toLowerCase();
387
+ if (s_u.indexOf('http://') == 0)
388
+ {
389
+ s_u = s_u.slice(7);
390
+ }
391
+ out += '<p class="tipue_search_content_url"><a href="' + found[i].url + '"' + tipue_search_w + '>' + s_u + '</a></p>';
392
+ }
393
+
394
+ if (found[i].desc)
395
+ {
396
+ var t = found[i].desc;
397
+
398
+ if (set.showContext)
399
+ {
400
+ d_w = d.split(' ');
401
+ var s_1 = found[i].desc.toLowerCase().indexOf(d_w[0]);
402
+ if (s_1 > set.contextStart)
403
+ {
404
+ var t_1 = t.substr(s_1 - set.contextBuffer);
405
+ var s_2 = t_1.indexOf(' ');
406
+ t_1 = t.substr(s_1 - set.contextBuffer + s_2);
407
+ t_1 = $.trim(t_1);
408
+
409
+ if (t_1.length > set.contextLength)
410
+ {
411
+ t = '... ' + t_1;
412
+ }
413
+ }
414
+ }
415
+
416
+ if (standard)
417
+ {
418
+ d_w = d.split(' ');
419
+ for (var f = 0; f < d_w.length; f++)
420
+ {
421
+ if (set.highlightTerms)
422
+ {
423
+ var patr = new RegExp('(' + d_w[f] + ')', 'gi');
424
+ t = t.replace(patr, "<h0011>$1<h0012>");
425
+ }
426
+ }
427
+ }
428
+ else if (set.highlightTerms)
429
+ {
430
+ var patr = new RegExp('(' + d + ')', 'gi');
431
+ t = t.replace(patr, "<mark>$1</mark>");
432
+ }
433
+
434
+ var t_d = '';
435
+ var t_w = t.split(' ');
436
+ if (t_w.length < set.descriptiveWords)
437
+ {
438
+ t_d = t;
439
+ }
440
+ else
441
+ {
442
+ for (var f = 0; f < set.descriptiveWords; f++)
443
+ {
444
+ t_d += t_w[f] + ' ';
445
+ }
446
+ }
447
+ t_d = $.trim(t_d);
448
+ if (t_d.charAt(t_d.length - 1) != '.')
449
+ {
450
+ t_d += ' ...';
451
+ }
452
+
453
+ t_d = t_d.replace(/h0011/g, 'mark');
454
+ t_d = t_d.replace(/h0012/g, '/mark');
455
+
456
+ out += '<p class="tipue_search_content_text">' + t_d + '</p></li>';
457
+ }
458
+ }
459
+ l_o++;
460
+ }
461
+
462
+ if (set.showRelated && standard)
463
+ {
464
+ f = 0;
465
+ for (var i = 0; i < tipuesearch_related.searches.length; i++)
466
+ {
467
+ if (d == tipuesearch_related.searches[i].search)
468
+ {
469
+ if (show_replace)
470
+ {
471
+ d_o = d;
472
+ }
473
+ if (!f)
474
+ {
475
+ out += '<div class="tipue_search_related_title">' + tipuesearch_string_15 + ' <span class="tipue_search_related_bold">' + d_o + '</span></div><div class="tipue_search_related_cols">';
476
+ }
477
+
478
+ out += '<div class="tipue_search_related_text"><a class="tipue_search_related" id="' + tipuesearch_related.searches[i].related + '">';
479
+ if (tipuesearch_related.searches[i].before)
480
+ {
481
+ out += '<span class="tipue_search_related_before">' + tipuesearch_related.searches[i].before + '</span> ';
482
+ }
483
+ out += tipuesearch_related.searches[i].related;
484
+ if (tipuesearch_related.searches[i].after)
485
+ {
486
+ out += ' <span class="tipue_search_related_after">' + tipuesearch_related.searches[i].after + '</span>';
487
+ }
488
+ out += '</a></div>';
489
+ f++;
490
+ }
491
+ }
492
+ if (f)
493
+ {
494
+ out += '</div>';
495
+ }
496
+ }
497
+
498
+ out += '</ul>';
499
+
500
+ if (c > set.show)
501
+ {
502
+ var pages = Math.ceil(c / set.show);
503
+ var page = (start / set.show);
504
+ out += '<footer><nav class="pagination" aria-label="pagination"><ul>';
505
+
506
+ if (start > 0)
507
+ {
508
+ out += '<li><button class="tipue_search_foot_box" id="' + (start - set.show) + '_' + replace + '">' + tipuesearch_string_6 + '</button></li>';
509
+ }
510
+
511
+ if (page <= 2)
512
+ {
513
+ var p_b = pages;
514
+ if (pages > 3)
515
+ {
516
+ p_b = 3;
517
+ }
518
+ for (var f = 0; f < p_b; f++)
519
+ {
520
+ if (f == page)
521
+ {
522
+ out += '<li class="current">' + (f + 1) + '</li>';
523
+ }
524
+ else
525
+ {
526
+ out += '<li><button class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</button></li>';
527
+ }
528
+ }
529
+ }
530
+ else
531
+ {
532
+ var p_b = page + 2;
533
+ if (p_b > pages)
534
+ {
535
+ p_b = pages;
536
+ }
537
+ for (var f = page - 1; f < p_b; f++)
538
+ {
539
+ if (f == page)
540
+ {
541
+ out += '<li class="current">' + (f + 1) + '</li>';
542
+ }
543
+ else
544
+ {
545
+ out += '<li><button class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</button></li>';
546
+ }
547
+ }
548
+ }
549
+
550
+ if (page + 1 != pages)
551
+ {
552
+ out += '<li><button class="tipue_search_foot_box" id="' + (start + set.show) + '_' + replace + '">' + tipuesearch_string_7 + '</button></li>';
553
+ }
554
+
555
+ out += '</ul></nav></footer>';
556
+ }
557
+ }
558
+ else
559
+ {
560
+ out += '<div id="tipue_search_warning">' + tipuesearch_string_8 + '</div>';
561
+ }
562
+ }
563
+ else
564
+ {
565
+ if (show_stop)
566
+ {
567
+ out += '<div id="tipue_search_warning">' + tipuesearch_string_8 + '. ' + tipuesearch_string_9 + '</div>';
568
+ }
569
+ else
570
+ {
571
+ out += '<div id="tipue_search_warning">' + tipuesearch_string_10 + '</div>';
572
+ if (set.minimumLength == 1)
573
+ {
574
+ out += '<div id="tipue_search_warning">' + tipuesearch_string_11 + '</div>';
575
+ }
576
+ else
577
+ {
578
+ out += '<div id="tipue_search_warning">' + tipuesearch_string_12 + ' ' + set.minimumLength + ' ' + tipuesearch_string_13 + '</div>';
579
+ }
580
+ }
581
+ }
582
+
583
+ $('#tipue_search_content').hide().html(out).slideDown(200);
584
+
585
+ $('#tipue_search_replaced').click(function()
586
+ {
587
+ getTipueSearch(0, false);
588
+ });
589
+
590
+ $('.tipue_search_related').click(function()
591
+ {
592
+ $('#tipue_search_input').val($(this).attr('id'));
593
+ getTipueSearch(0, true);
594
+ });
595
+
596
+ $('.tipue_search_foot_box').click(function()
597
+ {
598
+ var id_v = $(this).attr('id');
599
+ var id_a = id_v.split('_');
600
+
601
+ getTipueSearch(parseInt(id_a[0]), id_a[1]);
602
+ });
603
+ }
604
+
605
+ });
606
+ };
607
+
608
+ })(jQuery);