MDL-44480 yui: shifter build
This commit is contained in:
@@ -7,7 +7,6 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
AJAXEXCEPTION_NAME = 'Moodle AJAX exception',
|
||||
ALERT_NAME = 'Moodle alert',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
@@ -29,8 +28,8 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
DIALOGUE;
|
||||
|
||||
DIALOGUE = function(config) {
|
||||
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>')
|
||||
@@ -147,6 +146,9 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
draggable : {
|
||||
validator : Y.Lang.isBoolean,
|
||||
value : false
|
||||
},
|
||||
COUNT: {
|
||||
value: null
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -159,14 +161,14 @@ Y.extend(ALERT, DIALOGUE, {
|
||||
closeEvents: [],
|
||||
initializer : function() {
|
||||
this.publish('complete');
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.COUNT + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.get('COUNT') + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
|
||||
.append(Y.Node.create('<div class="confirmation-message">'+this.get('message')+'</div>'))
|
||||
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
|
||||
.append(yes));
|
||||
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-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
|
||||
this.closeEvents.push(
|
||||
@@ -222,8 +224,8 @@ Y.extend(CONFIRM, DIALOGUE, {
|
||||
this.publish('complete');
|
||||
this.publish('complete-yes');
|
||||
this.publish('complete-no');
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' + this.COUNT + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
no = Y.Node.create('<input type="button" id="id_yuiconfirmno-' + this.COUNT + '" value="'+this.get(CONFIRMNO)+'" />'),
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' + this.get('COUNT') + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
no = Y.Node.create('<input type="button" id="id_yuiconfirmno-' + this.get('COUNT') + '" value="'+this.get(CONFIRMNO)+'" />'),
|
||||
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
|
||||
.append(Y.Node.create('<div class="confirmation-message">'+this.get(QUESTION)+'</div>'))
|
||||
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
|
||||
@@ -231,7 +233,7 @@ Y.extend(CONFIRM, DIALOGUE, {
|
||||
.append(no));
|
||||
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-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
|
||||
|
||||
@@ -297,7 +299,7 @@ Y.extend(EXCEPTION, DIALOGUE, {
|
||||
self = this,
|
||||
delay = this.get('hideTimeoutDelay');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ config.name + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-exception"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">'+this.get('message')+'</div>'))
|
||||
@@ -377,7 +379,7 @@ Y.extend(AJAXEXCEPTION, DIALOGUE, {
|
||||
self = this,
|
||||
delay = this.get('hideTimeoutDelay');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ config.name + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-ajaxexception"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">'+this.get('error')+'</div>'))
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,6 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
AJAXEXCEPTION_NAME = 'Moodle AJAX exception',
|
||||
ALERT_NAME = 'Moodle alert',
|
||||
BASE = 'notificationBase',
|
||||
COUNT = 0,
|
||||
CONFIRMYES = 'yesLabel',
|
||||
CONFIRMNO = 'noLabel',
|
||||
TITLE = 'title',
|
||||
@@ -29,8 +28,8 @@ var DIALOGUE_NAME = 'Moodle dialogue',
|
||||
DIALOGUE;
|
||||
|
||||
DIALOGUE = function(config) {
|
||||
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>')
|
||||
@@ -147,6 +146,9 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
draggable : {
|
||||
validator : Y.Lang.isBoolean,
|
||||
value : false
|
||||
},
|
||||
COUNT: {
|
||||
value: null
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -159,14 +161,14 @@ Y.extend(ALERT, DIALOGUE, {
|
||||
closeEvents: [],
|
||||
initializer : function() {
|
||||
this.publish('complete');
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.COUNT + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.get('COUNT') + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
|
||||
.append(Y.Node.create('<div class="confirmation-message">'+this.get('message')+'</div>'))
|
||||
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
|
||||
.append(yes));
|
||||
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-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
|
||||
this.closeEvents.push(
|
||||
@@ -222,8 +224,8 @@ Y.extend(CONFIRM, DIALOGUE, {
|
||||
this.publish('complete');
|
||||
this.publish('complete-yes');
|
||||
this.publish('complete-no');
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' + this.COUNT + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
no = Y.Node.create('<input type="button" id="id_yuiconfirmno-' + this.COUNT + '" value="'+this.get(CONFIRMNO)+'" />'),
|
||||
var yes = Y.Node.create('<input type="button" id="id_yuiconfirmyes-' + this.get('COUNT') + '" value="'+this.get(CONFIRMYES)+'" />'),
|
||||
no = Y.Node.create('<input type="button" id="id_yuiconfirmno-' + this.get('COUNT') + '" value="'+this.get(CONFIRMNO)+'" />'),
|
||||
content = Y.Node.create('<div class="confirmation-dialogue"></div>')
|
||||
.append(Y.Node.create('<div class="confirmation-message">'+this.get(QUESTION)+'</div>'))
|
||||
.append(Y.Node.create('<div class="confirmation-buttons"></div>')
|
||||
@@ -231,7 +233,7 @@ Y.extend(CONFIRM, DIALOGUE, {
|
||||
.append(no));
|
||||
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-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
|
||||
|
||||
@@ -297,7 +299,7 @@ Y.extend(EXCEPTION, DIALOGUE, {
|
||||
self = this,
|
||||
delay = this.get('hideTimeoutDelay');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ config.name + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-exception"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">'+this.get('message')+'</div>'))
|
||||
@@ -377,7 +379,7 @@ Y.extend(AJAXEXCEPTION, DIALOGUE, {
|
||||
self = this,
|
||||
delay = this.get('hideTimeoutDelay');
|
||||
this.get(BASE).addClass('moodle-dialogue-exception');
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+COUNT+'-header-text">'
|
||||
this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">'
|
||||
+ config.name + '</h1>', Y.WidgetStdMod.REPLACE);
|
||||
content = Y.Node.create('<div class="moodle-ajaxexception"></div>')
|
||||
.append(Y.Node.create('<div class="moodle-exception-message">'+this.get('error')+'</div>'))
|
||||
|
||||
Reference in New Issue
Block a user