7
7
* This should be called after the page has loaded e.g. on 'domready'.
10
function setup_privacy_notification(config) {
11
var notification_text = 'The information on this page is private';
13
var target_id = "maincontent";
14
if (config !== undefined) {
15
if (config.notification_text !== undefined) {
16
notification_text = config.notification_text;
18
if (config.hidden !== undefined) {
19
hidden = config.hidden;
21
if (config.target_id !== undefined) {
22
target_id = config.target_id;
25
var id_selector = "#" + target_id;
26
var main = Y.one(id_selector);
27
var notification = Y.Node.create('<div></div>')
28
.addClass('global-notification');
30
notification.addClass('hidden');
32
var notification_span = Y.Node.create('<span></span>')
34
.addClass('notification-private');
35
var close_link = Y.Node.create('<a></a>')
36
.addClass('global-notification-close')
38
var close_span = Y.Node.create('<span></span>')
40
.addClass('notification-close');
42
notification.set('text', notification_text);
43
close_link.set('text', "Hide");
45
main.appendChild(notification);
46
notification.appendChild(notification_span);
47
notification.appendChild(close_link);
48
close_link.appendChild(close_span);
51
namespace.setup_privacy_notification = setup_privacy_notification;
9
53
function display_privacy_notification(highlight_portlet_on_close) {
10
54
/* Check if the feature flag is set for this notification. */
11
55
var highlight = true;