77
| <![CDATA[<script type="text/javascript">
jQuery(function ($) {
$(document).on('click', '.toolbar a[data-target]', function (e) {
e.preventDefault();
var target = $(this).data('target');
$('.widget-box.visible').removeClass('visible');//hide others
$(target).addClass('visible');//show target
});
$('form .required label').after("<i class='fa fa-asterisk text-danger' data-rel='popover' data-trigger='hover' data-placement='right' title='Campo Obrigat�rio' data-original-title='Campo Obrigat�rio'></i>");
$('[data-rel=tooltip]').tooltip({container: 'body'});
$('[data-rel=popover]').popover({container: 'body'});
$('#num_processo').mask('99999999999999-9');
$('input[mask="lat"]').mask("-99.999999");
$('input[mask="long"]').mask("-99.999999");
$('input[mask="cpf"]').mask("99999999999");
$('#cpf_cnpj').mask("99999999999999");
$('input[mask="decimal"]').maskMoney({symbol: "", decimal: ".", thousands: ""});
$('input[mask="cnpj"]').mask("99999999999999");
$('input[mask="cep"]').mask("99999-999");
$('input[mask="data"]').mask("99-99-9999");
$('input[mask="hora"]').mask("99:99");
$('input[mask="tel1"]').mask("(99)9999-9999");
$('.date-picker').datepicker({
language: 'pt-BR',
autoclose: true,
format: 'dd-mm-yyyy'
});
$('input[mask="tel"]').focusout(function () {
var aux = $('input[mask="tel"]').val();
aux = aux.replace(/[^\d]+/g, '');
if (aux.length > 10) {
$('input[mask="tel"]').mask("(99)99999-9999");
$('input[mask="tel"]').val(aux);
} else if (aux.length <= 10) {
$('input[mask="tel"]').mask("(99)9999-9999");
$('input[mask="tel"]').val(aux);
}
});
var cpf_cnpj = $('#cpf_cnpj');
cpf_cnpj.focusout(function () {
var aux = cpf_cnpj.val();
aux = aux.replace(/[^\d]+/g, '');
if (aux.length > 11) {
cpf_cnpj.mask("99999999999999");
cpf_cnpj.val(aux);
} else if (aux.length <= 11) {
cpf_cnpj.mask("99999999999");
cpf_cnpj.val(aux);
}
});
$('input[mask="tel"]').focusin(function () {
var aux = $('input[mask="tel"]').val();
aux = aux.replace(/[^\d]+/g, '');
$('input[mask="tel"]').mask("(99)99999-9999");
});
cpf_cnpj.focusin(function () {
var aux = cpf_cnpj.val();
aux = aux.replace(/[^\d]+/g, '');
cpf_cnpj.mask("99999999999999");
});
$('input[mask="certificado"]').focusout(function () {
var aux = $('input[mask="certificado"]').val();
aux = aux.replace(/[^\d]+/g, '');
if (aux.length > 5) {
$('input[mask="certificado"]').mask("99999999999999-9");
$('input[mask="certificado"]').val(aux);
} else if (aux.length <= 5) {
$('input[mask="certificado"]').mask("99999");
$('input[mask="certificado"]').val(aux);
}
});
$('input[mask="certificado"]').focusin(function () {
$('input[mask="certificado"]').mask("99999999999999-9");
});
$('.chosen').chosen({width: '100%'});
$('.date-time').datetimepicker({
// format: 'DD/MM/YYYY h:mm',//use this option to display seconds
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
});
window.Parsley
.addValidator('cpfCnpj', {
requirementType: 'string',
validateString: function (value, requirement) {
return valida_cpf_cnpj(value);
}
});
</script>]]>
|