Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Last active August 29, 2015 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DeskWOW/50db422b895c0bb6ab3a to your computer and use it in GitHub Desktop.
Save DeskWOW/50db422b895c0bb6ab3a to your computer and use it in GitHub Desktop.
Custom Desk.com Email Widget Embed Code
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<style>
a.form-link {
display: block;
box-sizing: border-box;
color: white;
padding: 10px 20px;
position: fixed;
bottom: -2px;
right: 0;
margin: 0 20px 0 0;
background: #3498db;
text-shadow: 1px 1px black;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
font-family: sans-serif;
font-size: 1.1em;
text-decoration: none;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.15);
border: 1px solid #2180C0;
}
a.form-link:hover {
text-decoration: none;
}
.form-container {
display: none;
padding: 0;
overflow: visible;
width: 470px;
height: 445px;
position: fixed;
bottom: 10px;
right: 10px;
z-index: 1000;
border: 2px solid #2C97DE;
border-radius: 4px;
box-shadow: 0 0 25px rgba(0,0,0,.25);
background: #eee;
}
.form {
width: 100%;
height: 100%;
}
.form-close {
text-decoration: none;
position: absolute;
top: -4px;
left: -4px;
background: rgb(245, 64, 64);
padding: 2px 4px;
display: block;
color: rgba(165, 16, 16, 1);
border-radius: 100%;
font-size: 14px;
font-weight: bold;
text-shadow: 1px 1px rgba(255, 255, 255, 0.33);
line-height: 13px;
font-family: sans-serif;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.25), 1px 1px rgba(0, 0, 0, 0.25);
border: 1px solid rgb(255, 74, 74);
}
.form-close:hover {
background: rgb(255, 74, 74);
color: rgba(165, 16, 16, 1);
text-decoration: none;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.33), 1px 1px rgba(0, 0, 0, 0.25);
}
.form-minimize {
text-decoration: none;
position: absolute;
top: -4px;
left: 15px;
padding: 2px 4px;
background: rgb(245, 174, 0);
display: block;
color: rgba(219, 105, 0, 1);
border-radius: 100%;
font-size: 14px;
font-weight: bold;
text-shadow: 1px 1px rgba(255, 255, 255, 0.33);
line-height: 13px;
font-family: sans-serif;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.25), 1px 1px rgba(0, 0, 0, 0.25);
border: 1px solid rgb(255, 143, 0);
}
.form-minimize:hover {
background: rgb(255, 184, 0);
color: rgba(219, 105, 0, 1);
text-decoration: none;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.33), 1px 1px rgba(0, 0, 0, 0.25);
}
</style>
<div class="form-container">
<a class="form-close" href="#">x</a>
<iframe class="form" frameborder="0"></iframe>
</div>
<div class="form-link-container">
<a class="form-link" href="#">Feedback</a>
</div>
<script>
$(function() {
$(".form-link").click(function() {
$(".form").prop("src", "https://YOUR-SITE.desk.com/customer/widget/emails/new?interaction[name]=Pre-filled name&interaction[email]=Pre-filled email")
$(".form-container").toggle();
$(".form-link-container").toggle();
return false;
});
$(".form-close").click(function() {
$(".form").prop("src","");
$(".form-container").hide();
$(".form-link-container").show();
return false;
});
});
</script>
Normal page content goes here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment