10.07.2015 Views

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

function showMenu(userName, displayName, status, x, y ){var isOnline = (status != 0);setMenuItem("menu_message", "Message...", "javascript:onMessage()",isOnline);setMenuItem("menu_meeting", "Share Application...","javascript:onMeeting()", isOnline);setMenuItem("menu_addContact", "Add to Contact List","javascript:onAddContact()", isLoggedIn);setMenuItem("menu_mail", "Send Mail...", "mailto:" +getEmailAddress(userName), true);}var theMenu = document.getElementById("menu");theMenu.style.left=x - 10 + document.body.scrollLeft;theMenu.style.top=y + 10 + document.body.scrollTop;theMenu.style.visibility='visible';Before displaying the menu, showMenu sets the content of the four menu items.It positions the menu at the point on the screen where the mouse was clicked,and finally makes the menu visible.The first two items, Message and Share Application, are disabled if the statusparameter is zero, which means that the selected person is offline. The Add toContact List item is disabled if the page user is not logged in. The user has to belogged in with the Sametime Links applet in order to add a person to the contactlist. In showMenu, we use the flag isLoggedIn to test whether or not the user iscurrently logged in. This flag is not provided by the API. Because there is nodirect API call for testing if the user is logged in, we use the STLinksLoggedInand STLinksLoggedOut API events to set the isLoggedIn flag, as can be seen inExample 9-13 on page 267.266 <strong>Lotus</strong> <strong>Instant</strong> <strong>Messaging</strong>/<strong>Web</strong> <strong>Conferencing</strong> (Sametime): Building Sametime-Enabled Applications

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!