first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,69 @@
YUI.add('moodle-core-maintenancemodetimer', function (Y, NAME) {
/**
* Maintenance mode timer display.
*
* @module moodle-core-maintenancemodetimer
*/
var MAINTENANCEMODETIMER = function() {
MAINTENANCEMODETIMER.superclass.constructor.apply(this, arguments);
};
Y.extend(MAINTENANCEMODETIMER, Y.Base, {
timeleftinsec: 0,
maintenancenode: Y.one('.box.maintenancewarning'),
/**
* Initialise timer if maintenancemode set.
*
* @method initializer
* @param config {Array} array with timeleftinsec set.
*/
initializer: function(config) {
if (this.maintenancenode) {
this.timeleftinsec = config.timeleftinsec;
this.maintenancenode.setAttribute('aria-live', 'polite');
Y.later(1000, this, 'updatetimer', null, true);
}
},
/**
* Decrement time left and update display text.
*
* @method updatetimer
*/
updatetimer: function() {
this.timeleftinsec -= 1;
if (this.timeleftinsec <= 0) {
this.maintenancenode.set('text', M.util.get_string('sitemaintenance', 'admin'));
} else {
var a = {};
a.sec = this.timeleftinsec % 60;
a.min = Math.floor(this.timeleftinsec / 60) % 60;
a.hour = Math.floor(this.timeleftinsec / 3600);
if (a.hour > 0) {
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduledlong', 'admin', a));
} else {
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduled', 'admin', a));
}
}
// Set error class to highlight the importance.
if (this.timeleftinsec < 30) {
this.maintenancenode.addClass('alert-error')
.addClass('alert-danger')
.removeClass('alert-warning');
} else {
this.maintenancenode.addClass('alert-warning')
.removeClass('alert-error')
.removeClass('alert-danger');
}
}
});
M.core = M.core || {};
M.core.maintenancemodetimer = M.core.maintenancemodetimer || function(config) {
return new MAINTENANCEMODETIMER(config);
};
}, '@VERSION@', {"requires": ["base", "node"]});
@@ -0,0 +1 @@
YUI.add("moodle-core-maintenancemodetimer",function(t,e){var n=function(){n.superclass.constructor.apply(this,arguments)};t.extend(n,t.Base,{timeleftinsec:0,maintenancenode:t.one(".box.maintenancewarning"),initializer:function(e){this.maintenancenode&&(this.timeleftinsec=e.timeleftinsec,this.maintenancenode.setAttribute("aria-live","polite"),t.later(1e3,this,"updatetimer",null,!0))},updatetimer:function(){var e;--this.timeleftinsec,this.timeleftinsec<=0?this.maintenancenode.set("text",M.util.get_string("sitemaintenance","admin")):((e={}).sec=this.timeleftinsec%60,e.min=Math.floor(this.timeleftinsec/60)%60,e.hour=Math.floor(this.timeleftinsec/3600),0<e.hour?this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduledlong","admin",e)):this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduled","admin",e))),this.timeleftinsec<30?this.maintenancenode.addClass("alert-error").addClass("alert-danger").removeClass("alert-warning"):this.maintenancenode.addClass("alert-warning").removeClass("alert-error").removeClass("alert-danger")}}),M.core=M.core||{},M.core.maintenancemodetimer=M.core.maintenancemodetimer||function(e){return new n(e)}},"@VERSION@",{requires:["base","node"]});
@@ -0,0 +1,69 @@
YUI.add('moodle-core-maintenancemodetimer', function (Y, NAME) {
/**
* Maintenance mode timer display.
*
* @module moodle-core-maintenancemodetimer
*/
var MAINTENANCEMODETIMER = function() {
MAINTENANCEMODETIMER.superclass.constructor.apply(this, arguments);
};
Y.extend(MAINTENANCEMODETIMER, Y.Base, {
timeleftinsec: 0,
maintenancenode: Y.one('.box.maintenancewarning'),
/**
* Initialise timer if maintenancemode set.
*
* @method initializer
* @param config {Array} array with timeleftinsec set.
*/
initializer: function(config) {
if (this.maintenancenode) {
this.timeleftinsec = config.timeleftinsec;
this.maintenancenode.setAttribute('aria-live', 'polite');
Y.later(1000, this, 'updatetimer', null, true);
}
},
/**
* Decrement time left and update display text.
*
* @method updatetimer
*/
updatetimer: function() {
this.timeleftinsec -= 1;
if (this.timeleftinsec <= 0) {
this.maintenancenode.set('text', M.util.get_string('sitemaintenance', 'admin'));
} else {
var a = {};
a.sec = this.timeleftinsec % 60;
a.min = Math.floor(this.timeleftinsec / 60) % 60;
a.hour = Math.floor(this.timeleftinsec / 3600);
if (a.hour > 0) {
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduledlong', 'admin', a));
} else {
this.maintenancenode.set('text', M.util.get_string('maintenancemodeisscheduled', 'admin', a));
}
}
// Set error class to highlight the importance.
if (this.timeleftinsec < 30) {
this.maintenancenode.addClass('alert-error')
.addClass('alert-danger')
.removeClass('alert-warning');
} else {
this.maintenancenode.addClass('alert-warning')
.removeClass('alert-error')
.removeClass('alert-danger');
}
}
});
M.core = M.core || {};
M.core.maintenancemodetimer = M.core.maintenancemodetimer || function(config) {
return new MAINTENANCEMODETIMER(config);
};
}, '@VERSION@', {"requires": ["base", "node"]});