-
Notifications
You must be signed in to change notification settings - Fork 0
/
tipuesearch_set.js
52 lines (43 loc) · 1.35 KB
/
tipuesearch_set.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Tipue Search 3.0.1
Copyright (c) 2013 Tipue
Tipue Search is released under the MIT License
http://www.tipue.com/search
*/
var tipuesearch_stop_words = ["and", "be", "by", "do", "for", "he", "how", "if", "is", "it", "my", "not", "of", "or", "the", "to", "up", "what", "when"];
var tipuesearch_replace = {"words": [
{"word": "tipua", replace_with: "tipue"},
{"word": "javscript", replace_with: "javascript"}
]};
var tipuesearch_stem = {"words": [
{"word": "e-mail", stem: "email"},
{"word": "javascript", stem: "script"},
{"word": "javascript", stem: "js"}
]};
var tipuesearch_pages;
exclude_pages = ['/archives.html', '/tags.html', '/index.html', '/categories.html', '/search.html'];
function showGetResult()
{
var result = new Array();
var scriptUrl = 'sitemap.xml';
$.ajax({
url: scriptUrl,
type: 'GET',
dataType: 'xml',
async: false,
success: function(xml) {
$(xml).find('url').each(function(){
var loc = $(this).find('loc').text();
if ($.inArray(loc, exclude_pages) < 0) {
result.push(loc);
}
});
},
error: function() {
alert('An error occurred while processing XML file.');
}
});
return result;
}
var r = showGetResult();
tipuesearch_pages = r;