remove algolia from css and vendor stuff

This commit is contained in:
2017-12-29 14:19:22 +01:00
parent d726e15ed8
commit 04684c5f65
8 changed files with 21 additions and 23 deletions

View File

@@ -108,8 +108,7 @@ var elasticSearcher = (function() {
var elasticSearch = (function($, url) {
console.log(url);
return function findMatches(q, cb, async){
return function findMatches(q, cb, async){
if (!cb) { return; }
$.fn.getSearch(q, cb, async, url);
};
@@ -133,7 +132,7 @@ var elasticSearch = (function($, url) {
newhits = hits.map(function(hit){
return hit._source;
});
cb(newhits.slice(0));
//cb(newhits.slice(0));
async(newhits.slice(0));
});
};
@@ -151,7 +150,8 @@ $(document).ready(function() {
source: elasticSearch($),
async: true,
displayKey: 'name',
limit: 10,
limit: 9, // Above 10 it stops working from
// some magic reason
minLength: 0,
templates: {
suggestion: function(hit) {
@@ -193,7 +193,7 @@ $(document).ready(function() {
$('.search-site-result.advanced, .search-icon').on('click', function(e){
e.stopPropagation();
e.preventDefault();
window.location.href = '/search#q='+ $("#cloud-search").val() + '&page=1';
window.location.href = '/search?q='+ $("#cloud-search").val() + '&page=1';
});
@@ -224,7 +224,7 @@ $(document).ready(function() {
searchInput.bind('typeahead:render', function(event, suggestions, async, dataset) {
if( suggestions != undefined && $('.tt-all-results').length <= 0){
$('.tt-dataset').append(
'<a id="search-advanced" href="/search#q='+ $("#cloud-search").val() + '&page=1" class="search-site-result advanced tt-suggestion">' +
'<a id="search-advanced" href="/search?q='+ $("#cloud-search").val() + '&page=1" class="search-site-result advanced tt-suggestion">' +
'<div class="search-hit">' +
'<div class="search-hit-thumbnail">' +
'<div class="search-hit-thumbnail-icon">' +

View File

@@ -111,7 +111,7 @@ ul.sharing-users-list
color: $color-text-dark-secondary
padding-bottom: 10px
.algolia-autocomplete
.search-autocomplete
position: relative
width: 100%
&:before
@@ -124,16 +124,16 @@ ul.sharing-users-list
z-index: 1
color: $color-text-dark-secondary
.algolia-autocomplete .aa-input
.search-autocomplete .aa-input
padding-left: 35px
width: 100%
.algolia-autocomplete .aa-hint
.search-autocomplete .aa-hint
width: 100%
color: $color-text-dark-hint
.algolia-autocomplete .aa-dropdown-menu
.search-autocomplete .aa-dropdown-menu
width: 100%
background-color: white
border: 1px solid $color-text-dark-hint
@@ -142,16 +142,16 @@ ul.sharing-users-list
border-bottom-right-radius: 3px
box-shadow: 0 15px 30px rgba(black, .1)
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion
.search-autocomplete .aa-dropdown-menu .aa-suggestion
cursor: pointer
padding: 5px 4px
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor,
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor em
.search-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor,
.search-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor em
background-color: $color-primary
color: white
.algolia-autocomplete .aa-dropdown-menu .aa-suggestion em
.search-autocomplete .aa-dropdown-menu .aa-suggestion em
font-style: normal
color: $color-primary

View File

@@ -31,12 +31,9 @@ html(lang="en")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery-3.1.0.min.js')}}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.typeahead-0.11.1.min.js')}}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/algoliasearch-3.19.0.min.js')}}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/js.cookie-2.0.3.min.js')}}")
script.
var algolia = algoliasearch("{{config['ALGOLIA_USER']}}", "{{config['ALGOLIA_PUBLIC_KEY']}}");
var algoliaIndex = algolia.initIndex("{{config['ALGOLIA_INDEX_NODES']}}");
!function(e){"use strict";e.loadCSS=function(t,n,o){var r,i=e.document,l=i.createElement("link");if(n)r=n;else{var d=(i.body||i.getElementsByTagName("head")[0]).childNodes;r=d[d.length-1]}var a=i.styleSheets;l.rel="stylesheet",l.href=t,l.media="only x",r.parentNode.insertBefore(l,n?r:r.nextSibling);var f=function(e){for(var t=l.href,n=a.length;n--;)if(a[n].href===t)return e();setTimeout(function(){f(e)})};return l.onloadcssdefined=f,f(function(){l.media=o||"all"}),l},"undefined"!=typeof module&&(module.exports=e.loadCSS)}(this);

View File

@@ -180,9 +180,8 @@ script().
FACET_CONFIG.push({ name: 'project._id', title: 'Project', disjunctive: false, hidden: true, value: '{{project._id}}' })
{% endif %}
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/algoliasearch.helper.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/hogan.common-3.0.0.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/algolia_search.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/elasticsearch.min.js') }}")
script(type="text/javascript").

View File

@@ -74,7 +74,6 @@ meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/ba
| {% block footer_scripts %}
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.typeahead-0.11.1.min.js')}}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/algoliasearch-3.19.0.min.js')}}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.autocomplete-0.22.0.min.js') }}", async=true)
script.

View File

@@ -94,10 +94,8 @@ script(type="text/template", id="stats-template")
| {% block footer_scripts %}
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/algoliasearch-3.19.0.min.js')}}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/algoliasearch.helper.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/hogan.common-3.0.0.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/algolia_search.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/elasticsearch.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.select2.min.js') }}")
script(type="text/javascript").