Skip to content

Instantly share code, notes, and snippets.

Avatar

Luiz Faias Junior luizfaias

View GitHub Profile
@luizfaias
luizfaias / hc_add_custom_font.css
Created Jan 30, 2019
Adding a custom font to your Zendesk Guide theme
View hc_add_custom_font.css
/*** 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 Feb 28, 2020
Adds the noindex meta tag to all pages on the Help Center, except the home page
View hc_add_robots.js
<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 Feb 26, 2020
Zendesk Web Widget + Chat - shows the widget when a single department is online
View web_widget_chat_dept_status.js
<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 Oct 15, 2019
Zendesk Help Center - cookies consent banner
View document_head.hbs
<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() {
View depoimentos-loja-integrada-v2.html
<!--
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
Zendesk Chat - identify customer and show widget
View document_head.js
<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];
}
});
View Posts-do-Instagram.html
<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 Mar 9, 2017
Loja Integrada - forçar SSL (https)
View forcar-ssl.js
<!--
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
-->
View depoimentos-loja-integrada.html
<!--
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 Apr 1, 2015
Zendesk Help Center: hide the form dropdown field based on the ticket_form_id
View hide_form_dropdown.js
<script>
$(document).ready(function() {
$('#request_issue_type_select option[value="31391"]').closest('div').hide();
});
</script>