phpBB

Code Changes

File: adm/style/ajax.js

  Unmodified   Added   Modified   Removed
Line 1Line 1
/* global phpbb */

/* global phpbb, statsData */


(function($) { // Avoid conflicts with other libraries



(function($) { // Avoid conflicts with other libraries


Line 74Line 74
			var $sendStatisticsSuccess = $('<input />', {
type: 'hidden',
name: 'send_statistics_response',

			var $sendStatisticsSuccess = $('<input />', {
type: 'hidden',
name: 'send_statistics_response',

				value: res

				value: JSON.stringify(res)

			});
$sendStatisticsSuccess.appendTo('p.submit-buttons');


			});
$sendStatisticsSuccess.appendTo('p.submit-buttons');


Line 87Line 87
		$.ajax({
url: $this.attr('data-ajax-action').replace('&amp;', '&'),
type: 'POST',

		$.ajax({
url: $this.attr('data-ajax-action').replace('&amp;', '&'),
type: 'POST',

			data: 'systemdata=' + encodeURIComponent($this.find('input[name=systemdata]').val()),

			data: statsData,

			success: returnHandler,
error: errorHandler,
cache: false

			success: returnHandler,
error: errorHandler,
cache: false

Line 154Line 154
phpbb.addAjaxCallback('row_delete', function(res) {
if (res.SUCCESS !== false) {
$(this).parents('tr').remove();

phpbb.addAjaxCallback('row_delete', function(res) {
if (res.SUCCESS !== false) {
$(this).parents('tr').remove();

	}
});

/**
* Callbacks for extension actions
*/
phpbb.addAjaxCallback('ext_enable', function(res) {
if (res.EXT_ENABLE_SUCCESS) {
move_to_enabled(this.parentNode.parentNode);
set_actions(this.parentNode, res.ACTIONS);
show_enabled_header();
hide_disabled_header_if_empty();
}
});
phpbb.addAjaxCallback('ext_delete_data', function(res) {
if (res.EXT_DELETE_DATA_SUCCESS) {
move_to_disabled(this.parentNode.parentNode);
set_actions(this.parentNode, res.ACTIONS);
show_disabled_header();
hide_enabled_header_if_empty();
}
});
phpbb.addAjaxCallback('ext_disable', function(res) {
if (res.EXT_DISABLE_SUCCESS) {
move_to_disabled(this.parentNode.parentNode);
set_actions(this.parentNode, res.ACTIONS);
show_disabled_header();
hide_enabled_header_if_empty();

 
	}
});


	}
});


Line 201Line 173
	var permissionSubmitSize = 0,
permissionRequestCount = 0,
forumIds = [],

	var permissionSubmitSize = 0,
permissionRequestCount = 0,
forumIds = [],

		permissionSubmitFailed = false;



		permissionSubmitFailed = false,
clearIndicator = true,
$loadingIndicator;


if ($submitAllButton !== $submitButton) {
fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id);


if ($submitAllButton !== $submitButton) {
fieldsetList = $form.find('fieldset#' + $submitButton.closest('fieldset.permissions').id);

Line 234Line 208
			forumIds.push(value.value);
}
});

			forumIds.push(value.value);
}
});

 

$loadingIndicator = phpbb.loadingIndicator();


/**
* Handler for submitted permissions form chunk


/**
* Handler for submitted permissions form chunk

Line 250Line 226
		} else if (!permissionSubmitFailed && res.S_USER_NOTICE) {
// Display success message at the end of submitting the form
if (permissionRequestCount >= permissionSubmitSize) {

		} else if (!permissionSubmitFailed && res.S_USER_NOTICE) {
// Display success message at the end of submitting the form
if (permissionRequestCount >= permissionSubmitSize) {

 
				clearIndicator = true;


				var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
var $alertBoxLink = $alert.find('p.alert_text > a');


				var $alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT);
var $alertBoxLink = $alert.find('p.alert_text > a');


Line 299Line 277
						$form.submit();
}, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds
}

						$form.submit();
}, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds
}

 
			} else {
// Still more forms to submit, so do not clear indicator
clearIndicator = false;
}
}

if (clearIndicator) {
phpbb.clearLoadingTimeout();

if ($loadingIndicator) {
$loadingIndicator.fadeOut(phpbb.alertTime);

			}
}
}

			}
}
}