HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/assets/scripts/admin/comfortupdate/buildComfortButtons.js
/**
 * Plugin to build the ComfortUpdate Buttons
 * @param {Object} options
 */
$.fn.buildComfortButtons = function(options)
{
	// Will be used later for animation params
	var defauts={};  
	var params=$.extend(defauts, options); 
	
	return this.each(function(){
		$(this).on('click', function(e){
			// First, we check the required branches, depending of the user choice "Show update notifications: " 
			
			$urlBothButton = $("#updatebothbranchdatas").attr('data-url');             // URL generated by yii inside _ajaxVariable view
			$urlStableButton = $("#updatestrablebranchdatas").attr('data-url');        // URL generated by yii inside _ajaxVariable view
			$url = $("#updateBranch").val() == "both" ? $urlBothButton : $urlStableButton;  //  #updateBranch generated by php update controller inside the view)
			
			//We show the loader
			$("#updatesavailable").empty();	$("#ajaxLoading").show();
		    
		    // We request and append the html button  
		    $.ajax({
				url : $url,
				type : 'GET',
				dataType : 'html', 
				
				// html contains the buttons
				success : function(html, statut){
						$("#ajaxLoading").hide();
						$("#updatesavailable").empty().append(html);
				},
				error :  function(html, statut){
					$("#ajaxLoading").hide();
					$("#updatesavailable").empty().append("<span class='error'>You have an error, or a notice, inside your local installation of limesurvey. See : <br/></span>");
					$("#updatesavailable").append(html.responseText);
				}
		    });
		});
	});
};