mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-30899 moodle-core-notification Adding close button title for accessibility
This commit is contained in:
parent
f068cac195
commit
4bcbdb3e88
@ -322,6 +322,7 @@ abstract class base_moodleform extends moodleform {
|
||||
$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',
|
||||
|
@ -228,10 +228,10 @@ if (!empty($courses)) {
|
||||
}
|
||||
}
|
||||
$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));
|
||||
|
||||
|
9
blocks/community/yui/comments/comments.js
vendored
9
blocks/community/yui/comments/comments.js
vendored
@ -24,7 +24,8 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
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.panels[commentid].get('contentBox').one('.commenttitle').remove();
|
||||
@ -78,7 +79,11 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
}, {
|
||||
NAME : COMMENTSNAME,
|
||||
ATTRS : {
|
||||
commentids: {}
|
||||
commentids: {},
|
||||
closeButtonTitle : {
|
||||
validator : Y.Lang.isString,
|
||||
value : 'Close'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -102,7 +102,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
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.panel.render();
|
||||
this.panel.hide(); //show the panel
|
||||
@ -187,7 +188,11 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
ATTRS : {
|
||||
imageids: {},
|
||||
imagenumbers: {},
|
||||
huburl: {}
|
||||
huburl: {},
|
||||
closeButtonTitle : {
|
||||
validator : Y.Lang.isString,
|
||||
value : 'Close'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -4528,7 +4528,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
|
||||
// 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',
|
||||
|
8
lib/yui/chooserdialogue/chooserdialogue.js
vendored
8
lib/yui/chooserdialogue/chooserdialogue.js
vendored
@ -43,7 +43,9 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
|
||||
draggable : true,
|
||||
visible : false, // Hide by default
|
||||
zindex : 100, // Display in front of other items
|
||||
lightbox : true // This dialogue should be modal
|
||||
lightbox : true, // This dialogue should be modal
|
||||
shim : true,
|
||||
closeButtonTitle : this.get('closeButtonTitle')
|
||||
};
|
||||
|
||||
// Override with additional options
|
||||
@ -314,6 +316,10 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
|
||||
},
|
||||
maxheight : {
|
||||
value : 660
|
||||
},
|
||||
closeButtonTitle : {
|
||||
validator : Y.Lang.isString,
|
||||
value : 'Close'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
9
lib/yui/notification/notification.js
vendored
9
lib/yui/notification/notification.js
vendored
@ -61,6 +61,11 @@ var DIALOGUE = function(config) {
|
||||
];
|
||||
}
|
||||
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.Panel, {
|
||||
initializer : function(config) {
|
||||
@ -111,6 +116,10 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
validator : Y.Lang.isBoolean,
|
||||
value : true
|
||||
},
|
||||
closeButtonTitle : {
|
||||
validator : Y.Lang.isString,
|
||||
value : 'Close'
|
||||
},
|
||||
center : {
|
||||
validator : Y.Lang.isBoolean,
|
||||
value : true
|
||||
|
Loading…
x
Reference in New Issue
Block a user