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
<script> | |
$(document).ready(function() { | |
jQuery.extend({ | |
getQueryParameters : function(str) { | |
return (str || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){return n = n.split("="),this[n[0]] = n[1],this}.bind({}))[0]; | |
} | |
}); | |
var queryParameters = $.getQueryParameters(); |
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
//remove the options from the select | |
$('#request_issue_type_select option[value="43517"]').remove(); | |
//remove the option from the nesty-input after it's been created. | |
$('div').one('DOMNodeInserted', function(e){ | |
$('.nesty-panel').one('DOMNodeInserted', function(e){ | |
$(this).children('ul').children().remove('#43517'); | |
}); | |
}); |
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
<script> | |
$(document).ready(function() { | |
$('#request_issue_type_select option[value="631"]').wrap('<span class="hide-option"></span>'); | |
}); | |
</script> |
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
.nesty-input { | |
max-width: 555px; | |
} |
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
$('a.submit-a-request').text('Contact Us').attr('href', function(){return this +'?ticket_form_id=18434';}).addClass('contact-info'); |
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
//this function will walk all the way down the JSON object into all the arrays and create flat JSON object. | |
function flattenObject(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object' && ob[i] !== null) { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; | |
toReturn[i + '.' + x] = flatObject[x]; |
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
{{ticket.created_at}} old {{ticket.created_at_with_time | date: "%B %d %H:%M %Z" }} | |
{% capture day %}{{ticket.updated_at | date: "%d" }}{% endcapture %} | |
{% capture month %}{{ticket.updated_at | date: "%B" }}{% endcapture %} | |
new {{ticket.updated_at | date: "%B"}} {{day | plus:2}}</br> | |
{% capture dayCheck %}{{day | plus:2}}{% endcapture %} | |
{{dayCheck}}</br> | |
{% if month == 'January' %} | |
{% if dayCheck > '31' %} | |
{% assign month = 'February' %} |
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
$(document).ready(function() { | |
if ( $('.promoted-articles ul li a:contains("Issue")').length > 0 ){ | |
console.log( $('.promoted-articles ul li a:contains("Issue")').first().parent().html()); | |
$('.notification-text').html( | |
'<i class="fa fa-warning"></i> ' + | |
$('.promoted-articles ul li a:contains("Issue")').first().parent().html() | |
); | |
$('.notification').show(); | |
} |
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
<div class="form-field string required request_custom_fields_21631456"> | |
<label for="request_custom_fields_21631456">fav</label> | |
<input autocomplete="off" data-tagger=data-tagger="{"-":{"id":"","title":"-","selected":true},"pet":{"cat":{"id":"cat","title":"pet::cat"},"dog":{"id":"dog","title":"pet::dog"}},"Dolphin":{"id":"dolphin","title":"Dolphin"},"the fish":{"id":"the_fish","title":"the fish"}}" id="request_custom_fields_21631456" name="request[custom_fields][21631456]" size="0" type="hidden" value=""> | |
<a class="nesty-input" tabindex="0">-</a> | |
</div> | |
<script> | |
//in order to set the value of the field and make it visible set the input value and anchor text | |
//so this will set the field fav to The fish | |
$('.request_custom_fields_21631456').one('DOMNodeInserted', function(d){ |
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
<script> | |
var getPath = document.location.pathname; | |
var locID = getPath.split('/'); | |
$.ajax({ | |
type: "GET", | |
url: 'https://yourdomain.zendesk.com/api/v2/help_center/articles/'+locID[locID.length -1]+'.json', | |
success: function(data){console.log(data)}, | |
dataType: 'application/json', | |
contentType: 'application/json' | |
}); |