Merge branch 'wip-mdl-42597' of https://github.com/rajeshtaneja/moodle
[moodle.git] / lib / yui / build / moodle-core-maintenancemode / moodle-core-maintenancemode-min.js
CommitLineData
f487a8f8 1YUI.add("moodle-core-maintenancemode",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(MAINTENANCEMODE,e.Base,{timeleftinsec:0,maintenancenode:e.one(".box.maintenancewarning"),initializer:function(t){this.maintenancenode&&(this.timeleftinsec=t.timeleftinsec,this.maintenancenode.setAttribute("aria-live","polite"),e.later(1e3,this,"updatetimer",null,!0))},updatetimer:function(){this.timeleftinsec-=1;if(this.timeleftinsec<=0)this.maintenancenode.set("text",M.str.admin.sitemaintenance);else{var e={};e.sec=this.timeleftinsec%60,e.min=Math.floor(this.timeleftinsec/60),this.maintenancenode.set("text",M.util.get_string("maintenancemodeisscheduled","admin",e))}this.timeleftinsec<30?this.maintenancenode.addClass("error").removeClass("warning"):this.maintenancenode.addClass("warning").removeClass("error")}}),M.core=M.core||{},M.core.maintenancemodetimer=M.core.maintenancemodetimer||function(e){return new n(e)}},"@VERSION@",{requires:["base","node"]});