Skip to content

Instantly share code, notes, and snippets.

@DeskSupport
DeskSupport / gist:3821008
Created October 2, 2012 16:47
Culturecode Redirect
{% unless article.public_url %}
<script language="javascript" type="text/javascript">
if(document.URL.indexOf("articles/753844") >= 0){
window.location.href="http://support.culturedcode.com/customer/portal/articles/765090";
}
</script>
{% endunless %}
@DeskSupport
DeskSupport / 01 - Instructions
Created September 21, 2012 20:10
Mobile Help Center Template with Email Form
Using the following template components in the mobile template, you can add the ability to submit requests from your mobile help center.
If you are interested in using this template, please contact [email protected] and let them know so they can enable an extra feature that will allow you to use this. There is no fee for the feature, but we need to know.
To install template:
1.In the "Channel" section of the Admin, enable "Mobile Template" located in the "Support Center" configuration under the "Advanced Settings"
2. Create a New Mobile Template
@DeskSupport
DeskSupport / Body.html
Created September 21, 2012 20:08
Mobile Help Center Template with Email Form
{% assign HomePageName = "Help Home" %}
<script>
$.getUrlVar = function() { return ''; } // override hardcoded call to a non-existant function
$.fn.DefaultValue = function() { return ''; } // override hardcoded call to a non-existant function
</script>
<div id="questionblock2"><div id="questionblock1"><div id="questionblock">
<form accept-charset="UTF-8" action="/customer/portal/articles/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
<input id="q" maxlength="100" name="q" type="text" value="" placeholder="Search" class="questionblock_blur">
@DeskSupport
DeskSupport / multipass.cs
Created June 19, 2012 00:25
Desk.com Multi-Pass SSO csharp example
using System;
using System.Web;
using System.Web.UI;
using System.Web.Security;
using System.Text;
using System.IO;
using System.Security.Cryptography;
// NB: For dot net your json string will look something like this:
//
@DeskSupport
DeskSupport / Oauth.cs
Created June 18, 2012 23:58
csharp Oauth and API Example
// TwitPic/OAuth.cs
//
// Code to do OAuth stuff, in support of a cropper plugin that sends
// a screen snap to TwitPic.com.
//
// There's one main class: OAuth.Manager. It handles interaction with the OAuth-
// enabled service, for requesting temporary tokens (aka request tokens), as well
// as access tokens. It also provides a convenient way to construct an oauth
// Authorization header for use in any Http transaction.
//
{% assign _kb_topic_ids = '89110,89111,89112,89113,89114,89115,89116,89117,89118,89119,89120,89121,89122' %}

@DeskSupport
DeskSupport / Insert in <head> tag
Created April 4, 2012 17:55
Desk.com Contact Us Button
<link rel='stylesheet' href='http://jacklmoore.com/colorbox/example1/colorbox.css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src='http://jacklmoore.com/colorbox/colorbox/jquery.colorbox.js'></script>
<script>
$(document).ready(function(){
$(".80percent").colorbox({width:"480px", height:"640px", iframe:true});
});
</script>
<style>
@DeskSupport
DeskSupport / gist:2211014
Created March 27, 2012 00:31
Email for Notification
{% assign emails = case.emails %}
{% for email in emails reversed %}
{% if forloop.first %}
{% if forloop.length > 1 %}
<div style="line-height: 18px; margin-left: 10px; font-size: 12px; font-weight: bold; ">History:</div>
{% endif %}
<div style="border-top: solid 2px #e8f6f9; margin: 10px 0px 0px 10px;"></div>
<div style="border-bottom: solid 1px #ddd; margin: 0px 0px 15px 10px;"></div>
{% else %}
{% if email.agent %}
@DeskSupport
DeskSupport / gist:1853929
Created February 17, 2012 15:01
Table of content for Desk.com Knowledge Base Topics and Articles
{% if topics_count > 0 %}

{% for topic in topics %}

{% if topic.article_count > 0 %}
<div class='topic topic{{ topic.id }}'>
<a href='{{ topic.public_articles_url }}'>{{ topic.name }}</a><</div>
<ul>
{% for article in topic.articles %}

<li>
<a href='{{ article.public_url }}'>{{ article.subject_plain | clip:40 }}</a></li>
{% endfor %}
</ul>
{%endif%}
<div style="color: #222; font-family: ''Lucida Grande'', Helvetica, Arial, Verdana, sans-serif; font-size:12px; width:800px;">
<div style="color: #ff0000; margin: 0px 0px 10px 10px;">
Please type your reply at the top of the email...
</div>
<div style="border-bottom: dotted 2px #bbb; margin:0px 0px 15px 10px;"></div>