mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-14 22:31:30 +03:00
Add copyright headers
This commit is contained in:
parent
9cbdc4a613
commit
dda24da204
4 changed files with 47 additions and 14 deletions
|
@ -54,7 +54,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||||
const [displayCancel, setCancelWarning] = useState(false);
|
const [displayCancel, setCancelWarning] = useState(false);
|
||||||
const [exportCancelled, setExportCancelled] = useState(false);
|
const [exportCancelled, setExportCancelled] = useState(false);
|
||||||
const [exportSuccessful, setExportSuccessful] = useState(false);
|
const [exportSuccessful, setExportSuccessful] = useState(false);
|
||||||
const [Exporter, setExporter] = useStateCallback<Exporter>(
|
const [exporter, setExporter] = useStateCallback<Exporter>(
|
||||||
null,
|
null,
|
||||||
async (exporter: Exporter) => {
|
async (exporter: Exporter) => {
|
||||||
await exporter?.export().then(() => {
|
await exporter?.export().then(() => {
|
||||||
|
@ -195,7 +195,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const confirmCanel = async () => {
|
const confirmCanel = async () => {
|
||||||
await Exporter?.cancelExport().then(() => {
|
await exporter?.cancelExport().then(() => {
|
||||||
setExportCancelled(true);
|
setExportCancelled(true);
|
||||||
setExporting(false);
|
setExporting(false);
|
||||||
setExporter(null);
|
setExporter(null);
|
||||||
|
@ -203,14 +203,14 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const exportFormatOptions = Object.keys(ExportFormat).map((format) => ({
|
const exportFormatOptions = Object.keys(ExportFormat).map((format) => ({
|
||||||
value: format,
|
value: ExportFormat[format],
|
||||||
label: textForFormat(format),
|
label: textForFormat(ExportFormat[format]),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const exportTypeOptions = Object.keys(ExportType).map((type) => {
|
const exportTypeOptions = Object.keys(ExportType).map((type) => {
|
||||||
return (
|
return (
|
||||||
<option key={type} value={type}>
|
<option key={type} value={ExportType[type]}>
|
||||||
{ textForType(type) }
|
{ textForType(ExportType[type]) }
|
||||||
</option>
|
</option>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
import trashSVG from "!!raw-loader!../../../res/img/element-icons/trashcan.svg";
|
import trashSVG from "!!raw-loader!../../../res/img/element-icons/trashcan.svg";
|
||||||
import attachSVG from "!!raw-loader!../../../res/img/element-icons/room/composer/attach.svg";
|
import attachSVG from "!!raw-loader!../../../res/img/element-icons/room/composer/attach.svg";
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*
|
||||||
|
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// This file is raw-imported (imported as plain text) for the export bundle, which is why this is in JS
|
||||||
function showToastIfNeeded(replyId) {
|
function showToastIfNeeded(replyId) {
|
||||||
const el = document.getElementById(replyId);
|
const el = document.getElementById(replyId);
|
||||||
if (!el) {
|
if (!el) {
|
||||||
|
|
|
@ -17,19 +17,19 @@ limitations under the License.
|
||||||
import { _t } from "../../languageHandler";
|
import { _t } from "../../languageHandler";
|
||||||
|
|
||||||
export enum ExportFormat {
|
export enum ExportFormat {
|
||||||
Html = "HTML",
|
Html = "Html",
|
||||||
PlainText = "PLAIN_TEXT",
|
PlainText = "PlainText",
|
||||||
Json = "JSON",
|
Json = "Json",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ExportType {
|
export enum ExportType {
|
||||||
Timeline = "TIMELINE",
|
Timeline = "Timeline",
|
||||||
Beginning = "BEGINNING",
|
Beginning = "Beginning",
|
||||||
LastNMessages = "LAST_N_MESSAGES",
|
LastNMessages = "LastNMessages",
|
||||||
// START_DATE = "START_DATE",
|
// START_DATE = "START_DATE",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const textForFormat = (format: string): string => {
|
export const textForFormat = (format: ExportFormat): string => {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case ExportFormat.Html:
|
case ExportFormat.Html:
|
||||||
return _t("HTML");
|
return _t("HTML");
|
||||||
|
@ -42,7 +42,7 @@ export const textForFormat = (format: string): string => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const textForType = (type: string): string => {
|
export const textForType = (type: ExportType): string => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ExportType.Beginning:
|
case ExportType.Beginning:
|
||||||
return _t("From the beginning");
|
return _t("From the beginning");
|
||||||
|
|
Loading…
Reference in a new issue