summaryrefslogtreecommitdiff
path: root/plugins/localsearch/localsearch/files
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/localsearch/localsearch/files')
-rw-r--r--plugins/localsearch/localsearch/files/assets/css/img/loader.gifbin0 -> 4178 bytes
-rw-r--r--plugins/localsearch/localsearch/files/assets/css/img/search.pngbin0 -> 368 bytes
-rw-r--r--plugins/localsearch/localsearch/files/assets/css/tipuesearch.css271
-rw-r--r--plugins/localsearch/localsearch/files/assets/js/tipuesearch.js611
-rw-r--r--plugins/localsearch/localsearch/files/assets/js/tipuesearch.min.js181
-rw-r--r--plugins/localsearch/localsearch/files/assets/js/tipuesearch_set.js84
6 files changed, 1147 insertions, 0 deletions
diff --git a/plugins/localsearch/localsearch/files/assets/css/img/loader.gif b/plugins/localsearch/localsearch/files/assets/css/img/loader.gif
new file mode 100644
index 00000000..9c97738a
--- /dev/null
+++ b/plugins/localsearch/localsearch/files/assets/css/img/loader.gif
Binary files differ
diff --git a/plugins/localsearch/localsearch/files/assets/css/img/search.png b/plugins/localsearch/localsearch/files/assets/css/img/search.png
new file mode 100644
index 00000000..8c6943d4
--- /dev/null
+++ b/plugins/localsearch/localsearch/files/assets/css/img/search.png
Binary files differ
diff --git a/plugins/localsearch/localsearch/files/assets/css/tipuesearch.css b/plugins/localsearch/localsearch/files/assets/css/tipuesearch.css
new file mode 100644
index 00000000..5793c6db
--- /dev/null
+++ b/plugins/localsearch/localsearch/files/assets/css/tipuesearch.css
@@ -0,0 +1,271 @@
1/*
2Tipue Search 7.1
3Copyright (c) 2019 Tipue
4Tipue Search is released under the MIT License
5http://www.tipue.com/search
6*/
7
8
9/* search box */
10
11/*
12#tipue_search_input
13{
14 float: left;
15 font: 15px 'Open Sans', sans-serif;
16 color: #333;
17 -webkit-font-smoothing: antialiased;
18 -moz-osx-font-smoothing: grayscale;
19 width: 230px;
20 background-color: #f3f3f3;
21 border: none;
22 padding: 9px 0 10px 18px;
23 height: 56px;
24 border-radius: 3px;
25 -moz-appearance: none;
26 -webkit-appearance: none;
27 box-sizing: border-box;
28 box-shadow: none;
29 outline: 0;
30 margin: 0;
31}
32#tipue_search_input:-webkit-autofill,
33#tipue_search_input:-webkit-autofill:hover,
34#tipue_search_input:-webkit-autofill:focus
35{
36 -webkit-box-shadow: 0 0 0px 1000px #f3f3f3 inset;
37}
38*/
39.tipue_search_button {
40 position: relative;
41 float: left;
42 width: 49px;
43 height: 56px;
44 margin-left: -3px;
45 background-color: #f3f3f3;
46 border: none;
47 border-top-right-radius: 3px;
48 border-bottom-right-radius: 3px;
49 box-sizing: border-box;
50 cursor: pointer;
51 outline: 0;
52}
53
54.tipue_search_icon {
55 float: left;
56 font: 24px/1 'Open Sans', sans-serif;
57 -webkit-font-smoothing: antialiased;
58 -moz-osx-font-smoothing: grayscale;
59 color: #333;
60 transform: rotate(-45deg);
61 -moz-appearance: none;
62 -webkit-appearance: none;
63 box-sizing: border-box;
64 box-shadow: none;
65 outline: 0;
66 margin: -1px 0 0 16px;
67}
68
69.tipue_search_group:after {
70 content: "";
71 display: table;
72 clear: both;
73}
74
75
76/* search results */
77
78
79#tipue_search_content {
80 max-width: 100%;
81 margin: 0;
82}
83
84.tipue_search_content_title {
85 font-weight: 300;
86 font-size: 2rem;
87 color: #111;
88}
89
90.tipue_search_content_title a {
91 color: #111;
92 text-decoration: none;
93}
94
95.tipue_search_result {
96 padding-top: 27px;
97}
98
99#tipue_search_results_count, .tipue_search_content_debug {
100 font: 13px/1.5 'Source Code Pro', monospace;
101 text-transform: uppercase;
102 color: #999;
103 -webkit-font-smoothing: antialiased;
104 -moz-osx-font-smoothing: grayscale;
105}
106
107#tipue_search_results_count {
108 padding-top: 9px;
109}
110
111.tipue_search_content_url, .tipue_search_note, .tipue_search_related, #tipue_search_error, #tipue_search_replace {
112 font-weight: 300;
113 padding-top: 7px;
114 word-wrap: break-word;
115 hyphens: auto;
116}
117
118#tipue_search_replace, .tipue_search_related {
119 margin-top: 7px;
120}
121
122#tipue_search_error {
123 color: #333;
124 margin-top: 17px;
125}
126
127.tipue_search_content_text {
128 font-weight: 300;
129 word-wrap: break-word;
130 hyphens: auto;
131 margin-top: 9px;
132}
133
134.tipue_search_content_bold {
135 font-weight: 400;
136}
137
138.tipue_search_content_debug {
139 margin: 7px 0 2px 0;
140}
141
142
143/* images */
144
145
146.tipue_search_image {
147 padding: 17px 0 6px 0;
148}
149
150.tipue_search_img {
151 width: 100%;
152 max-width: 330px;
153 height: auto;
154 transition: 0.5s;
155 border-radius: 2px;
156}
157
158.tipue_search_img:hover {
159 opacity: 0.9;
160}
161
162#tipue_search_zoom_text {
163 font: 12px/1.7 'Source Code Pro', monospace;
164 color: #ccc;
165 text-transform: uppercase;
166 letter-spacing: 1px;
167 padding-top: 9px;
168}
169
170#tipue_search_zoom_text a {
171 color: #ccc;
172 text-decoration: none;
173 border-bottom: 2px solid #f7f7f7;
174}
175
176#tipue_search_zoom_text a:hover {
177 border: 0;
178}
179
180.tipue_search_image_zoom {
181 cursor: pointer;
182}
183
184#tipue_search_image_modal {
185 display: none;
186 position: fixed;
187 z-index: 1000;
188 left: 0;
189 top: 0;
190 width: 100%;
191 height: 100%;
192 overflow: auto;
193 background-color: rgba(0, 0, 0, 0.9);
194}
195
196.tipue_search_image_close {
197 position: absolute;
198 top: 0;
199 right: 0;
200 font: 22px/1 'Source Code Pro', monospace;
201 color: #ccc;
202 padding: 25px 30px;
203 cursor: pointer;
204}
205
206.tipue_search_image_block {
207 margin: 0 auto;
208 max-width: 900px;
209 padding: 73px 30px 30px 30px;
210 box-sizing: border-box;
211 color: #fff;
212}
213
214#tipue_search_zoom_img {
215 max-width: 100%;
216 height: auto;
217}
218
219#tipue_search_zoom_text, .tipue_search_zoom_options {
220 padding-top: 9px;
221}
222
223
224/* footer */
225
226
227#tipue_search_foot {
228 margin: 51px 0 21px 0;
229}
230
231#tipue_search_foot_boxes {
232 font: 14px 'Source Code Pro', sans-serif;
233 text-transform: uppercase;
234 color: #333;
235 padding: 0;
236 margin: 0;
237 cursor: pointer;
238}
239
240#tipue_search_foot_boxes li {
241 display: inline;
242 list-style: none;
243 margin: 0;
244 padding: 0;
245}
246
247#tipue_search_foot_boxes li a {
248 background-color: #f7f7f7;
249 color: #666;
250 padding: 10px 17px 11px 17px;
251 border-radius: 3px;
252 margin-right: 7px;
253 text-decoration: none;
254 text-align: center;
255 transition: 0.3s;
256}
257
258#tipue_search_foot_boxes li.current {
259 background: #252525;
260 color: #ccc;
261 padding: 10px 17px 11px 17px;
262 border-radius: 3px;
263 margin-right: 7px;
264 text-align: center;
265}
266
267#tipue_search_foot_boxes li a:hover {
268 background: #252525;
269 color: #ccc;
270}
271
diff --git a/plugins/localsearch/localsearch/files/assets/js/tipuesearch.js b/plugins/localsearch/localsearch/files/assets/js/tipuesearch.js
new file mode 100644
index 00000000..48245668
--- /dev/null
+++ b/plugins/localsearch/localsearch/files/assets/js/tipuesearch.js
@@ -0,0 +1,611 @@
1
2/*
3Tipue Search 7.1
4Copyright (c) 2019 Tipue
5Tipue Search is released under the MIT License
6http://www.tipue.com/search
7*/
8
9
10(function($) {
11
12 $.fn.tipuesearch = function(options) {
13
14 var set = $.extend( {
15
16 'contextBuffer' : 60,
17 'contextLength' : 60,
18 'contextStart' : 90,
19 'debug' : false,
20 'descriptiveWords' : 25,
21 'footerPages' : 3,
22 'highlightTerms' : true,
23 'imageZoom' : true,
24 'minimumLength' : 3,
25 'newWindow' : false,
26 'show' : 10,
27 'showContext' : true,
28 'showRelated' : true,
29 'showTime' : true,
30 'showTitleCount' : true,
31 'showURL' : true,
32 'wholeWords' : true
33 }, options);
34
35 return this.each(function() {
36
37 var tipuesearch_t_c = 0;
38
39 var tipue_search_w = '';
40 if (set.newWindow)
41 {
42 tipue_search_w = ' target="_blank"';
43 }
44
45 function getURLP(name)
46 {
47 var locSearch = location.search;
48 var splitted = (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(locSearch)||[,""]);
49 var searchString = splitted[1].replace(/\+/g, '%20');
50 try
51 {
52 searchString = decodeURIComponent(searchString);
53 }
54 catch(e)
55 {
56 searchString = unescape(searchString);
57 }
58 return searchString || null;
59 }
60
61 if (getURLP('q'))
62 {
63 $('#tipue_search_input').val(getURLP('q'));
64 getTipueSearch(0, true);
65 }
66
67 $(this).keyup(function(event)
68 {
69 if(event.keyCode == '13')
70 {
71 getTipueSearch(0, true);
72 }
73 });
74
75
76 function getTipueSearch(start, replace)
77 {
78 window.scrollTo(0, 0);
79
80 var out = '';
81 var show_replace = false;
82 var show_stop = false;
83 var standard = true;
84 var c = 0;
85 var found = [];
86
87 var d_o = $('#tipue_search_input').val();
88 d_o = d_o.replace(/\+/g, ' ').replace(/\s\s+/g, ' ');
89
90 d_o = $.trim(d_o);
91 var d = d_o.toLowerCase();
92
93 if ((d.match("^\"") && d.match("\"$")) || (d.match("^'") && d.match("'$")))
94 {
95 standard = false;
96 }
97
98 var d_w = d.split(' ');
99
100 if (standard)
101 {
102 d = '';
103 for (var i = 0; i < d_w.length; i++)
104 {
105 var a_w = true;
106 for (var f = 0; f < tipuesearch_stop_words.length; f++)
107 {
108 if (d_w[i] == tipuesearch_stop_words[f])
109 {
110 a_w = false;
111 show_stop = true;
112 }
113 }
114 if (a_w)
115 {
116 d = d + ' ' + d_w[i];
117 }
118 }
119 d = $.trim(d);
120 d_w = d.split(' ');
121 }
122 else
123 {
124 d = d.substring(1, d.length - 1);
125 }
126
127 if (d.length >= set.minimumLength)
128 {
129 if (standard)
130 {
131 if (replace)
132 {
133 var d_r = d;
134 for (var i = 0; i < d_w.length; i++)
135 {
136 for (var f = 0; f < tipuesearch_replace.words.length; f++)
137 {
138 if (d_w[i] == tipuesearch_replace.words[f].word)
139 {
140 d = d.replace(d_w[i], tipuesearch_replace.words[f].replace_with);
141 show_replace = true;
142 }
143 }
144 }
145 d_w = d.split(' ');
146 }
147
148 var d_t = d;
149 for (var i = 0; i < d_w.length; i++)
150 {
151 for (var f = 0; f < tipuesearch_stem.words.length; f++)
152 {
153 if (d_w[i] == tipuesearch_stem.words[f].word)
154 {
155 d_t = d_t + ' ' + tipuesearch_stem.words[f].stem;
156 }
157 }
158 }
159 d_w = d_t.split(' ');
160
161 for (var i = 0; i < tipuesearch.pages.length; i++)
162 {
163 var score = 0;
164 var s_t = tipuesearch.pages[i].text;
165 for (var f = 0; f < d_w.length; f++)
166 {
167 if (set.wholeWords)
168 {
169 var pat = new RegExp('\\b' + d_w[f] + '\\b', 'gi');
170 }
171 else
172 {
173 var pat = new RegExp(d_w[f], 'gi');
174 }
175 if (tipuesearch.pages[i].title.search(pat) != -1)
176 {
177 var m_c = tipuesearch.pages[i].title.match(pat).length;
178 score += (20 * m_c);
179 }
180 if (tipuesearch.pages[i].text.search(pat) != -1)
181 {
182 var m_c = tipuesearch.pages[i].text.match(pat).length;
183 score += (20 * m_c);
184 }
185 if (tipuesearch.pages[i].tags)
186 {
187 if (tipuesearch.pages[i].tags.search(pat) != -1)
188 {
189 var m_c = tipuesearch.pages[i].tags.match(pat).length;
190 score += (10 * m_c);
191 }
192 }
193 if (tipuesearch.pages[i].url.search(pat) != -1)
194 {
195 score += 20;
196 }
197
198 if (score != 0)
199 {
200 for (var e = 0; e < tipuesearch_weight.weight.length; e++)
201 {
202 if (tipuesearch.pages[i].url == tipuesearch_weight.weight[e].url)
203 {
204 score += tipuesearch_weight.weight[e].score;
205 }
206 }
207 }
208
209 if (d_w[f].match('^-'))
210 {
211 pat = new RegExp(d_w[f].substring(1), 'i');
212 if (tipuesearch.pages[i].title.search(pat) != -1 || tipuesearch.pages[i].text.search(pat) != -1 || tipuesearch.pages[i].tags.search(pat) != -1)
213 {
214 score = 0;
215 }
216 }
217 }
218
219 if (score != 0)
220 {
221 found.push(
222 {
223 "score": score,
224 "title": tipuesearch.pages[i].title,
225 "desc": s_t,
226 "img": tipuesearch.pages[i].img,
227 "url": tipuesearch.pages[i].url,
228 "note": tipuesearch.pages[i].note
229 });
230 c++;
231 }
232 }
233 }
234 else
235 {
236 for (var i = 0; i < tipuesearch.pages.length; i++)
237 {
238 var score = 0;
239 var s_t = tipuesearch.pages[i].text;
240 var pat = new RegExp(d, 'gi');
241 if (tipuesearch.pages[i].title.search(pat) != -1)
242 {
243 var m_c = tipuesearch.pages[i].title.match(pat).length;
244 score += (20 * m_c);
245 }
246 if (tipuesearch.pages[i].text.search(pat) != -1)
247 {
248 var m_c = tipuesearch.pages[i].text.match(pat).length;
249 score += (20 * m_c);
250 }
251 if (tipuesearch.pages[i].tags)
252 {
253 if (tipuesearch.pages[i].tags.search(pat) != -1)
254 {
255 var m_c = tipuesearch.pages[i].tags.match(pat).length;
256 score += (10 * m_c);
257 }
258 }
259 if (tipuesearch.pages[i].url.search(pat) != -1)
260 {
261 score += 20;
262 }
263
264 if (score != 0)
265 {
266 for (var e = 0; e < tipuesearch_weight.weight.length; e++)
267 {
268 if (tipuesearch.pages[i].url == tipuesearch_weight.weight[e].url)
269 {
270 score += tipuesearch_weight.weight[e].score;
271 }
272 }
273 }
274
275 if (score != 0)
276 {
277 found.push(
278 {
279 "score": score,
280 "title": tipuesearch.pages[i].title,
281 "desc": s_t,
282 "img": tipuesearch.pages[i].img,
283 "url": tipuesearch.pages[i].url,
284 "note": tipuesearch.pages[i].note
285 });
286 c++;
287 }
288 }
289 }
290
291 if (c != 0)
292 {
293 if (set.showTitleCount && tipuesearch_t_c == 0)
294 {
295 var title = document.title;
296 document.title = '(' + c + ') ' + title;
297 tipuesearch_t_c++;
298 }
299
300 if (c == 1)
301 {
302 out += '<div id="tipue_search_results_count">' + tipuesearch_string_4;
303 }
304 else
305 {
306 var c_c = c.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
307 out += '<div id="tipue_search_results_count">' + c_c + ' ' + tipuesearch_string_5;
308 }
309 if (set.showTime)
310 {
311 var endTimer = new Date().getTime();
312 var time = (endTimer - startTimer) / 1000;
313 out += ' (' + time.toFixed(2) + ' ' + tipuesearch_string_14 + ')';
314 set.showTime = false;
315 }
316 out += '</div>';
317
318 if (set.showRelated && standard)
319 {
320 var ront = '';
321 f = 0;
322 for (var i = 0; i < tipuesearch_related.Related.length; i++)
323 {
324 if (d == tipuesearch_related.Related[i].search)
325 {
326 if (!f)
327 {
328 out += '<div class="tipue_search_related">' + tipuesearch_string_10 + ': ';
329 }
330 if (show_replace)
331 {
332 d_o = d;
333 }
334
335 if (tipuesearch_related.Related[i].include)
336 {
337 var r_d = d_o + ' ' + tipuesearch_related.Related[i].related;
338 }
339 else
340 {
341 var r_d = tipuesearch_related.Related[i].related;
342 }
343
344 ront += '<a class="tipue_search_related_btn" id="' + r_d + '">' + tipuesearch_related.Related[i].related + '</a>, ';
345 f++;
346 }
347 }
348 if (f)
349 {
350 ront = ront.slice(0, -2);
351 ront += '.</div>';
352 out += ront;
353 }
354 }
355
356 if (show_replace)
357 {
358 out += '<div id="tipue_search_replace">' + tipuesearch_string_2 + ' ' + d + '. ' + tipuesearch_string_3 + ' <a id="tipue_search_replaced">' + d_r + '</a></div>';
359 }
360
361 found.sort(function(a, b) { return b.score - a.score } );
362
363 var l_o = 0;
364
365 if (set.imageZoom)
366 {
367 out += '<div id="tipue_search_image_modal"><div class="tipue_search_image_close">&#10005;</div><div class="tipue_search_image_block"><a id="tipue_search_zoom_url"><img id="tipue_search_zoom_img"></a><div id="tipue_search_zoom_text"></div></div></div>';
368 }
369
370 for (var i = 0; i < found.length; i++)
371 {
372 if (l_o >= start && l_o < set.show + start)
373 {
374 out += '<div class="tipue_search_result">';
375
376 out += '<div class="tipue_search_content_title"><a href="' + found[i].url + '"' + tipue_search_w + '>' + found[i].title + '</a></div>';
377
378 if (set.debug)
379 {
380 out += '<div class="tipue_search_content_debug">Score: ' + found[i].score + '</div>';
381 }
382
383 if (set.showURL)
384 {
385 var s_u = found[i].url.toLowerCase();
386 if (s_u.indexOf('http://') == 0)
387 {
388 s_u = s_u.slice(7);
389 }
390 out += '<div class="tipue_search_content_url"><a href="' + found[i].url + '"' + tipue_search_w + '>' + s_u + '</a></div>';
391 }
392
393 if (found[i].img)
394 {
395 if (set.imageZoom)
396 {
397 out += '<div class="tipue_search_image"><img class="tipue_search_img tipue_search_image_zoom" src="' + found[i].img + '" alt="' + found[i].title + '" data-url="' + found[i].url + '"></div>';
398 }
399 else
400 {
401 out += '<div class="tipue_search_image"><a href="' + found[i].url + '"' + tipue_search_w + '><img class="tipue_search_img" src="' + found[i].img + '" alt="' + found[i].title + '"></a></div>';
402 }
403 }
404
405 if (found[i].desc)
406 {
407 var t = found[i].desc;
408
409 if (set.showContext)
410 {
411 d_w = d.split(' ');
412 var s_1 = found[i].desc.toLowerCase().indexOf(d_w[0]);
413 if (s_1 > set.contextStart)
414 {
415 var t_1 = t.substr(s_1 - set.contextBuffer);
416 var s_2 = t_1.indexOf(' ');
417 t_1 = t.substr(s_1 - set.contextBuffer + s_2);
418 t_1 = $.trim(t_1);
419
420 if (t_1.length > set.contextLength)
421 {
422 t = '... ' + t_1;
423 }
424 }
425 }
426
427 if (standard)
428 {
429 d_w = d.split(' ');
430 for (var f = 0; f < d_w.length; f++)
431 {
432 if (set.highlightTerms)
433 {
434 var patr = new RegExp('(' + d_w[f] + ')', 'gi');
435 t = t.replace(patr, "<h0011>$1<h0012>");
436 }
437 }
438 }
439 else if (set.highlightTerms)
440 {
441 var patr = new RegExp('(' + d + ')', 'gi');
442 t = t.replace(patr, "<span class=\"tipue_search_content_bold\">$1</span>");
443 }
444
445 var t_d = '';
446 var t_w = t.split(' ');
447 if (t_w.length < set.descriptiveWords)
448 {
449 t_d = t;
450 }
451 else
452 {
453 for (var f = 0; f < set.descriptiveWords; f++)
454 {
455 t_d += t_w[f] + ' ';
456 }
457 }
458 t_d = $.trim(t_d);
459 if (t_d.charAt(t_d.length - 1) != '.')
460 {
461 t_d += ' ...';
462 }
463
464 t_d = t_d.replace(/h0011/g, 'span class=\"tipue_search_content_bold\"');
465 t_d = t_d.replace(/h0012/g, '/span');
466
467 out += '<div class="tipue_search_content_text">' + t_d + '</div>';
468 }
469
470 if (found[i].note)
471 {
472 out += '<div class="tipue_search_note">' + found[i].note + '</div>';
473 }
474
475 out += '</div>';
476 }
477 l_o++;
478 }
479
480 if (c > set.show)
481 {
482 var pages = Math.ceil(c / set.show);
483 var page = (start / set.show);
484 if (set.footerPages < 3)
485 {
486 set.footerPages = 3;
487 }
488
489 out += '<div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';
490
491 if (start > 0)
492 {
493 out += '<li role="navigation"><a class="tipue_search_foot_box" accesskey="b" id="' + (start - set.show) + '_' + replace + '">' + tipuesearch_string_6 + '</a></li>';
494 }
495
496 if (page <= 2)
497 {
498 var p_b = pages;
499 if (pages > set.footerPages)
500 {
501 p_b = set.footerPages;
502 }
503 for (var f = 0; f < p_b; f++)
504 {
505 if (f == page)
506 {
507 out += '<li class="current" role="navigation">' + (f + 1) + '</li>';
508 }
509 else
510 {
511 out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
512 }
513 }
514 }
515 else
516 {
517 var p_b = page + set.footerPages - 1;
518 if (p_b > pages)
519 {
520 p_b = pages;
521 }
522 for (var f = page - 1; f < p_b; f++)
523 {
524 if (f == page)
525 {
526 out += '<li class="current" role="navigation">' + (f + 1) + '</li>';
527 }
528 else
529 {
530 out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
531 }
532 }
533 }
534
535 if (page + 1 != pages)
536 {
537 out += '<li role="navigation"><a class="tipue_search_foot_box" accesskey="m" id="' + (start + set.show) + '_' + replace + '">' + tipuesearch_string_7 + '</a></li>';
538 }
539
540 out += '</ul></div>';
541 }
542
543 }
544 else
545 {
546 out += '<div id="tipue_search_error">' + tipuesearch_string_8 + '</div>';
547 }
548 }
549 else
550 {
551 if (show_stop)
552 {
553 out += '<div id="tipue_search_error">' + tipuesearch_string_8 + ' ' + tipuesearch_string_9 + '</div>';
554 }
555 else
556 {
557 if (set.minimumLength == 1)
558 {
559 out += '<div id="tipue_search_error">' + tipuesearch_string_11 + '</div>';
560 }
561 else
562 {
563 out += '<div id="tipue_search_error">' + tipuesearch_string_12 + ' ' + set.minimumLength + ' ' + tipuesearch_string_13 + '</div>';
564 }
565 }
566 }
567
568 $('#tipue_search_content').hide().html(out).slideDown(200);
569
570 $('#tipue_search_replaced').click(function()
571 {
572 getTipueSearch(0, false);
573 });
574
575 $('.tipue_search_related_btn').click(function()
576 {
577 $('#tipue_search_input').val($(this).attr('id'));
578 getTipueSearch(0, true);
579 });
580
581 $('.tipue_search_image_zoom').click(function()
582 {
583 $('#tipue_search_image_modal').fadeIn(300);
584 $('#tipue_search_zoom_img').attr('src', this.src);
585
586 var z_u = $(this).attr('data-url');
587 $('#tipue_search_zoom_url').attr('href', z_u);
588
589 var z_o = this.alt + '<div class="tipue_search_zoom_options"><a href="' + this.src + '" target="_blank">' + tipuesearch_string_15 + '</a>&nbsp; <a href="' + z_u + '">' + tipuesearch_string_16 + '</a></div>';
590
591 $('#tipue_search_zoom_text').html(z_o);
592 });
593
594 $('.tipue_search_image_close').click(function()
595 {
596 $('#tipue_search_image_modal').fadeOut(300);
597 });
598
599 $('.tipue_search_foot_box').click(function()
600 {
601 var id_v = $(this).attr('id');
602 var id_a = id_v.split('_');
603
604 getTipueSearch(parseInt(id_a[0]), id_a[1]);
605 });
606 }
607
608 });
609 };
610
611})(jQuery);
diff --git a/plugins/localsearch/localsearch/files/assets/js/tipuesearch.min.js b/plugins/localsearch/localsearch/files/assets/js/tipuesearch.min.js
new file mode 100644
index 00000000..f50ef6ee
--- /dev/null
+++ b/plugins/localsearch/localsearch/files/assets/js/tipuesearch.min.js
@@ -0,0 +1,181 @@
1(function($){$.fn.tipuesearch=function(options){var set=$.extend({'contextBuffer':60,'contextLength':60,'contextStart':90,'debug':false,'descriptiveWords':25,'footerPages':3,'highlightTerms':true,'imageZoom':true,'minimumLength':3,'newWindow':false,'show':10,'showContext':true,'showRelated':true,'showTime':true,'showTitleCount':true,'showURL':true,'wholeWords':true},options);return this.each(function(){var tipuesearch_t_c=0;var tipue_search_w='';if(set.newWindow)
2{tipue_search_w=' target="_blank"';}
3function getURLP(name)
4{var locSearch=location.search;var splitted=(new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(locSearch)||[,""]);var searchString=splitted[1].replace(/\+/g,'%20');try
5{searchString=decodeURIComponent(searchString);}
6catch(e)
7{searchString=unescape(searchString);}
8return searchString||null;}
9if(getURLP('q'))
10{$('#tipue_search_input').val(getURLP('q'));getTipueSearch(0,true);}
11$(this).keyup(function(event)
12{if(event.keyCode=='13')
13{getTipueSearch(0,true);}});function getTipueSearch(start,replace)
14{window.scrollTo(0,0);var out='';var show_replace=false;var show_stop=false;var standard=true;var c=0;var found=[];var d_o=$('#tipue_search_input').val();d_o=d_o.replace(/\+/g,' ').replace(/\s\s+/g,' ');d_o=$.trim(d_o);var d=d_o.toLowerCase();if((d.match("^\"")&&d.match("\"$"))||(d.match("^'")&&d.match("'$")))
15{standard=false;}
16var d_w=d.split(' ');if(standard)
17{d='';for(var i=0;i<d_w.length;i++)
18{var a_w=true;for(var f=0;f<tipuesearch_stop_words.length;f++)
19{if(d_w[i]==tipuesearch_stop_words[f])
20{a_w=false;show_stop=true;}}
21if(a_w)
22{d=d+' '+d_w[i];}}
23d=$.trim(d);d_w=d.split(' ');}
24else
25{d=d.substring(1,d.length-1);}
26if(d.length>=set.minimumLength)
27{if(standard)
28{if(replace)
29{var d_r=d;for(var i=0;i<d_w.length;i++)
30{for(var f=0;f<tipuesearch_replace.words.length;f++)
31{if(d_w[i]==tipuesearch_replace.words[f].word)
32{d=d.replace(d_w[i],tipuesearch_replace.words[f].replace_with);show_replace=true;}}}
33d_w=d.split(' ');}
34var d_t=d;for(var i=0;i<d_w.length;i++)
35{for(var f=0;f<tipuesearch_stem.words.length;f++)
36{if(d_w[i]==tipuesearch_stem.words[f].word)
37{d_t=d_t+' '+tipuesearch_stem.words[f].stem;}}}
38d_w=d_t.split(' ');for(var i=0;i<tipuesearch.pages.length;i++)
39{var score=0;var s_t=tipuesearch.pages[i].text;for(var f=0;f<d_w.length;f++)
40{if(set.wholeWords)
41{var pat=new RegExp('\\b'+d_w[f]+'\\b','gi');}
42else
43{var pat=new RegExp(d_w[f],'gi');}
44if(tipuesearch.pages[i].title.search(pat)!=-1)
45{var m_c=tipuesearch.pages[i].title.match(pat).length;score+=(20*m_c);}
46if(tipuesearch.pages[i].text.search(pat)!=-1)
47{var m_c=tipuesearch.pages[i].text.match(pat).length;score+=(20*m_c);}
48if(tipuesearch.pages[i].tags)
49{if(tipuesearch.pages[i].tags.search(pat)!=-1)
50{var m_c=tipuesearch.pages[i].tags.match(pat).length;score+=(10*m_c);}}
51if(tipuesearch.pages[i].url.search(pat)!=-1)
52{score+=20;}
53if(score!=0)
54{for(var e=0;e<tipuesearch_weight.weight.length;e++)
55{if(tipuesearch.pages[i].url==tipuesearch_weight.weight[e].url)
56{score+=tipuesearch_weight.weight[e].score;}}}
57if(d_w[f].match('^-'))
58{pat=new RegExp(d_w[f].substring(1),'i');if(tipuesearch.pages[i].title.search(pat)!=-1||tipuesearch.pages[i].text.search(pat)!=-1||tipuesearch.pages[i].tags.search(pat)!=-1)
59{score=0;}}}
60if(score!=0)
61{found.push({"score":score,"title":tipuesearch.pages[i].title,"desc":s_t,"img":tipuesearch.pages[i].img,"url":tipuesearch.pages[i].url,"note":tipuesearch.pages[i].note});c++;}}}
62else
63{for(var i=0;i<tipuesearch.pages.length;i++)
64{var score=0;var s_t=tipuesearch.pages[i].text;var pat=new RegExp(d,'gi');if(tipuesearch.pages[i].title.search(pat)!=-1)
65{var m_c=tipuesearch.pages[i].title.match(pat).length;score+=(20*m_c);}
66if(tipuesearch.pages[i].text.search(pat)!=-1)
67{var m_c=tipuesearch.pages[i].text.match(pat).length;score+=(20*m_c);}
68if(tipuesearch.pages[i].tags)
69{if(tipuesearch.pages[i].tags.search(pat)!=-1)
70{var m_c=tipuesearch.pages[i].tags.match(pat).length;score+=(10*m_c);}}
71if(tipuesearch.pages[i].url.search(pat)!=-1)
72{score+=20;}
73if(score!=0)
74{for(var e=0;e<tipuesearch_weight.weight.length;e++)
75{if(tipuesearch.pages[i].url==tipuesearch_weight.weight[e].url)
76{score+=tipuesearch_weight.weight[e].score;}}}
77if(score!=0)
78{found.push({"score":score,"title":tipuesearch.pages[i].title,"desc":s_t,"img":tipuesearch.pages[i].img,"url":tipuesearch.pages[i].url,"note":tipuesearch.pages[i].note});c++;}}}
79if(c!=0)
80{if(set.showTitleCount&&tipuesearch_t_c==0)
81{var title=document.title;document.title='('+c+') '+title;tipuesearch_t_c++;}
82if(c==1)
83{out+='<div id="tipue_search_results_count">'+tipuesearch_string_4;}
84else
85{var c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='<div id="tipue_search_results_count">'+c_c+' '+tipuesearch_string_5;}
86if(set.showTime)
87{var endTimer=new Date().getTime();var time=(endTimer-startTimer)/ 1000;out+=' ('+time.toFixed(2)+' '+tipuesearch_string_14+')';set.showTime=false;}
88out+='</div>';if(set.showRelated&&standard)
89{var ront='';f=0;for(var i=0;i<tipuesearch_related.Related.length;i++)
90{if(d==tipuesearch_related.Related[i].search)
91{if(!f)
92{out+='<div class="tipue_search_related">'+tipuesearch_string_10+': ';}
93if(show_replace)
94{d_o=d;}
95if(tipuesearch_related.Related[i].include)
96{var r_d=d_o+' '+tipuesearch_related.Related[i].related;}
97else
98{var r_d=tipuesearch_related.Related[i].related;}
99ront+='<a class="tipue_search_related_btn" id="'+r_d+'">'+tipuesearch_related.Related[i].related+'</a>, ';f++;}}
100if(f)
101{ront=ront.slice(0,-2);ront+='.</div>';out+=ront;}}
102if(show_replace)
103{out+='<div id="tipue_search_replace">'+tipuesearch_string_2+' '+d+'. '+tipuesearch_string_3+' <a id="tipue_search_replaced">'+d_r+'</a></div>';}
104found.sort(function(a,b){return b.score-a.score});var l_o=0;if(set.imageZoom)
105{out+='<div id="tipue_search_image_modal"><div class="tipue_search_image_close">&#10005;</div><div class="tipue_search_image_block"><a id="tipue_search_zoom_url"><img id="tipue_search_zoom_img"></a><div id="tipue_search_zoom_text"></div></div></div>';}
106for(var i=0;i<found.length;i++)
107{if(l_o>=start&&l_o<set.show+start)
108{out+='<div class="tipue_search_result">';out+='<div class="tipue_search_content_title"><a href="'+found[i].url+'"'+tipue_search_w+'>'+found[i].title+'</a></div>';if(set.debug)
109{out+='<div class="tipue_search_content_debug">Score: '+found[i].score+'</div>';}
110if(set.showURL)
111{var s_u=found[i].url.toLowerCase();if(s_u.indexOf('http://')==0)
112{s_u=s_u.slice(7);}
113out+='<div class="tipue_search_content_url"><a href="'+found[i].url+'"'+tipue_search_w+'>'+s_u+'</a></div>';}
114if(found[i].img)
115{if(set.imageZoom)
116{out+='<div class="tipue_search_image"><img class="tipue_search_img tipue_search_image_zoom" src="'+found[i].img+'" alt="'+found[i].title+'" data-url="'+found[i].url+'"></div>';}
117else
118{out+='<div class="tipue_search_image"><a href="'+found[i].url+'"'+tipue_search_w+'><img class="tipue_search_img" src="'+found[i].img+'" alt="'+found[i].title+'"></a></div>';}}
119if(found[i].desc)
120{var t=found[i].desc;if(set.showContext)
121{d_w=d.split(' ');var s_1=found[i].desc.toLowerCase().indexOf(d_w[0]);if(s_1>set.contextStart)
122{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)
123{t='... '+t_1;}}}
124if(standard)
125{d_w=d.split(' ');for(var f=0;f<d_w.length;f++)
126{if(set.highlightTerms)
127{var patr=new RegExp('('+d_w[f]+')','gi');t=t.replace(patr,"<h0011>$1<h0012>");}}}
128else if(set.highlightTerms)
129{var patr=new RegExp('('+d+')','gi');t=t.replace(patr,"<span class=\"tipue_search_content_bold\">$1</span>");}
130var t_d='';var t_w=t.split(' ');if(t_w.length<set.descriptiveWords)
131{t_d=t;}
132else
133{for(var f=0;f<set.descriptiveWords;f++)
134{t_d+=t_w[f]+' ';}}
135t_d=$.trim(t_d);if(t_d.charAt(t_d.length-1)!='.')
136{t_d+=' ...';}
137t_d=t_d.replace(/h0011/g,'span class=\"tipue_search_content_bold\"');t_d=t_d.replace(/h0012/g,'/span');out+='<div class="tipue_search_content_text">'+t_d+'</div>';}
138if(found[i].note)
139{out+='<div class="tipue_search_note">'+found[i].note+'</div>';}
140out+='</div>';}
141l_o++;}
142if(c>set.show)
143{var pages=Math.ceil(c / set.show);var page=(start / set.show);if(set.footerPages<3)
144{set.footerPages=3;}
145out+='<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>';}
147if(page<=2)
148{var p_b=pages;if(pages>set.footerPages)
149{p_b=set.footerPages;}
150for(var f=0;f<p_b;f++)
151{if(f==page)
152{out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
153else
154{out+='<li role="navigation"><a class="tipue_search_foot_box" id="'+(f*set.show)+'_'+replace+'">'+(f+1)+'</a></li>';}}}
155else
156{var p_b=page+set.footerPages-1;if(p_b>pages)
157{p_b=pages;}
158for(var f=page-1;f<p_b;f++)
159{if(f==page)
160{out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
161else
162{out+='<li role="navigation"><a class="tipue_search_foot_box" id="'+(f*set.show)+'_'+replace+'">'+(f+1)+'</a></li>';}}}
163if(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>';}
165out+='</ul></div>';}}
166else
167{out+='<div id="tipue_search_error">'+tipuesearch_string_8+'</div>';}}
168else
169{if(show_stop)
170{out+='<div id="tipue_search_error">'+tipuesearch_string_8+' '+tipuesearch_string_9+'</div>';}
171else
172{if(set.minimumLength==1)
173{out+='<div id="tipue_search_error">'+tipuesearch_string_11+'</div>';}
174else
175{out+='<div id="tipue_search_error">'+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_btn').click(function()
178{$('#tipue_search_input').val($(this).attr('id'));getTipueSearch(0,true);});$('.tipue_search_image_zoom').click(function()
179{$('#tipue_search_image_modal').fadeIn(300);$('#tipue_search_zoom_img').attr('src',this.src);var z_u=$(this).attr('data-url');$('#tipue_search_zoom_url').attr('href',z_u);var z_o=this.alt+'<div class="tipue_search_zoom_options"><a href="'+this.src+'" target="_blank">'+tipuesearch_string_15+'</a>&nbsp; <a href="'+z_u+'">'+tipuesearch_string_16+'</a></div>';$('#tipue_search_zoom_text').html(z_o);});$('.tipue_search_image_close').click(function()
180{$('#tipue_search_image_modal').fadeOut(300);});$('.tipue_search_foot_box').click(function()
181{var id_v=$(this).attr('id');var id_a=id_v.split('_');getTipueSearch(parseInt(id_a[0]),id_a[1]);});}});};})(jQuery); \ No newline at end of file
diff --git a/plugins/localsearch/localsearch/files/assets/js/tipuesearch_set.js b/plugins/localsearch/localsearch/files/assets/js/tipuesearch_set.js
new file mode 100644
index 00000000..8475b5c0
--- /dev/null
+++ b/plugins/localsearch/localsearch/files/assets/js/tipuesearch_set.js
@@ -0,0 +1,84 @@
1
2/*
3Tipue Search 7.1
4Copyright (c) 2019 Tipue
5Tipue Search is released under the MIT License
6http://www.tipue.com/search
7*/
8
9
10/*
11Stop words
12Stop words list from http://www.ranks.nl/stopwords
13*/
14
15var tipuesearch_stop_words = ["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"];
16
17
18// Word replace
19
20var tipuesearch_replace = {'words': [
21 {'word': 'tipua', 'replace_with': 'tipue'},
22 {'word': 'javscript', 'replace_with': 'javascript'},
23 {'word': 'jqeury', 'replace_with': 'jquery'}
24]};
25
26
27// Weighting
28
29var tipuesearch_weight = {'weight': [
30 {'url': 'http://www.tipue.com', 'score': 60},
31 {'url': 'http://www.tipue.com/search', 'score': 60},
32 {'url': 'http://www.tipue.com/tipr', 'score': 30},
33 {'url': 'http://www.tipue.com/support', 'score': 20}
34]};
35
36
37// Illogical stemming
38
39var tipuesearch_stem = {'words': [
40 {'word': 'e-mail', 'stem': 'email'},
41 {'word': 'javascript', 'stem': 'jquery'},
42 {'word': 'javascript', 'stem': 'js'}
43]};
44
45
46// Related
47
48var tipuesearch_related = {'Related': [
49 {'search': 'tipue', 'related': 'Search', 'include': 1},
50 {'search': 'tipue', 'related': 'jQuery'},
51 {'search': 'tipue', 'related': 'Blog'},
52 {'search': 'tipue', 'related': 'Support'},
53 {'search': 'tipue search', 'related': 'Demo', 'include': 1},
54 {'search': 'tipue search', 'related': 'Support'}
55]};
56
57
58// Internal strings
59
60var tipuesearch_string_1 = 'No title';
61var tipuesearch_string_2 = 'Showing results for';
62var tipuesearch_string_3 = 'Search instead for';
63var tipuesearch_string_4 = '1 result';
64var tipuesearch_string_5 = 'results';
65var tipuesearch_string_6 = 'Prev';
66var tipuesearch_string_7 = 'Next';
67var tipuesearch_string_8 = 'Nothing found';
68var tipuesearch_string_9 = 'Common words are largely ignored';
69var tipuesearch_string_10 = 'Related';
70var tipuesearch_string_11 = 'Search should be one character or more';
71var tipuesearch_string_12 = 'Search should be';
72var tipuesearch_string_13 = 'characters or more';
73var tipuesearch_string_14 = 'seconds';
74var tipuesearch_string_15 = 'Open Image';
75var tipuesearch_string_16 = 'Goto Page';
76
77
78// Internals
79
80
81// Timer for showTime
82
83var startTimer = new Date().getTime();
84