mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-44480-master' of git://github.com/andrewnicols/moodle
Conflicts: lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js
This commit is contained in:
commit
72e2a1d7eb
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-ajaxexception",function(e,t){var n,r,i,s,o,u,a,f;n="moodle-dialogue",r="notificationBase",i=0,s="yesLabel",o="noLabel",u="title",a="question",f={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var l="Moodle AJAX exception",c;c=function(e){e.name=e.name||"Error",e.closeButton=!0,c.superclass.constructor.apply(this,[e])},e.extend(c,M.core.notification.info,{_keypress:null,initializer:function(t){var n,i=this,s=this.get("hideTimeoutDelay");this.get(r).addClass("moodle-dialogue-exception"),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+t.name+"</h1>",e.WidgetStdMod.REPLACE),n=e.Node.create('<div class="moodle-ajaxexception"></div>').append(e.Node.create('<div class="moodle-exception-message">'+this.get("error")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>URL:</label> '+this.get("reproductionlink")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>Debug info:</label> '+this.get("debuginfo")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>Stack trace:</label> <pre>'+this.get("stacktrace")+"</pre></div>")),M.cfg.developerdebug&&n.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),s&&(this._hideTimeout=setTimeout(function(){i.hide()},s)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=e.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){if(e.attrName==="visible"&&e.prevVal&&!e.newVal){var t=this;this._keypress.detach(),setTimeout(function(){t.destroy()},1e3)}}},{NAME:l,CSS_PREFIX:n,ATTRS:{error:{validator:e.Lang.isString,value:"Unknown error"},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return e!==null&&(e='<a href="'+e+'">'+e.replace(M.cfg.wwwroot,"")+"</a>"),e},value:null},hideTimeoutDelay:{validator:e.Lang.isNumber,value:null}}}),M.core.ajaxException=c},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-ajaxexception",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle AJAX exception",l;l=function(e){e.name=e.name||"Error",e.closeButton=!0,l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{_keypress:null,initializer:function(t){var n,i=this,s=this.get("hideTimeoutDelay");this.get(r).addClass("moodle-dialogue-exception"),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+t.name+"</h1>",e.WidgetStdMod.REPLACE),n=e.Node.create('<div class="moodle-ajaxexception"></div>').append(e.Node.create('<div class="moodle-exception-message">'+this.get("error")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>URL:</label> '+this.get("reproductionlink")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-debuginfo"><label>Debug info:</label> '+this.get("debuginfo")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>Stack trace:</label> <pre>'+this.get("stacktrace")+"</pre></div>")),M.cfg.developerdebug&&n.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),s&&(this._hideTimeout=setTimeout(function(){i.hide()},s)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=e.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){if(e.attrName==="visible"&&e.prevVal&&!e.newVal){var t=this;this._keypress.detach(),setTimeout(function(){t.destroy()},1e3)}}},{NAME:f,CSS_PREFIX:n,ATTRS:{error:{validator:e.Lang.isString,value:"Unknown error"},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return e!==null&&(e='<a href="'+e+'">'+e.replace(M.cfg.wwwroot,"")+"</a>"),e},value:null},hideTimeoutDelay:{validator:e.Lang.isNumber,value:null}}}),M.core.ajaxException=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-ajaxexception', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-alert', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-alert",function(e,t){var n,r,i,s,o,u,a,f;n="moodle-dialogue",r="notificationBase",i=0,s="yesLabel",o="noLabel",u="title",a="question",f={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var l="Moodle alert",c;c=function(e){e.closeButton=!1,c.superclass.constructor.apply(this,[e])},e.extend(c,M.core.notification.info,{closeEvents:[],initializer:function(){this.publish("complete");var t=e.Node.create('<input type="button" id="id_yuialertconfirm-'+this.get("COUNT")+'" value="'+this.get(s)+'" />'),n=e.Node.create('<div class="confirmation-dialogue"></div>').append(e.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(e.Node.create('<div class="confirmation-buttons"></div>').append(t));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(u)+"</h1>",e.WidgetStdMod.REPLACE),this.closeEvents.push(e.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this));var i=this.get("boundingBox").one(".closebutton");i&&this.closeEvents.push(i.on("click",this.submit,this))},submit:function(){(new e.EventHandle(this.closeEvents)).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:l,CSS_PREFIX:n,ATTRS:{title:{validator:e.Lang.isString,value:"Alert"},message:{validator:e.Lang.isString,value:"Confirm"},yesLabel:{validator:e.Lang.isString,setter:function(e){return e||(e="Ok"),e},value:"Ok"}}}),M.core.alert=c},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-alert",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle alert",l;l=function(e){e.closeButton=!1,l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{closeEvents:[],initializer:function(){this.publish("complete");var t=e.Node.create('<input type="button" id="id_yuialertconfirm-'+this.get("COUNT")+'" value="'+this.get(i)+'" />'),n=e.Node.create('<div class="confirmation-dialogue"></div>').append(e.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(e.Node.create('<div class="confirmation-buttons"></div>').append(t));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(o)+"</h1>",e.WidgetStdMod.REPLACE),this.closeEvents.push(e.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this));var s=this.get("boundingBox").one(".closebutton");s&&this.closeEvents.push(s.on("click",this.submit,this))},submit:function(){(new e.EventHandle(this.closeEvents)).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:f,CSS_PREFIX:n,ATTRS:{title:{validator:e.Lang.isString,value:"Alert"},message:{validator:e.Lang.isString,value:"Confirm"},yesLabel:{validator:e.Lang.isString,setter:function(e){return e||(e="Ok"),e},value:"Ok"}}}),M.core.alert=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-alert', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-confirm', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-confirm",function(e,t){var n,r,i,s,o,u,a,f;n="moodle-dialogue",r="notificationBase",i=0,s="yesLabel",o="noLabel",u="title",a="question",f={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var l="Moodle confirmation dialogue",c;c=function(e){c.superclass.constructor.apply(this,[e])},e.extend(c,M.core.notification.info,{closeEvents:[],initializer:function(){this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no");var t=e.Node.create('<input type="button" id="id_yuiconfirmyes-'+this.get("COUNT")+'" value="'+this.get(s)+'" />'),n=e.Node.create('<input type="button" id="id_yuiconfirmno-'+this.get("COUNT")+'" value="'+this.get(o)+'" />'),i=e.Node.create('<div class="confirmation-dialogue"></div>').append(e.Node.create('<div class="confirmation-message">'+this.get(a)+"</div>")).append(e.Node.create('<div class="confirmation-buttons"></div>').append(t).append(n));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,i,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(u)+"</h1>",e.WidgetStdMod.REPLACE),this.closeEvents.push(e.on("key",this.submit,window,"down:27",this,!1),t.on("click",this.submit,this,!0),n.on("click",this.submit,this,!1));var f=this.get("boundingBox").one(".closebutton");f&&this.closeEvents.push(f.on("click",this.submit,this))},submit:function(t,n){(new e.EventHandle(this.closeEvents)).detach(),this.fire("complete",n),n?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:l,CSS_PREFIX:n,ATTRS:{yesLabel:{validator:e.Lang.isString,value:"Yes"},noLabel:{validator:e.Lang.isString,value:"No"},title:{validator:e.Lang.isString,value:"Confirm"},question:{validator:e.Lang.isString,value:"Are you sure?"}}}),e.augment(c,e.EventTarget),M.core.confirm=c},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-confirm",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle confirmation dialogue",l;l=function(e){l.superclass.constructor.apply(this,[e])},e.extend(l,M.core.notification.info,{closeEvents:[],initializer:function(){this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no");var t=e.Node.create('<input type="button" id="id_yuiconfirmyes-'+this.get("COUNT")+'" value="'+this.get(i)+'" />'),n=e.Node.create('<input type="button" id="id_yuiconfirmno-'+this.get("COUNT")+'" value="'+this.get(s)+'" />'),a=e.Node.create('<div class="confirmation-dialogue"></div>').append(e.Node.create('<div class="confirmation-message">'+this.get(u)+"</div>")).append(e.Node.create('<div class="confirmation-buttons"></div>').append(t).append(n));this.get(r).addClass("moodle-dialogue-confirm"),this.setStdModContent(e.WidgetStdMod.BODY,a,e.WidgetStdMod.REPLACE),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+this.get("COUNT")+'-header-text">'+this.get(o)+"</h1>",e.WidgetStdMod.REPLACE),this.closeEvents.push(e.on("key",this.submit,window,"down:27",this,!1),t.on("click",this.submit,this,!0),n.on("click",this.submit,this,!1));var f=this.get("boundingBox").one(".closebutton");f&&this.closeEvents.push(f.on("click",this.submit,this))},submit:function(t,n){(new e.EventHandle(this.closeEvents)).detach(),this.fire("complete",n),n?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:f,CSS_PREFIX:n,ATTRS:{yesLabel:{validator:e.Lang.isString,value:"Yes"},noLabel:{validator:e.Lang.isString,value:"No"},title:{validator:e.Lang.isString,value:"Confirm"},question:{validator:e.Lang.isString,value:"Are you sure?"}}}),e.augment(l,e.EventTarget),M.core.confirm=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-confirm', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-dialogue', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
@ -55,8 +53,8 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
*/
|
||||
DIALOGUE = function(c) {
|
||||
var config = Y.clone(c);
|
||||
COUNT++;
|
||||
var id = 'moodle-dialogue-'+COUNT;
|
||||
config.COUNT = Y.stamp(this);
|
||||
var id = 'moodle-dialogue-' + config.COUNT;
|
||||
config.notificationBase =
|
||||
Y.Node.create('<div class="'+CSS.BASE+'">')
|
||||
.append(Y.Node.create('<div id="'+id+'" role="dialog" aria-labelledby="'+id+'-header-text" class="'+CSS.WRAP+'"></div>')
|
||||
@ -70,7 +68,6 @@ DIALOGUE = function(c) {
|
||||
}
|
||||
|
||||
config.srcNode = '#'+id;
|
||||
config.COUNT = COUNT;
|
||||
|
||||
// closeButton param to keep the stable versions API.
|
||||
if (config.closeButton === false) {
|
||||
@ -116,7 +113,6 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
if (this.get('center')) {
|
||||
this.centerDialogue();
|
||||
}
|
||||
this.set('COUNT', COUNT);
|
||||
|
||||
if (this.get('modal')) {
|
||||
this.plug(Y.M.core.LockScroll);
|
||||
@ -476,11 +472,11 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
* Used to generate a unique id for the dialogue.
|
||||
*
|
||||
* @attribute COUNT
|
||||
* @type Integer
|
||||
* @default 0
|
||||
* @type String
|
||||
* @default null
|
||||
*/
|
||||
COUNT: {
|
||||
value: 0
|
||||
value: null
|
||||
},
|
||||
|
||||
/**
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-dialogue', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
@ -55,8 +53,8 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
*/
|
||||
DIALOGUE = function(c) {
|
||||
var config = Y.clone(c);
|
||||
COUNT++;
|
||||
var id = 'moodle-dialogue-'+COUNT;
|
||||
config.COUNT = Y.stamp(this);
|
||||
var id = 'moodle-dialogue-' + config.COUNT;
|
||||
config.notificationBase =
|
||||
Y.Node.create('<div class="'+CSS.BASE+'">')
|
||||
.append(Y.Node.create('<div id="'+id+'" role="dialog" aria-labelledby="'+id+'-header-text" class="'+CSS.WRAP+'"></div>')
|
||||
@ -70,7 +68,6 @@ DIALOGUE = function(c) {
|
||||
}
|
||||
|
||||
config.srcNode = '#'+id;
|
||||
config.COUNT = COUNT;
|
||||
|
||||
// closeButton param to keep the stable versions API.
|
||||
if (config.closeButton === false) {
|
||||
@ -116,7 +113,6 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
if (this.get('center')) {
|
||||
this.centerDialogue();
|
||||
}
|
||||
this.set('COUNT', COUNT);
|
||||
|
||||
if (this.get('modal')) {
|
||||
this.plug(Y.M.core.LockScroll);
|
||||
@ -474,11 +470,11 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
* Used to generate a unique id for the dialogue.
|
||||
*
|
||||
* @attribute COUNT
|
||||
* @type Integer
|
||||
* @default 0
|
||||
* @type String
|
||||
* @default null
|
||||
*/
|
||||
COUNT: {
|
||||
value: 0
|
||||
value: null
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-exception', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-core-notification-exception",function(e,t){var n,r,i,s,o,u,a,f;n="moodle-dialogue",r="notificationBase",i=0,s="yesLabel",o="noLabel",u="title",a="question",f={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var l="Moodle exception",c;c=function(t){t.width=t.width||M.cfg.developerdebug?Math.floor(e.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,c.superclass.constructor.apply(this,[t])},e.extend(c,M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(t){var n,s=this,o=this.get("hideTimeoutDelay");this.get(r).addClass("moodle-dialogue-exception"),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+i+'-header-text">'+t.name+"</h1>",e.WidgetStdMod.REPLACE),n=e.Node.create('<div class="moodle-exception"></div>').append(e.Node.create('<div class="moodle-exception-message">'+this.get("message")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-filename"><label>File:</label> '+this.get("fileName")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-linenumber"><label>Line:</label> '+this.get("lineNumber")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>Stack trace:</label> <pre>'+this.get("stack")+"</pre></div>")),M.cfg.developerdebug&&n.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),o&&(this._hideTimeout=setTimeout(function(){s.hide()},o)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=e.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){if(e.attrName==="visible"&&e.prevVal&&!e.newVal){this._keypress&&this._keypress.detach();var t=this;setTimeout(function(){t.destroy()},1e3)}}},{NAME:l,CSS_PREFIX:n,ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var t=e.split("\n"),n=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$"),r;for(r in t)t[r]=t[r].replace(n,"<div class='stacktrace-line'>ln: $4</div><div class='stacktrace-file'>$3</div><div class='stacktrace-call'>$1</div>");return t.join("")},value:""},hideTimeoutDelay:{validator:e.Lang.isNumber,value:null}}}),M.core.exception=c},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
YUI.add("moodle-core-notification-exception",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle exception",l;l=function(t){t.width=t.width||M.cfg.developerdebug?Math.floor(e.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,l.superclass.constructor.apply(this,[t])},e.extend(l,M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(t){var n,i=this,s=this.get("hideTimeoutDelay");this.get(r).addClass("moodle-dialogue-exception"),this.setStdModContent(e.WidgetStdMod.HEADER,'<h1 id="moodle-dialogue-'+COUNT+'-header-text">'+t.name+"</h1>",e.WidgetStdMod.REPLACE),n=e.Node.create('<div class="moodle-exception"></div>').append(e.Node.create('<div class="moodle-exception-message">'+this.get("message")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-filename"><label>File:</label> '+this.get("fileName")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-linenumber"><label>Line:</label> '+this.get("lineNumber")+"</div>")).append(e.Node.create('<div class="moodle-exception-param hidden param-stacktrace"><label>Stack trace:</label> <pre>'+this.get("stack")+"</pre></div>")),M.cfg.developerdebug&&n.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(e.WidgetStdMod.BODY,n,e.WidgetStdMod.REPLACE),s&&(this._hideTimeout=setTimeout(function(){i.hide()},s)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=e.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){if(e.attrName==="visible"&&e.prevVal&&!e.newVal){this._keypress&&this._keypress.detach();var t=this;setTimeout(function(){t.destroy()},1e3)}}},{NAME:f,CSS_PREFIX:n,ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var t=e.split("\n"),n=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$"),r;for(r in t)t[r]=t[r].replace(n,"<div class='stacktrace-line'>ln: $4</div><div class='stacktrace-file'>$3</div><div class='stacktrace-call'>$1</div>");return t.join("")},value:""},hideTimeoutDelay:{validator:e.Lang.isNumber,value:null}}}),M.core.exception=l},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});
|
||||
|
@ -2,7 +2,6 @@ YUI.add('moodle-core-notification-exception', function (Y, NAME) {
|
||||
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -11,7 +10,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
12
lib/yui/src/notification/js/dialogue.js
vendored
12
lib/yui/src/notification/js/dialogue.js
vendored
@ -24,8 +24,8 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
*/
|
||||
DIALOGUE = function(c) {
|
||||
var config = Y.clone(c);
|
||||
COUNT++;
|
||||
var id = 'moodle-dialogue-'+COUNT;
|
||||
config.COUNT = Y.stamp(this);
|
||||
var id = 'moodle-dialogue-' + config.COUNT;
|
||||
config.notificationBase =
|
||||
Y.Node.create('<div class="'+CSS.BASE+'">')
|
||||
.append(Y.Node.create('<div id="'+id+'" role="dialog" aria-labelledby="'+id+'-header-text" class="'+CSS.WRAP+'"></div>')
|
||||
@ -39,7 +39,6 @@ DIALOGUE = function(c) {
|
||||
}
|
||||
|
||||
config.srcNode = '#'+id;
|
||||
config.COUNT = COUNT;
|
||||
|
||||
// closeButton param to keep the stable versions API.
|
||||
if (config.closeButton === false) {
|
||||
@ -85,7 +84,6 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
if (this.get('center')) {
|
||||
this.centerDialogue();
|
||||
}
|
||||
this.set('COUNT', COUNT);
|
||||
|
||||
if (this.get('modal')) {
|
||||
this.plug(Y.M.core.LockScroll);
|
||||
@ -445,11 +443,11 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
* Used to generate a unique id for the dialogue.
|
||||
*
|
||||
* @attribute COUNT
|
||||
* @type Integer
|
||||
* @default 0
|
||||
* @type String
|
||||
* @default null
|
||||
*/
|
||||
COUNT: {
|
||||
value: 0
|
||||
value: null
|
||||
},
|
||||
|
||||
/**
|
||||
|
2
lib/yui/src/notification/js/shared.js
vendored
2
lib/yui/src/notification/js/shared.js
vendored
@ -1,6 +1,5 @@
|
||||
var DIALOGUE_PREFIX,
|
||||
BASE,
|
||||
COUNT,
|
||||
CONFIRMYES,
|
||||
CONFIRMNO,
|
||||
TITLE,
|
||||
@ -9,7 +8,6 @@ var DIALOGUE_PREFIX,
|
||||
|
||||
DIALOGUE_PREFIX = 'moodle-dialogue',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
|
Loading…
x
Reference in New Issue
Block a user