summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/crosstab.js
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/script/crosstab.js')
-rw-r--r--admin/survey/script/crosstab.js46
1 files changed, 19 insertions, 27 deletions
diff --git a/admin/survey/script/crosstab.js b/admin/survey/script/crosstab.js
index e2bb144..78b2ac9 100644
--- a/admin/survey/script/crosstab.js
+++ b/admin/survey/script/crosstab.js
@@ -14,12 +14,6 @@ function add_new_variable(which) {
var spr = new Array();
var grid = new Array();
- if (which == '2' ) {
- //$('#crossRightHolder #crosstab_add_new').hide();
- } else {
- //$('#crossLeftHolder #crosstab_add_new').hide();
- }
-
$('select[name=crosstab_variable_'+which+']').each(function(index,el) {
sequence.push($(el).val());
});
@@ -32,19 +26,17 @@ function add_new_variable(which) {
$.post("ajax.php?t=crosstab&a=add_new_variable", {anketa:srv_meta_anketa_id, which:which, sequence:sequence, spr:spr, grid:grid, crossNavVsEno:crossNavVsEno}, function(response) {
if (which == '2' ) {
- $(response).appendTo('#crossRightHolder');
+ $(response).appendTo('#crossRightDropdowns');
} else {
- $(response).appendTo('#crossLeftHolder');
+ $(response).appendTo('#crossLeftDropdowns');
}
});
}
function crs_remove_variable(what) {
- $(what).parent().remove();
- if ( $(what).parent().find('select').val() > 0 ) {
- change_crosstab();
- }
+ $(what).parent().parent().remove();
+ change_crosstab();
}
function change_crosstab (action) {
@@ -108,7 +100,7 @@ function change_crosstab (action) {
var crossNavVsEno = $('#crossNavVsEno1').is(':checked') ? '1' : '0';
$("#crosstab_drobdowns").fadeTo(100, 0.2);
- $("#crosstab_table").fadeTo(100, 0.2);
+ $("#crosstab_tables").fadeTo(100, 0.2);
$("#crosstab_drobdowns").load("ajax.php?t=crosstab&a=changeDropdown", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
spr1:spr1, spr2:spr2 , crossNavVsEno:crossNavVsEno, grid1:grid1, grid2:grid2}, function() {
if (isNaN(spr1) && isNaN(spr2)) {
@@ -117,7 +109,7 @@ function change_crosstab (action) {
});
} else {
$("#crosstab_drobdowns").fadeTo(100, 1);
- $("#crosstab_table").fadeTo(100, 1);
+ $("#crosstab_tables").fadeTo(100, 1);
}
});
@@ -125,7 +117,7 @@ function change_crosstab (action) {
function change_crosstab_cb () {
$("#crosstab_drobdowns").fadeTo(100, 0.2);
- $("#crosstab_table").fadeTo(100, 0.2);
+ $("#crosstab_tables").fadeTo(100, 0.2);
// prebereomo dropdown variabli
@@ -149,12 +141,12 @@ function change_crosstab_cb () {
var crossNavVsEno = $('#crossNavVsEno1').is(':checked') ? '1' : '0';
- $("#crosstab_table").load("ajax.php?t=crosstab&a=change_cb", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
+ $("#crosstab_tables").load("ajax.php?t=crosstab&a=change_cb", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
//crossChk0:crossChk0, crossChk1:crossChk1, crossChk2:crossChk2, crossChk3:crossChk3,
//crossChkEC:crossChkEC, crossChkRE:crossChkRE,crossChkSR:crossChkSR,crossChkAR:crossChkAR, doColor:doColor,
spr1:spr1, spr2:spr2, crossNavVsEno:crossNavVsEno, grid1:grid1, grid2:grid2 }, function () {
$("#crosstab_drobdowns").fadeTo(100, 1);
- $("#crosstab_table").fadeTo(100, 1);
+ $("#crosstab_tables").fadeTo(100, 1);
});
}
@@ -203,20 +195,20 @@ function doInspectFromCrosstab(el,event) {
function doArchiveCrosstab() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function createArchiveCrosstabBeforeEmail() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
- var content = $("#crosstab_table").html();
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
+ var content = $("#crosstab_tables").html();
//global replace
var regex = new RegExp('ct_inspect', "g");
content = content.replace(regex, '');
@@ -230,9 +222,9 @@ function createArchiveCrosstabBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -240,13 +232,13 @@ function createArchiveCrosstabBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveCrosstabs() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
- var content = $("#crosstab_table").html();
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
+ var content = $("#crosstab_tables").html();
//global replace
var regex = new RegExp('ct_inspect', "g");
content = content.replace(regex, '');
@@ -263,7 +255,7 @@ function submitArchiveCrosstabs() {
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}