summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/zankaProfiles.js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/script/zankaProfiles.js
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/script/zankaProfiles.js')
-rw-r--r--admin/survey/script/zankaProfiles.js47
1 files changed, 28 insertions, 19 deletions
diff --git a/admin/survey/script/zankaProfiles.js b/admin/survey/script/zankaProfiles.js
index 43c0cc5..ff251a3 100644
--- a/admin/survey/script/zankaProfiles.js
+++ b/admin/survey/script/zankaProfiles.js
@@ -15,6 +15,7 @@ function changeViewZankaProfile(pid){
// funkcije ki skrbijo za profil zank
function zankaProfileAction(action) {
+
if (action == 'showProfiles') {
$('#fade').fadeTo('slow', 1);
// poiščemo center strani
@@ -26,19 +27,23 @@ function zankaProfileAction(action) {
var top = height / 2 - (msg.height() / 2);
}).show(200).draggable( { delay : 100, cancel : '#fs_list, input, .buttonwrapper, .select' });
- } else if (action == 'cancle') {
+ }
+ else if (action == 'cancle') {
$("#div_zanka_profiles").hide(200);
$('#fade').fadeOut('slow');
$("#div_zanka_profiles").html('');
return reloadData();
- } else if (action == 'newName') { // dodelimo novo ime profilu
+ }
+ else if (action == 'newName') { // dodelimo novo ime profilu
$("#zankaProfileCoverDiv").show();
$("#newProfileDiv").show();
- } else if (action == 'newCancle') { // preklicemo nov profil
+ }
+ else if (action == 'newCancle') { // preklicemo nov profil
$("#zankaProfileCoverDiv").hide();
$("#newProfileDiv").hide();
- } else if (action == 'newCreate') { // shranimo kot nov profil in pozenemo
+ }
+ else if (action == 'newCreate') { // shranimo kot nov profil in pozenemo
var profileName = $("#newProfileName").val();
var data = $.dds.serialize( 'fs_list_4' );
var mnozenje = 0;
@@ -46,13 +51,16 @@ function zankaProfileAction(action) {
$.post('ajax.php?t=zankaProfile&a=createProfile', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, profileName:profileName, data:data, mnozenje:mnozenje }, function(newId) {
zankaProfileAction('showProfiles');
});
- } else if (action == 'deleteAsk') { // vprašamo po potrditvi za brisanje
+ }
+ else if (action == 'deleteAsk') { // vprašamo po potrditvi za brisanje
$("#zankaProfileCoverDiv").show();
$("#deleteProfileDiv").show();
- } else if (action == 'deleteCancle') { // preklicemo brisanje
+ }
+ else if (action == 'deleteCancle') { // preklicemo brisanje
$("#deleteProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'deleteConfirm') { // izbrisemo profil
+ }
+ else if (action == 'deleteConfirm') { // izbrisemo profil
var pid = $("#zanka_profile .active").attr('value');
$.post('ajax.php?t=zankaProfile&a=delete_profile', { anketa : srv_meta_anketa_id, pid : pid }, function() {
$("#div_zanka_profiles").load(
@@ -64,13 +72,16 @@ function zankaProfileAction(action) {
});
$("#deleteProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'renameAsk') { // vprašamo za preimenovanje
+ }
+ else if (action == 'renameAsk') { // vprašamo za preimenovanje
$("#renameProfileDiv").show();
$("#zankaProfileCoverDiv").fadeIn();
- } else if (action == 'renameCancle') { // preklicemo preimenovanje
+ }
+ else if (action == 'renameCancle') { // preklicemo preimenovanje
$("#renameProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'renameConfirm') { // preimenujemo profil
+ }
+ else if (action == 'renameConfirm') { // preimenujemo profil
var pid = $("#zanka_profile .active").attr('value');
var name = $("#renameProfileName").val();
@@ -84,7 +95,8 @@ function zankaProfileAction(action) {
$("#zankaProfileCoverDiv").fadeOut();
});
});
- } else if (action == 'run' || action == 'runSession') { // shranimo kot nov profil in pozenemo
+ }
+ else if (action == 'run' || action == 'runSession') { // shranimo kot nov profil in pozenemo
var pid = $("#zanka_profile .active").attr('value');
var data = $.dds.serialize( 'fs_list_4' );
var mnozenje = 0;
@@ -92,24 +104,21 @@ function zankaProfileAction(action) {
// ce imamo mnozjenje pustimo max 2 variabli
if ( mnozenje * $("#fs_list_4 li").length > 2) {
- alert(lang['srv_loop_multiplication_error']);
+ genericAlertPopup('srv_loop_multiplication_error');
} else {
$.post('ajax.php?t=zankaProfile&a=run', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, data:data, mnozenje:mnozenje, run:action, pid:pid }, function() {
-// window.location.reload();
-// return '';
return reloadData('zanka');
});
}
- } else if (action == 'change') {
+ }
+ else if (action == 'change') {
$("#loading").show();
var pid = $("#current_zanka_profile").val();
$.post('ajax.php?t=zankaProfile&a=change_profile', { anketa : srv_meta_anketa_id, pid : pid}, function() {
-// window.location.reload();
-// return '';
return reloadData();
});
} else {
- alert('Missing action:'+action)
+ genericAlertPopup('alert_missing_action',action)
};
-} \ No newline at end of file
+}