Current File : /data/web/virtuals/215191/virtual/www/domains/gryna2.com.pl/swfobject/js/admin/gallery.js |
/**
* @author Jan Řasa, honza.rasa@seznam.cz
* @copyright 2012
* @description Gallery-admin functions
**/
function newGallery(){
var g_send_title = $(".gallery_title").val();
var g_send_description = $(".gallery_description").val();
$(".form_new").attr("disabled", "disabled");
$(".loading").css("display", "inline");
$.ajax({
type: "POST",
url: "../ajax/admin/gallery/new_gallery.php",
data: "title="+g_send_title+"&description="+g_send_description,
dataType: "html",
success: function(data){
//alert(data);
var output = data.split("|");
if(output[0] == "1"){
galleryStep(2);
gallery_id = output[1];
$(".gallery_id").val(gallery_id);
gallery_created = true;
}
else{
alert(output[1]);
}
}
});
$(".form_new").removeAttr("disabled")
$(".loading").css("display", "none");
}
function galleryStep(step){
switch(step){
case 2:{
$(".g_create_submit").css("display", "none");
$(".g_create_edit").css("display", "none");
$(".step").each(function(){
$(this).css("display", "none");
});
$(".step2").css("display", "");
//alert("d");
break;
}
}
gallery_step = step;
$(".step_back").css("display", "");
}
function step_back_gallery(){
if(gallery_step == 1){
return false;
}
step_number = gallery_step - 1;
switch(step_number){
case 1:{
$(".step").each(function(){
$(this).css("display", "none");
});
$(".step2").css("display", "");
$(".step_back").css("display", "none");
break;
}
}
}