You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
$(document).ready(function() {
|
|
$('.has-datepicker').datepicker({dateFormat: 'dd.mm.yy'});
|
|
|
|
$('.captcha_refresh').click(function(e) {
|
|
e.preventDefault();
|
|
var $form = $(this).parents('form');
|
|
var url = location.protocol + "//" + window.location.hostname + ":"
|
|
+ location.port + "/captcha/refresh/";
|
|
|
|
$.getJSON(url, {}, function(json) {
|
|
$form.find('input[name="captcha_1"]').val('');
|
|
$form.find('input[name="captcha_0"]').val(json.key);
|
|
$form.find('img.captcha').attr('src', json.image_url);
|
|
});
|
|
});
|
|
});
|
|
|
|
function fetch_data(url, async) {
|
|
// makes ajax call (synced by default)
|
|
var result = null;
|
|
$.ajax({
|
|
'async': async || false,
|
|
'global': false,
|
|
'cache': false,
|
|
'url': url,
|
|
'dataType': "json",
|
|
'timeout': 30000,
|
|
'success': function (data) {
|
|
result = data;
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
|
|
function getUrlVars() {
|
|
var vars = [], hash;
|
|
var href = window.location.href;
|
|
var hashes = href.slice(href.indexOf('?') + 1).split('&');
|
|
for (var i=0; i<hashes.length; i++) {
|
|
hash = hashes[i].split('=');
|
|
vars.push(hash[0]);
|
|
vars[hash[0]] = hash[1];
|
|
}
|
|
return vars;
|
|
}
|
|
|
|
|