-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved autocomplete from head_part.html to taskbar.js
- Loading branch information
1 parent
bd781f8
commit fb26f6b
Showing
2 changed files
with
33 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,7 @@ | ||
<link type="text/css" href="{{root}}/skin/jquery-ui/jquery-ui.min.css" rel="Stylesheet" /> | ||
<link type="text/css" href="{{root}}/skin/jquery-ui/jquery-ui.theme.min.css" rel="Stylesheet" /> | ||
<link type="text/css" href="{{root}}/skin/taskbar.css" rel="Stylesheet" /> | ||
<link type="root" href="{{root}}"> | ||
<script type="text/javascript" src="{{root}}/skin/jquery-ui/external/jquery/jquery.js"></script> | ||
<script type="text/javascript" src="{{root}}/skin/jquery-ui/jquery-ui.min.js"></script> | ||
<script> | ||
function htmlDecode(input) { | ||
var doc = new DOMParser().parseFromString(input, "text/html"); | ||
return doc.documentElement.textContent; | ||
} | ||
var jk = jQuery.noConflict(); | ||
jk(function() { | ||
jk( "#kiwixsearchbox" ).autocomplete({ | ||
|
||
source: "{{root}}/suggest?content={{#urlencoded}}{{{content}}}{{/urlencoded}}", | ||
dataType: "json", | ||
cache: false, | ||
|
||
response: function( event, ui ) { | ||
for(const item of ui.content) { | ||
item.label = htmlDecode(item.label); | ||
item.value = htmlDecode(item.value); | ||
} | ||
}, | ||
|
||
select: function(event, ui) { | ||
jk( "#kiwixsearchbox" ).val(ui.item.value); | ||
jk( "#kiwixsearchform" ).submit(); | ||
}, | ||
|
||
}); | ||
}); | ||
|
||
/* cybook hack */ | ||
if (navigator.userAgent.indexOf("bookeen/cybook") != -1) { | ||
jk("html").addClass("cybook"); | ||
} | ||
</script> | ||
<script type="text/javascript" src="{{root}}/skin/taskbar.js" async></script> |