HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/i/e/s/iestorre/moodleAW/moodle04/backup/util/ui/yui/confirmcancel/confirmcancel.js
YUI.add('moodle-backup-confirmcancel', function(Y) {

// Namespace for the backup
M.core_backup = M.core_backup || {};
/**
 * Adds confirmation dialogues to the cancel buttons on the page.
 *
 * @param {object} config
 */
M.core_backup.watch_cancel_buttons = function(config) {
    Y.all('.confirmcancel').each(function(){
        this._confirmationListener = this._confirmationListener || this.on('click', function(e){
            // Prevent the default event (sumbit) from firing
            e.preventDefault();
            // Create the confirm box
            var confirm = new M.core.confirm(config);
            // If the user clicks yes
            confirm.on('complete-yes', function(e){
                // Detach the listener for the confirm box so it doesn't fire again.
                this._confirmationListener.detach();
                // Simulate the original cancel button click
                this.simulate('click');
            }, this);
            // Show the confirm box
            confirm.show();
        }, this);
    });
}

}, '@VERSION@', {'requires':['base','node','node-event-simulate','moodle-core-notification']});