Merge branch 'MDL-83648_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE

This commit is contained in:
Jun Pataleta 2024-12-02 17:24:32 +08:00
commit 02d5efc450
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
8 changed files with 14 additions and 14 deletions

View File

@ -85,11 +85,11 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
self.hide();
}, delay);
}
this.after('visibleChange', this.visibilityChanged, this);
this.after('visibleChange', this.errorVisibilityChanged, this);
this._keypress = Y.on('key', this.hide, window, 'down:13, 27', this);
this.centerDialogue();
},
visibilityChanged: function(e) {
errorVisibilityChanged: function(e) {
if (e.attrName === 'visible' && e.prevVal && !e.newVal) {
var self = this;
this._keypress.detach();

View File

@ -1 +1 @@
YUI.add("moodle-core-notification-ajaxexception",function(a,e){var t;M.core=M.core||{},a.extend(t=function(e){e.name=e.name||M.util.get_string("error","moodle"),e.closeButton=!0,t.superclass.constructor.apply(this,[e])},M.core.notification.info,{_keypress:null,initializer:function(e){var t=this,i=this.get("hideTimeoutDelay"),o=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(a.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+a.Escape.html(e.name)+"</h5>",a.WidgetStdMod.REPLACE),e=a.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>').append(a.Node.create('<div class="moodle-exception-message">'+a.Escape.html(this.get("error"))+"</div>")).append(a.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("url","moodle")+o+"</label> "+this.get("reproductionlink")+"</div>")).append(a.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("debuginfo","debug")+o+"</label> "+a.Escape.html(this.get("debuginfo"))+"</div>")).append(a.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+o+"</label> <pre>"+a.Escape.html(this.get("stacktrace"))+"</pre></div>")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(a.WidgetStdMod.BODY,e,a.WidgetStdMod.REPLACE),i&&(this._hideTimeout=setTimeout(function(){t.hide()},i)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=a.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){var t;"visible"===e.attrName&&e.prevVal&&!e.newVal&&((t=this)._keypress.detach(),setTimeout(function(){t.destroy()},1e3))}},{NAME:"Moodle AJAX exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:a.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return e=null!==e?'<a href="'+(e=a.Escape.html(e))+'">'+e.replace(M.cfg.wwwroot,"")+"</a>":e},value:null},hideTimeoutDelay:{validator:a.Lang.isNumber,value:null}}}),M.core.ajaxException=t},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
YUI.add("moodle-core-notification-ajaxexception",function(a,e){var t;M.core=M.core||{},a.extend(t=function(e){e.name=e.name||M.util.get_string("error","moodle"),e.closeButton=!0,t.superclass.constructor.apply(this,[e])},M.core.notification.info,{_keypress:null,initializer:function(e){var t=this,i=this.get("hideTimeoutDelay"),o=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(a.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+a.Escape.html(e.name)+"</h5>",a.WidgetStdMod.REPLACE),e=a.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>').append(a.Node.create('<div class="moodle-exception-message">'+a.Escape.html(this.get("error"))+"</div>")).append(a.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("url","moodle")+o+"</label> "+this.get("reproductionlink")+"</div>")).append(a.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("debuginfo","debug")+o+"</label> "+a.Escape.html(this.get("debuginfo"))+"</div>")).append(a.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+o+"</label> <pre>"+a.Escape.html(this.get("stacktrace"))+"</pre></div>")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(a.WidgetStdMod.BODY,e,a.WidgetStdMod.REPLACE),i&&(this._hideTimeout=setTimeout(function(){t.hide()},i)),this.after("visibleChange",this.errorVisibilityChanged,this),this._keypress=a.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},errorVisibilityChanged:function(e){var t;"visible"===e.attrName&&e.prevVal&&!e.newVal&&((t=this)._keypress.detach(),setTimeout(function(){t.destroy()},1e3))}},{NAME:"Moodle AJAX exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:a.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return e=null!==e?'<a href="'+(e=a.Escape.html(e))+'">'+e.replace(M.cfg.wwwroot,"")+"</a>":e},value:null},hideTimeoutDelay:{validator:a.Lang.isNumber,value:null}}}),M.core.ajaxException=t},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});

View File

@ -85,11 +85,11 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
self.hide();
}, delay);
}
this.after('visibleChange', this.visibilityChanged, this);
this.after('visibleChange', this.errorVisibilityChanged, this);
this._keypress = Y.on('key', this.hide, window, 'down:13, 27', this);
this.centerDialogue();
},
visibilityChanged: function(e) {
errorVisibilityChanged: function(e) {
if (e.attrName === 'visible' && e.prevVal && !e.newVal) {
var self = this;
this._keypress.detach();

View File

@ -100,11 +100,11 @@ Y.extend(EXCEPTION, M.core.notification.info, {
self.hide();
}, delay);
}
this.after('visibleChange', this.visibilityChanged, this);
this.after('visibleChange', this.errorVisibilityChanged, this);
this._keypress = Y.on('key', this.hide, window, 'down:13,27', this);
this.centerDialogue();
},
visibilityChanged: function(e) {
errorVisibilityChanged: function(e) {
if (e.attrName === 'visible' && e.prevVal && !e.newVal) {
if (this._keypress) {
this._keypress.detach();

View File

@ -1 +1 @@
YUI.add("moodle-core-notification-exception",function(o,e){var a;M.core=M.core||{},o.extend(a=function(i){var t=o.mix({},i);t.width=t.width||M.cfg.developerdebug?Math.floor(o.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,o.Array.each(["message","name","fileName","lineNumber","stack"],function(e){t[e]=i[e]}),a.superclass.constructor.apply(this,[t])},M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(e){var i=this,t=this.get("hideTimeoutDelay"),a=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(o.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+o.Escape.html(e.name)+"</h5>",o.WidgetStdMod.REPLACE),e=o.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>').append(o.Node.create('<div class="moodle-exception-message">'+o.Escape.html(this.get("message"))+"</div>")).append(o.Node.create('<div class="moodle-exception-param hidden param-filename"><label>'+M.util.get_string("file","moodle")+a+"</label> "+o.Escape.html(this.get("fileName"))+"</div>")).append(o.Node.create('<div class="moodle-exception-param hidden param-linenumber"><label>'+M.util.get_string("line","debug")+a+"</label> "+o.Escape.html(this.get("lineNumber"))+"</div>")).append(o.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+a+"</label> <pre>"+this.get("stack")+"</pre></div>")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),t&&(this._hideTimeout=setTimeout(function(){i.hide()},t)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=o.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){var i;"visible"===e.attrName&&e.prevVal&&!e.newVal&&(this._keypress&&this._keypress.detach(),i=this,setTimeout(function(){i.destroy()},1e3))}},{NAME:"Moodle exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=o.Escape.html(e).split("\n"),a=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$");for(i in t)t[i]=t[i].replace(a,"<div class='stacktrace-line'>ln: $4</div><div class='stacktrace-file'>$3</div><div class='stacktrace-call'>$1</div>");return t.join("\n")},value:""},hideTimeoutDelay:{validator:o.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
YUI.add("moodle-core-notification-exception",function(o,e){var a;M.core=M.core||{},o.extend(a=function(i){var t=o.mix({},i);t.width=t.width||M.cfg.developerdebug?Math.floor(o.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,o.Array.each(["message","name","fileName","lineNumber","stack"],function(e){t[e]=i[e]}),a.superclass.constructor.apply(this,[t])},M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(e){var i=this,t=this.get("hideTimeoutDelay"),a=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(o.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+o.Escape.html(e.name)+"</h5>",o.WidgetStdMod.REPLACE),e=o.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>').append(o.Node.create('<div class="moodle-exception-message">'+o.Escape.html(this.get("message"))+"</div>")).append(o.Node.create('<div class="moodle-exception-param hidden param-filename"><label>'+M.util.get_string("file","moodle")+a+"</label> "+o.Escape.html(this.get("fileName"))+"</div>")).append(o.Node.create('<div class="moodle-exception-param hidden param-linenumber"><label>'+M.util.get_string("line","debug")+a+"</label> "+o.Escape.html(this.get("lineNumber"))+"</div>")).append(o.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+a+"</label> <pre>"+this.get("stack")+"</pre></div>")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),t&&(this._hideTimeout=setTimeout(function(){i.hide()},t)),this.after("visibleChange",this.errorVisibilityChanged,this),this._keypress=o.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},errorVisibilityChanged:function(e){var i;"visible"===e.attrName&&e.prevVal&&!e.newVal&&(this._keypress&&this._keypress.detach(),i=this,setTimeout(function(){i.destroy()},1e3))}},{NAME:"Moodle exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=o.Escape.html(e).split("\n"),a=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$");for(i in t)t[i]=t[i].replace(a,"<div class='stacktrace-line'>ln: $4</div><div class='stacktrace-file'>$3</div><div class='stacktrace-call'>$1</div>");return t.join("\n")},value:""},hideTimeoutDelay:{validator:o.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});

View File

@ -100,11 +100,11 @@ Y.extend(EXCEPTION, M.core.notification.info, {
self.hide();
}, delay);
}
this.after('visibleChange', this.visibilityChanged, this);
this.after('visibleChange', this.errorVisibilityChanged, this);
this._keypress = Y.on('key', this.hide, window, 'down:13,27', this);
this.centerDialogue();
},
visibilityChanged: function(e) {
errorVisibilityChanged: function(e) {
if (e.attrName === 'visible' && e.prevVal && !e.newVal) {
if (this._keypress) {
this._keypress.detach();

View File

@ -55,11 +55,11 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
self.hide();
}, delay);
}
this.after('visibleChange', this.visibilityChanged, this);
this.after('visibleChange', this.errorVisibilityChanged, this);
this._keypress = Y.on('key', this.hide, window, 'down:13, 27', this);
this.centerDialogue();
},
visibilityChanged: function(e) {
errorVisibilityChanged: function(e) {
if (e.attrName === 'visible' && e.prevVal && !e.newVal) {
var self = this;
this._keypress.detach();

View File

@ -70,11 +70,11 @@ Y.extend(EXCEPTION, M.core.notification.info, {
self.hide();
}, delay);
}
this.after('visibleChange', this.visibilityChanged, this);
this.after('visibleChange', this.errorVisibilityChanged, this);
this._keypress = Y.on('key', this.hide, window, 'down:13,27', this);
this.centerDialogue();
},
visibilityChanged: function(e) {
errorVisibilityChanged: function(e) {
if (e.attrName === 'visible' && e.prevVal && !e.newVal) {
if (this._keypress) {
this._keypress.detach();