tipuesearch_set.js 1.3 KB

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