$('#chart-calculate').click(function() {
var empty = false;
$('#chart-form input:not(#place)').each(function() {
if ($(this).val() == '') {
$(this).css('border', '1px solid #DB4B4B');
empty = true;
return;
} else $(this).css('border', '1px solid #CCC');
});
if (!empty && is_correct_data()) {
var name = $('#name').val();
var date = $('#date').val();
var time = $('#time').val();
var latitude = get_coordinates($('#latitude').val());
var longitude = get_coordinates($('#longitude').val());
var timezone = $('#timezone').val();
if (timezone.indexOf(':') + 1) { var tz = timezone.split(':'); timezone = (tz[1] == 0) ? tz[0] : timezone.replace(':', '.'); }
var page = ($('#not-astrologer').is(':checked')) ? 'horoscope' : 'analyse';
var href = page + '.php?name=' + name + '&date=' + date + '&time=' + time + '&latitude=' + latitude + '&longitude=' + longitude + '&timezone=' + timezone;
window.open(href, '_blank');
} else return false;
});
$( ".slideToggle" ).click(function() {
$(this).slideToggle();
}
function findObject(src, obj) {
for (var i = 0; i < src.length; i++) {
if ((src[i].color1 === obj.color1) && (src[i].color2 === obj.color2)) {
return src[i];
}
}
}
function addObject(dest, obj) {
dest.push(obj);
return obj;
}
function mergeImage(objDest, objSrc) {
objDest.image.push(...objSrc.image); //Здесь отредактировано
}
function tryFindObj(src, dest, obj) {
let findedObj = findObject(src, obj);
if (!findedObject) {
findedObject = addObject(dest, obj);
}
return findedObject;
}
function findSimilarObj(arr) {
const resultArr = [];
let tmpObj;
for (var i = 0; i < arr.length; i++) {
tmpObj = tryFindObj(arr, resultArr, arr[i]);
mergeImage(tmpObj, arr[i]);
}
}
success: function(json) {
$('.UrlInfoCount').html(JSON.parse(json).response.count); // количество