swedbank-pay-design-guide-jekyll-theme 2.8.2 → 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.
@@ -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.8.2'
7
+ '3.0.0'
8
8
  end
9
9
  end
10
10
  end