Last active
December 13, 2015 22:38
-
-
Save bluemango/4985549 to your computer and use it in GitHub Desktop.
Zendesk Forum/ScreenSteps Live search that defaults to forum search.
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
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