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
//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
$('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
<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
//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() { | |
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
HC.api('user',function(x){console.log(x);}) | |
Object { identifier: "da39a3ee5e6b4b0d3255bfef95601890afd80709", | |
role: "anonymous", | |
avatar_url: "https://assets.zendesk.com/images/frame_user.png", | |
email: null, | |
name: null, | |
orgainizations: [] | |
} |
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
//make a function to hide options as they are passed into it. | |
var skip1 = function(k){ | |
$('.nesty-panel').on('DOMNodeInserted', function(e){ | |
$(this).children('ul').children(k).hide(); | |
}); | |
} | |
// call the function with the option value with a # in front | |
skip1('#sss_a_1') | |
//make a function to show the option |
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(){ | |
function setDefaultValue(field, setDefault){ | |
$('.'+field).one('DOMNodeInserted', function(d){ | |
var inputTar = $(d.currentTarget).children('select') | |
var inputNest = $(d.currentTarget).children('a.nesty-input'); | |
var TestObj = inputTar[0]; | |
var TestNest = inputNest[0]; | |
$('#'+TestObj.id).append('<option value="-">-</option>'); | |
$('#'+TestObj.id+' option').removeAttr('selected').filter('[value='+setDefault+']').attr('selected', true); | |
$(TestNest).text(setDefault); |
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 userRole = HelpCenter.user.role; | |
if (userRole === "anonymous") { | |
$(".banners").hide(); | |
} |