Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

close.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* global interfaceConfig */
  2. //list of tips
  3. var hints = [
  4. "You can pin participants by clicking on their thumbnails.",// jshint ignore:line
  5. "You can tell others you have something to say by using the \"Raise Hand\" feature",// jshint ignore:line
  6. "You can learn about key shortcuts by pressing Shift+?",// jshint ignore:line
  7. "You can learn more about the state of everyone's connection by hovering on the bars in their thumbnail",// jshint ignore:line
  8. "You can hide all thumbnails by using the button in the bottom right corner"// jshint ignore:line
  9. ];
  10. /**
  11. * Get a random hint meessage from hint array.
  12. *
  13. * @return {string} the hint message.
  14. */
  15. function getHint(){
  16. var l = hints.length - 1;
  17. var n = Math.round(Math.random() * l);
  18. return hints[n];
  19. }
  20. /**
  21. * Inserts text message
  22. * into DOM element
  23. *
  24. * @param id {string} element identificator
  25. * @param msg {string} text message
  26. */
  27. // eslint-disable-next-line no-unused-vars
  28. function insertTextMsg(id, msg){
  29. var el = document.getElementById(id);
  30. if (el)
  31. el.innerHTML = msg;
  32. }
  33. /**
  34. * Sets the hint and thanks messages. Will be executed on load event.
  35. */
  36. function onLoad() {
  37. //Works only for close2.html because close.html doesn't have this element.
  38. insertTextMsg('thanksMessage',
  39. 'Thank you for using ' + interfaceConfig.APP_NAME);
  40. // If there is a setting show a special message only for the guests
  41. if (interfaceConfig.CLOSE_PAGE_GUEST_HINT) {
  42. if ( window.sessionStorage.getItem('guest') === 'true' ) {
  43. var element = document.getElementById('hintQuestion');
  44. element.classList.add('hide');
  45. insertTextMsg('hintMessage', interfaceConfig.CLOSE_PAGE_GUEST_HINT);
  46. return;
  47. }
  48. }
  49. insertTextMsg('hintMessage', getHint());
  50. }
  51. window.onload = onLoad;