Edit the file notices.js in Documents -> Javascript to add, update or remove system notices.
siteNotice() allows a site notice to be set for a specific time range, on specific pages, and with a javascript callback if needed.
siteNotice(message, options, callback)
message: [required] Your message which will appear in an area above the main menu.
options: [object] [optional] An object that defines additional options. You may define any or all options:
priority: 'high', 'medium','low'. The are styled in red, yellow, and blue, respectively.
default/empty = 'high'.
startdate: Indicate the dates the message will appear.
default/empty = now.
enddate: Indicate the dates the message will disappear.
default/empty = forever.
(Dates are based on MST. Dates are in this form:
"January 1, 2012 23:30:00")
pages: "home" indicates home page only.
Any other words, e.g. "students", will be matched to the URL. If that word in in the url, the message will display.
default/empty = all pages.
callback: a function that will be called after the message
is displayed. The only built-in-function is "disableLogin." Do not use
quote marks, and use the proper case (just like calling a normal function). If something is wrong with the function, a generic error is sent to the console.
Examples:
This puts a notice on every page during a certain time period, and runs a function called disableLogin which makes the login and apps.asrt.org links "non-interactive."
// simple (stays up until you remove/comment out this function)
siteNotice('The ASRT website is temporarily down.');
------------------------------------------
// set options object
var opts = {
priority:'medium',
pages:'home',
startdate:'Jan 01 2012 00:00:00',
enddate: 'Jan 01 2040 00:00:00'
}
// call function
siteNotice('The ASRT website is temporarily down.', opts, disableLogin);
------------------------------------------
// object and callback within function
siteNotice(
"The ASRT website is undergoing routine maintenance.",
{
priority:'high',
pages:'students',
startdate:'Jan 01 2012 00:00:00',
enddate: 'Jan 01 2040 00:00:00'
},
function() {
alert('it worked');
}
);