MDL-71672 javascript: Fix the markup in the header of YUI dialogs
Move the close button out of the element that is set as the aria-labelledby for the dialog. Also used h5 for the dialog titles so they are consistent with AMD modals.
This commit is contained in:
lib/yui/build/moodle-core-notification-ajaxexception/moodle-core-notification-ajaxexception-debug.js
Vendored
+2
-2
@@ -61,8 +61,8 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
|
||||
labelsep = M.util.get_string('labelsep', 'langconfig');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">'
|
||||
+ Y.Escape.html(config.name) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">'
|
||||
+ Y.Escape.html(config.name) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('error')) + '</div>'))
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-ajaxexception",function(d,e){var t,i;M.core=M.core||{},t="Moodle AJAX exception",i=function(e){e.name=e.name||M.util.get_string("error","moodle"),e.closeButton=!0,i.superclass.constructor.apply(this,[e])},d.extend(i,M.core.notification.info,{_keypress:null,initializer:function(e){var t,i=this,o=this.get("hideTimeoutDelay"),a=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(d.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+d.Escape.html(e.name)+"</h1>",d.WidgetStdMod.REPLACE),t=d.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>').append(d.Node.create('<div class="moodle-exception-message">'+d.Escape.html(this.get("error"))+"</div>")).append(d.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("url","moodle")+a+"</label> "+this.get("reproductionlink")+"</div>")).append(d.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("debuginfo","debug")+a+"</label> "+d.Escape.html(this.get("debuginfo"))+"</div>")).append(d.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+a+"</label> <pre>"+d.Escape.html(this.get("stacktrace"))+"</pre></div>")),M.cfg.developerdebug&&t.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(d.WidgetStdMod.BODY,t,d.WidgetStdMod.REPLACE),o&&(this._hideTimeout=setTimeout(function(){i.hide()},o)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=d.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){if("visible"===e.attrName&&e.prevVal&&!e.newVal){var t=this;this._keypress.detach(),setTimeout(function(){t.destroy()},1e3)}}},{NAME:t,CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:d.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return null!==e&&(e='<a href="'+(e=d.Escape.html(e))+'">'+e.replace(M.cfg.wwwroot,"")+"</a>"),e},value:null},hideTimeoutDelay:{validator:d.Lang.isNumber,value:null}}}),M.core.ajaxException=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-ajaxexception",function(d,e){var t,i;M.core=M.core||{},t="Moodle AJAX exception",i=function(e){e.name=e.name||M.util.get_string("error","moodle"),e.closeButton=!0,i.superclass.constructor.apply(this,[e])},d.extend(i,M.core.notification.info,{_keypress:null,initializer:function(e){var t,i=this,o=this.get("hideTimeoutDelay"),a=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(d.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+d.Escape.html(e.name)+"</h5>",d.WidgetStdMod.REPLACE),t=d.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>').append(d.Node.create('<div class="moodle-exception-message">'+d.Escape.html(this.get("error"))+"</div>")).append(d.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("url","moodle")+a+"</label> "+this.get("reproductionlink")+"</div>")).append(d.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>'+M.util.get_string("debuginfo","debug")+a+"</label> "+d.Escape.html(this.get("debuginfo"))+"</div>")).append(d.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+a+"</label> <pre>"+d.Escape.html(this.get("stacktrace"))+"</pre></div>")),M.cfg.developerdebug&&t.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(d.WidgetStdMod.BODY,t,d.WidgetStdMod.REPLACE),o&&(this._hideTimeout=setTimeout(function(){i.hide()},o)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=d.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){if("visible"===e.attrName&&e.prevVal&&!e.newVal){var t=this;this._keypress.detach(),setTimeout(function(){t.destroy()},1e3)}}},{NAME:t,CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:d.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return null!==e&&(e='<a href="'+(e=d.Escape.html(e))+'">'+e.replace(M.cfg.wwwroot,"")+"</a>"),e},value:null},hideTimeoutDelay:{validator:d.Lang.isNumber,value:null}}}),M.core.ajaxException=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
Vendored
+2
-2
@@ -61,8 +61,8 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
|
||||
labelsep = M.util.get_string('labelsep', 'langconfig');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">'
|
||||
+ Y.Escape.html(config.name) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">'
|
||||
+ Y.Escape.html(config.name) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('error')) + '</div>'))
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ Y.extend(ALERT, M.core.notification.info, {
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + this.get(TITLE) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + this.get(TITLE) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
this._closeEvents.push(
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-alert",function(o,t){var e,i;M.core=M.core||{},e="Moodle alert",i=function(t){t.closeButton=!1,i.superclass.constructor.apply(this,[t])},o.extend(i,M.core.notification.info,{_closeEvents:null,initializer:function(){var t,e,i;this._closeEvents=[],this.publish("complete"),t=o.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-'+this.get("COUNT")+'"value="'+this.get("yesLabel")+'" />'),e=o.Node.create('<div class="confirmation-dialogue"></div>').append(o.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(o.Node.create('<div class="confirmation-buttons text-xs-right"></div>').append(t)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),this.setStdModContent(o.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get("title")+"</h1>",o.WidgetStdMod.REPLACE),this._closeEvents.push(o.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this)),(i=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(i.on("click",this.submit,this))},submit:function(){new o.EventHandle(this._closeEvents).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{title:{validator:o.Lang.isString,value:"Alert"},message:{validator:o.Lang.isString,value:"Confirm"},yesLabel:{validator:o.Lang.isString,setter:function(t){return t=t||"OK"},value:"OK"}}}),M.core.alert=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-alert",function(o,t){var e,i;M.core=M.core||{},e="Moodle alert",i=function(t){t.closeButton=!1,i.superclass.constructor.apply(this,[t])},o.extend(i,M.core.notification.info,{_closeEvents:null,initializer:function(){var t,e,i;this._closeEvents=[],this.publish("complete"),t=o.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-'+this.get("COUNT")+'"value="'+this.get("yesLabel")+'" />'),e=o.Node.create('<div class="confirmation-dialogue"></div>').append(o.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(o.Node.create('<div class="confirmation-buttons text-xs-right"></div>').append(t)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),this.setStdModContent(o.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+this.get("title")+"</h5>",o.WidgetStdMod.REPLACE),this._closeEvents.push(o.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this)),(i=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(i.on("click",this.submit,this))},submit:function(){new o.EventHandle(this._closeEvents).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{title:{validator:o.Lang.isString,value:"Alert"},message:{validator:o.Lang.isString,value:"Confirm"},yesLabel:{validator:o.Lang.isString,setter:function(t){return t=t||"OK"},value:"OK"}}}),M.core.alert=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
+1
-1
@@ -71,7 +71,7 @@ Y.extend(ALERT, M.core.notification.info, {
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + this.get(TITLE) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + this.get(TITLE) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
this._closeEvents.push(
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ Y.extend(CONFIRM, M.core.notification.info, {
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + this.get(TITLE) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + this.get(TITLE) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
this._closeEvents.push(
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-confirm",function(i,t){var e,o;M.core=M.core||{},e="Moodle confirmation dialogue",o=function(t){o.superclass.constructor.apply(this,[t])},i.extend(o,M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){var t,e;this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=i.Node.create('<input type="button" class="btn btn-primary" id="id_yuiconfirmyes-'+this.get("COUNT")+'" value="'+this.get("yesLabel")+'" />'),this._noButton=i.Node.create('<input type="button" class="btn btn-secondary" id="id_yuiconfirmno-'+this.get("COUNT")+'" value="'+this.get("noLabel")+'" />'),this._question=i.Node.create('<div class="confirmation-message">'+this.get("question")+"</div>"),t=i.Node.create('<div class="confirmation-dialogue"></div>').append(this._question).append(i.Node.create('<div class="confirmation-buttons form-inline justify-content-around"></div>').append(this._yesButton).append(this._noButton)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,t,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get("title")+"</h1>",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1)),(e=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(e.on("click",this.submit,this))},submit:function(t,e){new i.EventHandle(this._closeEvents).detach(),this.fire("complete",e),e?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{yesLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(t){return this._yesButton&&this._yesButton.set("value",t),t}},noLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(t){return this._noButton&&this._noButton.set("value",t),t}},title:{validator:i.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(t){return this._question&&this._question.set("value",t),t}}}}),i.augment(o,i.EventTarget),M.core.confirm=o},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-confirm",function(i,t){var e,o;M.core=M.core||{},e="Moodle confirmation dialogue",o=function(t){o.superclass.constructor.apply(this,[t])},i.extend(o,M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){var t,e;this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=i.Node.create('<input type="button" class="btn btn-primary" id="id_yuiconfirmyes-'+this.get("COUNT")+'" value="'+this.get("yesLabel")+'" />'),this._noButton=i.Node.create('<input type="button" class="btn btn-secondary" id="id_yuiconfirmno-'+this.get("COUNT")+'" value="'+this.get("noLabel")+'" />'),this._question=i.Node.create('<div class="confirmation-message">'+this.get("question")+"</div>"),t=i.Node.create('<div class="confirmation-dialogue"></div>').append(this._question).append(i.Node.create('<div class="confirmation-buttons form-inline justify-content-around"></div>').append(this._yesButton).append(this._noButton)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,t,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+this.get("title")+"</h5>",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1)),(e=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(e.on("click",this.submit,this))},submit:function(t,e){new i.EventHandle(this._closeEvents).detach(),this.fire("complete",e),e?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{yesLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(t){return this._yesButton&&this._yesButton.set("value",t),t}},noLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(t){return this._noButton&&this._noButton.set("value",t),t}},title:{validator:i.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(t){return this._question&&this._question.set("value",t),t}}}}),i.augment(o,i.EventTarget),M.core.confirm=o},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
+1
-1
@@ -104,7 +104,7 @@ Y.extend(CONFIRM, M.core.notification.info, {
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + this.get(TITLE) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + this.get(TITLE) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
this._closeEvents.push(
|
||||
|
||||
+5
-1
@@ -73,7 +73,7 @@ DIALOGUE = function(config) {
|
||||
'<div id="' + id + '" role="dialog" ' +
|
||||
'aria-labelledby="' + id + '-header-text" class="' + CSS_CLASSES.WRAP + '" aria-live="polite"></div>'
|
||||
)
|
||||
.append(Y.Node.create('<div id="' + id + '-header-text" class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.BODY + ' yui3-widget-bd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.FOOTER + ' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
@@ -138,6 +138,10 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
this.get('buttons').header[0].setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h5 id="' + this.get('id') + '-wrap-header-text">' + this.get('headerContent') + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
// Initialise the element cache.
|
||||
this._hiddenSiblings = [];
|
||||
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+5
-1
@@ -73,7 +73,7 @@ DIALOGUE = function(config) {
|
||||
'<div id="' + id + '" role="dialog" ' +
|
||||
'aria-labelledby="' + id + '-header-text" class="' + CSS_CLASSES.WRAP + '" aria-live="polite"></div>'
|
||||
)
|
||||
.append(Y.Node.create('<div id="' + id + '-header-text" class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.BODY + ' yui3-widget-bd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.FOOTER + ' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
@@ -138,6 +138,10 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
this.get('buttons').header[0].setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h5 id="' + this.get('id') + '-wrap-header-text">' + this.get('headerContent') + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
// Initialise the element cache.
|
||||
this._hiddenSiblings = [];
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -77,7 +77,7 @@ Y.extend(EXCEPTION, M.core.notification.info, {
|
||||
labelsep = M.util.get_string('labelsep', 'langconfig');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + config.COUNT + '-header-text">' + Y.Escape.html(config.name) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + Y.Escape.html(config.name) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('message')) + '</div>'))
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-exception",function(l,e){var i,a;M.core=M.core||{},i="Moodle exception",a=function(i){var e,t=l.mix({},i);t.width=t.width||M.cfg.developerdebug?Math.floor(l.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,e=["message","name","fileName","lineNumber","stack"],l.Array.each(e,function(e){t[e]=i[e]}),a.superclass.constructor.apply(this,[t])},l.extend(a,M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(e){var i,t=this,a=this.get("hideTimeoutDelay"),o=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(l.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+e.COUNT+'-header-text">'+l.Escape.html(e.name)+"</h1>",l.WidgetStdMod.REPLACE),i=l.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>').append(l.Node.create('<div class="moodle-exception-message">'+l.Escape.html(this.get("message"))+"</div>")).append(l.Node.create('<div class="moodle-exception-param hidden param-filename"><label>'+M.util.get_string("file","moodle")+o+"</label> "+l.Escape.html(this.get("fileName"))+"</div>")).append(l.Node.create('<div class="moodle-exception-param hidden param-linenumber"><label>'+M.util.get_string("line","debug")+o+"</label> "+l.Escape.html(this.get("lineNumber"))+"</div>")).append(l.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+o+"</label> <pre>"+this.get("stack")+"</pre></div>")),M.cfg.developerdebug&&i.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(l.WidgetStdMod.BODY,i,l.WidgetStdMod.REPLACE),a&&(this._hideTimeout=setTimeout(function(){t.hide()},a)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=l.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){if("visible"===e.attrName&&e.prevVal&&!e.newVal){this._keypress&&this._keypress.detach();var i=this;setTimeout(function(){i.destroy()},1e3)}}},{NAME:i,CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=l.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:l.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-exception",function(l,e){var i,a;M.core=M.core||{},i="Moodle exception",a=function(i){var e,t=l.mix({},i);t.width=t.width||M.cfg.developerdebug?Math.floor(l.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,e=["message","name","fileName","lineNumber","stack"],l.Array.each(e,function(e){t[e]=i[e]}),a.superclass.constructor.apply(this,[t])},l.extend(a,M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(e){var i,t=this,a=this.get("hideTimeoutDelay"),o=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(l.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+l.Escape.html(e.name)+"</h5>",l.WidgetStdMod.REPLACE),i=l.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>').append(l.Node.create('<div class="moodle-exception-message">'+l.Escape.html(this.get("message"))+"</div>")).append(l.Node.create('<div class="moodle-exception-param hidden param-filename"><label>'+M.util.get_string("file","moodle")+o+"</label> "+l.Escape.html(this.get("fileName"))+"</div>")).append(l.Node.create('<div class="moodle-exception-param hidden param-linenumber"><label>'+M.util.get_string("line","debug")+o+"</label> "+l.Escape.html(this.get("lineNumber"))+"</div>")).append(l.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>'+M.util.get_string("stacktrace","debug")+o+"</label> <pre>"+this.get("stack")+"</pre></div>")),M.cfg.developerdebug&&i.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(l.WidgetStdMod.BODY,i,l.WidgetStdMod.REPLACE),a&&(this._hideTimeout=setTimeout(function(){t.hide()},a)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=l.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){if("visible"===e.attrName&&e.prevVal&&!e.newVal){this._keypress&&this._keypress.detach();var i=this;setTimeout(function(){i.destroy()},1e3)}}},{NAME:i,CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=l.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:l.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
+1
-1
@@ -77,7 +77,7 @@ Y.extend(EXCEPTION, M.core.notification.info, {
|
||||
labelsep = M.util.get_string('labelsep', 'langconfig');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + config.COUNT + '-header-text">' + Y.Escape.html(config.name) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + Y.Escape.html(config.name) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('message')) + '</div>'))
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ Y.extend(AJAXEXCEPTION, M.core.notification.info, {
|
||||
labelsep = M.util.get_string('labelsep', 'langconfig');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">'
|
||||
+ Y.Escape.html(config.name) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">'
|
||||
+ Y.Escape.html(config.name) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-ajaxexception" data-rel="fatalerror"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('error')) + '</div>'))
|
||||
|
||||
Vendored
+1
-1
@@ -41,7 +41,7 @@ Y.extend(ALERT, M.core.notification.info, {
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + this.get(TITLE) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + this.get(TITLE) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
this._closeEvents.push(
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ Y.extend(CONFIRM, M.core.notification.info, {
|
||||
this.get(BASE).addClass('moodle-dialogue-confirm');
|
||||
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + this.get('COUNT') + '-header-text">' + this.get(TITLE) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + this.get(TITLE) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
this._closeEvents.push(
|
||||
|
||||
+5
-1
@@ -43,7 +43,7 @@ DIALOGUE = function(config) {
|
||||
'<div id="' + id + '" role="dialog" ' +
|
||||
'aria-labelledby="' + id + '-header-text" class="' + CSS_CLASSES.WRAP + '" aria-live="polite"></div>'
|
||||
)
|
||||
.append(Y.Node.create('<div id="' + id + '-header-text" class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.BODY + ' yui3-widget-bd"></div>'))
|
||||
.append(Y.Node.create('<div class="' + CSS_CLASSES.FOOTER + ' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
@@ -108,6 +108,10 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
this.get('buttons').header[0].setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h5 id="' + this.get('id') + '-wrap-header-text">' + this.get('headerContent') + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
|
||||
// Initialise the element cache.
|
||||
this._hiddenSiblings = [];
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ Y.extend(EXCEPTION, M.core.notification.info, {
|
||||
labelsep = M.util.get_string('labelsep', 'langconfig');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER,
|
||||
'<h1 id="moodle-dialogue-' + config.COUNT + '-header-text">' + Y.Escape.html(config.name) + '</h1>',
|
||||
'<h5 id="moodle-dialogue-' + this.get('COUNT') + '-wrap-header-text">' + Y.Escape.html(config.name) + '</h5>',
|
||||
Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-exception" data-rel="fatalerror"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">' + Y.Escape.html(this.get('message')) + '</div>'))
|
||||
|
||||
@@ -1284,8 +1284,11 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h1 {
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h5 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: $font-weight-base;
|
||||
margin-bottom: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd .yui3-widget-buttons {
|
||||
|
||||
@@ -10731,8 +10731,11 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
|
||||
font-size: 1.5rem;
|
||||
line-height: 1.5; }
|
||||
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h1 {
|
||||
font-size: 1.5rem; }
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h5 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 400;
|
||||
margin-bottom: 0;
|
||||
line-height: 1.5; }
|
||||
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd .yui3-widget-buttons {
|
||||
/*rtl:raw:
|
||||
|
||||
@@ -10943,8 +10943,11 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
|
||||
font-size: 1.5rem;
|
||||
line-height: 1.5; }
|
||||
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h1 {
|
||||
font-size: 1.5rem; }
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h5 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 400;
|
||||
margin-bottom: 0;
|
||||
line-height: 1.5; }
|
||||
|
||||
.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd .yui3-widget-buttons {
|
||||
/*rtl:raw:
|
||||
|
||||
Reference in New Issue
Block a user