A custom script is JavaScript that your display runs after it loads. Use it to change what the display shows when no setting does it.
We built custom scripts for our own use. If you want something custom, contact us from your admin portal and we can write it with you.
Add a custom script
Saving the script reloads the display.
- In the Admin Portal, open the display.
- Select the Hardware tab.
- Under Custom Script, type or paste your JavaScript. Paste the code itself, not a URL.
- Select Save.
Run code each time the display redraws
The display redraws its meeting list after it loads new calendar data. To run your code after each redraw, put it in window.afterCorrectPositions:
window.afterCorrectPositions = function () {
// Your custom code here
};
Code outside this function runs one time, when the display loads.
Example scripts
The examples below use jQuery and the page elements of the v2 Theme. The v3 Theme and SDK themes also run afterCorrectPositions, but they use different page elements, so these examples do not change them. To see your theme, open the display and select the Style tab.
Show other reservation lengths
This script changes the reservation buttons from 15, 30, 45 and 60 minutes to 30 minutes, 1, 1.5 and 2 hours. The buttons show only when Allow User Selected Reservation Lengths is on, on the Features tab.
window.afterCorrectPositions = function () {
$('.ib[data-length="60"]').attr('data-length', 120).html('2 hrs');
$('.ib[data-length="45"]').attr('data-length', 90).html('1.5 hrs');
$('.ib[data-length="30"]').attr('data-length', 60).html('1 hr');
$('.ib[data-length="15"]').attr('data-length', 30).html('30 min');
};
If Custom Reservation Button is also on, the display changes the 60-minute button to Custom. You then see 30 minutes, 1 hour, 1.5 hours and Custom.
Show only the organizer, not the attendees
window.afterCorrectPositions = function () {
$('.meeting').each(function () {
var organizer = $(this).attr('data-organizer');
$(this).find('h4 label').html(organizer);
});
};
Show the organizer instead of the subject
window.afterCorrectPositions = function () {
$('.meeting').each(function () {
var organizer = $(this).attr('data-organizer');
$(this).find('h2').html(organizer);
});
};
To hide both subjects and names, you do not need a script. Turn on Private Mode on the Features tab.
Move the room status slightly to reduce burn-in
Most LCD screens do not get burn-in. On an OLED screen, this script moves the room name and status a few pixels at each redraw.
window.afterCorrectPositions = function () {
$('.top.right').css('padding-top', Math.floor(Math.random() * 10) + 'px');
$('.top.right').css('padding-left', Math.floor(Math.random() * 10) + 'px');
$('.top.right').css('opacity', 1 - Math.floor(Math.random() * 5) / 100);
};
Settings that replace old scripts
- To show fewer past meetings, set Past Meeting Limit on the Features tab.
- This article used to include a weather script for Toronto. The weather service it used no longer works, so we removed it.