Created
June 8, 2017 08:27
-
-
Save Sarapulov/1fc0a444558a5a9abd0854ce9eec7c29 to your computer and use it in GitHub Desktop.
Zendesk Help Center redirect after page is loaded
This file contains hidden or 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
<script type="text/javascript"> | |
$(document).ready(function() { | |
(function(f, l, lh, isR){ // redirect to ticket form page if not already form page, requests page or article page | |
f = 151485, l = window.location, lh = l.href, isR = !(l.search.match("ticket_form_id") || lh.indexOf('/requests') > -1 || lh.indexOf('/articles') > -1), | |
hc = HelpCenter, isU = hc && (hc.user.role !== 'manager' && hc.user.role !== 'agent'); | |
if (isR && isU) l.replace("/hc/"+document.getElementsByTagName("html")[0].lang.toLowerCase()+"/requests/new?ticket_form_id="+f); | |
})(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment