Skip to content

Instantly share code, notes, and snippets.

@skipjac
skipjac / customJS.css
Created March 13, 2014 16:19
import javascript to zendesk feedback tab
</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" charset="UTF-8"></script>
<script type="text/javascript">
setTimeout(function(){
$("header h1").after("</br><div id=\"blurb\"><p>Welcome to AOL Customer Support – we’re happy to help. Please fill out the form below and we’ll get back to you as soon as we can. Or, tweet us <a href=\"https://twitter.com/AOLSupportHelp\" target=\"_blank\">@AOLSupportHelp</a>. We’re available business hours from 9 AM to 5 PM ET, Monday-Friday.</p></br><p>Looking for AOL Mail help? Please click <a href=\"https://www.facebook.com/aolmail/app_258933330820414\" target=\"_blank\">click here</a> to ask the AOL Mail Support team a question on Facebook.</p></br><p>After hours? For online AOL Customer Support, please go to <a href=\"http://help.aol.com/\" target=\"_blank\">help.aol.com</a>.</p>");
$('#name').attr('placeholder', 'Please enter your name');
$('#email').attr('placeholder', 'Please enter your email: me@example.com')
@skipjac
skipjac / helpcenter-articlepage.html
Created March 17, 2014 22:24
this changes the sidebar section that show recently viewed articles in Zendesk's HelpCenter
<script>
console.log('test');
var skipTest = function(){
if($('section.recent-articles').length === 1 ){
$('section.recent-articles h3').text('Skip is god')
return;
}
_.defer(skipTest.bind(this));
}
@skipjac
skipjac / vote_counts.json
Last active August 29, 2015 13:57
get the zendesk article votes and add them to the subject line
var api = document.location.pathname + '.json';
if (api.indexOf('entries') !== -1){
$j.getJSON(api, function(data){
var currentTitle = $j('h3.entry-title').text()
$j('h3.entry-title').text(currentTitle + ' ('+data.votes_count+ ' votes)');
});
}
@skipjac
skipjac / hideOrgIDoption.js
Created March 27, 2014 21:30
HelpCenter hide ticket forms options based on organization ID
<script>
$(document).ready(function(){
(function(){
$('option[value="641"]').wrap('<span class="hide-option"></span>');
var isCust;
function isCustomer(element, index, array){
return (element === 'paying');
}
HelpCenter.user.organizations.forEach(function(x){
isCust = x.tags.some(isCustomer);

Keybase proof

I hereby claim:

  • I am skipjac on github.
  • I am skip (https://keybase.io/skip) on keybase.
  • I have a public key whose fingerprint is 581A 42F6 79E0 BB16 6574 253D 82C6 E27E 1F28 4B2A

To claim this, I am signing this object:

@skipjac
skipjac / call getWeekNumber
Created April 8, 2014 17:25
Get the week number for a given date
getWeekNumber(Date.now())
if (self != top)
{
$j('#header').remove();
$j('.tab_home').remove();
$j('.tab_requests').remove();
$j('#top-menu').remove();
$j('#top-menu-background').remove();
$j('#page').css('maxWidth', '100%');
$j('html, body').css('background-color', '#FFFFFF');
$j('body').css('min-width', '0');
@skipjac
skipjac / gist:bdaee1ce41e65c2166cf
Created June 13, 2014 17:43
Proof of concept to get labels for article pages in zendesk helpcenter
<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'
});
@skipjac
skipjac / hc_ticket_fields.html
Last active August 29, 2015 14:02
Set default dropdown values in Zendesk Help Center. This is just the code to set the actual value.
<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){
@skipjac
skipjac / app.js
Created October 8, 2014 04:42
hijack Zendesk's notification system
$(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();
}