Skip to content

Instantly share code, notes, and snippets.

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 / getBlog.js
Created April 17, 2014 18:26
A RSS reader for Zendesk HelpCenter
<script>
console.log($('#one').contents());
$(document).ready(function() {
truncate = function(text, length, ellipsis) {
// Set length and ellipsis to defaults if not defined
if (typeof length == 'undefined') var length = 100;
if (typeof ellipsis == 'undefined') var ellipsis = '...';
@skipjac
skipjac / call getWeekNumber
Created April 8, 2014 17:25
Get the week number for a given date
getWeekNumber(Date.now())

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 / 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);
@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 / 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 / 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 / eventListner.js
Created January 15, 2014 06:07
idea for watching the DOM in Helpcenter
var target = document.querySelector('.nesty-panel');
target.addEventListener ("DOMSubtreeModified", function(){
_.defer(function(){ console.log($('[name="request[custom_fields][21305759]"]').val())});
})
@skipjac
skipjac / helpcenterUser.js
Last active January 23, 2016 15:29
This is the Zendesk HelpCenter.user javascript object that can be called from any javascript code in HelpCenter
Object {identifier: "sss", email: "skip@zen.com", name: "Skip Moore", tags: Array[2], locale: "en-us"…}
avatar_url: "https://z3nofskip.zendesk.com//system/photos/6753/8923/200px-Skippy-dvd.jpg"
email: "skip@zendesk.com"
groups: Array[4]
0: Object
default: false
isActive: true
name: "Support"
__proto__: Object
1: Object