Skip to content

Commit

Permalink
Dev : clean and quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
louis committed Oct 7, 2015
1 parent 955446e commit 175b7bf
Showing 1 changed file with 73 additions and 100 deletions.
173 changes: 73 additions & 100 deletions scripts/admin/comfortupdater/displayComfortStep.js
@@ -1,102 +1,75 @@
$.fn.displayComfortStep = function(options)
{
// Will be used later for animation params
var defauts={};
var params=$.extend(defauts, options);

$ajaxLoader = $("#ajaxContainerLoading");
$ajaxLoader.show();

$("#preUpdaterContainer").empty();
$("#updaterLayout").show();
$("#updaterContainer").show();






// We need to know the destination build to resume any step
$destinationBuild = $('#destinationBuildForAjax').val();
$access_token = $('#access_tokenForAjax').val();
$url = "";


$("#step0Updt").removeClass("on").addClass("off");

switch(params.step) {
case "newKey":
$url = $("#newkeyurl").attr('data-url');
$("#welcome").hide();
$("#newKey").show();
break;

case "checkFiles":
$url = $("#filesystemurl").attr('data-url');
break;

case "checkLocalErrors":
$url = $("#checklocalerrorsurl").attr('data-url');
break;

case "welcome":
$url = $("#welcomeurl").attr('data-url');
break;

}

$url += '?destinationBuild=' + $destinationBuild + '&access_token=' + $access_token;

/*
$url += '?destinationBuild=' + $destinationBuild + '&access_token=' + $access_token;
$.ajax({
url: $url,
success: function(html) {
// We hide the loader, and we append the submit new key content
$ajaxLoader.hide();
$("#updaterContainer").empty().append(html);
// Menus
$("#welcome").hide();
$("#newKey").show();
},
error : function(html, statut){
$("#preUpdaterContainer").empty();
$("#updaterLayout").show();
$("#updaterContainer").show();
$("#updaterContainer").empty().append("<span class='error'>you have an error, or a notice, inside your local installation of limesurvey. See : <br/></span>");
$("#updaterContainer").append(html.responseText);
}
});
*/

// Those datas are defined in _ajaxVariables view
datas = 'destinationBuild=' + $destinationBuild + '&access_token=' + $access_token + '&'+csrf_token_name+'='+csrf_token;

$.ajax({
type: "POST",
data: datas,
url: $url,
success: function(html) {
// We hide the loader, and we append the submit new key content
$ajaxLoader.hide();
$("#updaterContainer").empty().append(html);

// Menus

},
error : function(html, statut){
$("#preUpdaterContainer").empty();
$("#updaterLayout").show();
$("#updaterContainer").show();

$("#updaterContainer").empty().append("<span class='error'>you have an error, or a notice, inside your local installation of limesurvey. See : <br/></span>");
$("#updaterContainer").append(html.responseText);
}
});

}

};
// Will be used later for animation params
var defauts={};
var params=$.extend(defauts, options);

$ajaxLoader = $("#ajaxContainerLoading");
$ajaxLoader.show();

$("#preUpdaterContainer").empty();
$("#updaterLayout").show();
$("#updaterContainer").show();






// We need to know the destination build to resume any step
$destinationBuild = $('#destinationBuildForAjax').val();
$access_token = $('#access_tokenForAjax').val();
$url = "";


$("#step0Updt").removeClass("on").addClass("off");

switch(params.step) {
case "newKey":
$url = $("#newkeyurl").attr('data-url');
$("#welcome").hide();
$("#newKey").show();
break;

case "checkFiles":
$url = $("#filesystemurl").attr('data-url');
break;

case "checkLocalErrors":
$url = $("#checklocalerrorsurl").attr('data-url');
break;

case "welcome":
$url = $("#welcomeurl").attr('data-url');
break;

}

$url += '?destinationBuild=' + $destinationBuild + '&access_token=' + $access_token;

// Those datas are defined in _ajaxVariables view
datas = 'destinationBuild=' + $destinationBuild + '&access_token=' + $access_token + '&'+csrf_token_name+'='+csrf_token;

$.ajax({
type: "POST",
data: datas,
url: $url,
success: function(html) {
// We hide the loader, and we append the submit new key content
$ajaxLoader.hide();
$("#updaterContainer").empty().append(html);

// Menus

},
error : function(html, statut){
$("#preUpdaterContainer").empty();
$("#updaterLayout").show();
$("#updaterContainer").show();

$("#updaterContainer").empty().append("<span class='error'>you have an error, or a notice, inside your local installation of limesurvey. See : <br/></span>");
$("#updaterContainer").append(html.responseText);
}
});

};

0 comments on commit 175b7bf

Please sign in to comment.