| Server IP : 104.21.80.248 / Your IP : 172.71.28.155 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/myschool/triamudom/tuprblearn/admin/tool/usertours/amd/src/ |
Upload File : |
/**
* Step management code.
*
* @module tool_usertours/managesteps
* @class managesteps
* @package tool_usertours
* @copyright 2016 Andrew Nicols <[email protected]>
*/
define(
['jquery', 'core/str', 'core/notification'],
function($, str, notification) {
var manager = {
/**
* Confirm removal of the specified step.
*
* @method removeStep
* @param {EventFacade} e The EventFacade
*/
removeStep: function(e) {
e.preventDefault();
var targetUrl = $(e.currentTarget).attr('href');
str.get_strings([
{
key: 'confirmstepremovaltitle',
component: 'tool_usertours'
},
{
key: 'confirmstepremovalquestion',
component: 'tool_usertours'
},
{
key: 'yes',
component: 'moodle'
},
{
key: 'no',
component: 'moodle'
}
])
.then(function(s) {
notification.confirm(s[0], s[1], s[2], s[3], function() {
window.location = targetUrl;
});
return;
})
.catch();
},
/**
* Setup the step management UI.
*
* @method setup
*/
setup: function() {
$('body').delegate('[data-action="delete"]', 'click', manager.removeStep);
}
};
return /** @alias module:tool_usertours/managesteps */ {
/**
* Setup the step management UI.
*
* @method setup
*/
setup: manager.setup
};
});