Skip to content

Instantly share code, notes, and snippets.

View sidneycalebe's full-sized avatar

Calebe Ribeiro sidneycalebe

View GitHub Profile
<li> <a onclick="openChat()" id="idSaibaMais" class="dropbtn">Fale Conosco</a> </li>
<script>
// As informações ocultadas neste código podem ser encontradas na tela de configuração do Huggy Chat.
let huggyChatLoaded = false;
function openChat() {
huggyChatLoaded == true ? Huggy.openBox() : alert('Aguarde alguns instantes e tente novamente!');
}
var $_Huggy = {
defaultCountry: '+55',
uuid: '-----', // este campo foi ocultado por conter informação sigilosa.
company: '-----', // este campo foi ocultado por conter informação sigilosa.
let widthScreenDefault = 768
let chatBoxOpened = false
function screenWidthVerify() {
var screenWidth = window.innerWidth
return screenWidth
}
function showHideDefaultButton(status) {
if (status === 'show') {
Huggy.showButton()
}
if (status === 'hide') {
Huggy.hideButton()
}
}
function showHideAlternativeButton(status) {
var chat = document.getElementById('button-chat')
if (status === 'show') {
chat.style.display = 'block'
}
if (status === 'hide') {
chat.style.display = 'none'
}
}
function startButtons() {
startDefaultButton()
startAlternativeButton()
}
function startDefaultButton() {
screenWidthVerify() < widthScreenDefault ? showHideDefaultButton('hide') : showHideDefaultButton('show')
}
function startAlternativeButton() {
// As informações ocultadas neste código podem ser encontradas na tela de configuração do Huggy Chat.
var $_Huggy = {
defaultCountry: '+55',
uuid: '---', // este campo foi ocultado por conter informação sigilosa.
company: '---', // este campo foi ocultado por conter informação sigilosa.
afterLoad: function () {
startButtons()
Huggy.subscribe('box-closed', function () {
chatBoxOpened = false
startButtons()
function openChat() {
huggyChatLoaded == true ? Huggy.openBox() : alert('Aguarde alguns instantes e tente novamente!');
}
let huggyChatLoaded = false;