+ implement the suggestion in kiwix-serve

This commit is contained in:
kelson42 2012-08-13 23:37:51 +00:00
parent d37e2355f8
commit c55de68072
2 changed files with 93 additions and 35 deletions

View File

@ -21171,39 +21171,65 @@ const unsigned char server_home_html_tmpl[]={
};
const unsigned char server_taskbar_html_part[]={
0x3c,0x73,0x70,0x61,0x6e,0x20,0x69,0x64,0x3d,0x22,0x6b,0x69,0x77,0x69,0x78,0x74,
0x6f,0x6f,0x6c,0x62,0x61,0x72,0x22,0x20,0x63,0x6c,0x61,0x73,0x73,0x3d,0x22,0x75,
0x69,0x2d,0x77,0x69,0x64,0x67,0x65,0x74,0x2d,0x68,0x65,0x61,0x64,0x65,0x72,0x20,
0x75,0x69,0x2d,0x63,0x6f,0x72,0x6e,0x65,0x72,0x2d,0x61,0x6c,0x6c,0x22,0x3e,0x0a,
0x20,0x20,0x3c,0x62,0x75,0x74,0x74,0x6f,0x6e,0x20,0x69,0x64,0x3d,0x22,0x6b,0x69,
0x77,0x69,0x78,0x6c,0x69,0x62,0x72,0x61,0x72,0x79,0x22,0x20,0x6f,0x6e,0x63,0x6c,
0x69,0x63,0x6b,0x3d,0x22,0x77,0x69,0x6e,0x64,0x6f,0x77,0x2e,0x6c,0x6f,0x63,0x61,
0x74,0x69,0x6f,0x6e,0x2e,0x68,0x72,0x65,0x66,0x3d,0x27,0x2f,0x27,0x3b,0x22,0x3e,
0x4c,0x69,0x62,0x72,0x61,0x72,0x79,0x3c,0x2f,0x62,0x75,0x74,0x74,0x6f,0x6e,0x3e,
0x0a,0x20,0x20,0x3c,0x62,0x75,0x74,0x74,0x6f,0x6e,0x20,0x69,0x64,0x3d,0x22,0x6b,
0x69,0x77,0x69,0x78,0x68,0x6f,0x6d,0x65,0x22,0x20,0x6f,0x6e,0x63,0x6c,0x69,0x63,
0x6b,0x3d,0x22,0x77,0x69,0x6e,0x64,0x6f,0x77,0x2e,0x6c,0x6f,0x63,0x61,0x74,0x69,
0x6f,0x6e,0x2e,0x68,0x72,0x65,0x66,0x3d,0x27,0x2f,0x5f,0x5f,0x43,0x4f,0x4e,0x54,
0x45,0x4e,0x54,0x5f,0x5f,0x2f,0x27,0x3b,0x22,0x3e,0x48,0x6f,0x6d,0x65,0x3c,0x2f,
0x62,0x75,0x74,0x74,0x6f,0x6e,0x3e,0x0a,0x20,0x20,0x3c,0x66,0x6f,0x72,0x6d,0x20,
0x6d,0x65,0x74,0x68,0x6f,0x64,0x3d,0x22,0x47,0x45,0x54,0x22,0x20,0x61,0x63,0x74,
0x69,0x6f,0x6e,0x3d,0x22,0x2f,0x73,0x65,0x61,0x72,0x63,0x68,0x22,0x20,0x2f,0x3e,
0x0a,0x20,0x20,0x20,0x20,0x3c,0x69,0x6e,0x70,0x75,0x74,0x20,0x74,0x79,0x70,0x65,
0x3d,0x22,0x73,0x75,0x62,0x6d,0x69,0x74,0x22,0x20,0x69,0x64,0x3d,0x22,0x6b,0x69,
0x77,0x69,0x78,0x73,0x65,0x61,0x72,0x63,0x68,0x22,0x20,0x76,0x61,0x6c,0x75,0x65,
0x3d,0x22,0x53,0x65,0x61,0x72,0x63,0x68,0x22,0x20,0x2f,0x3e,0x0a,0x20,0x20,0x20,
0x20,0x3c,0x69,0x6e,0x70,0x75,0x74,0x20,0x69,0x64,0x3d,0x22,0x6b,0x69,0x77,0x69,
0x78,0x73,0x65,0x61,0x72,0x63,0x68,0x62,0x6f,0x78,0x22,0x20,0x74,0x79,0x70,0x65,
0x3d,0x22,0x74,0x65,0x78,0x74,0x62,0x6f,0x78,0x22,0x20,0x6e,0x61,0x6d,0x65,0x3d,
0x22,0x70,0x61,0x74,0x74,0x65,0x72,0x6e,0x22,0x20,0x2f,0x3e,0x0a,0x20,0x20,0x20,
0x20,0x3c,0x69,0x6e,0x70,0x75,0x74,0x20,0x74,0x79,0x70,0x65,0x3d,0x22,0x68,0x69,
0x64,0x64,0x65,0x6e,0x22,0x20,0x6e,0x61,0x6d,0x65,0x3d,0x22,0x63,0x6f,0x6e,0x74,
0x65,0x6e,0x74,0x22,0x20,0x76,0x61,0x6c,0x75,0x65,0x3d,0x22,0x5f,0x5f,0x43,0x4f,
0x4e,0x54,0x45,0x4e,0x54,0x5f,0x5f,0x22,0x20,0x2f,0x3e,0x0a,0x20,0x20,0x3c,0x2f,
0x66,0x6f,0x72,0x6d,0x3e,0x0a,0x3c,0x2f,0x73,0x70,0x61,0x6e,0x3e,0x0a,0x3c,0x64,
0x69,0x76,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x64,0x69,0x73,0x70,0x6c,0x61,
0x79,0x3a,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x3b,0x20,0x68,0x65,0x69,0x67,0x68,0x74,
0x3a,0x20,0x34,0x30,0x70,0x78,0x3b,0x22,0x3e,0x3c,0x2f,0x64,0x69,0x76,0x3e,0x0a
0x3c,0x73,0x63,0x72,0x69,0x70,0x74,0x3e,0x0a,0x20,0x20,0x24,0x28,0x66,0x75,0x6e,
0x63,0x74,0x69,0x6f,0x6e,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,
0x61,0x76,0x61,0x69,0x6c,0x61,0x62,0x6c,0x65,0x54,0x61,0x67,0x73,0x20,0x3d,0x20,
0x5b,0x0a,0x20,0x20,0x22,0x41,0x63,0x74,0x69,0x6f,0x6e,0x53,0x63,0x72,0x69,0x70,
0x74,0x22,0x2c,0x0a,0x20,0x20,0x22,0x41,0x70,0x70,0x6c,0x65,0x53,0x63,0x72,0x69,
0x70,0x74,0x22,0x2c,0x0a,0x20,0x20,0x22,0x41,0x73,0x70,0x22,0x2c,0x0a,0x20,0x20,
0x22,0x42,0x41,0x53,0x49,0x43,0x22,0x2c,0x0a,0x20,0x20,0x22,0x43,0x22,0x2c,0x0a,
0x20,0x20,0x22,0x43,0x2b,0x2b,0x22,0x2c,0x0a,0x20,0x20,0x22,0x43,0x6c,0x6f,0x6a,
0x75,0x72,0x65,0x22,0x2c,0x0a,0x20,0x20,0x22,0x43,0x4f,0x42,0x4f,0x4c,0x22,0x2c,
0x0a,0x20,0x20,0x22,0x43,0x6f,0x6c,0x64,0x46,0x75,0x73,0x69,0x6f,0x6e,0x22,0x2c,
0x0a,0x20,0x20,0x22,0x45,0x72,0x6c,0x61,0x6e,0x67,0x22,0x2c,0x0a,0x20,0x20,0x22,
0x46,0x6f,0x72,0x74,0x72,0x61,0x6e,0x22,0x2c,0x0a,0x20,0x20,0x22,0x47,0x72,0x6f,
0x6f,0x76,0x79,0x22,0x2c,0x0a,0x20,0x20,0x22,0x48,0x61,0x73,0x6b,0x65,0x6c,0x6c,
0x22,0x2c,0x0a,0x20,0x20,0x22,0x4a,0x61,0x76,0x61,0x22,0x2c,0x0a,0x20,0x20,0x22,
0x4a,0x61,0x76,0x61,0x53,0x63,0x72,0x69,0x70,0x74,0x22,0x2c,0x0a,0x20,0x20,0x22,
0x4c,0x69,0x73,0x70,0x22,0x2c,0x0a,0x20,0x20,0x22,0x50,0x65,0x72,0x6c,0x22,0x2c,
0x0a,0x20,0x20,0x22,0x50,0x48,0x50,0x22,0x2c,0x0a,0x20,0x20,0x22,0x50,0x79,0x74,
0x68,0x6f,0x6e,0x22,0x2c,0x0a,0x20,0x20,0x22,0x52,0x75,0x62,0x79,0x22,0x2c,0x0a,
0x20,0x20,0x22,0x53,0x63,0x61,0x6c,0x61,0x22,0x2c,0x0a,0x20,0x20,0x22,0x53,0x63,
0x68,0x65,0x6d,0x65,0x22,0x0a,0x20,0x20,0x5d,0x3b,0x0a,0x20,0x20,0x24,0x28,0x20,
0x22,0x23,0x6b,0x69,0x77,0x69,0x78,0x73,0x65,0x61,0x72,0x63,0x68,0x62,0x6f,0x78,
0x22,0x20,0x29,0x2e,0x61,0x75,0x74,0x6f,0x63,0x6f,0x6d,0x70,0x6c,0x65,0x74,0x65,
0x28,0x7b,0x0a,0x20,0x20,0x73,0x6f,0x75,0x72,0x63,0x65,0x3a,0x20,0x22,0x2f,0x73,
0x75,0x67,0x67,0x65,0x73,0x74,0x3f,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x3d,0x5f,
0x5f,0x43,0x4f,0x4e,0x54,0x45,0x4e,0x54,0x5f,0x5f,0x22,0x0a,0x20,0x20,0x7d,0x29,
0x3b,0x0a,0x20,0x20,0x7d,0x29,0x3b,0x0a,0x3c,0x2f,0x73,0x63,0x72,0x69,0x70,0x74,
0x3e,0x0a,0x0a,0x3c,0x73,0x70,0x61,0x6e,0x20,0x69,0x64,0x3d,0x22,0x6b,0x69,0x77,
0x69,0x78,0x74,0x6f,0x6f,0x6c,0x62,0x61,0x72,0x22,0x20,0x63,0x6c,0x61,0x73,0x73,
0x3d,0x22,0x75,0x69,0x2d,0x77,0x69,0x64,0x67,0x65,0x74,0x2d,0x68,0x65,0x61,0x64,
0x65,0x72,0x20,0x75,0x69,0x2d,0x63,0x6f,0x72,0x6e,0x65,0x72,0x2d,0x61,0x6c,0x6c,
0x22,0x3e,0x0a,0x20,0x20,0x3c,0x62,0x75,0x74,0x74,0x6f,0x6e,0x20,0x69,0x64,0x3d,
0x22,0x6b,0x69,0x77,0x69,0x78,0x6c,0x69,0x62,0x72,0x61,0x72,0x79,0x22,0x20,0x6f,
0x6e,0x63,0x6c,0x69,0x63,0x6b,0x3d,0x22,0x77,0x69,0x6e,0x64,0x6f,0x77,0x2e,0x6c,
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x2e,0x68,0x72,0x65,0x66,0x3d,0x27,0x2f,0x27,
0x3b,0x22,0x3e,0x4c,0x69,0x62,0x72,0x61,0x72,0x79,0x3c,0x2f,0x62,0x75,0x74,0x74,
0x6f,0x6e,0x3e,0x0a,0x20,0x20,0x3c,0x62,0x75,0x74,0x74,0x6f,0x6e,0x20,0x69,0x64,
0x3d,0x22,0x6b,0x69,0x77,0x69,0x78,0x68,0x6f,0x6d,0x65,0x22,0x20,0x6f,0x6e,0x63,
0x6c,0x69,0x63,0x6b,0x3d,0x22,0x77,0x69,0x6e,0x64,0x6f,0x77,0x2e,0x6c,0x6f,0x63,
0x61,0x74,0x69,0x6f,0x6e,0x2e,0x68,0x72,0x65,0x66,0x3d,0x27,0x2f,0x5f,0x5f,0x43,
0x4f,0x4e,0x54,0x45,0x4e,0x54,0x5f,0x5f,0x2f,0x27,0x3b,0x22,0x3e,0x48,0x6f,0x6d,
0x65,0x3c,0x2f,0x62,0x75,0x74,0x74,0x6f,0x6e,0x3e,0x0a,0x20,0x20,0x3c,0x66,0x6f,
0x72,0x6d,0x20,0x6d,0x65,0x74,0x68,0x6f,0x64,0x3d,0x22,0x47,0x45,0x54,0x22,0x20,
0x61,0x63,0x74,0x69,0x6f,0x6e,0x3d,0x22,0x2f,0x73,0x65,0x61,0x72,0x63,0x68,0x22,
0x20,0x2f,0x3e,0x0a,0x20,0x20,0x20,0x20,0x3c,0x69,0x6e,0x70,0x75,0x74,0x20,0x74,
0x79,0x70,0x65,0x3d,0x22,0x68,0x69,0x64,0x64,0x65,0x6e,0x22,0x20,0x6e,0x61,0x6d,
0x65,0x3d,0x22,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x22,0x20,0x76,0x61,0x6c,0x75,
0x65,0x3d,0x22,0x5f,0x5f,0x43,0x4f,0x4e,0x54,0x45,0x4e,0x54,0x5f,0x5f,0x22,0x20,
0x2f,0x3e,0x0a,0x20,0x20,0x20,0x20,0x3c,0x69,0x6e,0x70,0x75,0x74,0x20,0x74,0x79,
0x70,0x65,0x3d,0x22,0x73,0x75,0x62,0x6d,0x69,0x74,0x22,0x20,0x69,0x64,0x3d,0x22,
0x6b,0x69,0x77,0x69,0x78,0x73,0x65,0x61,0x72,0x63,0x68,0x22,0x20,0x76,0x61,0x6c,
0x75,0x65,0x3d,0x22,0x53,0x65,0x61,0x72,0x63,0x68,0x22,0x20,0x2f,0x3e,0x0a,0x20,
0x20,0x20,0x20,0x3c,0x69,0x6e,0x70,0x75,0x74,0x20,0x69,0x64,0x3d,0x22,0x6b,0x69,
0x77,0x69,0x78,0x73,0x65,0x61,0x72,0x63,0x68,0x62,0x6f,0x78,0x22,0x20,0x6e,0x61,
0x6d,0x65,0x3d,0x22,0x70,0x61,0x74,0x74,0x65,0x72,0x6e,0x22,0x2f,0x3e,0x0a,0x20,
0x20,0x3c,0x2f,0x66,0x6f,0x72,0x6d,0x3e,0x0a,0x3c,0x2f,0x73,0x70,0x61,0x6e,0x3e,
0x0a,0x3c,0x64,0x69,0x76,0x20,0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x64,0x69,0x73,
0x70,0x6c,0x61,0x79,0x3a,0x20,0x62,0x6c,0x6f,0x63,0x6b,0x3b,0x20,0x68,0x65,0x69,
0x67,0x68,0x74,0x3a,0x20,0x34,0x30,0x70,0x78,0x3b,0x22,0x3e,0x3c,0x2f,0x64,0x69,
0x76,0x3e,0x0a
};
static std::map<std::string, std::pair<const unsigned char*, unsigned int> > createResourceMap() {

View File

@ -1,10 +1,42 @@
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#kiwixsearchbox" ).autocomplete({
source: "/suggest?content=__CONTENT__"
});
});
</script>
<span id="kiwixtoolbar" class="ui-widget-header ui-corner-all">
<button id="kiwixlibrary" onclick="window.location.href='/';">Library</button>
<button id="kiwixhome" onclick="window.location.href='/__CONTENT__/';">Home</button>
<form method="GET" action="/search" />
<input type="submit" id="kiwixsearch" value="Search" />
<input id="kiwixsearchbox" type="textbox" name="pattern" />
<input type="hidden" name="content" value="__CONTENT__" />
<input type="submit" id="kiwixsearch" value="Search" />
<input id="kiwixsearchbox" name="pattern"/>
</form>
</span>
<div style="display: block; height: 40px;"></div>