swedbank-pay-design-guide-jekyll-theme 2.6.7 → 3.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54dc6dfb64184de3b5c512b78bd4aebca90c0becc25933634161b951ae88eb11
4
- data.tar.gz: 1fb99ccff6b95f596ea4fe2da0a3e56e8c4bdd77c5acd81d4568cddc25da0710
3
+ metadata.gz: e28064d55bb8b2b97cc7a6cfd24178347a6fec42c3cb4c00b7925abab1f1f02f
4
+ data.tar.gz: 4fd452ed00c0b6fe2ccc252396b3a335ace084d1174b89a3afce76f3f6dc8a5d
5
5
  SHA512:
6
- metadata.gz: 5dff26b7f8a6cdcfad62640db1bcef0497c7e13e8b905d3331aafed5c72c76f3fa588f049e8f92c8fa3610318971f5337d4cd484d9d7720746e876b86a01e850
7
- data.tar.gz: b72fb7aac1854e758f45c5c276f157fa56229355af41748b5869351dcbaa466ab843e5d260f04853e7fe066993e10a39f439a79c92ad17c612f9b56ca932eaf8
6
+ metadata.gz: d3b046c74104f352fff4fa1dc1219c34a41fcd8cb1ce9b14d0843fc15803bad98546cbc27cf4156a18ca5fcc1d89461a5f9fa2c7fe19cd06295cadd304dbc872
7
+ data.tar.gz: ba283af076e0aecf2060ddcc559b5e47618600f81d40d1219f41e11ea63a8d0df955d84a920af3446ea8117fc43b6eb28808b2679934cfb88e30396c0b7d1616
@@ -3,7 +3,7 @@
3
3
  normal-padding
4
4
  {% elsif page.card_overview %}
5
5
  normal-padding max-width-card-overview
6
- {% elsif page.has_release_notes %}
6
+ {% elsif page.release_notes %}
7
7
  dg-front-page py-0
8
8
  {% else %}
9
9
  normal-padding max-width
@@ -14,8 +14,8 @@ normal-padding max-width
14
14
  <article>
15
15
  {% if page.card_overview %}
16
16
  {% include card-overview.html %}
17
- {% elsif page.has_release_notes %}
18
- {% include release_notes.html num_of_releases_to_display=5 %}
17
+ {% elsif page.release_notes %}
18
+ {% include release_notes.html num_of_releases_to_display=5 release_notes_title="What's new in " %}
19
19
  {% else %}
20
20
  {% include anchor_headings.html html=content anchorClass='header-anchor' %}
21
21
  {% endif %}
@@ -1,31 +1,23 @@
1
- {%- comment -%}
2
- **Parameters
3
- release_notes: The release notes pages to use if sitePage.content cannot be used.
4
- {%- endcomment -%}
5
-
6
- {% assign release_notes = include.release_notes %}
7
1
  {% assign num_of_releases_to_display = include.num_of_releases_to_display %}
8
- {% assign min_cnt = num_of_releases_to_display | plus: 1 %}
9
-
10
- {% if page.url contains '/release-notes' %}
11
- {% if release_notes %}
12
- {% assign max_cnt = release_notes | markdownify | split: '</h2>' | size %}
13
- {% assign releases = release_notes | markdownify | split: '<h2' | slice: 1, num_of_releases_to_display %}
14
- {% assign archive = release_notes | markdownify | split: '<h2' | slice: min_cnt, max_cnt %}
15
- {% else %}
16
- {% for sitePage in site.pages %}
17
- {% if sitePage.url == page.url %}
18
- {% assign max_cnt = sitePage.content | markdownify | split: '</h2>' | size %}
19
- {% assign releases = sitePage.content | markdownify | split: '<h2' | slice: 1, num_of_releases_to_display %}
20
- {% assign archive = sitePage.content | markdownify | split: '<h2' | slice: min_cnt, max_cnt %}
21
- {% endif %}
22
- {% endfor %}
23
- {% endif %}
24
- {% endif %}
25
-
2
+ {% assign release_notes_title = include.release_notes_title %}
26
3
  {% if page.url contains '/release-notes' %}
4
+ {% for sitePage in site.pages %}
5
+ {% if sitePage.url == page.url %}
6
+ {% assign min_cnt = num_of_releases_to_display | plus: 1 %}
7
+ {% assign max_cnt = sitePage.content | split: '</h2>' | size %}
8
+ {% assign releases = sitePage.content | markdownify | split: '<h2' | slice: 1, num_of_releases_to_display %}
9
+ {% assign archive = sitePage.content | markdownify | split: '<h2' | slice: min_cnt, max_cnt %}
27
10
  <section class="dg-changelog-container d-flex flex-column mb-0">
