2018-03-07 00:28:19 +00:00
|
|
|
import {
|
|
|
|
SET_DOCUMENT_EDITING_STATUS,
|
2019-10-04 15:10:19 +00:00
|
|
|
SET_DOCUMENT_URL,
|
2018-03-07 00:28:19 +00:00
|
|
|
TOGGLE_DOCUMENT_EDITING
|
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches an action to set whether document editing has started or stopped.
|
|
|
|
*
|
|
|
|
* @param {boolean} editing - Whether or not a document is currently being
|
|
|
|
* edited.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_DOCUMENT_EDITING_STATUS,
|
|
|
|
* editing: boolean
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function setDocumentEditingState(editing: boolean) {
|
|
|
|
return {
|
|
|
|
type: SET_DOCUMENT_EDITING_STATUS,
|
|
|
|
editing
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-10-04 15:10:19 +00:00
|
|
|
/**
|
|
|
|
* Dispatches an action to set the shared document URL.
|
|
|
|
*
|
|
|
|
* @param {string} documentUrl - The shared document URL.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_DOCUMENT_URL,
|
|
|
|
* documentUrl: string
|
|
|
|
* }}
|
|
|
|
*/
|
2022-10-13 08:26:28 +00:00
|
|
|
export function setDocumentUrl(documentUrl?: string) {
|
2019-10-04 15:10:19 +00:00
|
|
|
return {
|
|
|
|
type: SET_DOCUMENT_URL,
|
|
|
|
documentUrl
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-03-07 00:28:19 +00:00
|
|
|
/**
|
|
|
|
* Dispatches an action to show or hide Etherpad.
|
|
|
|
*
|
|
|
|
* @returns {{
|
|
|
|
* type: TOGGLE_DOCUMENT_EDITING
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function toggleDocument() {
|
|
|
|
return {
|
|
|
|
type: TOGGLE_DOCUMENT_EDITING
|
|
|
|
};
|
|
|
|
}
|