Skip to content

Commit

Permalink
Merge branch 'MDL-44480-25' of git://github.com/andrewnicols/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_25_STABLE
  • Loading branch information
danpoltawski committed Mar 11, 2014
2 parents 549f507 + 8b20595 commit d356168
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/yui/src/notification/js/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,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',
Expand All @@ -27,8 +26,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>')
Expand Down Expand Up @@ -145,6 +144,9 @@ Y.extend(DIALOGUE, Y.Panel, {
draggable : {
validator : Y.Lang.isBoolean,
value : false
},
COUNT: {
value: null
}
}
});
Expand All @@ -157,14 +159,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(
Expand Down Expand Up @@ -220,16 +222,16 @@ 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>')
.append(yes)
.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);

Expand Down Expand Up @@ -295,7 +297,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>'))
Expand Down Expand Up @@ -375,7 +377,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>'))
Expand Down

0 comments on commit d356168

Please sign in to comment.