Skip to content

Instantly share code, notes, and snippets.

@bluemango
Last active December 13, 2015 22:38
Show Gist options
  • Save bluemango/4985549 to your computer and use it in GitHub Desktop.
Save bluemango/4985549 to your computer and use it in GitHub Desktop.
Zendesk Forum/ScreenSteps Live search that defaults to forum search.
var home_search = jQuery("#suggestion_submit");
if (home_search) {
var search_url = "http://help.bluemangolearning.com/searches";
jQuery("#search_box").text("Search");
home_search.val("Search Forums");
var html_string = '<input type="submit" name="commit" value="Search Docs" class="button search" id="screensteps-search-submit"/>';
home_search.after(html_string);
jQuery("#screensteps-search-submit").click(function(e){
var search_string = jQuery("#suggestions_query").val();
var query_string = jQuery("#suggestions_query").val().replace(/\s/g,"+");
window.location = search_url + "?text=" + query_string;
return false;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment