diff options
author | yvesf <yvesf-git@xapek.org> | 2010-11-26 19:04:25 +0100 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2010-11-26 19:04:25 +0100 |
commit | 9122cfed447a643a8c383be5558fd82fc3be7cc7 (patch) | |
tree | de4711d4bddc99815726356b136926e2d7e9714d /templates | |
parent | 06b3f727378323089ee56a24999dd97c87887cc0 (diff) | |
download | booksearch-9122cfed447a643a8c383be5558fd82fc3be7cc7.tar.gz booksearch-9122cfed447a643a8c383be5558fd82fc3be7cc7.zip |
prettify
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_base.html | 32 | ||||
-rw-r--r-- | templates/search.html | 23 |
2 files changed, 35 insertions, 20 deletions
diff --git a/templates/_base.html b/templates/_base.html index ba9e8f2..d6d2010 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -3,30 +3,36 @@ <head> {% block head %} <link type="text/css" href="{{ url_for("static", filename="style.css") }}" rel="stylesheet" /> - <link type="text/css" href="{{ url_for("static", filename="css/ui-lightness/jquery-ui-1.8.6.custom.css") }}"rel="Stylesheet" /> + <link type="text/css" href="{{ url_for("static", filename="css/smoothness/jquery-ui-1.8.6.custom.css") }}"rel="Stylesheet" /> <script type="text/javascript" src="{{ url_for("static", filename="js/jquery-1.4.2.min.js") }}"></script> <script type="text/javascript" src="{{ url_for("static", filename="js/jquery-ui-1.8.6.custom.min.js") }}"></script> <title>{% block title %}{% endblock %} - booksearch</title> <script> - function start() { - var inputField = document.getElementById("searchInput"); - window.location = "{{ url_for("do_search") }}" + inputField.value; - return false; - } + jQuery(document).ready(function() { + function start() { + var inputField = document.getElementById("searchInput"); + window.location = "{{ url_for("do_search") }}" + inputField.value; + return false; + } + jQuery("#searchInput").bind('keyup', function(evt) { + if (evt.which == 13) + start(); + }); + jQuery("#searchSubmit").click(start); + }); </script> {% block javascript %}{% endblock %} {% endblock %} </head> <body> <div id="header"> - booksearch + <img title="A book is a loaded gun" src="{{ url_for("static", filename="logo.png") }}"/> + <div id="search"> + <input id="searchInput" type="text" value="{% block searchValue %}{% endblock %}" placeholder="terms..." size=40/> + <button id="searchSubmit">Senden</button> + </div> </div> - <div id="search"> - <span class="preSearchField">Search:</span> - <input id="searchInput" type="text" value="{% block searchValue %}{% endblock %}" placeholder="terms..." /> - <button onclick="start()">Senden</button> - </div> - <hr /> + <hr style="clear: both;"/> <div id="content"> {% block content %}{% endblock %} </div> diff --git a/templates/search.html b/templates/search.html index dc4cfe8..adbd92d 100644 --- a/templates/search.html +++ b/templates/search.html @@ -18,17 +18,22 @@ ui.newContent.children("div.excerpt").html(data); } ); - /* update image preview */ var frontpage = jQuery(this).parent().parent().find("img.frontpage"); - frontpage.attr('src', "{{ url_for("static", filename="ajax-loader.gif") }}"); + var loader = jQuery(this).parent().parent().find("div.loader"); + frontpage.attr('src', "{{ url_for("do_page_image",docnum=-9999) }}".replace("-9999", docnum)); + frontpage.hide(); + loader.show() frontpage.load(function() { - frontpage.attr('src', "{{ url_for("do_page_image",docnum=-9999) }}".replace("-9999", docnum)); + loader.hide(); + frontpage.show(); }); - - /* scroll image preview */ - var offset = ui.newHeader[0].offsetTop - frontpage.parent()[0].offsetTop; - frontpage.parent().css({paddingTop: offset+"px"}); + }); + acc.bind('accordionchange', function(event, ui) { + /* align image preview to current match */ + var frontpage = jQuery(this).parent().parent().find("img.frontpage"); + var offset = ui.newHeader[0].offsetTop - frontpage.parent()[0].offsetTop; + frontpage.parent().animate({paddingTop: offset}); }); }); </script> @@ -51,6 +56,10 @@ <div class="book"> <div class="c_frontpage"> <img class="frontpage" src="{{ url_for("do_book_frontpage", docnum=docnum) }}"/> + <div class="loader"> + <img class="ajaxLoader" src="{{ url_for("static", filename="ajax-loader.gif") }}"/> + Loading.. + </div> </div> <div class="description"> filename, creationtime, indexed-time, +any pdf metadata |