]> gitweb @ CieloNegro.org - Rakka.git/blob - js/search.js
preparation for page search
[Rakka.git] / js / search.js
1 (function () {
2
3     $(document).ready(function () {
4         $("input.searchField")
5             .val("Search")
6             .removeClass("activeField")
7             .addClass("inactiveField")
8             .focus(function () {
9                 if ($(this).attr("class").indexOf("inactiveField")) {
10                     $(this)
11                         .val("")
12                         .removeClass("inactiveField")
13                         .addClass("activeField");
14                 }
15             })
16             .keypress(function (e) {
17                 if (e.which == 10 || e.which == 13) {
18                     window.location = Rakka.baseURI + "search.html?q=" + encodeURI($(this).val());
19                 }
20             });
21     });
22
23 })();