632
| <![CDATA[<script>
$('#UNASUSTemplate_menu').sidebar({
transition: 'push',
onVisible: function () {
$('#UNASUSTemplate_sidebar i').removeClass("sidebar");
$('#UNASUSTemplate_menu_right3').sidebar('hide');
},
onShow: function () {
$('#UNASUSTemplate_sidebar i').addClass("arrow left");
},
onHide: function () {
$('#UNASUSTemplate_sidebar i').removeClass("arrow left");
},
onHidden: function () {
$('#UNASUSTemplate_sidebar i').addClass("sidebar");
},
}).sidebar('attach events', '#UNASUSTemplate_sidebar');
$('.coupled.modal').modal({
observeChanges: true,
allowMultiple: true,
});
function mostra_termo_de_uso() {
$('#UNASUSTemplate_termo_de_uso_modal').modal('show');
}
;
$('#UNASUSTemplate_termo_de_uso_modal').modal({
onShow: function () {
$("#UNASUSTemplate_termo_de_uso").load("https://acesso.unasus.gov.br/acesso/pub/termosDeUso/view");
}
});
$('#UNASUSTemplate_body')
.visibility({
once: false,
onTopPassed: function (calculations) {
},
onTopPassedReverse: function (calculations) {
}
})
;
</script>]]>
|
682
| <![CDATA[<script>
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['setUserId', '']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['trackVisibleContentImpressions']);
(function () {
var u = "https://www.unasus.gov.br/statistics";
_paq.push(['setTrackerUrl', u + '/matomo.php']);
_paq.push(['setSiteId', '1']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = 'https://www.unasus.gov.br/statistics/matomo.js';
s.parentNode.insertBefore(g, s);
})();
$('#menu_edicao')
.dropdown()
;
$('#UNASUSTemplate_menu_right').sidebar({
transition: 'overlay',
dimPage: false,
onVisible: function () {
$('#menu_administracao').attr('style', 'height: 100%; color: white !important; background: rgba(16, 100, 176, 1); border-radius: 0;');
$('#UNASUSTemplate_menu_right2').sidebar('hide');
$('#UNASUSTemplate_menu_right3').sidebar('hide');
},
onShow: function () {
},
onHide: function () {
$('#menu_administracao').attr('style', 'height: 100%;');
},
onHidden: function () {
},
}).sidebar('attach events', '#menu_administracao');
$('#UNASUSTemplate_menu_right2').sidebar({
transition: 'overlay',
dimPage: false,
onVisible: function () {
$('#menu_servicos').attr('style', 'height: 100%; color: white !important; background: rgba(16, 100, 176, 1); border-radius: 0;');
$('#UNASUSTemplate_menu_right').sidebar('hide');
$('#UNASUSTemplate_menu_right3').sidebar('hide');
},
onShow: function () {
},
onHide: function () {
$('#menu_servicos').attr('style', 'height: 100%;');
},
onHidden: function () {
},
}).sidebar('attach events', '#menu_servicos');
$('#UNASUSTemplate_menu_right3').sidebar({
transition: 'overlay',
dimPage: true,
onVisible: function () {
$('#menu_usuario').attr('style', 'height: 57px; width:57px; padding-left:10px !important; color: white !important; background: rgba(16, 100, 176, 1); border-radius: 0;');
$('#UNASUSTemplate_menu').sidebar('hide');
$('#UNASUSTemplate_menu_right').sidebar('hide');
$('#UNASUSTemplate_menu_right2').sidebar('hide');
},
onShow: function () {
},
onHide: function () {
$('#menu_usuario').attr('style', 'height: 57px; width:57px; padding-left:10px !important;');
},
onHidden: function () {
},
}).sidebar('attach events', '#menu_usuario');
</script>]]>
|
762
| <![CDATA[<script>
var $buoop = {notify: {i: 12, f: 56, o: 49, s: 9, c: 60}, insecure: true, unsupported: true, style: "corner", api: 5};
function $buo_f() {
var e = document.createElement("script");
e.src = "/js/update.min.js";
document.body.appendChild(e);
}
;
try {
document.addEventListener("DOMContentLoaded", $buo_f, false)
} catch (e) {
window.attachEvent("onload", $buo_f)}
</script>]]>
|
779
| <![CDATA[<script>
/**
* Get the URL parameters
* source: https://css-tricks.com/snippets/javascript/get-url-variables/
* @param {String} url The URL
* @return {Object} The URL parameters
*/
var getParams = function (url) {
var params = {};
var parser = document.createElement('a');
parser.href = url;
var query = parser.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
params[pair[0]] = decodeURIComponent(pair[1]);
}
return params;
};
$('#recurso')
.dropdown({
transition: 'none',
direction:'downward',
duration: 200,
apiSettings: {
url: 'rest/busca/autocomplete/{query}',
cache: false
},
message: {
addResult: 'Adicionado <b>{term}</b>',
count: '{count} selecionado',
maxSelections: 'Máximo de {maxCount} seleções',
noResults: 'Nenhum resultado encontrado.'
},
minCharacters: 3,
onChange(value, text, $choice) {
$('#button_search').click();
},
onLabelCreate(value, text) {
return $('<a class="ui green label" data-value="'+value+'">'+text+'<i class="delete icon"></i></a>');
},
onAdd(addedValue, addedText, $addedChoice) {
$('#recurso .menu').removeClass("visible").addClass( "hidden");
$('#recurso').removeClass("active").removeClass("visible");
$('#recurso').find(".search").val("");
},
})
;
$('#filtro_acervo')
.dropdown({
onChange: function (value, text, choice) {
$('#button_search').click();
}
})
;
function mudar_acervo(element) {
$('#filtro_acervo').dropdown('set selected',$(element).data("content"));
}
$('#filtro_ordenacao')
.dropdown({
onChange: function (value, text, choice) {
$('#button_search').click();
}
})
;
function montaResposta(response) {
$('#button_proximo').hide();
var hea1 = document.getElementById("resultado_resumo1");
var hea2 = document.getElementById("resultado_resumo2");
var hea3 = document.getElementById("resultado_resumo3");
var resu = document.getElementById("resultado");
var total = response.results.total;
var proximo = response.results.proximo;
if (response.results.acervos) {
var resumo_acervos = '';
for (var key in response.results.acervos) {
if (key != 'NC') {
switch (key) {
case 'Material multimídia':
icon = 'server';
break;
case 'Trabalho de conclusão de curso':
icon = 'student';
break;
case 'Documento institucional':
icon = 'university';
break;
case 'Texto':
icon = 'font';
break;
case 'Vídeo':
icon = 'film';
break;
case 'Áudio':
icon = 'sound';
break;
case 'Imagem':
icon = 'image';
break;
default:
icon = '';
break;
}
resumo_acervos += '<a href="#" onClick="mudar_acervo(this); return false;" class="ui image" style="color:green" data-content="' + key + '"><i class="green ' + icon + ' icon"></i>' + response.results.acervos[key] + ' ; ;</a>';
}
}
hea3.innerHTML = resumo_acervos;
} else {
hea3.innerHTML = '';
}
total_texto = null;
if (total === 0) {
total = 'Nenhum';
total_texto = 'Recurso';
}
if (total === 1) {
total_texto = 'Recurso';
}
if (total > 1) {
total_texto = 'Recursos';
}
if (!total_texto) {
total = 'Erro';
total_texto = 'ao buscar resultados!';
}
hea1.innerHTML = '<div class="ui container column floated right aligned"><div class="ui mini statistic"><div class="value">'+total+'</div><div class="label">'+total_texto+'</div></div></div>';
hea2.innerHTML = '<div class="ui container column floated center aligned"><div class="ui mini statistic"><div class="value">'+total+' ; ;'+total_texto+'</div></div>';
for (item in response.results.itens) {
var codigo = response.results.itens[item].codigo;
var handle = response.results.itens[item].handle;
var acervo = response.results.itens[item].acervo;
var dt_publicacao = response.results.itens[item].data_publicacao;
var metadados = response.results.itens[item].metadados;
var met = [];
var autores_ord = [];
var autores = '';
for (metadado in metadados) {
if (metadados[metadado].nome === 'dc.contributor.author') {
autores_ord[metadados[metadado].sequencia] = metadados[metadado].valor;
} else {
met[metadados[metadado].nome] = metadados[metadado].valor;
}
}
for (autor in autores_ord) {
if (autores === '') {
autores = autores_ord[autor];
} else {
autores += ' ; ' + autores_ord[autor];
}
;
}
var div = document.createElement('div');
div.setAttribute('class', 'item');
div.innerHTML = '';
switch (acervo) {
case 'Material multimídia':
icon = 'server';
break;
case 'Trabalho de conclusão de curso':
icon = 'student';
break;
case 'Documento institucional':
icon = 'university';
break;
case 'Texto':
icon = 'font';
break;
case 'Vídeo':
icon = 'film';
break;
case 'Áudio':
icon = 'sound';
break;
default:
icon = '';
break;
}
div.innerHTML += '<div class="ui image" data-content="' + acervo + '"><i class="huge icons"><i class="file outline green icon"></i><i class="corner ' + icon + ' green mini icon"></i></i></div>';
div.innerHTML += '<div class="content">' +
' <a class="ui header" href="./recurso/' + handle + '">' + met['dc.title'] + '</a>' +
' <div class="meta"><i>' + autores + '</i><span>(' + moment(dt_publicacao).format('DD/MM/YYYY') + ')</span></div>' +
' <div id="abstract_' + codigo + '" class="description abstract">' +
' <p>' + met['dc.description.abstract'] + '</p>' +
' </div><div class="ui divider"></div>' +
'</div>';
resu.appendChild(div);
}
if (proximo) {
$('#button_proximo').attr("data-ativado", 0);
$('#button_proximo').attr("data-proximo", proximo);
$('#button_proximo').show();
$('#button_proximo').visibility('refresh');
}
$('.image').popup({
transition: 'fade'
});
}
$('#button_search')
.api({
url: 'rest/busca',
method: 'POST',
beforeSend: function (settings) {
$('#recurso').addClass('loading');
settings.data.busca = document.getElementById('input_search').value;
settings.data.ordenacao = document.getElementById('input_ordenacao').value;
settings.data.acervo = document.getElementById('input_acervo').value;
settings.data.proximo = 0;
return settings;
},
onResponse: function (response) {
document.getElementById("resultado").innerHTML = '';
montaResposta(response);
$('#recurso').removeClass('loading');
var getUrl = window.location;
var baseUrl = getUrl .protocol + "//" + getUrl.host + "/recursos/busca";
window.history.replaceState(null,null, baseUrl+'?'+'acervo='+document.getElementById('input_acervo').value+'&busca='+document.getElementById('input_search').value+'&ordenacao='+document.getElementById('input_ordenacao').value);
}
})
;
$('#button_proximo')
.api({
url: 'rest/busca',
method: 'POST',
beforeSend: function (settings) {
settings.data.busca = document.getElementById('input_search').value;
settings.data.ordenacao = document.getElementById('input_ordenacao').value;
settings.data.acervo = document.getElementById('input_acervo').value;
settings.data.proximo = document.getElementById('button_proximo').getAttribute("data-proximo");
return settings;
},
onResponse: function (response) {
montaResposta(response);
}
})
;
$(document).ready(function () {
var param = getParams(window.location.href);
if (param['ordenacao']) { $('#filtro_ordenacao').dropdown('set selected', param['ordenacao']); }
if (param['acervo']) { $('#filtro_acervo').dropdown('set selected', param['acervo']); }
if (param['busca']) {
parametros = param['busca'].split(',');
$('#recurso').dropdown('set value', param['busca']);
for (param in parametros) {
$('#recurso').dropdown('add label', parametros[param], parametros[param]);
}
}
$('#button_search').click();
$('#button_proximo').hide();
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('a[href="#top"]').fadeIn();
} else {
$('a[href="#top"]').fadeOut();
}
});
$('a[href="#top"]').click(function(){
$('html, body').animate({scrollTop : 0},800);
return false;
});
});
$('#button_proximo')
.visibility({
once: false,
onBottomVisible: function () {
$data_proximo = document.getElementById('button_proximo').getAttribute("data-proximo");
$data_ativado = document.getElementById('button_proximo').getAttribute("data-ativado");
if ($data_proximo == 0) {
} else {
if ($data_ativado == 0) {
$('#button_proximo').attr("data-ativado", 1);
$('#button_proximo').click();
}
}
},
})
;
$('select').dropdown({
direction:'downward',
duration: 200,
onShow: function(evt){
$(this).find('select').trigger('click');return false;
},
});
</script>]]>
|