Skip to content

Instantly share code, notes, and snippets.

View DeskWOW's full-sized avatar

Desk.com Customer WOW Team DeskWOW

View GitHub Profile
@DeskWOW
DeskWOW / gist:96eb9f01db5d0b4eed17
Created July 2, 2015 19:22
Different date formats for different languages / locales.
{% if desk.system.language == 'fr' %}
<div class='meta'>
{{system.snippets.last_update}}: {{ article.updated_at | in_time_zone: site.timezone | date: '%d %b, %Y %I:%M%p %Z' }}
</div>
{% else %}
<div class='meta'>
{{system.snippets.last_update}}: {{ article.updated_at | in_time_zone: site.timezone | date: '%b %d, %Y %I:%M%p %Z' }}
</div>
{% endif %}
@DeskWOW
DeskWOW / gist:23e7093bfae7d7fb9aba
Last active December 3, 2015 18:41
Example dependent dropdown code for support center / widget contact form.
<style>
.hidden {
display: none;
}
</style>
<div class="div-category">
{{ ticket_custom_category }}
</div>
@DeskWOW
DeskWOW / gist:93fc54fcccf9cb01b0bb
Last active June 27, 2017 18:46
User Login/Page Test
<!-- Testing User/Page -->
{% if page == "login" or page == "forgot_password" or page == "registration" or page == "authentication_verification" or page == "email_new" or page == "email_pre_create" or page == "email_submitted" %}
{% assign Protected = false %}
{% else %}
{% if current_user and current_user.is_guest == false %}
{% assign Protected = false %}
{% else %}
{% assign Protected = true %}
{% endif %}
{% endif %}
@DeskWOW
DeskWOW / 1-Header.html
Created May 13, 2015 00:20
Responsive email widget theme
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>{{ site.company_name }}</title>
<link rel="icon" type="image/vnd.microsoft.icon" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<link rel="icon" type="image/png" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<style type="text/css">
@DeskWOW
DeskWOW / gist:94a9dbf4234e58a321a8
Created May 4, 2015 18:51
Click-to-Enlarge Images Within Articles - Paste this at the bottom of your web theme's Page (Article) section.
<!-- Magnific Popup core CSS file -->
<style>
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1042;
overflow: hidden;
<script>
$(function() {
$(".input-block select, .input-block input, .input-block textarea").on("change keyup", function() {
$("ticket_labels_new").val("");
var labels = [];
if ($("#div-inquiry-type select").val() == "Mobile App Support" && $("#div-platform select").val() == "Apple iPad" && $("#div-app select").val() == "Big Cat Week: Quest for Survival") {
labels.push("T- Channel");
}
@DeskWOW
DeskWOW / gist:0cbebbd691364cd2aafc
Created March 23, 2015 13:37
Custom Reply Theme -- Highlight the most recent message
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" style="color:#333; font-family:Arial; font-size:14px; line-height:150%; text-align:left;">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
@DeskWOW
DeskWOW / gist:6a00d3d2d6215f2cf27d
Created March 12, 2015 21:08
Set brand custom field within a widget via label GET param
<div class="brand-div" style="display: none;">{{ticket_custom_brand}}</div>
<script>
$(function() {
$(".brand-div select").val("{{ticket.labels_new}}");
});
</script>
{% if case.emails_and_notes.size < 1 %}
<!-- Code you want to appear only when creating a new case -->
{% endif %}
@DeskWOW
DeskWOW / gist:41526f5bab39a969f8bf
Created March 6, 2015 00:10
Autocomplete Styles
ul.ui-autocomplete.ui-menu {}
ul.ui-autocomplete.ui-menu li {}
ul.ui-autocomplete.ui-menu li a {}
ul.ui-autocomplete.ui-menu li a span.article-autocomplete-subject {}
ul.ui-autocomplete.ui-menu li a span.article-autocomplete-body {}