tinymce.init({
mode : "exact",
elements : "biografia-parlamentar,casa-informacoes"
});
function refreshDatePicker() {
$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
$('.dateinput').datepicker();
}
function refreshMask() {
$('.telefone').mask("(99) 9999-9999", {placeholder:"(__) ____ -____"});
$('.cpf').mask("000.000.000-00", {placeholder:"___.___.___-__"});
$('.cep').mask("00000-000", {placeholder:"_____-___"});
$('.rg').mask("0.000.000", {placeholder:"_.___.___"});
$('.titulo_eleitor').mask("0000.0000.0000.0000", {placeholder:"____.____.____.____"});
$('.hora').mask("00:00", {placeholder:"hh:mm"});
$('.hora_hms').mask("00:00:00", {placeholder:"hh:mm:ss"});
}
function autorModal() {
$(function() {
var dialog = $("#modal_autor").dialog({
autoOpen: false,
modal: true,
width: 500,
height: 300,
show: {
effect: "blind",
duration: 500 },
hide: {
effect: "explode",
duration: 500
}
});
$( "#button-id-limpar" ).click(function() {
$("#nome_autor").text('');
$("#id_autor").val(null);
});
$("#button-id-pesquisar").click(function() {
$("#q").val('');
$("#div-resultado").children().remove();
$("#modal_autor").dialog( "open" );
$("#selecionar").attr("hidden", "hidden");
});
$( "#pesquisar" ).click(function() {
var query = $("#q").val()
$.get("/proposicoes/pesquisar_autores?q="+ query, function(
data, status){
$("#div-resultado").children().remove();
if (data.length == 0) {
$("#selecionar").attr("hidden", "hidden");
$("#div-resultado").html(
"Nenhum resultado");
return;
}
var select = $(
'');
for (i = 0; i < data.length; i++) {
id = data[i][0];
nome = data[i][1];
select.append($("