Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

BottomToolbar.js 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* global $, APP, interfaceConfig, JitsiMeetJS */
  2. import UIUtil from '../util/UIUtil';
  3. import UIEvents from '../../../service/UI/UIEvents';
  4. const defaultBottomToolbarButtons = {
  5. 'chat': {
  6. id: '#bottom_toolbar_chat'
  7. },
  8. 'contacts': {
  9. id: '#bottom_toolbar_contact_list'
  10. },
  11. 'filmstrip': {
  12. id: '#bottom_toolbar_film_strip'
  13. }
  14. };
  15. const BottomToolbar = {
  16. init () {
  17. this.toolbar = $('#bottomToolbar');
  18. // The bottom toolbar is enabled by default.
  19. this.enabled = true;
  20. },
  21. /**
  22. * Enables / disables the bottom toolbar.
  23. * @param {e} set to {true} to enable the bottom toolbar or {false}
  24. * to disable it
  25. */
  26. enable (e) {
  27. this.enabled = e;
  28. if (!e && this.isVisible())
  29. this.hide(false);
  30. },
  31. /**
  32. * Indicates if the bottom toolbar is currently enabled.
  33. * @return {this.enabled}
  34. */
  35. isEnabled() {
  36. return this.enabled;
  37. },
  38. setupListeners (emitter) {
  39. UIUtil.hideDisabledButtons(defaultBottomToolbarButtons);
  40. const buttonHandlers = {
  41. "bottom_toolbar_contact_list": function () {
  42. JitsiMeetJS.analytics.sendEvent(
  43. 'bottomtoolbar.contacts.toggled');
  44. emitter.emit(UIEvents.TOGGLE_CONTACT_LIST);
  45. },
  46. "bottom_toolbar_film_strip": function () {
  47. JitsiMeetJS.analytics.sendEvent(
  48. 'bottomtoolbar.filmstrip.toggled');
  49. emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
  50. },
  51. "bottom_toolbar_chat": function () {
  52. JitsiMeetJS.analytics.sendEvent('bottomtoolbar.chat.toggled');
  53. emitter.emit(UIEvents.TOGGLE_CHAT);
  54. }
  55. };
  56. Object.keys(buttonHandlers).forEach(
  57. buttonId => $(`#${buttonId}`).click(buttonHandlers[buttonId])
  58. );
  59. },
  60. resizeToolbar (thumbWidth, thumbHeight) {
  61. let bottom = (thumbHeight - this.toolbar.outerHeight())/2 + 18;
  62. this.toolbar.css({bottom});
  63. },
  64. /**
  65. * Returns true if this toolbar is currently visible, or false otherwise.
  66. * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
  67. */
  68. isVisible() {
  69. return this.toolbar.is(":visible");
  70. },
  71. /**
  72. * Hides the bottom toolbar with animation or not depending on the animate
  73. * parameter.
  74. * @param animate <tt>true</tt> to hide the bottom toolbar with animation,
  75. * <tt>false</tt> or nothing to hide it without animation.
  76. */
  77. hide(animate) {
  78. if (animate)
  79. this.toolbar.hide("slide", {direction: "right", duration: 300});
  80. else
  81. this.toolbar.css("display", "none");
  82. },
  83. /**
  84. * Shows the bottom toolbar with animation or not depending on the animate
  85. * parameter.
  86. * @param animate <tt>true</tt> to show the bottom toolbar with animation,
  87. * <tt>false</tt> or nothing to show it without animation.
  88. */
  89. show(animate) {
  90. if (animate)
  91. this.toolbar.show("slide", {direction: "right", duration: 300});
  92. else
  93. this.toolbar.css("display", "block");
  94. }
  95. };
  96. export default BottomToolbar;