65
| <![CDATA[<script type="text/JavaScript">
$(function() {
//Responsável por desabilitar o botão que submitou o formulário (para evitar duplo clique)
$('.form-disable').on('submit', function(){
var self = $(this),
button = self.find('input[type="submit"], button'),
submitValue = button.data('submit-value');
button.attr('disabled','disabled').val((submitValue) ? submitValue : "Aguarde...");
});
$('.clearAllField').click(function(){
var id_form = $(this).closest('form').attr('id')
if (id_form !== null && id_form !== '') {
$('#' + id_form )[0].reset();
}
});
$(".accordion").accordion({ header: "h3", autoHeight: false });
$(".price").autoNumeric('init', {vMin: '0', wEmpty: 'zero', mDec: '2', aSep: '.', aDec: ',' });
$(".price").focus(function() {$(this).select();});
$(".price4").autoNumeric('init', {vMin: '0', wEmpty: 'zero', mDec: '4', aSep: '.', aDec: ',' });
$(".price4").focus(function() {$(this).select();});
$(".number").numberFormat();
$(".number").focusout(function() {
$(".number").numberFormat();
});
$('.spinner').spinner();
$(".date").datepicker();
$(".date").mask("99/99/9999");
$('.date').change(function() {
$(this).unmask();
$(this).mask("99/99/9999");
if ($(this).val() != "") {
if (!isDateValid($(this).val())) {
alert("Data inválida.");
$(this).val("");
}
}
});
$(".cep").mask("99.999-999");
$(".tabs").tabs();
$('.tableDados tbody tr:odd').addClass('zebraUm');
$('.tableDados tbody tr:even').addClass('zebraDois');
$('.cnpjcpf').attr("maxlength", 18);
$('.cnpjcpf').attr("title", "Informar apenas números");
$('.cnpjcpf').focus(function() {
$(this).unmask();
});
$('.cnpjcpf').keyup(function() {
$(this).val(removeInvalido($(this).val()));
});
$('.cnpjcpf').blur(function() {
$(this).unmask();
$('.mensagem-alerta-cpf-cnpj-invalido').text("");
if (removeInvalido($(this).val()).length == 11) {
$(this).mask("999.999.999-99");
} else if (removeInvalido($(this).val()).length == 14) {
$(this).mask("99.999.999/9999-99");
} else if (removeInvalido($(this).val()).length > 0) {
$('.mensagem-alerta-cpf-cnpj-invalido').text("CPF/CNPJ está inválido.");
}
});
$('.fancybox').fancybox({
'width' : 880
});
$('.voltar').click(function() {
history.back()
});
function removeInvalido(cnpjcpf) {
return cnpjcpf.replace(/\D/g, '')
}
//Usar este padão
$('.tooltip_msg').qtip({
position: {
target: 'mouse', // Track the mouse as the positioning target
viewport: $(window),
adjust: {
x: 5,
y: 5,
method: 'flip flip'
}
}
});
//Não usar mais. Usar tooltip_msg
$('.msgLeft').qtip({
position: {
target: 'mouse', // Track the mouse as the positioning target
viewport: $(window),
adjust: {
x: 5,
y: 5,
method: 'flip flip'
}
}
});
//Não usar mais. Usar tooltip_msg
$('.msgRight').qtip({
position: {
target: 'mouse', // Track the mouse as the positioning target
viewport: $(window),
adjust: {
x: 5,
y: 5,
method: 'flip flip'
}
}
});
$("#sortable").sortable();
$("#sortable").disableSelection();
$('select[multiple]').multiselect({
placeholder: 'Selecione uma opção'
});
});
</script>]]>
|