$config->question = get_string('confirmcancelquestion', 'backup');
$config->yesLabel = get_string('confirmcancelyes', 'backup');
$config->noLabel = get_string('confirmcancelno', 'backup');
+ $config->closeButtonTitle = get_string('close', 'editor');
$PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config));
$PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.select_all_init',
}
}
$PAGE->requires->yui_module('moodle-block_community-comments', 'M.blocks_community.init_comments',
- array(array('commentids' => $commentedcourseids)));
+ array(array('commentids' => $commentedcourseids, 'closeButtonTitle' => get_string('close', 'editor'))));
$PAGE->requires->yui_module('moodle-block_community-imagegallery', 'M.blocks_community.init_imagegallery',
array(array('imageids' => $courseids, 'imagenumbers' => $courseimagenumbers,
- 'huburl' => $huburl)));
+ 'huburl' => $huburl, 'closeButtonTitle' => get_string('close', 'editor'))));
echo highlight($search, $renderer->course_list($courses, $huburl, $courseid));
background-color:#F6F6F6;
border:1px solid #CCCCCC;
overflow: auto;
+ padding: 7px 6px;
}
#page-blocks-community-communitycourse .moodle-dialogue-base .moodle-dialogue-bd {
#page-blocks-community-communitycourse .moodle-dialogue-base .closebutton {
margin-top:4px;
- width:30px;
-}
\ No newline at end of file
+ margin-right: 4px;
+}
Y.extend(COMMENTS, Y.Base, {
event:null,
- overlayevent:null,
- overlays: [], //all the comment boxes
+ panelevent: null,
+ panels: [], //all the comment boxes
initializer : function(params) {
for (var i=0;i<this.get('commentids').length;i++)
{
var commentid = this.get('commentids')[i];
- this.overlays[commentid] = new M.core.dialogue({
- headerContent:Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML'),
+ this.panels[commentid] = new M.core.dialogue({
+ headerContent:Y.Node.create('<h1>')
+ .append(Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML')),
bodyContent:Y.one('#commentoverlay-'+commentid).get('innerHTML'),
visible: false, //by default it is not displayed
lightbox : false,
- zIndex:100
+ zIndex:100,
+ closeButtonTitle: this.get('closeButtonTitle')
});
- this.overlays[commentid].get('contentBox').one('.commenttitle').remove();
- this.overlays[commentid].render();
- this.overlays[commentid].hide();
+ this.panels[commentid].get('contentBox').one('.commenttitle').remove();
+ this.panels[commentid].render();
+ this.panels[commentid].hide();
Y.one('#comments-'+commentid).on('click', this.show, this, commentid);
}
show : function (e, commentid) {
- //hide all overlays
+ // Hide all panels.
for (var i=0;i<this.get('commentids').length;i++)
{
this.hide(e, this.get('commentids')[i]);
}
- this.overlays[commentid].show(); //show the overlay
+ this.panels[commentid].show(); //show the panel
- e.halt(); // we are going to attach a new 'hide overlay' event to the body,
+ e.halt(); // we are going to attach a new 'hide panel' event to the body,
// because javascript always propagate event to parent tag,
// we need to tell Yahoo to stop to call the event on parent tag
// otherwise the hide event will be call right away.
- //we add a new event on the body in order to hide the overlay for the next click
+ // We add a new event on the body in order to hide the panel for the next click.
this.event = Y.one(document.body).on('click', this.hide, this, commentid);
- //we add a new event on the overlay in order to hide the overlay for the next click (touch device)
- this.overlayevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
+ // We add a new event on the panel in order to hide the panel for the next click (touch device).
+ this.panelevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
+
+ // Focus on the close button
+ this.panels[commentid].get('buttons').header[0].focus();
},
hide : function (e, commentid) {
- this.overlays[commentid].hide(); //hide the overlay
+ this.panels[commentid].hide(); //hide the panel
if (this.event != null) {
this.event.detach(); //we need to detach the body hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
- if (this.overlayevent != null) {
- this.overlayevent.detach(); //we need to detach the overlay hide event
+ if (this.panelevent != null) {
+ this.panelevent.detach(); //we need to detach the panel hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
}, {
NAME : COMMENTSNAME,
ATTRS : {
- commentids: {}
+ commentids: {},
+ closeButtonTitle : {
+ validator : Y.Lang.isString,
+ value : 'Close'
+ }
}
});
}
}, '@VERSION@', {
- requires:['base','overlay', 'moodle-enrol-notification']
+ requires:['base', 'moodle-enrol-notification']
});
event:null,
previousevent:null,
nextevent:null,
- overlayevent:null,
- overlay:null, //all the comment boxes
+ panelevent: null,
+ panel: null, //all the images boxes
imageidnumbers: [],
imageloadingevent: null,
loadingimage: null,
+'</div>');
objBody.append(this.loadingimage);
- /// create the div for overlay
+ // Create the div for panel.
var objBody = Y.one(document.body);
- var overlaytitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
- objBody.append(overlaytitle);
- var overlay = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
- objBody.append(overlay);
+ var paneltitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
+ objBody.append(paneltitle);
+ var panel = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
+ objBody.append(panel);
- /// create the overlay
- this.overlay = new M.core.dialogue({
+ /// Create the panel.
+ this.panel = new M.core.dialogue({
headerContent:Y.one('#imagetitleoverlay').get('innerHTML'),
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
visible: false, //by default it is not displayed
zIndex:100
});
- this.overlay.render();
- this.overlay.hide();
+ this.panel.render();
+ this.panel.hide();
//attach a show event on the image divs (<tag id='image-X'>)
for (var i=0;i<this.get('imageids').length;i++)
var maxheight = windowheight - 150;
//load the title + link to next image
- var overlaytitle = Y.one('#imagetitleoverlay');
+ var paneltitle = Y.one('#imagetitleoverlay');
var previousimagelink = "<div id=\"previousarrow\" class=\"imagearrow\">←</div>";
var nextimagelink = "<div id=\"nextarrow\" class=\"imagearrow\">→</div>";
- /// need to load the images in the overlay
- var overlay = Y.one('#imageoverlay');
- overlay.setContent('');
+ // Need to load the images in the panel.
+ var panel = Y.one('#imageoverlay');
+ panel.setContent('');
-
- overlay.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
+ panel.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
+ '" style="max-height:' + maxheight + 'px;"></div>'));
- this.overlay.destroy();
- this.overlay = new M.core.dialogue({
- headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
- + screennumber + ' / ' + this.imageidnumbers[imageid] + ' </div>' + nextimagelink,
+ this.panel.destroy();
+ this.panel = new M.core.dialogue({
+ headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"><h1> Image '
+ + screennumber + ' / ' + this.imageidnumbers[imageid] + ' </h1></div>' + nextimagelink,
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
visible: false, //by default it is not displayed
lightbox : false,
- zIndex:100
+ zIndex:100,
+ closeButtonTitle: this.get('closeButtonTitle')
});
- this.overlay.render();
- this.overlay.hide(); //show the overlay
- this.overlay.set("centered", true);
+ this.panel.render();
+ this.panel.hide(); //show the panel
+ this.panel.set("centered", true);
- e.halt(); // we are going to attach a new 'hide overlay' event to the body,
+ e.halt(); // we are going to attach a new 'hide panel' event to the body,
// because javascript always propagate event to parent tag,
// we need to tell Yahoo to stop to call the event on parent tag
// otherwise the hide event will be call right away.
var screenshot = new Image();
screenshot.src = url;
- var overlaywidth = windowwidth - 100;
- if(overlaywidth > screenshot.width) {
- overlaywidth = screenshot.width;
+ var panelwidth = windowwidth - 100;
+ if(panelwidth > screenshot.width) {
+ panelwidth = screenshot.width;
}
- this.overlay.set('width', overlaywidth);
- this.overlay.set("centered", true);
- this.overlay.show();
+ this.panel.set('width', panelwidth);
+ this.panel.set("centered", true);
+ this.panel.show();
+
+ // Focus on the close button
+ this.panel.get('buttons').header[0].focus();
}, this, url);
Y.one('#nextarrow').on('click', this.show, this, imageid, nextnumber);
Y.one('#imagenumber').on('click', this.show, this, imageid, nextnumber);
- //we add a new event on the body in order to hide the overlay for the next click
+ //we add a new event on the body in order to hide the panel for the next click
this.event = Y.one(document.body).on('click', this.hide, this);
- //we add a new event on the overlay in order to hide the overlay for the next click (touch device)
- this.overlayevent = Y.one("#imageoverlay").on('click', this.hide, this);
+ //we add a new event on the panel in order to hide the panel for the next click (touch device)
+ this.panelevent = Y.one("#imageoverlay").on('click', this.hide, this);
- this.overlay.on('visibleChange',function(e){
+ this.panel.on('visibleChange',function(e){
if(e.newVal == 0){
this.get('maskNode').remove()
}
//hide the loading image
Y.one('#hubloadingimage').setStyle('display', 'none');
- this.overlay.hide(); //hide the overlay
+ this.panel.hide(); //hide the panel
if (this.event != null) {
this.event.detach(); //we need to detach the body hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
- if (this.overlayevent != null) {
- this.overlayevent.detach(); //we need to detach the overlay hide event
+ if (this.panelevent != null) {
+ this.panelevent.detach(); //we need to detach the panel hide event
//Note: it would work without but create js warning everytime
//we click on the body
}
ATTRS : {
imageids: {},
imagenumbers: {},
- huburl: {}
+ huburl: {},
+ closeButtonTitle : {
+ validator : Y.Lang.isString,
+ value : 'Close'
+ }
}
});
}
}, '@VERSION@', {
- requires:['base','node','overlay', 'moodle-enrol-notification']
+ requires:['base','node', 'moodle-enrol-notification']
});
// Add the module chooser
$PAGE->requires->yui_module('moodle-course-modchooser',
'M.course.init_chooser',
- array(array('courseid' => $course->id))
+ array(array('courseid' => $course->id, 'closeButtonTitle' => get_string('close', 'editor')))
);
$PAGE->requires->strings_for_js(array(
'addresourceoractivity',
AJAXURL = 'ajaxurl',
MANUALENROLMENT = 'manualEnrolment',
CSS = {
+ CLOSEBTN : 'close-button',
COHORT : 'qce-cohort',
COHORTS : 'qce-cohorts',
COHORTBUTTON : 'qce-cohort-button',
this.publish('cohortsloaded');
this.publish('defaultcohortroleloaded', {fireOnce:true});
+ var finishbutton = Y.Node.create('<div class="'+CSS.CLOSEBTN+'"></div>')
+ .append(Y.Node.create('<input type="button" value="'+M.str.enrol.finishenrollingusers+'" />'));
var base = Y.Node.create('<div class="'+CSS.PANELCONTENT+'"></div>')
.append(Y.Node.create('<div class="'+CSS.PANELROLES+'"></div>'))
.append(Y.Node.create('<div class="'+CSS.PANELCOHORTS+'"></div>'))
.append(Y.Node.create('<div class="'+CSS.FOOTER+'"></div>')
- .append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol_cohort.cohortsearch+':</label></div>')
+ .append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label for="enrolcohortsearch">'+M.str.enrol_cohort.cohortsearch+':</label></div>')
.append(Y.Node.create('<input type="text" id="enrolcohortsearch" value="" />'))
)
+ .append(finishbutton)
)
.append(Y.Node.create('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>')
.append(Y.Node.create('<img alt="loading" class="'+CSS.LOADINGICON+'" />')
this.on('defaultcohortroleloaded', this.updateContent, this, panel);
Y.on('key', this.hide, document.body, 'down:27', this);
close.on('click', this.hide, this);
+ finishbutton.on('click', this.hide, this);
Y.all('.enrol_cohort_plugin input').each(function(node){
if (node.getAttribute('type', 'submit')) {
this.getCohorts(e, false);
this.getAssignableRoles();
this.fire('show');
+
+ var rolesselect = Y.one('#id_enrol_cohort_assignable_roles');
+ if (rolesselect) {
+ rolesselect.focus();
+ }
},
updateContent : function(e, panel) {
var content, i, roles, cohorts, count=0, supportmanual = this.get(MANUALENROLMENT), defaultrole;
break;
case 'assignablerolesloaded':
roles = this.get(ASSIGNABLEROLES);
- content = Y.Node.create('<select></select>');
+ content = Y.Node.create('<select id="id_enrol_cohort_assignable_roles"></select>');
for (i in roles) {
content.append(Y.Node.create('<option value="'+i+'">'+roles[i]+'</option>'));
}
- panel.get('contentBox').one('.'+CSS.PANELROLES).setContent(Y.Node.create('<div><label>'+M.str.role.assignroles+':</label></div>').append(content));
+ panel.get('contentBox').one('.'+CSS.PANELROLES).setContent(Y.Node.create('<div><label for="id_enrol_cohort_assignable_roles">'+M.str.role.assignroles+':</label></div>').append(content));
this.getDefaultCohortRole();
+ Y.one('#id_enrol_cohort_assignable_roles').focus();
break;
case 'defaultcohortroleloaded':
defaultrole = this.get(DEFAULTCOHORTROLE);
new M.core.ajaxException(result);
} else {
if (result.response && result.response.message) {
- new M.core.alert(result.response);
+ var alertpanel = new M.core.alert(result.response);
+ Y.Node.one('#id_yuialertconfirm-' + alertpanel.COUNT).focus();
}
var enrolled = Y.Node.create('<div class="'+CSS.COHORTBUTTON+' alreadyenrolled">'+M.str.enrol.synced+'</div>');
node.one('.'+CSS.COHORT+' #cohortid_'+cohort.get(COHORTID)).replace(enrolled);
.append(create('<h2>'+M.str.enrol.enrolusers+'</h2>')))
.append(create('<div class="'+CSS.CONTENT+'"></div>')
.append(create('<div class="'+CSS.SEARCHCONTROLS+'"></div>')
- .append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.ROLE+'">'+M.str.role.assignroles+'</div>')
- .append(create('<select><option value="">'+M.str.enrol.none+'</option></select>'))
+ .append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.ROLE+'"><label for="id_enrol_manual_assignable_roles">'+M.str.role.assignroles+'</label></div>')
+ .append(create('<select id="id_enrol_manual_assignable_roles"><option value="">'+M.str.enrol.none+'</option></select>'))
)
.append(create('<div class="'+CSS.SEARCHOPTIONS+'"></div>')
.append(create('<div class="'+CSS.COLLAPSIBLEHEADING+'"><img alt="" />'+M.str.enrol.enrolmentoptions+'</div>'))
s.append(option);
}
s.set('selectedIndex', index);
+ Y.one('#id_enrol_manual_assignable_roles').focus();
}, this);
this.getAssignableRoles();
},
}
this._escCloseEvent = Y.on('key', this.hide, document.body, 'down:27', this);
+ var rolesselect = Y.one('#id_enrol_manual_assignable_roles');
+ if (rolesselect) {
+ rolesselect.focus();
+ }
},
hide : function(e) {
if (this._escCloseEvent) {
.moodle-dialogue-base .hidden,
.moodle-dialogue-base .moodle-dialogue-hidden {display:none;}
-.moodle-dialogue-base .moodle-dialogue-lightbox {background-color:#AAA;position:absolute;top:0;left:0;width:100%;height:100%;}
+.moodle-dialogue-base .moodle-dialogue-lightbox {background-color:#AAA;}
.moodle-dialogue-base .moodle-dialogue {background-color:#666;border:0 solid #666;border-right-width:3px;border-bottom-width:3px;}
.moodle-dialogue-base .moodle-dialogue-wrap {background-color:#FFF;margin-top:-3px;margin-left:-3px;border:1px solid #555;height:auto;}
-.moodle-dialogue-base .moodle-dialogue-hd {font-size:110%;color:inherit;font-weight:bold;text-align:left;padding:5px 6px;margin:0;border-bottom:1px solid #ccc;background-color:#f6f6f6;}
-.moodle-dialogue-base .closebutton {background-image:url(sprite.png);width:25px;height:15px;background-repeat:no-repeat;float:right;vertical-align:middle;display:inline-block;cursor:pointer;}
+.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd {font-size:110%;color:inherit;font-weight:bold;text-align:left;padding:5px 6px;margin:0;border-bottom:1px solid #ccc;background:#f6f6f6;}
+.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd h1{font-size:100%;font-weight:bold;margin:0;padding:0;display:inline;}
+.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd .yui3-widget-buttons {padding: 5px;}
+.moodle-dialogue-base .closebutton {background-image:url(sprite.png);width:25px;height:15px;background-repeat:no-repeat;float:right;vertical-align:middle;display:inline-block;cursor:pointer;padding:0px;border-style:none;}
.moodle-dialogue-base .moodle-dialogue-bd {padding:5px; overflow: auto;}
-.moodle-dialogue-base .moodle-dialogue-ft {}
+.moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-content {background:#FFF;padding:0px;}
+.moodle-dialogue-base .moodle-dialogue .moodle-dialogue-content .moodle-dialogue-ft {padding:0px;}
.moodle-dialogue-confirm .confirmation-dialogue {text-align:center;}
.moodle-dialogue-confirm .confirmation-message {margin:0.5em 1em;}
ALERT_NAME = 'Moodle alert',
C = Y.Node.create,
BASE = 'notificationBase',
- LIGHTBOX = 'lightbox',
- NODELIGHTBOX = 'nodeLightbox',
COUNT = 0,
CONFIRMYES = 'yesLabel',
CONFIRMNO = 'noLabel',
var id = 'moodle-dialogue-'+COUNT;
config.notificationBase =
C('<div class="'+CSS.BASE+'">')
- .append(C('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>'))
.append(C('<div id="'+id+'" class="'+CSS.WRAP+'"></div>')
.append(C('<div class="'+CSS.HEADER+' yui3-widget-hd"></div>'))
.append(C('<div class="'+CSS.BODY+' yui3-widget-bd"></div>'))
config.visible = config.visible || false;
config.center = config.centered || true;
config.centered = false;
+
+ // lightbox param to keep the stable versions API.
+ if (config.lightbox !== false) {
+ config.modal = true;
+ }
+ delete config.lightbox;
+
+ // closeButton param to keep the stable versions API.
+ if (config.closeButton === false) {
+ config.buttons = null;
+ } else {
+ config.buttons = [
+ {
+ section: Y.WidgetStdMod.HEADER,
+ classNames: 'closebutton',
+ action: function (e) {
+ this.hide();
+ }
+ }
+ ];
+ }
DIALOGUE.superclass.constructor.apply(this, [config]);
+
+ if (config.closeButton !== false) {
+ // The buttons constructor does not allow custom attributes
+ this.get('buttons').header[0].setAttribute('title', this.get('closeButtonTitle'));
+ }
};
-Y.extend(DIALOGUE, Y.Overlay, {
+Y.extend(DIALOGUE, Y.Panel, {
initializer : function(config) {
- this.set(NODELIGHTBOX, this.get(BASE).one('.'+CSS.LIGHTBOX).setStyle('opacity', 0.5));
this.after('visibleChange', this.visibilityChanged, this);
- this.after('headerContentChange', function(e){
- var h = (this.get('closeButton'))?this.get(BASE).one('.'+CSS.HEADER):false;
- if (h && !h.one('.closebutton')) {
- var c = C('<div class="closebutton"></div>');
- c.on('click', this.hide, this);
- h.append(c);
- }
- }, this);
this.render();
this.show();
},
visibilityChanged : function(e) {
switch (e.attrName) {
case 'visible':
- if (this.get(LIGHTBOX)) {
- var l = this.get(NODELIGHTBOX);
- if (!e.prevVal && e.newVal) {
- l.setStyle('height',l.get('docHeight')+'px').removeClass(CSS.HIDDEN);
- } else if (e.prevVal && !e.newVal) {
- l.addClass(CSS.HIDDEN);
- }
- }
+ this.get('maskNode').addClass(CSS.LIGHTBOX);
if (this.get('center') && !e.prevVal && e.newVal) {
this.centerDialogue();
}
if (this.get('draggable')) {
var titlebar = '#' + this.get('id') + ' .' + CSS.HEADER;
this.plug(Y.Plugin.Drag, {handles : [titlebar]});
- this.dd.addInvalid('div.closebutton');
Y.one(titlebar).setStyle('cursor', 'move');
}
break;
ATTRS : {
notificationBase : {
- },
- nodeLightbox : {
- value : null
},
lightbox : {
validator : Y.Lang.isBoolean,
validator : Y.Lang.isBoolean,
value : true
},
+ closeButtonTitle : {
+ validator : Y.Lang.isString,
+ value : 'Close'
+ },
center : {
validator : Y.Lang.isBoolean,
value : true
_enterKeypress : null,
initializer : function(config) {
this.publish('complete');
- var yes = C('<input type="button" value="'+this.get(CONFIRMYES)+'" />'),
+ var yes = C('<input type="button" id="id_yuialertconfirm-' + this.COUNT + '" value="'+this.get(CONFIRMYES)+'" />'),
content = C('<div class="confirmation-dialogue"></div>')
.append(C('<div class="confirmation-message">'+this.get('message')+'</div>'))
.append(C('<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, this.get(TITLE), Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
this._enterKeypress = Y.on('key', this.submit, window, 'down:13', this);
yes.on('click', this.submit, this);
this.publish('complete');
this.publish('complete-yes');
this.publish('complete-no');
- var yes = C('<input type="button" value="'+this.get(CONFIRMYES)+'" />'),
- no = C('<input type="button" value="'+this.get(CONFIRMNO)+'" />'),
+ var yes = C('<input type="button" id="id_yuiconfirmyes-' + this.COUNT + '" value="'+this.get(CONFIRMYES)+'" />'),
+ no = C('<input type="button" id="id_yuiconfirmno-' + this.COUNT + '" value="'+this.get(CONFIRMNO)+'" />'),
content = C('<div class="confirmation-dialogue"></div>')
.append(C('<div class="confirmation-message">'+this.get(QUESTION)+'</div>'))
.append(C('<div class="confirmation-buttons"></div>')
.append(no));
this.get(BASE).addClass('moodle-dialogue-confirm');
this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE);
- this.setStdModContent(Y.WidgetStdMod.HEADER, this.get(TITLE), Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
this._enterKeypress = Y.on('key', this.submit, window, 'down:13', this, true);
this._escKeypress = Y.on('key', this.submit, window, 'down:27', this, false);
_keypress : null,
initializer : function(config) {
this.get(BASE).addClass('moodle-dialogue-exception');
- this.setStdModContent(Y.WidgetStdMod.HEADER, config.name, Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
var content = C('<div class="moodle-exception"></div>')
.append(C('<div class="moodle-exception-message">'+this.get('message')+'</div>'))
.append(C('<div class="moodle-exception-param hidden param-filename"><label>File:</label> '+this.get('fileName')+'</div>'))
_keypress : null,
initializer : function(config) {
this.get(BASE).addClass('moodle-dialogue-exception');
- this.setStdModContent(Y.WidgetStdMod.HEADER, config.name, Y.WidgetStdMod.REPLACE);
+ this.setStdModContent(Y.WidgetStdMod.HEADER, '<h1>' + config.name + '</h1>', Y.WidgetStdMod.REPLACE);
var content = C('<div class="moodle-ajaxexception"></div>')
.append(C('<div class="moodle-exception-message">'+this.get('error')+'</div>'))
.append(C('<div class="moodle-exception-param hidden param-debuginfo"><label>URL:</label> '+this.get('reproductionlink')+'</div>'))
M.core.exception = EXCEPTION;
M.core.ajaxException = AJAXEXCEPTION;
-}, '@VERSION@', {requires:['base','node','overlay','event-key', 'moodle-enrol-notification-skin', 'dd-plugin']});
+}, '@VERSION@', {requires:['base','node','panel','event-key', 'moodle-enrol-notification-skin', 'dd-plugin']});
for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments
- new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
+ var alertpanel = new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
+ Y.Node.one('#id_yuialertconfirm-' + alertpanel.COUNT).focus();
}
return true;
}
Y.extend(CHOOSERDIALOGUE, Y.Base, {
- // The overlay widget
- overlay: null,
+ // The panel widget
+ panel: null,
// The submit button - we disable this until an element is set
submitbutton : null,
bodyContent : this.bodycontent.get('innerHTML'),
headerContent : this.headercontent.get('innerHTML'),
draggable : true,
- visible : false, // Hide by default.
- zindex : 100, // Display in front of other items.
- lightbox : true // This dialogue should be modal.
+ visible : false, // Hide by default
+ zindex : 100, // Display in front of other items
+ lightbox : true, // This dialogue should be modal
+ shim : true,
+ closeButtonTitle : this.get('closeButtonTitle')
}
// Override with additional options
params[paramkey] = this.instanceconfig[paramkey];
}
- // Create the overlay
- this.overlay = new M.core.dialogue(params);
+ // Create the panel
+ this.panel = new M.core.dialogue(params);
// Remove the template for the chooser
this.bodycontent.remove();
this.headercontent.remove();
- // Hide and then render the overlay
- this.overlay.hide();
- this.overlay.render();
+ // Hide and then render the panel
+ this.panel.hide();
+ this.panel.render();
// Set useful links
- this.container = this.overlay.get('boundingBox').one('.choosercontainer');
+ this.container = this.panel.get('boundingBox').one('.choosercontainer');
this.options = this.container.all('.option input[type=radio]');
// Add the chooserdialogue class to the container for styling
- this.overlay.get('boundingBox').addClass('chooserdialogue');
+ this.panel.get('boundingBox').addClass('chooserdialogue');
},
/**
// Stop the default event actions before we proceed
e.preventDefault();
- var bb = this.overlay.get('boundingBox');
+ var bb = this.panel.get('boundingBox');
var dialogue = this.container.one('.alloptions');
// Get the overflow setting when the chooser was opened - we
// Hook onto the cancel button to hide the form
thisevent = this.container.one('#addcancel').on('click', this.cancel_popup, this);
this.listenevents.push(thisevent);
- thisevent = bb.one('div.closebutton').on('click', this.cancel_popup, this);
+
+ // Hide will be managed by cancel_popup after restoring the body overflow
+ thisevent = bb.one('button.closebutton').on('click', this.cancel_popup, this);
this.listenevents.push(thisevent);
// Grab global keyup events and handle them
// Ensure that the options are shown
this.options.removeAttribute('disabled');
- // Display the overlay
- this.overlay.show();
+ // Display the panel
+ this.panel.show();
// Re-centre the dialogue after we've shown it.
this.center_dialogue(dialogue);
* @return void
*/
center_dialogue : function(dialogue) {
- var bb = this.overlay.get('boundingBox');
+ var bb = this.panel.get('boundingBox');
var winheight = bb.get('winHeight');
var winwidth = bb.get('winWidth');
}
this.container.detachAll();
- this.overlay.hide();
+ this.panel.hide();
},
check_options : function(e) {
},
maxheight : {
value : 660
+ },
+ closeButtonTitle : {
+ validator : Y.Lang.isString,
+ value : 'Close'
}
}
});
M.core.chooserdialogue = CHOOSERDIALOGUE;
},
'@VERSION@', {
- requires:['base', 'overlay', 'moodle-enrol-notification']
+ requires:['base', 'panel', 'moodle-enrol-notification']
}
);
-moz-box-shadow: 5px 5px 20px 0px #666666;
}
-.chooserdialogue .moodle-dialogue-hd {
+.chooserdialogue .moodle-dialogue-wrap .moodle-dialogue-hd {
font-size:12px!important;
font-weight: normal!important;
letter-spacing: 1px;
/* Question Bank - Question Chooser "Close" button */
#page-question-edit.dir-rtl a.container-close {right:auto;left:6px;}
-.chooserdialogue .moodle-dialogue-bd {
+.chooserdialogue .moodle-dialogue-wrap .moodle-dialogue-bd {
font-size: 12px;
color: #555555;
overflow: auto;