Search

Rob Garrison edited this page May 17, 2018 · 7 revisions

Wiki: Home | FAQ | Customize | Snippets | Search | Language | Changes | Older-changes-2.25.0 | Older-changes-2.13.0 | Change summary

Search Documentation

Why use it?

  • Advantages:
    • The advantage of using this search over the browser's built-in search (Ctrl-F) is that it will find text within the hidden content.
    • Also, this search automatically reveals the hidden content while cycling through the results.
    • Search for multiple terms by separating the queries with a comma (e.g. boolean, false will highlight both boolean and false on the page).
    • This search will ignore the contents of the side menu and all table headers.
  • Disadvantage:
    • This search will not find multiple words that are contained within different elements. For example, searching for "tablesorter" in the browser search will find the main page title. This search will not find the title because "sorter" is wrapped within an <em> tag to change its styling.
    • Documentation searching is only available on the main document page.
  • Sorry, IE7 and older users, the search works but it is really slow. And the side menu styling leaves much to be desired (using Bootstrap).

The search box

  • To access the search box, click on the side menu icon (☰) in the upper left corner.
  • The search box includes:
    • An input area (showing "Find on page..." inside)
    • A clear search button
    • Previous result button
    • Next result button
    • Word or letter toggle button
    • Case sensitive or case in-sensitive toggle button

Search buttons

  • Clear search button
    • Clears the search in the input and all highlighted results.
  • Previous result button
    • Moves the highlight to the previous search result. If on the first result, it wraps to the last.
    • If the result is hidden, the row will open (just like clicking on the option name) and reveal the highlighted result.
    • The page will scroll to the current result.
    • Results that are revealed will not automatically close.
  • Next result button
    • Moves the highlight to the next search result. If on the last result, it wraps to the first.
    • If the result is hidden, the row will open and reveal the highlighted result.
    • The page will scroll to the current result.
    • Results that are revealed will not automatically close.
  • Word or Letter
    • This toggle forces the document search to either look for full words only. If set and searching for 2.13, no results will be found (all version numbers within the documentation start with a "v").
    • If the toggle is set to "Letter", searching for 2.13 will show seven results.
    • This also applies to words like alpha; With "Word" set, it only finds "alpha-numerically" (the dash breaks up the word), and after switching the toggle to "Letter" it finds nine results ("alphabetically", "alphanumeric", etc).
  • Case sensitive or case-insensitive searches.
    • When the toggle is set to case-sensitive ("Ab"), capitalization matters!
    • If set to case-insensitive ("ab"), all captialization is ignored.

How to search

  • Searches must be at least three characters in length, or an error will be displayed.
  • Search on the page for any text by entering your query into the input area and pressing the Enter key, or click on the previous result, next result or either of the toggle buttons.
  • Searches can also be initialized through the url: http://mottie.github.io/tablesorter/docs/?q=array&index=10
    • Find "array" on the page
    • Start on the 10th result (this parameter is optional, it defaults to start on the first result)
  • Using toggle button combinations: If searching for "Key"
    • "Word" + "Ab" (case sensitive) will not find any results, because it is basically looking for an exact match the word.
    • "Word" + "ab" (case-insensitive) will find more than eight results (at the time of this writing).
    • "Letter" + "Ab" (case sensitive) will find eight results (includes shiftKey, ctrlKey, etc)
    • "Letter" + "ab" (case-insensitive) finds twenty results

Successful searches:

  • A result count will be shown within the search input (i.e. 33/50)
  • Searches always start on the first result (1/50).
  • All search results will be highlighted on the page (even in hidden content).
  • The current search result (10/20) will be highlighted in a different color on the page.
  • Clicking on any search result will update the search counter.

Unsuccessful searches:

  • Searches that have no results will show a count of 0/0 within the search input
  • An warning message will appear stating that no results were found.