31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-09-21 17:29:01 +00:00
patchtester/media/com_patchtester/js/patchtester.js

36 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-03-16 05:18:16 +00:00
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
2016-03-16 05:18:16 +00:00
* @license GNU General Public License version 2 or later
*/
2016-03-16 05:18:16 +00:00
if (typeof Joomla === 'undefined') {
throw new Error('PatchTester JavaScript requires the Joomla core JavaScript API')
}
2016-03-16 05:18:16 +00:00
!function (Joomla, window, document) {
'use strict';
2016-03-16 05:18:16 +00:00
window.PatchTester = {
/**
* Process the patch action
*
* @param {String} task The task to perform
* @param {Number} id The item ID
*/
submitpatch: function (task, id) {
var idField = document.getElementById('pull_id');
idField.value = id;
Joomla.submitform(task);
}
};
Joomla.submitbutton = function (task) {
2017-02-04 16:10:27 +00:00
if (task != 'reset' || confirm(Joomla.JText._('COM_PATCHTESTER_CONFIRM_RESET', 'Resetting will attempt to revert all applied patches and removes all backed up files. This may result in a corrupted environment. Are you sure you want to continue?'))) {
Joomla.submitform(task);
}
};
2016-03-16 05:18:16 +00:00
}(Joomla, window, document);