28
- <div class="container dg-changelog-content">
11
+ <div class="container dg-changelog-content">
12
+ <div class="row mt-3">
13
+ <span class="dg-changlelog-title">
14
+ {{ release_notes_title | append: sitePage.lead_title }}
15
+ <div class="dg-changelog-divider my-2"></div>
16
+ </span>
17
+ {% include alert.html type="informative" icon="info" header="Version numbers"
18
+ body="The version numbers used in headers on this page refers to the version of
19
+ this very documentation, not to a version of any APIs described by it." %}
20
+ </div>
29
21
  {% for release in releases %}
30
22
  {% if forloop.length > 0 %}
31
23
  {% if forloop.last %}
@@ -41,7 +33,7 @@ release_notes: The release notes pages to use if sitePage.content cannot be used
41
33
  {{ release_value[1] | strip }}
42
34
  </div>
43
35
  {% assign version_list = versions | shift %}
44
- <div class="col dg-changelog-description px-0">
36
+ <div class="dg-changelog-description px-0">
45
37
  {% for version in version_list %}
46
38
  {% assign version_parts = version | split: '</h3>' %}
47
39
  {% assign version_value = version_parts[0] | split: '>' %}
@@ -87,4 +79,7 @@ release_notes: The release notes pages to use if sitePage.content cannot be used
87
79
  {% endif %}
88
80
 
89
81
  </section>
82
+ {% endif %}
83
+
84
+ {% endfor %}
90
85
  {% endif %}
data/_includes/tabs.html CHANGED
@@ -1,9 +1,8 @@
1
1
  {%- comment -%}
2
2
  **Parameters
3
3
  tab_list(required): An array with items having the attributes title(required), content_text (required),
4
- content_src(optional), mark_with_star (optional).
4
+ content_src(optional), mark_with_star (optional)
5
5
  default_tab_index(optional): Index of the tab to be active by default, starting from 1
6
- has_release_notes(optional): Indicate if the tabs contains release notes.
7
6
  {%- endcomment -%}
8
7
 
9
8
  {% assign tabs = include.tab_list %}
@@ -30,12 +29,7 @@ has_release_notes(optional): Indicate if the tabs contains release notes.
30
29
  {% capture sourced_content %}
31
30
  {% include {{tab.content_src}} %}
32
31
  {% endcapture %}
33
-
34
- {% if include.has_release_notes %}
35
- {% include release_notes.html release_notes=sourced_content num_of_releases_to_display=5 %}
36
- {% else %}
37
32
  {{ sourced_content | markdownify }}
38
- {% endif %}
39
33
  </div>
40
34
  {% endif %}
41
35
  {% endfor %}
@@ -44,13 +38,7 @@ has_release_notes(optional): Indicate if the tabs contains release notes.
44
38
  var defaultIndex = {{ default_tab_index | jsonify }};
45
39
  const allTabs = {{ tabs | jsonify }};
46
40
  const compiledTabTextContents = allTabs?.map(tab => tab.content_text);
47
- const compiledTabSrcContents = $(".tab-src");
48
- const hasReleaseNotes = {{ include.has_release_notes | jsonify }};
49
- if(hasReleaseNotes){
50
- const container = $(".doc-container");
51
- container.attr("class", "doc-container dg-front-page py-0");
52
- }
53
-
41
+ const compiledTabSrcContents = $(".tab-src");
54
42
  </script>
55
43
 
56
44
  <script>
@@ -26,4 +26,6 @@
26
26
  <p>{{ description | markdownify }}</p>
27
27
  {% endif %}
28
28
  </div>
29
+
30
+ {% include github.html %}
29
31
  </div>
@@ -72,8 +72,8 @@
72
72
  </a>
73
73
  </header>
74
74
  <div class="documentation">
75
- <div id="search-box-container" class="form-group search-box search-expander">
76
- {% if site.search.enabled == true and page.name != "search.md" %}
75
+ <div class="form-group search-box search-expander">
76
+ {% if site.search.enabled == true %}
77
77
  <form class="search d-flex"
78
78
  method="get" action="{{ site.search.url | relative_url }}">
79
79
  <input name="q" type="text" id="tipue_search_input"
@@ -62,8 +62,8 @@ layout: default
62
62
  <div class="front-page-container">
63
63
  {% contentblock intro_cards%}
64
64
 
65
- <div class="front-page-promotion-container">
66
- {% contentblock promotion-container %}
65
+ <div class="front-page-playground">
66
+ {% contentblock playground %}
67
67
  </div>
68
68
 
69
69
  <div class="front-page-cards-sdk">
data/_layouts/search.html CHANGED
@@ -1,24 +1,5 @@
1
1
  ---
2
2
  layout: default
3
3
  ---
4
- <form class="search d-flex" method="get" action="{{ site.search.url | relative_url }}">
5
- <input name="q" type="text" id="tipue_search_input" class="form-control search-input"
6
- placeholder="Search in documentation" onfocus="this.placeholder=''"
7
- onblur="this.placeholder='Search in documentation'" pattern=".{3,}" title="At least 3 characters">
8
- <script>
9
- (function () {
10
- var params = new URLSearchParams(window.location.search);
11
- var q = params.get('q');
12
- if (q) {
13
- document.getElementById('tipue_search_input').value = q;
14
- }
15
- })();
16
- </script>
17
- <button id="search-btn" class="btn btn-primary btn-icon-lg" type="submit" aria-label="Search button">
18
- <i class="material-icons-outlined" aria-hidden="true">search</i>
19
- </button>
20
- </form>
21
- <p id="search-hint-text" class="hint-text mb-5">Tip: Try using quotes for more precise
22
- results. <code>online payments</code> will give a different result compared to <code>"online payments"</code>.</p>
23
4
 
24
- <div id="tipue_search_content"></div>
5
+ <div id="tipue_search_content"></div>
@@ -9,7 +9,6 @@
9
9
  @import 'paragraph-highlight.scss';
10
10
  @import 'sidebar.scss';
11
11
  @import 'title-header.scss';
12
- @import 'tipue_search.scss';
13
12
 
14
13
  $bg: #f5f2f0;
15
14
  $darkened-bg: darken($bg, 10%);
@@ -28,10 +27,6 @@ img {
28
27
  padding-left: 0;
29
28
  }
30
29
 
31
- .cards:has(.cards-cta) {
32
- min-width: 100% !important;
33
- }
34
-
35
30
  body {
36
31
  font-size: 1.125rem;
37
32
  }
@@ -443,43 +438,40 @@ body {
443
438
  }
444
439
  }
445
440
 
446
- #search-btn {
447
- height: 56px;
448
- border-top-left-radius: 0;
449
- border-bottom-left-radius: 0;
450
- }
451
-
452
- .search-input {
453
- border-top-right-radius: 0;
454
- border-bottom-right-radius: 0;
455
- }
456
-
457
441
  .search-box {
458
442
  position: absolute;
459
- right: 1rem;
460
- top: 1rem;
443
+ right: 8rem;
444
+ top: 1.5rem;
461
445
  z-index: 2;
462
446
 
447
+
448
+ .search-input {
449
+ border-top-right-radius: 0;
450
+ border-bottom-right-radius: 0;
451
+ }
452
+
453
+ #search-btn {
454
+ border-top-left-radius: 0;
455
+ border-bottom-left-radius: 0;
456
+ height: 56px;
457
+ }
458
+
463
459
  @media screen and (max-width: $breakpoint-lg) {
464
460
  position: fixed;
465
461
  right: 1rem;
466
462
  top: 1rem;
467
463
  z-index: 401;
468
464
 
465
+ #tipue_search_input {
466
+ display: none;
467
+ }
468
+
469
469
  #search-btn {
470
470
  border-top-left-radius: 8px;
471
471
  border-top-left-radius: var(--border-radius);
472
472
  border-bottom-left-radius: 8px;
473
473
  border-bottom-left-radius: var(--border-radius);
474
474
  }
475
-
476
- #tipue_search_input {
477
- display: none;
478
- }
479
-
480
- #search-box-container {
481
- max-width: 54px;
482
- }
483
475
  }
484
476
  }
485
477
 
@@ -490,7 +482,7 @@ body {
490
482
  }
491
483
  }
492
484
 
