diff options
author | Cqoicebordel <Cqoicebordel@users.noreply.github.com> | 2015-02-17 01:07:14 +0100 |
---|---|---|
committer | Cqoicebordel <Cqoicebordel@users.noreply.github.com> | 2015-02-17 01:07:14 +0100 |
commit | e181041f11f612937299d440ccb090d3a78cf740 (patch) | |
tree | 6cbd329785ac90ecec5787c1bc3bc0cae1afd733 /searx/templates | |
parent | d740e7384a95c6a7d80e5f492f4dd7edb312175e (diff) | |
download | searxng-e181041f11f612937299d440ccb090d3a78cf740.tar.gz searxng-e181041f11f612937299d440ccb090d3a78cf740.zip |
Ajax loading + Tweaks of CSS
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/pix-art/base.html | 6 | ||||
-rw-r--r-- | searx/templates/pix-art/result_templates/default.html | 9 | ||||
-rw-r--r-- | searx/templates/pix-art/results.html | 40 | ||||
-rw-r--r-- | searx/templates/pix-art/search.html | 2 |
4 files changed, 22 insertions, 35 deletions
diff --git a/searx/templates/pix-art/base.html b/searx/templates/pix-art/base.html index 2a3870e58..f98d617fb 100644 --- a/searx/templates/pix-art/base.html +++ b/searx/templates/pix-art/base.html @@ -14,6 +14,9 @@ {% block meta %}{% endblock %} {% block head %} {% endblock %} + <script type="text/javascript"> + var favicons = [[]]; + </script> </head> <body> <div id="container"> @@ -23,6 +26,9 @@ searx = {}; </script> <script src="{{ url_for('static', filename='js/searx.js') }}" ></script> + <script type="text/javascript"> + load_images(1); + </script> </div> </body> </html> diff --git a/searx/templates/pix-art/result_templates/default.html b/searx/templates/pix-art/result_templates/default.html index b9cbca342..60ff502c8 100644 --- a/searx/templates/pix-art/result_templates/default.html +++ b/searx/templates/pix-art/result_templates/default.html @@ -2,12 +2,5 @@ <canvas id="canvas-{{ pageno }}-{{ index }}" class="icon" width="16" height="16"></canvas> </a> <script type="text/javascript"> -var img{{ pageno }}_{{ index }} = new Image(); -img{{ pageno }}_{{ index }}.src = 'http://{{ result.url | extract_domain }}/favicon.ico'; - -img{{ pageno }}_{{ index }}.onload = function () { - var can{{ pageno }}_{{ index }} = document.getElementById('canvas-{{ pageno }}-{{ index }}'); - var ctx = can{{ pageno }}_{{ index }}.getContext("2d"); - ctx.drawImage(img{{ pageno }}_{{ index }}, 0, 0, 16, 16); -}; +favicons[{{ pageno }}][{{ index }}] = 'http://{{ result.url | extract_domain }}/favicon.ico'; </script>
\ No newline at end of file diff --git a/searx/templates/pix-art/results.html b/searx/templates/pix-art/results.html index b01b7cb09..9385b608a 100644 --- a/searx/templates/pix-art/results.html +++ b/searx/templates/pix-art/results.html @@ -1,44 +1,32 @@ +{% if pageno > 1 %} + {% for result in results %} + {% set index = loop.index %} + {% include 'pix-art/result_templates/default.html' %} + {% endfor %} +{% else %} {% extends "pix-art/base.html" %} {% block title %}{{ q }} - {% endblock %} {% block meta %}{% endblock %} {% block content %} +<div id="logo"><a href="./"><img src="{{ url_for('static', filename='img/searx-pixel-small.png') }}" alt="Searx Logo"/></a></div> <div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div> <div class="small search center"> {% include 'pix-art/search.html' %} </div> +<script type="text/javascript"> + favicons[{{ pageno }}] = []; +</script> <div id="results"> + <span id="results_list"> {% for result in results %} {% set index = loop.index %} {% include 'pix-art/result_templates/default.html' %} {% endfor %} - - {% if paging %} + </span> <div id="pagination"> - {% if pageno > 1 %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> - <div class="{% if rtl %}right{% else %}left{% endif %}"> - <input type="hidden" name="q" value="{{ q }}" /> - {% for category in selected_categories %} - <input type="hidden" name="category_{{ category }}" value="1"/> - {% endfor %} - <input type="hidden" name="pageno" value="{{ pageno-1 }}" /> - <input type="submit" value="<< {{ _('previous page') }}" /> - </div> - </form> - {% endif %} - <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> - <div class="{% if rtl %}left{% else %}right{% endif %}"> - {% for category in selected_categories %} - <input type="hidden" name="category_{{ category }}" value="1"/> - {% endfor %} - <input type="hidden" name="q" value="{{ q }}" /> - <input type="hidden" name="pageno" value="{{ pageno+1 }}" /> - <input type="submit" value="{{ _('next page') }} >>" /> - </div> - </form> - <br /> + <input type="button" onclick="load_more('{{ q }}', {{ pageno+1 }})" id="load_more" value="{{ _('Load more...') }}" /> </div> - {% endif %} </div> {% endblock %} +{% endif %}
\ No newline at end of file diff --git a/searx/templates/pix-art/search.html b/searx/templates/pix-art/search.html index 678ab11ed..4d129ec68 100644 --- a/searx/templates/pix-art/search.html +++ b/searx/templates/pix-art/search.html @@ -1,7 +1,7 @@ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> <div id="search_wrapper"> <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" size="100" {% if q %}value="{{ q }}"{% endif %}/> - <input type="submit" value="search" id="search_submit" /> + <input type="submit" value="" id="search_submit" /> {% for category in categories %} <input type="hidden" name="category_{{ category }}" value="1"/> {% endfor %} |