Skip to content

Instantly share code, notes, and snippets.

@sidneydemoraes
Created May 23, 2017 18:26
Show Gist options
  • Save sidneydemoraes/1c905066ee5484653f679edc0d251721 to your computer and use it in GitHub Desktop.
Save sidneydemoraes/1c905066ee5484653f679edc0d251721 to your computer and use it in GitHub Desktop.
Alertify
window.alert = function(message, title, opts){
if(opts)
{
myCustomMessage = '<br /><ul id="minha-assinatura-buttons">' +
'<li class="atendimento-online">' +
'<p>Atendimento On-Line</p>' +
'<a href="#" target="_blank" title="" class="atendimento-online">' +
'<img src="#" class="ico">' +
'<span>Clique aqui para falar com um de nossos atendentes</span>' +
'</a>' +
'</li>' +
'<li class="fale-conosco">' +
'<p>Fale Conosco</p>' +
'<a href="#" title="" class="fale-conosco">' +
'<img src="#" class="ico">' +
'<span>Clique aqui para enviar suas dúvidas, críticas e sugestões</span>' +
'</a>' +
'</li>' +
'</ul>' +
'<p>Atendimento ao Cliente.</p>' +
'<p>Capitais: </p>' +
'<p>Demais Localidades: </p>' +
'</div>';
myOutputMessage = message.concat(myCustomMessage);
myAlertObject = alertify.alert().setContent(myOutputMessage).set('title', title).set(opts);
// Configuração para manter no centro da tela
var leftPosition = ((window.innerWidth - myAlertObject.elements.dialog.offsetWidth) / 2);
var topPosition = ((window.innerHeight - myAlertObject.elements.dialog.offsetHeight) / 2);
myAlertObject.moveTo(leftPosition, topPosition).show();
return;
};
if(title && message)
alertify.alert(title, message);
else
alertify.alert("Atenção!", message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment