Skip to content

Commit

Permalink
Add doc search controls.
Browse files Browse the repository at this point in the history
pawchen committed Jul 25, 2024
1 parent 59b5797 commit 549bc41
Showing 2 changed files with 35 additions and 3 deletions.
35 changes: 33 additions & 2 deletions src/en/template.html
Original file line number Diff line number Diff line change
@@ -845,8 +845,39 @@
</tr>
<tr>
<td style="margin-left: 10px;" colspan="2">

<hr />
<div id="ContentPlaceHolderBody_TheContentPage_Panel1" class="DocSearchPanel">
<div class="DocSearchInput" style="text-align:right;">
<input name="ctl00$ContentPlaceHolderBody$TheContentPage$ctl00$ctl00$TextBox_SearchInput" type="text"
id="ContentPlaceHolderBody_TheContentPage_ctl00_ctl00_TextBox_SearchInput">
<select name="ctl00$ContentPlaceHolderBody$TheContentPage$ctl00$ctl00$DropDownList_Book"
id="ContentPlaceHolderBody_TheContentPage_ctl00_ctl00_DropDownList_Book">
<option selected="selected" value="">All Books</option>
<option value="Non-Programming Books">Non-Programming Books</option>
<option value="User-Guide"> User Guide</option>
<option value="Tutorials"> Tutorials</option>
<option value="Quick-Help"> Quick Help</option>
<option value="Origin-Help"> Origin Help</option>
<option value="Programming Books">Programming Books</option>
<option value="X-Function"> X-Function</option>
<option value="OriginC"> Origin C</option>
<option value="LabTalk"> LabTalk Programming</option>
<option value="python"> Python</option>
<option value="ExternalPython"> Python (External)</option>
<option value="COM"> Automation Server</option>
<option value="LabVIEW"> LabVIEW VI</option>
<option value="App"> Apps</option>
<option value="AppDev"> App Development</option>
<option value="CodeBuild"> Code Builder</option>
<option value="License"> License</option>
<option value="MOCA"> MOCA</option>
<option value="Orglab"> Orglab</option>
</select>
<input name="ctl00$ContentPlaceHolderBody$TheContentPage$ctl00$ctl00$Button_Search" value="Search"
id="ContentPlaceHolderBody_TheContentPage_ctl00_ctl00_Button_Search"
onclick="searchDoc('en', 'ContentPlaceHolderBody_TheContentPage_ctl00_ctl00_TextBox_SearchInput', 'ContentPlaceHolderBody_TheContentPage_ctl00_ctl00_DropDownList_Book')">
</div>
</div>
<hr />
</td>
</tr>
<tr style="border-bottom: solid 1px black">
3 changes: 2 additions & 1 deletion src/lib/script.js
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@ function searchSite(inputId) {
document.location.href = "https://www.google.com/search?sitesearch=www.originlab.com&q=" + encodeURIComponent(terms);
}

function searchDoc(inputId, lang, book) {
function searchDoc(lang, inputId, selectId) {
var terms = document.getElementById(inputId).value;
var book = document.getElementById(selectId).value;
document.location.href = `https://www.google.com/search?sitesearch=www.originlab.com/doc/${lang}/${book}&` + encodeURIComponent(terms);
}

0 comments on commit 549bc41

Please sign in to comment.