|
|
|
@ -3,15 +3,15 @@ |
|
|
|
|
import type { Dispatch } from 'redux-thunk'; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
CLEAR_TOOLBAR_TIMEOUT, |
|
|
|
|
SET_ALWAYS_VISIBLE_TOOLBAR, |
|
|
|
|
CLEAR_TOOLBOX_TIMEOUT, |
|
|
|
|
SET_TOOLBOX_ALWAYS_VISIBLE, |
|
|
|
|
SET_SUBJECT, |
|
|
|
|
SET_SUBJECT_SLIDE_IN, |
|
|
|
|
SET_TOOLBAR_BUTTON, |
|
|
|
|
SET_TOOLBAR_HOVERED, |
|
|
|
|
SET_TOOLBAR_TIMEOUT, |
|
|
|
|
SET_TOOLBAR_TIMEOUT_NUMBER, |
|
|
|
|
SET_TOOLBAR_VISIBLE |
|
|
|
|
SET_TOOLBOX_TIMEOUT, |
|
|
|
|
SET_TOOLBOX_TIMEOUT_MS, |
|
|
|
|
SET_TOOLBOX_VISIBLE |
|
|
|
|
} from './actionTypes'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -23,7 +23,7 @@ import { |
|
|
|
|
export function changeLocalRaiseHand(handRaised: boolean): Function { |
|
|
|
|
return (dispatch: Dispatch<*>, getState: Function) => { |
|
|
|
|
const state = getState(); |
|
|
|
|
const { secondaryToolbarButtons } = state['features/toolbar']; |
|
|
|
|
const { secondaryToolbarButtons } = state['features/toolbox']; |
|
|
|
|
const buttonName = 'raisehand'; |
|
|
|
|
const button = secondaryToolbarButtons.get(buttonName); |
|
|
|
|
|
|
|
|
@ -34,15 +34,15 @@ export function changeLocalRaiseHand(handRaised: boolean): Function { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Signals that toolbar timeout should be cleared. |
|
|
|
|
* Signals that toolbox timeout should be cleared. |
|
|
|
|
* |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: CLEAR_TOOLBAR_TIMEOUT |
|
|
|
|
* type: CLEAR_TOOLBOX_TIMEOUT |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function clearToolbarTimeout(): Object { |
|
|
|
|
export function clearToolboxTimeout(): Object { |
|
|
|
|
return { |
|
|
|
|
type: CLEAR_TOOLBAR_TIMEOUT |
|
|
|
|
type: CLEAR_TOOLBOX_TIMEOUT |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -51,22 +51,22 @@ export function clearToolbarTimeout(): Object { |
|
|
|
|
* |
|
|
|
|
* @param {boolean} alwaysVisible - Value to be set in redux store. |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: SET_ALWAYS_VISIBLE_TOOLBAR, |
|
|
|
|
* alwaysVisible: bool |
|
|
|
|
* type: SET_TOOLBOX_ALWAYS_VISIBLE, |
|
|
|
|
* alwaysVisible: boolean |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setAlwaysVisibleToolbar(alwaysVisible: boolean): Object { |
|
|
|
|
export function setToolboxAlwaysVisible(alwaysVisible: boolean): Object { |
|
|
|
|
return { |
|
|
|
|
type: SET_ALWAYS_VISIBLE_TOOLBAR, |
|
|
|
|
type: SET_TOOLBOX_ALWAYS_VISIBLE, |
|
|
|
|
alwaysVisible |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Enables / disables audio toolbar button. |
|
|
|
|
* Enables/disables audio toolbar button. |
|
|
|
|
* |
|
|
|
|
* @param {boolean} enabled - Indicates if the button should be enabled |
|
|
|
|
* or disabled. |
|
|
|
|
* @param {boolean} enabled - True if the button should be enabled; otherwise, |
|
|
|
|
* false. |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function setAudioIconEnabled(enabled: boolean = false): Function { |
|
|
|
@ -84,12 +84,12 @@ export function setAudioIconEnabled(enabled: boolean = false): Function { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Signals that value of conference subject should be changed. |
|
|
|
|
* Signals that value of conference subject should be changed. |
|
|
|
|
* |
|
|
|
|
* @param {string} subject - Conference subject string. |
|
|
|
|
* @returns {Object} |
|
|
|
|
* @param {string} subject - Conference subject string. |
|
|
|
|
* @returns {Object} |
|
|
|
|
*/ |
|
|
|
|
export function setSubject(subject: string) { |
|
|
|
|
export function setSubject(subject: string): Object { |
|
|
|
|
return { |
|
|
|
|
type: SET_SUBJECT, |
|
|
|
|
subject |
|
|
|
@ -97,9 +97,10 @@ export function setSubject(subject: string) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Signals that toolbar subject slide in value should be changed. |
|
|
|
|
* Signals that toolbox subject slide in value should be changed. |
|
|
|
|
* |
|
|
|
|
* @param {boolean} subjectSlideIn - Flag showing whether subject is shown. |
|
|
|
|
* @param {boolean} subjectSlideIn - True if the subject is shown; otherwise, |
|
|
|
|
* false. |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: SET_SUBJECT_SLIDE_IN, |
|
|
|
|
* subjectSlideIn: boolean |
|
|
|
@ -119,15 +120,15 @@ export function setSubjectSlideIn(subjectSlideIn: boolean): Object { |
|
|
|
|
* @param {Object} button - Button object. |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: SET_TOOLBAR_BUTTON, |
|
|
|
|
* buttonName: string, |
|
|
|
|
* button: Object |
|
|
|
|
* button: Object, |
|
|
|
|
* buttonName: string |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setToolbarButton(buttonName: string, button: Object): Object { |
|
|
|
|
return { |
|
|
|
|
type: SET_TOOLBAR_BUTTON, |
|
|
|
|
buttonName, |
|
|
|
|
button |
|
|
|
|
button, |
|
|
|
|
buttonName |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -147,63 +148,67 @@ export function setToolbarHovered(hovered: boolean): Object { |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* eslint-disable flowtype/space-before-type-colon */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Dispatches an action which sets new timeout and clears the previous one. |
|
|
|
|
* |
|
|
|
|
* @param {Function} handler - Function to be invoked after the timeout. |
|
|
|
|
* @param {number} toolbarTimeout - Delay. |
|
|
|
|
* @param {number} timeoutMS - Delay. |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: SET_TOOLBAR_TIMEOUT, |
|
|
|
|
* handler: Function, |
|
|
|
|
* toolbarTimeout: number |
|
|
|
|
* type: SET_TOOLBOX_TIMEOUT, |
|
|
|
|
* handler: Function, |
|
|
|
|
* timeoutMS: number |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setToolbarTimeout(handler: Function, |
|
|
|
|
toolbarTimeout: number): Object { |
|
|
|
|
export function setToolboxTimeout(handler: Function, timeoutMS: number) |
|
|
|
|
: Object { |
|
|
|
|
return { |
|
|
|
|
type: SET_TOOLBAR_TIMEOUT, |
|
|
|
|
type: SET_TOOLBOX_TIMEOUT, |
|
|
|
|
handler, |
|
|
|
|
toolbarTimeout |
|
|
|
|
timeoutMS |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* eslint-enable flowtype/space-before-type-colon */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Dispatches an action which sets new toolbar timeout value. |
|
|
|
|
* Dispatches an action which sets new toolbox timeout value. |
|
|
|
|
* |
|
|
|
|
* @param {number} toolbarTimeout - Delay. |
|
|
|
|
* @param {number} timeoutMS - Delay. |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: SET_TOOLBAR_TIMEOUT_NUMBER, |
|
|
|
|
* toolbarTimeout: number |
|
|
|
|
* type: SET_TOOLBOX_TIMEOUT_MS, |
|
|
|
|
* timeoutMS: number |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setToolbarTimeoutNumber(toolbarTimeout: number): Object { |
|
|
|
|
export function setToolboxTimeoutMS(timeoutMS: number): Object { |
|
|
|
|
return { |
|
|
|
|
type: SET_TOOLBAR_TIMEOUT_NUMBER, |
|
|
|
|
toolbarTimeout |
|
|
|
|
type: SET_TOOLBOX_TIMEOUT_MS, |
|
|
|
|
timeoutMS |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Shows/hides the toolbar. |
|
|
|
|
* Shows/hides the toolbox. |
|
|
|
|
* |
|
|
|
|
* @param {boolean} visible - True to show the toolbar or false to hide it. |
|
|
|
|
* @param {boolean} visible - True to show the toolbox or false to hide it. |
|
|
|
|
* @returns {{ |
|
|
|
|
* type: SET_TOOLBAR_VISIBLE, |
|
|
|
|
* type: SET_TOOLBOX_VISIBLE, |
|
|
|
|
* visible: boolean |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
export function setToolbarVisible(visible: boolean): Object { |
|
|
|
|
export function setToolboxVisible(visible: boolean): Object { |
|
|
|
|
return { |
|
|
|
|
type: SET_TOOLBAR_VISIBLE, |
|
|
|
|
type: SET_TOOLBOX_VISIBLE, |
|
|
|
|
visible |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Enables / disables audio toolbar button. |
|
|
|
|
* Enables/disables audio toolbar button. |
|
|
|
|
* |
|
|
|
|
* @param {boolean} enabled - Indicates if the button should be enabled |
|
|
|
|
* or disabled. |
|
|
|
|
* @param {boolean} enabled - True if the button should be enabled; otherwise, |
|
|
|
|
* false. |
|
|
|
|
* @returns {Function} |
|
|
|
|
*/ |
|
|
|
|
export function setVideoIconEnabled(enabled: boolean = false): Function { |
|
|
|
@ -243,7 +248,7 @@ export function showEtherpadButton(): Function { |
|
|
|
|
export function toggleFullScreen(isFullScreen: boolean): Function { |
|
|
|
|
return (dispatch: Dispatch<*>, getState: Function) => { |
|
|
|
|
const state = getState(); |
|
|
|
|
const { primaryToolbarButtons } = state['features/toolbar']; |
|
|
|
|
const { primaryToolbarButtons } = state['features/toolbox']; |
|
|
|
|
const buttonName = 'fullscreen'; |
|
|
|
|
const button = primaryToolbarButtons.get(buttonName); |
|
|
|
|
|
|
|
|
@ -265,7 +270,7 @@ export function toggleToolbarButton(buttonName: string): Function { |
|
|
|
|
const { |
|
|
|
|
primaryToolbarButtons, |
|
|
|
|
secondaryToolbarButtons |
|
|
|
|
} = state['features/toolbar']; |
|
|
|
|
} = state['features/toolbox']; |
|
|
|
|
const button |
|
|
|
|
= primaryToolbarButtons.get(buttonName) |
|
|
|
|
|| secondaryToolbarButtons.get(buttonName); |