A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Manual: add search box to HTML output.

To allow easy searching the HTML (multi page) output add a search box that
queries Google. The Google search will get restricted to the location the
manual is stored. Google seems to happily accept a subfolder when specifying a
domain to search. For this to work the search box has to be created dynamically
with the help of a bit JavaScript.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30017 a1c6a512-1295-4272-9138-f99709370657

+21 -2
+1
manual/Makefile.pdflatex
··· 17 17 buildhtml: rockbox-build.tex 18 18 @mkdir -p $(OBJDIR)/html 19 19 @$(HTLATEX) $(DOCUMENT) "$(HTOPTS1),$(SPLITHTML)" $(HTOPTS2) $(HTOPTS3) 20 + @cp --parent `cat $(OBJDIR)/html/*.html | sed -e '/\.js/!d;s/.*\"\(.*\.js\)\".*/\1/g;/</d' | uniq` $(OBJDIR)/html 20 21 @cp --parent `cat $(OBJDIR)/html/*.html | sed -e '/[pj][np]g/!d;s/.*\"\(.*\.[pj][np]g\)\".*/\1/g;/</d'` $(OBJDIR)/html 21 22 @cp -r $(OBJDIR)/html $(OBJDIR)/../ 22 23
+11
manual/gsearch.js
··· 1 + function gsearch() { 2 + var expr=/(.*)\/([^/]+)$/; 3 + var loc = expr.exec(window.location)[1]; 4 + document.getElementById("gsearch").innerHTML = '' 5 + + '<form action="http://www.google.com/search">' 6 + + 'Search this manual ' 7 + + '<input name="as_q" size="30">' 8 + + '<input value="Google it" type="submit">' 9 + + '<input type="hidden" name="as_sitesearch" value="' + loc + '">' 10 + + '</form>'; 11 + }
+9 -2
manual/rockbox-html.cfg
··· 12 12 .fancyvrb { background-color:\#c6d6f5; } 13 13 table.multicols { width:95\%; margin-left:auto; margin-right:auto; text-align:justify; } 14 14 .crosslinks { color:\#ffffff; text-align:center; background-color:\#6887bb; padding:8px; } 15 - div.crosslinks>p>a { color:\#ffffff; } 15 + div.crosslinks>a { color:\#ffffff; } 16 16 hr { display:none; } 17 17 } 18 18 \EndPreamble 19 19 \Configure{Link}{a}{href=}{name=}{} 20 - 20 + \Configure{@HEAD}{\HCode{<script type="text/javascript" src="gsearch.js"></script>}} 21 + \Configure{BODY}{\HCode{<body onload="gsearch();">}}{\HCode{</body>}} 22 + \Configure{crosslinks*}{next}{up}{prev}{} 23 + \Configure{crosslinks+}% 24 + {\HCode{<div style='float:left;'><a href='http://www.rockbox.org'><img src='http://www.rockbox.org/rockbox100.png'/></a></div><div id='gsearch' style='float:right;'>Enable JavaScript to show search field.</div><div style='clear:both;' class='crosslinks'>}}% 25 + {\HCode{</div>}}% 26 + {\HCode{<div class='crosslinks'>}}% 27 + {\HCode{</div>}}