Skip to content

Instantly share code, notes, and snippets.

View luizfaias's full-sized avatar

Luiz Faias Junior luizfaias

View GitHub Profile
@luizfaias
luizfaias / hc_add_custom_font.css
Created January 30, 2019 12:55
Adding a custom font to your Zendesk Guide theme
/*** BELLABOO font by Marcelo Reis Melo ***/
/*** http://freegoodiesfordesigners.blogspot.com/2015/02/hipster-free-font-bellaboo-by-marcelo.html ***/
@font-face {
font-family: 'BELLABOO-Regular';
font-style: normal;
font-weight: 400;
src: url('$assets-bellaboo-regular-eot'); /* IE9 Compat Modes */
src: url('$assets-bellaboo-regular-eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('$assets-bellaboo-regular-woff2') format('woff2'), /* Super Modern Browsers */
@luizfaias
luizfaias / hc_add_robots.js
Last active February 28, 2020 14:22
Adds the noindex meta tag to all pages on the Help Center, except the home page
<script type="text/javascript">
//prevents all pages, except the home page, from being indexed by search engines
if(window.location.pathname.match(/\/hc\/(.*)\/([a-z])/)) {
var meta = document.createElement('meta');
meta.name = 'robots';
meta.content = 'noindex';
document.getElementsByTagName('head')[0].appendChild(meta);
}
</script>
@luizfaias
luizfaias / web_widget_chat_dept_status.js
Created February 26, 2020 13:18
Zendesk Web Widget + Chat - shows the widget when a single department is online
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=YOUR_WEB_WIDGET_KEY_GOES_HERE"> </script>
<script type="text/javascript">
var department_name = 'Sales';
zE('webWidget:on', 'chat:connected', function() {
zE('webWidget', 'updateSettings', {
webWidget: {
chat: {
departments: {
enabled: [department_name],
@luizfaias
luizfaias / document_head.hbs
Last active October 15, 2019 13:17
Zendesk Help Center - cookies consent banner
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<script>
$(function() {
var cookies_accepted = localStorage.getItem('cookies_accepted');
if (cookies_accepted !== 'true') {
$("#cookie-consent-banner").show();
}
$("#cookie-consent-banner .close").click(function() {
@luizfaias
luizfaias / depoimentos-loja-integrada-v2.html
Created March 31, 2017 16:48
Loja Integrada - depoimentos
<!--
1. Crie um novo código HTML (https://app.lojaintegrada.com.br/painel/configuracao/html/criar)
2. Descrição: Depoimentos
3. Local de publicação: Rodapé
4. Página: home
5. Tipo: HTML
6. Conteúdo: cole todo o código abaixo
7. Divirta-se
-->
<div id="depoimentos">
@luizfaias
luizfaias / document_head.js
Last active May 9, 2018 15:41
Zendesk Chat - identify customer and show widget
<script>
<!-- Opens the chat widget automatically
Example: https://SUBDOMAIN.zendesk.com/hc?start_chat=true&customer_name=John&customer_email=john@example.com
-->
jQuery.extend({
getQueryParameters : function(str) {
return (str || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){return n = n.split("="),this[n[0]] = n[1],this}.bind({}))[0];
}
});
<div id="instagram-feed" class="hide listagem">
<div class="titulo-categoria borda-principal cor-principal">
<strong>Siga-nos no Instagram <a href="https://instagram.com/meluorganicos">@meluorganicos</a></strong>
</div>
<!-- SnapWidget -->
<script src="https://snapwidget.com/js/snapwidget.js"></script>
<iframe src="https://snapwidget.com/embed/348522" class="snapwidget-widget" allowTransparency="true" frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:100%; margin-top: 10px;"></iframe>
</div>
<script type="text/javascript">
$(document).ready(function() {
@luizfaias
luizfaias / forcar-ssl.js
Created March 9, 2017 03:34
Loja Integrada - forçar SSL (https)
<!--
1. Crie um novo código HTML (https://app.lojaintegrada.com.br/painel/configuracao/html/criar)
2. Descrição: Forçar SSL
3. Local de publicação: Rodapé
4. Página: Todas as páginas
5. Tipo: Javascript
6. Conteúdo: cole todo o código abaixo
7. Divirta-se
-->
@luizfaias
luizfaias / depoimentos-loja-integrada.html
Created March 9, 2017 03:24
Loja Integrada - depoimentos
<!--
1. Crie um novo código HTML (https://app.lojaintegrada.com.br/painel/configuracao/html/criar)
2. Descrição: Depoimentos
3. Local de publicação: Rodapé
4. Página: home
5. Tipo: HTML
6. Conteúdo: cole todo o código abaixo
7. Divirta-se
-->
@luizfaias
luizfaias / hide_form_dropdown.js
Created April 1, 2015 11:36
Zendesk Help Center: hide the form dropdown field based on the ticket_form_id
<script>
$(document).ready(function() {
$('#request_issue_type_select option[value="31391"]').closest('div').hide();
});
</script>