Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pelican-bootstrap3: Fix tipue search/upgrade to Tipue 7.0 #636

Merged
merged 3 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pelican-bootstrap3/static/js/jquery.min.js

Large diffs are not rendered by default.

Binary file removed pelican-bootstrap3/static/tipuesearch/img/search.png
Binary file not shown.
404 changes: 282 additions & 122 deletions pelican-bootstrap3/static/tipuesearch/tipuesearch.css

Large diffs are not rendered by default.

416 changes: 252 additions & 164 deletions pelican-bootstrap3/static/tipuesearch/tipuesearch.js

Large diffs are not rendered by default.

180 changes: 103 additions & 77 deletions pelican-bootstrap3/static/tipuesearch/tipuesearch.min.js

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions pelican-bootstrap3/static/tipuesearch/tipuesearch_content.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 41 additions & 16 deletions pelican-bootstrap3/static/tipuesearch/tipuesearch_set.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/*
Tipue Search 5.0
Copyright (c) 2015 Tipue
Tipue Search 7.0
Copyright (c) 2018 Tipue
Tipue Search is released under the MIT License
http://www.tipue.com/search
*/
Expand All @@ -12,13 +12,13 @@ Stop words
Stop words list from http://www.ranks.nl/stopwords
*/

var 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"];
var tipuesearch_stop_words = ["a", "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"];


// Word replace

var tipuesearch_replace = {'words': [
{'word': 'tipua', 'replace_with': 'tipue'},
{'word': 'tip', 'replace_with': 'tipue'},
{'word': 'javscript', 'replace_with': 'javascript'},
{'word': 'jqeury', 'replace_with': 'jquery'}
]};
Expand All @@ -27,13 +27,14 @@ var tipuesearch_replace = {'words': [
// Weighting

var tipuesearch_weight = {'weight': [
{'url': 'http://www.tipue.com', 'score': 200},
{'url': 'http://www.tipue.com/search', 'score': 100},
{'url': 'http://www.tipue.com/about', 'score': 100}
{'url': 'http://www.tipue.com', 'score': 60},
{'url': 'http://www.tipue.com/search', 'score': 60},
{'url': 'http://www.tipue.com/tipr', 'score': 30},
{'url': 'http://www.tipue.com/support', 'score': 20}
]};


// Stemming
// Illogical stemming

var tipuesearch_stem = {'words': [
{'word': 'e-mail', 'stem': 'email'},
Expand All @@ -42,18 +43,42 @@ var tipuesearch_stem = {'words': [
]};


// Related

var tipuesearch_related = {'Related': [
{'search': 'tipue', 'related': 'Search', 'include': 1},
{'search': 'tipue', 'related': 'jQuery'},
{'search': 'tipue', 'related': 'Features'},
{'search': 'tipue', 'related': 'Support'},
{'search': 'tipue search', 'related': 'Help', 'include': 1},
{'search': 'tipue search', 'related': 'Support'}
]};


// Internal strings

var tipuesearch_string_1 = 'No title';
var tipuesearch_string_2 = 'Showing results for';
var tipuesearch_string_3 = 'Search instead for';
var tipuesearch_string_4 = '1 result';
var tipuesearch_string_5 = 'results';
var tipuesearch_string_6 = 'Prev';
var tipuesearch_string_7 = 'Next';
var tipuesearch_string_8 = 'Nothing found';
var tipuesearch_string_9 = 'Common words are largely ignored';
var tipuesearch_string_10 = 'Search too short';
var tipuesearch_string_11 = 'Should be one character or more';
var tipuesearch_string_12 = 'Should be';
var tipuesearch_string_13 = 'characters or more';
var tipuesearch_string_6 = '<';
var tipuesearch_string_7 = '>';
var tipuesearch_string_8 = 'Nothing found.';
var tipuesearch_string_9 = 'Common words are largely ignored.';
var tipuesearch_string_10 = 'Related';
var tipuesearch_string_11 = 'Search too short. Should be one character or more.';
var tipuesearch_string_12 = 'Search too short. Should be';
var tipuesearch_string_13 = 'characters or more.';
var tipuesearch_string_14 = 'seconds';
var tipuesearch_string_15 = 'Open Image';
var tipuesearch_string_16 = 'Goto Page';


// Internals


// Timer for showTime

var startTimer = new Date().getTime();

5 changes: 2 additions & 3 deletions pelican-bootstrap3/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
{% if 'assets' in PLUGINS %}
{% include 'includes/minify_tipuesearch.html' with context %}
{% else %}
<script src="{{ SITEURL }}/tipuesearch_content.js"></script>
<script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch_set.js"></script>
<script type="text/javascript" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
{% endif %}
<script>
$(document).ready(function() {
$('#tipue_search_input').tipuesearch({
'mode' : 'json',
'show': 10,
'newWindow': false,
'contentLocation': 'tipuesearch_content.json'
'newWindow': false
});
});
</script>
Expand Down