181
| <![CDATA[<script>
var url = '/poll';
jQ = jQuery.noConflict();
// jQ.noConflict();
jQ(function() {
configureCaptcha();
refreshCaptcha();
var rating = jQ( ".divRating" );
var sendRating = jQ( "#sendRating" );
rating.popup({
position:'bottom left'
});
rating.hover(function() {
jQ('.iconCustom').transition('jiggle');
});
rating.click(function() {
sendRating.addClass("disabled");
jQ('#modalRating').modal({
onVisible: function () {
rating.popup({
position:'bottom left'
});
}
}).modal('show');
jQ('.iconCustom').transition('jiggle');
});
sendRating.click(function() {
var result = parseInt(jQ('.captchaV1').text())+ parseInt(jQ('.captchaV2').text());
if(parseInt(result) === parseInt(jQ('input.resultCaptcha').val())){
// console.log(jQ('#ratingForm').rating('get rating'));
sendEvaluation(url);
}else
jQ('.iconCustom').transition('jiggle');
});
});
function refreshCaptcha() {
jQ('.refreshCaptcha').click(function() {
a = Math.ceil(Math.random() * 10);
b = Math.ceil(Math.random() * 10);
c = jQ('input.resultCaptcha').val('');
jQ('.captchaV1').text(a);
jQ('.captchaV2').text(b);
jQ('input.resultCaptcha').focus();
jQ('#sendRating').addClass("disabled");
});
}
function configureCaptcha() {
jQ('input.resultCaptcha').on('input',function(e){
var result = parseInt(jQ('.captchaV1').text())+ parseInt(jQ('.captchaV2').text());
// console.log(result);
// console.log(jQ('input.resultCaptcha').val());
if(parseInt(result) === parseInt(jQ('input.resultCaptcha').val())){
jQ('#sendRating').removeClass("disabled");
}else{
jQ('#sendRating').addClass("disabled");
}
});
jQ('#ratingForm').rating({
initialRating: 3,
maxRating: 5
});
var a = Math.ceil(Math.random() * 10);
var b = Math.ceil(Math.random() * 10);
jQ('.captchaV1').text(a);
jQ('.captchaV2').text(b);
}
function sendEvaluation(url) {
var resultCaptcha = parseInt(jQ('.captchaV1').text()) + parseInt(jQ('.captchaV2').text());
var validateCaptcha = jQ('input.resultCaptcha').val();
var ratingValue = jQ('#ratingForm').rating('get rating');
var data = {operation: "saveEvaluation",
ratingValue: ratingValue,
resultCaptcha: resultCaptcha,
validateCaptcha: validateCaptcha
};
jQ.post(url, data, function (res) {
// console.log(res);
if(res.indexOf("success") >= 0){
jQ('#modalRating').modal('hide');
jQ('div.divRating')
.popup({
delay: {
hide: 900
},
position : 'right center',
target : 'div.divRating',
title : 'Avaliação!',
content : 'Sua avaliação foi registrada, Obrigado!'
}).popup('show');
}else{
jQ('#modalRating').modal('hide');
jQ('div.divRating')
.popup({
delay: {
hide: 900
},
position : 'right center',
target : 'div.divRating',
title : 'Avaliação incorreta!',
content : 'Avaliação não foi registrada!'
}).popup('show');
}
});
}
</script>]]>
|
520
| <![CDATA[<script>
function enviaForm(){
var form = document.getElementById('default');
form.target='_blank';
form.method='post';
form.action = '/periodicos';
form.submit();
}
var capturando="";
var place = document.getElementById('input').placeholder;
function enviaDefault() {
var form = document.getElementById('default');
form.method='get';
form.action = '/simple-search';
form.submit();
}
</script>]]>
|
718
| <![CDATA[<script>
var nameDialog = null;
function OpenInNewTabWinBrowser(url) {
var win = window.open(url, '_blank');
if (win) {
//Browser has allowed it to be opened
win.focus();
} else {
//Browser has blocked it
alert('Por favor, habilite os popups para este site para realizar o download');
}
}
var configuration = ({
afterClose: function (event) {
if (getCookie('capes-download-term-accepted') == 'accepted') {
// var uriDl = jQ("#callerUrl").val();
// OpenInNewTabWinBrowser(bslink);
// window.location = getBsLink();
setCookie('capes-download-term-accepted', 'undefined', 30);
}
}
});
function formatDcCreator(){
var test = jQ("#dccontributor").html() + "<br/>" +jQ("#dccreator").html();
if(jQ("#dccreator").html() != undefined){
jQ("#dccontributor").html(test);
}
}
window.bslink = null;
function configureCheckbox(intranet,condition,bslink) {
jQ('.ui.checkbox').checkbox({
onChecked: function () {
condition = jQ(this).val();
validateModal(intranet,condition,bslink);
// console.log(condition);
}
});
}
function validateModal(intranet,condition,bslink) {
jQ('.longer.modal').modal({
closable : true,
onApprove : function() {
// console.log('Approved!');
// console.log(intranet," ",condition);
if(condition === "yep"){
if(intranet != null){
bslink = bslink.children("#bsLinkClick").text();
OpenInNewTabWinBrowser(bslink);
bslink = "";
condition = "";
jQ('.ui.checkbox').checkbox('uncheck');
}else{
bslink = bslink.children("#bitLink").text();
OpenInNewTabWinBrowser(bslink);
bslink = "";
condition = "";
jQ('.ui.checkbox').checkbox('uncheck');
}
}else{
bslink = "";
condition = "";
jQ('.ui.checkbox').checkbox('uncheck');
}
}
})
}
function getBsLink(intranet,condition){
jQ(".btn.btnItemSelecionado").click(function (){
jQ('.longer.modal').modal('show');
configureCheckbox(intranet,condition,jQ(this));
// validateModal(intranet,condition);
});
}
jQ(document).ready(function () {
var condition = "";
getBsLink(null,condition);
formatDcCreator();
jQ("#itemFilesListt").find("a").click(function (event) {
var downloadChoice = getCookie('capes-download-term-accepted');
if (downloadChoice == undefined || downloadChoice != 'accepted') {
event.preventDefault();
jQ("#callerUrl").val(bslink);
jQ.featherlight(jQ("#download-term"), configuration);
}
});
jQ('#submit-term-option').click(function () {
if (jQ("input[name='download-term-option']:checked").val() == 'true') {
setCookie('capes-download-term-accepted', 'accepted', 30);
}
jQ.featherlight.current().close();
});
jQ('#submiteva').click(function (event) {
var vuser = 'null';
var vitemid = document.getElementById('item_id').value;
if (document.getElementById('grade1').checked) {
var vgrade = 1;
} else if (document.getElementById('grade2').checked) {
var vgrade = 2;
} else if (document.getElementById('grade3').checked) {
var vgrade = 3;
} else if (document.getElementById('grade4').checked) {
var vgrade = 4;
} else if (document.getElementById('grade5').checked) {
var vgrade = 5;
} else {
alert('Escolha uma nota!');
}
jQ.ajax({
url: '/evaluation-insert',
data: {'grade': vgrade, 'item_id': vitemid},
success: function (responseText) {
jQ('#response-evaluation').text(responseText);
}
});
});
jQ('#popup').click(function (event) {
event.preventDefault();
if (!nameDialog) // First time...
nameDialog = jQ.featherlight(jQ("#popupContact"), {'persist': true});
else // After that...
nameDialog.open();
});
jQ('#send-denun').click(function () {
if (document.getElementById('msg-d').value == "") {
alert("O campo motivo é obrigatório!");
} else {
var vname = document.getElementById('name-d').value;
var vemail = document.getElementById('email-d').value;
var vmsg = document.getElementById('msg-d').value;
var vitemid = document.getElementById('item_id1').value;
jQ.ajax({
url: '/evaluation-insert',
data: {'vname': vname, 'vemail': vemail, 'vmsg': vmsg, 'vitemid': vitemid},
success: function (responseText) {
jQ('#response-evaluation').text(responseText);
}
});
/*document.getElementById('abc').style.display = "none";*/
jQ.featherlight.current().close();
alert("Denuncia enviada com sucesso...");
}
});
});
</script>]]>
|
1224
| <![CDATA[<script>
jQ.fn.raty.defaults.path = '/static/lib/images';
jQ(function () {
jQ('#raty1').raty();
jQ('#raty2').raty({
click: function (score, evt) {
var vuser = 'null';
var vitemid = document.getElementById('item_id').value;
jQ.ajax({
url: '/evaluation-insert',
data: {'grade': score, 'item_id': vitemid},
success: function (responseText) {
jQ('#response-evaluation').text(responseText);
}
});
},
score: function () {
return jQ(this).attr('data-score');
}
});
});
// jQ('#submitBtn').click(function() {
// /* when the button in the form, display the entered values in the modal */
// jQ('#lname').text(jQ('#lastname').val());
// jQ('#fname').text(jQ('#firstname').val());
// });
//
// jQ('#submit').click(function(){
// /* when the submit button in the modal is clicked, submit the form */
// alert('submitting');
// jQ('#formfield').submit();
//// jQ('#').
//
// });
//
// jQ('#submit').onclick(function(){
// /* when the submit button in the modal is clicked, submit the form */
// jQ('#modall').modal.('hide');
//
// });
// jQ('#submit').submit(function(e) {
// e.preventDefault();
// // Coding
// jQ('#modall').modal('toggle'); //or jQ('#IDModal').modal('hide');
// return false;
// });
</script>]]>
|