Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
louis
committed
Oct 7, 2015
1 parent
955446e
commit 175b7bf
Showing
1 changed file
with
73 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
}); | ||
|
||
}; |