/**
 * Script for the tools page.
 *
 * @package flo-sync
 */

/* global northmill_online_shared_admin_sync, NMS_AJAX */
jQuery( document ).ready(
	function () {
		new NMF_Tools();
	}
);


class NMF_Tools {
	constructor() {
		jQuery( '#nm-remove-sync-3-data' ).click( this.remove_sync_3_data );
	}

	/**
	 * Remove Sync 3 data.
	 */
	remove_sync_3_data() {
		// Confirm action.
		if ( ! confirm( northmill_sync_admin_tools.l10n.confirm_remove_data ) ) {
			return;
		}

		NMS_AJAX.post(
			northmill_sync_admin_tools.remove_sync_3_data_ajax,
			{},
			NMS_AJAX.success_reload,
			NMS_AJAX.fail_alert
		);
	}
}