493
- .promotion-container-cta {
485
+ .playground-cta {
494
486
  margin-top: 2.5rem;
495
487
 
496
488
  @media screen and (max-width: $breakpoint-lg) {
@@ -7,7 +7,7 @@
7
7
 
8
8
  .title-header-container {
9
9
  width: 100%;
10
- padding: 4rem 1rem;
10
+ padding: 3rem 1rem;
11
11
 
12
12
  h1,
13
13
  h4,
@@ -96,7 +96,7 @@
96
96
 
97
97
  // Simple sidebar functionality while dg.js is being loaded
98
98
 
99
- function _handleSimpleSidebar(e) {
99
+ function _handleSimpleSidebar (e) {
100
100
  const target = e.target.parentElement.parentElement;
101
101
 
102
102
  if (target.tagName === "LI") {
@@ -121,7 +121,7 @@ function _handleSimpleSidebar(e) {
121
121
 
122
122
  // Remove simple sidebar functionality when proper sidebar functionality is loaded
123
123
  (function () {
124
- document.addEventListener("DOMContentLoaded", function (e) {
124
+ document.addEventListener("DOMContentLoaded", function(e) {
125
125
  const sidebar = document.querySelector(".sidebar");
126
126
 
127
127
  sidebar.removeEventListener("click", _handleSimpleSidebar);
@@ -131,7 +131,7 @@ function _handleSimpleSidebar(e) {
131
131
 
132
132
  // Override the topbar click to show and hide our own sidebar
133
133
  (function () {
134
- const isLeaf = function (currentUrl) {
134
+ const isLeaf = function(currentUrl) {
135
135
  const path = window.location.pathname;
136
136
  const href = currentUrl || window.location.href;
137
137
  const pathIndex = href.indexOf(path);
@@ -142,11 +142,11 @@ function _handleSimpleSidebar(e) {
142
142
  : false;
143
143
  };
144
144
 
145
- const isHome = function () {
145
+ const isHome = function() {
146
146
  return window.location.pathname === "/";
147
147
  };
148
148
 
149
- const controlVisibility = function (currentUrl) {
149
+ const controlVisibility = function(currentUrl) {
150
150
  const sidebar = document.querySelector(".sidebar");
151
151
  const overlay = document.querySelector("#overlay");
152
152
  const topbarButton = document.querySelector(".topbar-btn");
@@ -158,10 +158,12 @@ function _handleSimpleSidebar(e) {
158
158
  overlay.style.display = "none";
159
159
  topbarButton.style.display = "flex";
160
160
  topbarClose.style.display = "none";
161
+ } else {
162
+ sidebar.classList.add("visible");
161
163
  }
162
164
  };
163
165
 
164
- document.addEventListener("DOMContentLoaded", function () {
166
+ document.addEventListener("DOMContentLoaded", function() {
165
167
  const topbarButton = document.querySelector(".topbar-btn");
166
168
  const newTopbarButton = topbarButton.cloneNode(true);
167
169
  const sidebar = document.querySelector(".sidebar");
@@ -177,7 +179,7 @@ function _handleSimpleSidebar(e) {
177
179
  overlay.style.display = "block";
178
180
  }
179
181
 
180
- newTopbarButton.addEventListener("click", function (e) {
182
+ newTopbarButton.addEventListener("click", function(e) {
181
183
  if (sidebar.classList.contains("visible")) {
182
184
  sidebar.classList.remove("visible");
183
185
  newTopbarButton.style.display = "flex";
@@ -192,7 +194,7 @@ function _handleSimpleSidebar(e) {
192
194
  }
193
195
  });
194
196
 
195
- topbarClose.addEventListener("click", function (e) {
197
+ topbarClose.addEventListener("click", function(e) {
196
198
  if (sidebar.classList.contains("visible")) {
197
199
  sidebar.classList.remove("visible");
198
200
  newTopbarButton.style.display = "flex";
@@ -206,7 +208,7 @@ function _handleSimpleSidebar(e) {
206
208
  }
207
209
  });
208
210
 
209
- overlay.addEventListener("click", function (e) {
211
+ overlay.addEventListener("click", function(e) {
210
212
  if (sidebar.classList.contains("visible")) {
211
213
  sidebar.classList.remove("visible");
212
214
  newTopbarButton.style.display = "flex";
@@ -215,15 +217,15 @@ function _handleSimpleSidebar(e) {
215
217
  }
216
218
  });
217
219
 
218
- document.querySelectorAll(".nav-leaf a").forEach(function (a) {
219
- a.addEventListener("click", function (e) {
220
+ document.querySelectorAll(".nav-leaf a").forEach(function(a) {
221
+ a.addEventListener("click", function(e) {
220
222
  controlVisibility(e.target.href);
221
223
  });
222
224
  });
223
225
 
224
226
  topbarButton.parentNode.replaceChild(newTopbarButton, topbarButton);
225
227
 
226
- searchButton.addEventListener("click", function (e) {
228
+ searchButton.addEventListener("click", function(e) {
227
229
  const searchInput = document.querySelector(".search-input");
228
230
  const searchBtn = document.querySelector("#search-btn");
229
231
  return false;
@@ -231,9 +233,10 @@ function _handleSimpleSidebar(e) {
231
233
  });
232
234
  })();
233
235
 
236
+
234
237
  // Initialize Tipue search
235
- (function () {
238
+ (function() {
236
239
  $(document).ready(function () {
237
- $("#tipue_search_input").tipuesearch({ 'footerPages': 6 });
240
+ $("#tipue_search_input").tipuesearch();
238
241
  });
239
242
  })();
@@ -1,269 +1,179 @@
1
- (function ($) {
2
- $.fn.tipuesearch = function (options) {
3
- var set = $.extend({ 'contentLocation': 'tipuesearch/tipuesearch_content.json', 'contextBuffer': 60, 'contextLength': 60, 'contextStart': 90, 'debug': false, 'descriptiveWords': 25, 'footerPages': 10, 'highlightTerms': true, 'liveContent': '*', 'liveDescription': '*', 'minimumLength': 3, 'mode': 'static', 'newWindow': false, 'show': 10, 'showContext': true, 'showRelated': true, 'showTime': true, 'showTitleCount': true, 'showURL': true, 'wholeWords': true }, options); return this.each(function () {
4
- var tipuesearch_in = { pages: [] }; $.ajaxSetup({ async: false });
5
- var tipuesearch_t_c = 0; $('#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();
6
- if (set.mode == 'live') {
7
- for (var i = 0; i < tipuesearch_pages.length; i++) {
8
- $.get(tipuesearch_pages[i]).done(function (html) {
9
- var cont = $(set.liveContent, html).text(); cont = cont.replace(/\s+/g, ' '); var desc = $(set.liveDescription, html).text(); desc = desc.replace(/\s+/g, ' '); var t_1 = html.toLowerCase().indexOf('<title>'); var t_2 = html.toLowerCase().indexOf('</title>', t_1 + 7); if (t_1 != -1 && t_2 != -1) { var tit = html.slice(t_1 + 7, t_2); }
10
- else { var tit = tipuesearch_string_1; }
11
- tipuesearch_in.pages.push({ "title": tit, "text": desc, "tags": cont, "url": tipuesearch_pages[i] });
12
- });
13
- }
14
- }
15
- if (set.mode == 'json') {
16
- $.getJSON(set.contentLocation).done(function (json) { tipuesearch_in = $.extend({}, json); });
17
- }
18
- if (set.mode == 'static') { tipuesearch_in = $.extend({}, tipuesearch); }
19
- var tipue_search_w = ''; if (set.newWindow) { tipue_search_w = ' target="_blank"'; }
20
- function getURLP(name) {
21
- var _locSearch = location.search; var _splitted = (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(_locSearch) || [, ""]); var searchString = _splitted[1].replace(/\+/g, '%20'); try { searchString = decodeURIComponent(searchString); }
22
- catch (e) { searchString = unescape(searchString); }
23
- return searchString || null;
24
- }
25
- if (getURLP('q')) {
26
- $('#tipue_search_input').val(getURLP('q'));
27
- getTipueSearch(0, true);
28
- }
29
- $(this).keyup(function (event) {
30
- if (event.keyCode == '13') {
31
- getTipueSearch(0, true);
32
- }
33
- });
34
-
35
- function getTipueSearch(start, replace) {
36
- var out = '';
37
- var show_replace = false;
38
- var show_stop = false;
39
- var standard = true;
40
- var c = 0;
41
- found = [];
42
- var d_o = $('#tipue_search_input').val();
43
- var d = d_o.toLowerCase();
44
- d = $.trim(d);
45
- if ((d.match("^\"") && d.match("\"$")) || (d.match("^'") && d.match("'$"))) { standard = false; }
46
- var d_w = d.split(' '); if (standard) {
47
- d = '';
48
- for (var i = 0; i < d_w.length; i++) {
49
- var a_w = true; for (var f = 0; f < tipuesearch_stop_words.length; f++) {
50
- if (d_w[i] == tipuesearch_stop_words[f]) { a_w = false; show_stop = true; }
51
- }
52
- if (a_w) { d = d + ' ' + d_w[i]; }
53
- }
54
- d = $.trim(d); d_w = d.split(' ');
55
- }
56
- else { d = d.substring(1, d.length - 1); }
57
- if (d.length >= set.minimumLength) {
58
- if (standard) {
59
- if (replace) {
60
- var d_r = d; for (var i = 0; i < d_w.length; i++) {
61
- for (var f = 0; f < tipuesearch_replace.words.length; f++) {
62
- if (d_w[i] == tipuesearch_replace.words[f].word) { d = d.replace(d_w[i], tipuesearch_replace.words[f].replace_with); show_replace = true; }
63
- }
64
- }
65
- d_w = d.split(' ');
66
- }
67
- var d_t = d; for (var i = 0; i < d_w.length; i++) {
68
- for (var f = 0; f < tipuesearch_stem.words.length; f++) {
69
- if (d_w[i] == tipuesearch_stem.words[f].word) { d_t = d_t + ' ' + tipuesearch_stem.words[f].stem; }
70
- }
71
- }
72
- d_w = d_t.split(' '); for (var i = 0; i < tipuesearch_in.pages.length; i++) {
73
- var score = 0; var s_t = tipuesearch_in.pages[i].text; for (var f = 0; f < d_w.length; f++) {
74
- if (set.wholeWords) { var pat = new RegExp('\\b' + d_w[f] + '\\b', 'gi'); }
75
- else { var pat = new RegExp(d_w[f], 'gi'); }
76
- if (tipuesearch_in.pages[i].title.search(pat) != -1) { var m_c = tipuesearch_in.pages[i].title.match(pat).length; score += (20 * m_c); }
77
- if (tipuesearch_in.pages[i].text.search(pat) != -1) { var m_c = tipuesearch_in.pages[i].text.match(pat).length; score += (20 * m_c); }
78
- if (tipuesearch_in.pages[i].tags.search(pat) != -1) { var m_c = tipuesearch_in.pages[i].tags.match(pat).length; score += (10 * m_c); }
79
- if (tipuesearch_in.pages[i].url.search(pat) != -1) { score += 20; }
80
- if (score != 0) {
81
- for (var e = 0; e < tipuesearch_weight.weight.length; e++) {
82
- if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url) { score += tipuesearch_weight.weight[e].score; }
83
- }
84
- }
85
- if (d_w[f].match('^-')) {
86
- pat = new RegExp(d_w[f].substring(1), 'i'); 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) { score = 0; }
87
- }
88
- }
89
- if (score != 0) {
90
- if (tipuesearch_in.pages[i].title && s_t) {
91
- found.push({ "score": score, "title": tipuesearch_in.pages[i].title, "desc": s_t, "url": tipuesearch_in.pages[i].url });
92
- c++;
93
- }
94
- }
95
- }
96
- }
97
- else {
98
- for (var i = 0; i < tipuesearch_in.pages.length; i++) {
99
- var score = 0; var s_t = tipuesearch_in.pages[i].text; var pat = new RegExp(d, 'gi'); if (tipuesearch_in.pages[i].title.search(pat) != -1) { var m_c = tipuesearch_in.pages[i].title.match(pat).length; score += (20 * m_c); }
100
- if (tipuesearch_in.pages[i].text.search(pat) != -1) { var m_c = tipuesearch_in.pages[i].text.match(pat).length; score += (20 * m_c); }
101
- if (tipuesearch_in.pages[i].tags.search(pat) != -1) { var m_c = tipuesearch_in.pages[i].tags.match(pat).length; score += (10 * m_c); }
102
- if (tipuesearch_in.pages[i].url.search(pat) != -1) { score += 20; }
103
- if (score != 0) {
104
- for (var e = 0; e < tipuesearch_weight.weight.length; e++) {
105
- if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url) { score += tipuesearch_weight.weight[e].score; }
106
- }
107
- }
108
- if (score != 0) {
109
- if (tipuesearch_in.pages[i].title && s_t) {
110
- found.push({ "score": score, "title": tipuesearch_in.pages[i].title, "desc": s_t, "url": tipuesearch_in.pages[i].url });
111
- c++;
112
- }
113
- }
114
- }
115
- }
116
- if (c != 0) {
117
- if (set.showTitleCount && tipuesearch_t_c == 0) { var title = document.title; document.title = '(' + c + ') ' + title; tipuesearch_t_c++; }
118
- if (show_replace) { out += '<div id="tipue_search_warning">' + tipuesearch_string_2 + ' ' + d + '. ' + tipuesearch_string_3 + ' <a id="tipue_search_replaced">' + d_r + '</a></div>'; }
119
- if (c == 1) {
120
- out += '<div id="tipue_search_results_count">' + tipuesearch_string_4;
121
- }
122
- else {
123
- c_c = c.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
124
- out += '<div id="tipue_search_results_count">' + c_c + ' ' + tipuesearch_string_5;
125
- }
126
- if (set.showTime) {
127
- var endTimer = new Date().getTime();
128
- var time = (endTimer - startTimer) / 1000;
129
- out += ' (' + time.toFixed(2) + ' ' + tipuesearch_string_14 + ')'; set.showTime = false;
130
- }
131
- out += '</div>';
132
- found.sort(function (a, b) { return b.score - a.score });
133
- var l_o = 0;
134
- for (var i = 0; i < found.length; i++) {
135
- if (l_o >= start && l_o < set.show + start) {
136
- out += '<h2 class="tipue_search_content_title"><a href="' + found[i].url + '"' + tipue_search_w + '>' + found[i].title + '</a></h2>';
137
- if (set.debug) { out += '<div class="tipue_search_content_debug">Score: ' + found[i].score + '</div>'; }
138
- if (set.showURL) {
139
- var s_u = found[i].url.toLowerCase(); if (s_u.indexOf('http://') == 0) { s_u = s_u.slice(7); }
140
- // out+='<div class="tipue_search_content_url"><a href="'+found[i].url+'"'+tipue_search_w+'>'+s_u+'</a></div>';
141
- }
142
- if (found[i].desc) {
143
- var t = found[i].desc; if (set.showContext) {
144
- d_w = d.split(' '); var s_1 = found[i].desc.toLowerCase().indexOf(d_w[0]); if (s_1 > set.contextStart) {
145
- var t_1 = t.substr(s_1 - set.contextBuffer); var s_2 = t_1.indexOf(' '); t_1 = t.substr(s_1 - set.contextBuffer + s_2); t_1 = $.trim(t_1); if (t_1.length > set.contextLength) { t = '... ' + t_1; }
146
- }
147
- }
148
- if (standard) {
149
- d_w = d.split(' '); for (var f = 0; f < d_w.length; f++) {
150
- if (set.highlightTerms) { var patr = new RegExp('(' + d_w[f] + ')', 'gi'); t = t.replace(patr, "<h0011>$1<h0012>"); }
151
- }
152
- }
153
- else if (set.highlightTerms) { var patr = new RegExp('(' + d + ')', 'gi'); t = t.replace(patr, "<strong>$1</strong>"); }
154
- var t_d = ''; var t_w = t.split(' '); if (t_w.length < set.descriptiveWords) { t_d = t; }
155
- else {
156
- for (var f = 0; f < set.descriptiveWords; f++) { t_d += t_w[f] + ' '; }
157
- }
158
- t_d = $.trim(t_d); if (t_d.charAt(t_d.length - 1) != '.') { t_d += ' ...'; }
159
- t_d = t_d.replace(/h0011/g, 'strong'); t_d = t_d.replace(/h0012/g, '/strong'); out += '<div class="tipue_search_content_text">' + t_d + '</div>';
160
- }
161
- }
162
- l_o++;
163
- }
164
- if (set.showRelated && standard) {
165
- f = 0;
166
- for (var i = 0; i < tipuesearch_related.searches.length; i++) {
167
- if (d == tipuesearch_related.searches[i].search) {
168
- if (show_replace) { d_o = d; }
169
- if (!f) { 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">'; }
170
- out += '<div class="tipue_search_related_text"><a class="tipue_search_related" id="' + tipuesearch_related.searches[i].related + '">'; if (tipuesearch_related.searches[i].before) { out += '<span class="tipue_search_related_before">' + tipuesearch_related.searches[i].before + '</span> '; }
171
- out += tipuesearch_related.searches[i].related; if (tipuesearch_related.searches[i].after) { out += ' <span class="tipue_search_related_after">' + tipuesearch_related.searches[i].after + '</span>'; }
172
- out += '</a></div>'; f++;
173
- }
174
- }
175
- if (f) { out += '</div>'; }
176
- }
177
- if (c > set.show) {
178
- var pages = Math.ceil(c / set.show);
179
- var p_b_high = pages;
180
- var p_b_low = 0;
181
- var hasPagination = false
182
- if (pages > set.footerPages) {
183
- p_b_high = set.footerPages; //limit pagination to set.footerPages
184
- hasPagination = true;
185
- }
186
- var page = (start / set.show);
187
- out += '<nav><div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';
188
-
189
- if (start > 0) {
190
- p_b_low = p_b_low + 1;
191
- }
192
- if ((page + 1) > set.footerPages) {
193
- var diff = (page + 1) - set.footerPages;
194
- if (page + 1 > p_b_high) {
195
- p_b_high = (p_b_high + diff) > pages ? pages : p_b_high + diff;
196
- p_b_low = p_b_low + diff;
197
- }
198
- else if (page + 1 < p_b_low) {
199
- p_b_low = (p_b_low - diff) < 0 ? 0 : p_b_low - diff;
200
- p_b_high = p_b_high - diff;
201
- }
202
- }
203
- console.log('p_b_low: ' + p_b_low + ', p_b_high: ' + p_b_high);
204
-
205
- if (start > 0) { //tipuesearch_string_6
206
- if (hasPagination && page !== 0) {
207
- out += '<li role="navigation"><a class="tipue_search_foot_box" accesskey="b" id="' + (start - set.show) + '_' + replace + '"><i class="swepay-icon-chevron-left" aria-label="back"></i></a></li>';
208
- }
209
- out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (0) + '_' + replace + '">' + (1) + '</a></li>';
210
- if (hasPagination && p_b_low === 2) {
211
- out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (1) + '_' + replace + '">' + (2) + '</a></li>';
212
- }
213
- if (hasPagination && p_b_low > 2) {
214
- out += '<li role="navigation"><span>...</span></li>';
215
- }
216
- }
217
- for (var f = p_b_low; f < p_b_high; f++) {
218
- //if (f == page)
219
- //{out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
220
- if (f == page) {
221
- out += '<li class="current" role="navigation"><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
222
- }
223
- else {
224
- out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
225
- }
226
- }
227
- if (page + 1 != pages) { //tipuesearch_string_7
228
- if (hasPagination && p_b_high === (pages - 2)) {
229
- out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + ((pages - 2) * set.show) + '_' + replace + '">' + (pages - 1) + '</a></li>';
230
- }
231
- if (hasPagination && p_b_high < (pages - 2)) {
232
- out += '<li role="navigation"><span>...</span></li>';
233
- }
234
- if (hasPagination) {
235
- out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + ((pages - 1) * set.show) + '_' + replace + '">' + (pages) + '</a></li>';
236
- }
237
- if (hasPagination && (page + 1) !== pages) {
238
- out += '<li role="navigation"><a class="tipue_search_foot_box" accesskey="m" id="' + (start + set.show) + '_' + replace + '"><i class="swepay-icon-chevron-right" aria-label="forward"></i></a></li>';
239
- }
240
- }
241
- out += '</ul></div></nav>';
242
- }
243
- }
244
- else { out += '<div id="tipue_search_warning">' + tipuesearch_string_8 + '</div>'; }
245
- }
246
- else {
247
- if (show_stop) { out += '<div id="tipue_search_warning">' + tipuesearch_string_8 + '. ' + tipuesearch_string_9 + '</div>'; }
248
- else {
249
- out += '<div id="tipue_search_warning">' + tipuesearch_string_10 + '</div>'; if (set.minimumLength == 1) { out += '<div id="tipue_search_warning">' + tipuesearch_string_11 + '</div>'; }
250
- else { out += '<div id="tipue_search_warning">' + tipuesearch_string_12 + ' ' + set.minimumLength + ' ' + tipuesearch_string_13 + '</div>'; }
251
- }
252
- }
253
- $('#tipue_search_content').hide().html(out).slideDown(200);
254
- $('#tipue_search_replaced').click(function () {
255
- getTipueSearch(0, false);
256
- });
257
- $('.tipue_search_related').click(function () {
258
- $('#tipue_search_input').val($(this).attr('id'));
259
- getTipueSearch(0, true);
260
- });
261
- $('.tipue_search_foot_box').click(function () {
262
- var id_v = $(this).attr('id');
263
- var id_a = id_v.split('_');
264
- getTipueSearch(parseInt(id_a[0]), id_a[1]);
265
- });
266
- }
267
- });
268
- };
269
- })(jQuery);
1
+ (function($){$.fn.tipuesearch=function(options){var set=$.extend({'contentLocation':'tipuesearch/tipuesearch_content.json','contextBuffer':60,'contextLength':60,'contextStart':90,'debug':false,'descriptiveWords':25,'highlightTerms':true,'liveContent':'*','liveDescription':'*','minimumLength':3,'mode':'static','newWindow':false,'show':9,'showContext':true,'showRelated':true,'showTime':true,'showTitleCount':true,'showURL':true,'wholeWords':true},options);return this.each(function(){var tipuesearch_in={pages:[]};$.ajaxSetup({async:false});var tipuesearch_t_c=0;$('#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();if(set.mode=='live')
2
+ {for(var i=0;i<tipuesearch_pages.length;i++)
3
+ {$.get(tipuesearch_pages[i]).done(function(html)
4
+ {var cont=$(set.liveContent,html).text();cont=cont.replace(/\s+/g,' ');var desc=$(set.liveDescription,html).text();desc=desc.replace(/\s+/g,' ');var t_1=html.toLowerCase().indexOf('<title>');var t_2=html.toLowerCase().indexOf('</title>',t_1+7);if(t_1!=-1&&t_2!=-1)
5
+ {var tit=html.slice(t_1+7,t_2);}
6
+ else
7
+ {var tit=tipuesearch_string_1;}
8
+ tipuesearch_in.pages.push({"title":tit,"text":desc,"tags":cont,"url":tipuesearch_pages[i]});});}}
9
+ if(set.mode=='json')
10
+ {$.getJSON(set.contentLocation).done(function(json)
11
+ {tipuesearch_in=$.extend({},json);});}
12
+ if(set.mode=='static')
13
+ {tipuesearch_in=$.extend({},tipuesearch);}
14
+ var tipue_search_w='';if(set.newWindow)
15
+ {tipue_search_w=' target="_blank"';}
16
+ function getURLP(name)
17
+ {var _locSearch=location.search;var _splitted=(new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(_locSearch)||[,""]);var searchString=_splitted[1].replace(/\+/g,'%20');try
18
+ {searchString=decodeURIComponent(searchString);}
19
+ catch(e)
20
+ {searchString=unescape(searchString);}
21
+ return searchString||null;}
22
+ if(getURLP('q'))
23
+ {$('#tipue_search_input').val(getURLP('q'));getTipueSearch(0,true);}
24
+ $(this).keyup(function(event)
25
+ {if(event.keyCode=='13')
26
+ {getTipueSearch(0,true);}});function getTipueSearch(start,replace)
27
+ {var out='';var show_replace=false;var show_stop=false;var standard=true;var c=0;found=[];var d_o=$('#tipue_search_input').val();var d=d_o.toLowerCase();d=$.trim(d);if((d.match("^\"")&&d.match("\"$"))||(d.match("^'")&&d.match("'$")))
28
+ {standard=false;}
29
+ var d_w=d.split(' ');if(standard)
30
+ {d='';for(var i=0;i<d_w.length;i++)
31
+ {var a_w=true;for(var f=0;f<tipuesearch_stop_words.length;f++)
32
+ {if(d_w[i]==tipuesearch_stop_words[f])
33
+ {a_w=false;show_stop=true;}}
34
+ if(a_w)
35
+ {d=d+' '+d_w[i];}}
36
+ d=$.trim(d);d_w=d.split(' ');}
37
+ else
38
+ {d=d.substring(1,d.length-1);}
39
+ if(d.length>=set.minimumLength)
40
+ {if(standard)
41
+ {if(replace)
42
+ {var d_r=d;for(var i=0;i<d_w.length;i++)
43
+ {for(var f=0;f<tipuesearch_replace.words.length;f++)
44
+ {if(d_w[i]==tipuesearch_replace.words[f].word)
45
+ {d=d.replace(d_w[i],tipuesearch_replace.words[f].replace_with);show_replace=true;}}}
46
+ d_w=d.split(' ');}
47
+ var d_t=d;for(var i=0;i<d_w.length;i++)
48
+ {for(var f=0;f<tipuesearch_stem.words.length;f++)
49
+ {if(d_w[i]==tipuesearch_stem.words[f].word)
50
+ {d_t=d_t+' '+tipuesearch_stem.words[f].stem;}}}
51
+ d_w=d_t.split(' ');for(var i=0;i<tipuesearch_in.pages.length;i++)
52
+ {var score=0;var s_t=tipuesearch_in.pages[i].text;for(var f=0;f<d_w.length;f++)
53
+ {if(set.wholeWords)
54
+ {var pat=new RegExp('\\b'+d_w[f]+'\\b','gi');}
55
+ else
56
+ {var pat=new RegExp(d_w[f],'gi');}
57
+ if(tipuesearch_in.pages[i].title.search(pat)!=-1)
58
+ {var m_c=tipuesearch_in.pages[i].title.match(pat).length;score+=(20*m_c);}
59
+ if(tipuesearch_in.pages[i].text.search(pat)!=-1)
60
+ {var m_c=tipuesearch_in.pages[i].text.match(pat).length;score+=(20*m_c);}
61
+ if(tipuesearch_in.pages[i].tags.search(pat)!=-1)
62
+ {var m_c=tipuesearch_in.pages[i].tags.match(pat).length;score+=(10*m_c);}
63
+ if(tipuesearch_in.pages[i].url.search(pat)!=-1)
64
+ {score+=20;}
65
+ if(score!=0)
66
+ {for(var e=0;e<tipuesearch_weight.weight.length;e++)
67
+ {if(tipuesearch_in.pages[i].url==tipuesearch_weight.weight[e].url)
68
+ {score+=tipuesearch_weight.weight[e].score;}}}
69
+ if(d_w[f].match('^-'))
70
+ {pat=new RegExp(d_w[f].substring(1),'i');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)
71
+ {score=0;}}}
72
+ if(score!=0)
73
+ {found.push({"score":score,"title":tipuesearch_in.pages[i].title,"desc":s_t,"url":tipuesearch_in.pages[i].url});c++;}}}
74
+ else
75
+ {for(var i=0;i<tipuesearch_in.pages.length;i++)
76
+ {var score=0;var s_t=tipuesearch_in.pages[i].text;var pat=new RegExp(d,'gi');if(tipuesearch_in.pages[i].title.search(pat)!=-1)
77
+ {var m_c=tipuesearch_in.pages[i].title.match(pat).length;score+=(20*m_c);}
78
+ if(tipuesearch_in.pages[i].text.search(pat)!=-1)
79
+ {var m_c=tipuesearch_in.pages[i].text.match(pat).length;score+=(20*m_c);}
80
+ if(tipuesearch_in.pages[i].tags.search(pat)!=-1)
81
+ {var m_c=tipuesearch_in.pages[i].tags.match(pat).length;score+=(10*m_c);}
82
+ if(tipuesearch_in.pages[i].url.search(pat)!=-1)
83
+ {score+=20;}
84
+ if(score!=0)
85
+ {for(var e=0;e<tipuesearch_weight.weight.length;e++)
86
+ {if(tipuesearch_in.pages[i].url==tipuesearch_weight.weight[e].url)
87
+ {score+=tipuesearch_weight.weight[e].score;}}}
88
+ if(score!=0)
89
+ {found.push({"score":score,"title":tipuesearch_in.pages[i].title,"desc":s_t,"url":tipuesearch_in.pages[i].url});c++;}}}
90
+ if(c!=0)
91
+ {if(set.showTitleCount&&tipuesearch_t_c==0)
92
+ {var title=document.title;document.title='('+c+') '+title;tipuesearch_t_c++;}
93
+ if(show_replace)
94
+ {out+='<div id="tipue_search_warning">'+tipuesearch_string_2+' '+d+'. '+tipuesearch_string_3+' <a id="tipue_search_replaced">'+d_r+'</a></div>';}
95
+ if(c==1)
96
+ {out+='<div id="tipue_search_results_count">'+tipuesearch_string_4;}
97
+ else
98
+ {c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='<div id="tipue_search_results_count">'+c_c+' '+tipuesearch_string_5;}
99
+ if(set.showTime)
100
+ {var endTimer=new Date().getTime();var time=(endTimer-startTimer)/ 1000;out+=' ('+time.toFixed(2)+' '+tipuesearch_string_14+')';set.showTime=false;}
101
+ out+='</div>';found.sort(function(a,b){return b.score-a.score});var l_o=0;for(var i=0;i<found.length;i++)
102
+ {if(l_o>=start&&l_o<set.show+start)
103
+ {out+='<h2 class="tipue_search_content_title"><a href="'+found[i].url+'"'+tipue_search_w+'>'+found[i].title+'</a></h2>';if(set.debug)
104
+ {out+='<div class="tipue_search_content_debug">Score: '+found[i].score+'</div>';}
105
+ if(set.showURL)
106
+ {var s_u=found[i].url.toLowerCase();if(s_u.indexOf('http://')==0)
107
+ {s_u=s_u.slice(7);}
108
+ // out+='<div class="tipue_search_content_url"><a href="'+found[i].url+'"'+tipue_search_w+'>'+s_u+'</a></div>';
109
+ }
110
+ if(found[i].desc)
111
+ {var t=found[i].desc;if(set.showContext)
112
+ {d_w=d.split(' ');var s_1=found[i].desc.toLowerCase().indexOf(d_w[0]);if(s_1>set.contextStart)
113
+ {var t_1=t.substr(s_1-set.contextBuffer);var s_2=t_1.indexOf(' ');t_1=t.substr(s_1-set.contextBuffer+s_2);t_1=$.trim(t_1);if(t_1.length>set.contextLength)
114
+ {t='... '+t_1;}}}
115
+ if(standard)
116
+ {d_w=d.split(' ');for(var f=0;f<d_w.length;f++)
117
+ {if(set.highlightTerms)
118
+ {var patr=new RegExp('('+d_w[f]+')','gi');t=t.replace(patr,"<h0011>$1<h0012>");}}}
119
+ else if(set.highlightTerms)
120
+ {var patr=new RegExp('('+d+')','gi');t=t.replace(patr,"<strong>$1</strong>");}
121
+ var t_d='';var t_w=t.split(' ');if(t_w.length<set.descriptiveWords)
122
+ {t_d=t;}
123
+ else
124
+ {for(var f=0;f<set.descriptiveWords;f++)
125
+ {t_d+=t_w[f]+' ';}}
126
+ t_d=$.trim(t_d);if(t_d.charAt(t_d.length-1)!='.')
127
+ {t_d+=' ...';}
128
+ t_d=t_d.replace(/h0011/g,'strong');t_d=t_d.replace(/h0012/g,'/strong');out+='<div class="tipue_search_content_text">'+t_d+'</div>';}}
129
+ l_o++;}
130
+ if(set.showRelated&&standard)
131
+ {f=0;for(var i=0;i<tipuesearch_related.searches.length;i++)
132
+ {if(d==tipuesearch_related.searches[i].search)
133
+ {if(show_replace)
134
+ {d_o=d;}
135
+ if(!f)
136
+ {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">';}
137
+ out+='<div class="tipue_search_related_text"><a class="tipue_search_related" id="'+tipuesearch_related.searches[i].related+'">';if(tipuesearch_related.searches[i].before)
138
+ {out+='<span class="tipue_search_related_before">'+tipuesearch_related.searches[i].before+'</span> ';}
139
+ out+=tipuesearch_related.searches[i].related;if(tipuesearch_related.searches[i].after)
140
+ {out+=' <span class="tipue_search_related_after">'+tipuesearch_related.searches[i].after+'</span>';}
141
+ out+='</a></div>';f++;}}
142
+ if(f)
143
+ {out+='</div>';}}
144
+ if(c>set.show)
145
+ {var pages=Math.ceil(c / set.show);var page=(start / set.show);out+='<nav><div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';if(start>0)
146
+ {out+='<li role="navigation"><a class="tipue_search_foot_box" accesskey="b" id="'+(start-set.show)+'_'+replace+'">'+tipuesearch_string_6+'</a></li>';}
147
+ if(page<=2)
148
+ {var p_b=pages;if(pages>3)
149
+ {p_b=3;}
150
+ for(var f=0;f<p_b;f++)
151
+ {if(f==page)
152
+ {out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
153
+ else
154
+ {out+='<li role="navigation"><a class="tipue_search_foot_box" id="'+(f*set.show)+'_'+replace+'">'+(f+1)+'</a></li>';}}}
155
+ else
156
+ {var p_b=page+2;if(p_b>pages)
157
+ {p_b=pages;}
158
+ for(var f=page-1;f<p_b;f++)
159
+ {if(f==page)
160
+ {out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
161
+ else
162
+ {out+='<li role="navigation"><a class="tipue_search_foot_box" id="'+(f*set.show)+'_'+replace+'">'+(f+1)+'</a></li>';}}}
163
+ if(page+1!=pages)
164
+ {out+='<li role="navigation"><a class="tipue_search_foot_box" accesskey="m" id="'+(start+set.show)+'_'+replace+'">'+tipuesearch_string_7+'</a></li>';}
165
+ out+='</ul></div></nav>';}}
166
+ else
167
+ {out+='<div id="tipue_search_warning">'+tipuesearch_string_8+'</div>';}}
168
+ else
169
+ {if(show_stop)
170
+ {out+='<div id="tipue_search_warning">'+tipuesearch_string_8+'. '+tipuesearch_string_9+'</div>';}
171
+ else
172
+ {out+='<div id="tipue_search_warning">'+tipuesearch_string_10+'</div>';if(set.minimumLength==1)
173
+ {out+='<div id="tipue_search_warning">'+tipuesearch_string_11+'</div>';}
174
+ else
175
+ {out+='<div id="tipue_search_warning">'+tipuesearch_string_12+' '+set.minimumLength+' '+tipuesearch_string_13+'</div>';}}}
176
+ $('#tipue_search_content').hide().html(out).slideDown(200);$('#tipue_search_replaced').click(function()
177
+ {getTipueSearch(0,false);});$('.tipue_search_related').click(function()
178
+ {$('#tipue_search_input').val($(this).attr('id'));getTipueSearch(0,true);});$('.tipue_search_foot_box').click(function()
179
+ {var id_v=$(this).attr('id');var id_a=id_v.split('_');getTipueSearch(parseInt(id_a[0]),id_a[1]);});}});};})(jQuery);
@@ -60,8 +60,8 @@ var tipuesearch_string_3 = 'Search instead for';
60
60
  var tipuesearch_string_4 = '1 result';
61
61
  var tipuesearch_string_5 = 'results';
62
62
  var tipuesearch_string_6 = 'Back';
63
- var tipuesearch_string_7 = 'Next';
64
- var tipuesearch_string_8 = 'Nothing found';
63
+ var tipuesearch_string_7 = 'More';
64
+ var tipuesearch_string_8 = 'Nothing found.';
65
65
  var tipuesearch_string_9 = 'Common words are largely ignored.';
66
66
  var tipuesearch_string_10 = 'Search too short';
67
67
  var tipuesearch_string_11 = 'Should be one character or more.';
data/lib/gem_version.rb CHANGED
@@ -4,7 +4,7 @@ module Gem
4
4
  # Gem Specification
5
5
  class Specification
6
6
  def self.gem_version
7
- '2.6.7'
7
+ '3.0.0'
8
8
  end
9
9
  end
10
10
  end
@@ -65,9 +65,9 @@ module SwedbankPay
65
65
  end
66
66
 
67
67
  def change_root_class(current_page)
68
- return unless current_page.path == '/search/' || current_page.path == '/'
69
-
70
- # On 'home' or 'search', set the 'class' to 'sidebar dg-sidebar' to effectively remove 'has-secondary-nav'.
68
+ return if current_page.path != '/'
69
+
70
+ # On 'home', set the 'class' to 'sidebar dg-sidebar' to effectively remove 'has-secondary-nav'.
71
71
  current_page.doc.xpath('//*[@id="dg-sidebar"]').first.set_attribute('class', 'sidebar dg-sidebar')
72
72
  end
73
73
 
@@ -28,23 +28,21 @@ module SwedbankPay
28
28
  return if pages.empty?
29
29
 
30
30
  pages.each do |page|
31
- unless page.filename.include?('404.html')
32
- sidebar_html = render_sidebar(page)
33
- name = page.filename || page.name || page.to_s
34
-
35
- if sidebar_html.nil?
36
- SidebarLogger.warn("No HTML rendered for #{name}.")
37
- next
38
- end
31
+ sidebar_html = render_sidebar(page)
32
+ name = page.filename || page.name || page.to_s
39
33
 
40
- if page.sidebar_container.nil?
41
- SidebarLogger.warn("No sidebar container found in '#{name}'. #{page.filename}")
42
- next
43
- end
34
+ if sidebar_html.nil?
35
+ SidebarLogger.warn("No HTML rendered for #{name}.")
36
+ next
37
+ end
44
38
 
45
- page.sidebar_container.inner_html = sidebar_html
39
+ if page.sidebar_container.nil?
40
+ SidebarLogger.warn("No sidebar container found in '#{name}'. #{page.filename}")
41
+ next
46
42
  end
47
43
 
44
+ page.sidebar_container.inner_html = sidebar_html
45
+
48
46
  page.save
49
47
 
50
48
  render_pages(page.children)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swedbank-pay-design-guide-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.7
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swedbank Pay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-08 00:00:00.000000000 Z
11
+ date: 2025-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -445,7 +445,6 @@ files:
445
445
  - _sass/paragraph-highlight.scss
446
446
  - _sass/sidebar.scss
447
447
  - _sass/swedbank-pay-design-guide-theme.scss
448
- - _sass/tipue_search.scss
449
448
  - _sass/title-header.scss
450
449
  - _sass/variables.scss
451
450
  - assets/css/pygments-autumn.css
@@ -503,14 +502,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
503
502
  requirements:
504
503
  - - ">="
505
504
  - !ruby/object:Gem::Version
506
- version: 2.5.0
505
+ version: 3.1.0
507
506
  required_rubygems_version: !ruby/object:Gem::Requirement
508
507
  requirements:
509
508
  - - ">="
510
509
  - !ruby/object:Gem::Version
511
510
  version: '0'
512
511
  requirements: []
513
- rubygems_version: 3.1.6
512
+ rubygems_version: 3.3.27
514
513
  signing_key:
515
514
  specification_version: 4
516
515
  summary: Swedbank Pay Design Guide theme for Jekyll
@@ -1,51 +0,0 @@
1
- #tipue_search_content {
2
-
3
- nav {
4
- display: flex;
5
- font-family: Swedbank Headline, Arial, sans-serif;
6
- justify-content: center;
7
- margin: 1rem 0;
8
- padding-left: 0;
9
-
10
- ul {
11
- display: flex;
12
- color: #2f2424;
13
- margin-top: 0;
14
- margin-bottom: 0;
15
- padding-left: 0;
16
- line-height: 24px;
17
-
18
- li {
19
- border-radius: .125rem;
20
- display: flex;
21
- margin: .5rem;
22
- color: #2f2424;
23
-
24
- a {
25
- border: 2px solid transparent;
26
- color: #2f2424;
27
- cursor: pointer;
28
- min-width: 1.75rem;
29
- padding-top: .1rem;
30
- text-align: center;
31
- -webkit-text-decoration: none;
32
- text-decoration: none;
33
- max-height: 29.6px;
34
-
35
- &:hover {
36
- border: 2px solid #2f2424;
37
- border-radius: .125rem;
38
- }
39
- }
40
-
41
- &.current {
42
- background-color: #2f2424;
43
-
44
- a {
45
- color: white;
46
- }
47
- }
48
- }
49
- }
50
- }
51
- }