Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flottform/forms/src/default-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const createDefaultFlottformComponent = ({
const flottformBaseInputHost = new FlottformFileInputHost({
flottformApi,
createClientUrl,
inputField
incomingInputField: inputField
});

const {
Expand Down Expand Up @@ -260,7 +260,7 @@ const handleFileInputStates = ({
}

flottformFileInputHost.on(
'progress',
'file-receiving-progress',
({ currentFileProgress, overallProgress, fileIndex, totalFileCount, fileName }) => {
removeConnectionStatusInformation(flottformStateItemsContainer);
updateOverallFilesStatusBar(
Expand All @@ -279,7 +279,7 @@ const handleFileInputStates = ({
);
}
);
flottformFileInputHost.on('done', () => {
flottformFileInputHost.on('single-file-received', () => {
statusInformation.innerHTML =
onSuccessText ?? `✨ You have succesfully downloaded all your files.`;
statusInformation.appendChild(refreshChannelButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
onMount(async () => {
const flottformFileInputClient = new FlottformFileInputClient({
endpointId: $page.params.endpointId,
fileInput,
outgoingInputField: fileInput,
flottformApi: sdpExchangeServerBase
});

Expand All @@ -34,13 +34,11 @@
flottformFileInputClient.on('connected', () => {
currentState = 'connected';
});
flottformFileInputClient.on('sending', () => {
currentState = 'sending';
});
flottformFileInputClient.on('progress', (p) => {
flottformFileInputClient.on('file-sending-progress', (p) => {
console.log('progress= ', p);
currentState = 'sending';
});
flottformFileInputClient.on('done', () => {
flottformFileInputClient.on('single-file-transfered', () => {
currentState = 'done';
});
flottformFileInputClient.on('disconnected', () => {
Expand Down
6 changes: 3 additions & 3 deletions servers/demo/src/routes/belegeinreichung/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
const flottformFileInputHost = new FlottformFileInputHost({
flottformApi: sdpExchangeServerBase,
createClientUrl: createDeExpenseReportClientUrl,
inputField: fileInput
incomingInputField: fileInput
});

flottformFileInputHost.on('new', () => {
Expand Down Expand Up @@ -145,14 +145,14 @@
flottformDialogDescription = 'Warte auf eine Verbindung...';
});

flottformFileInputHost.on('receive', () => {
flottformFileInputHost.on('file-receiving-progress', () => {
flottformState = 'receive';
flottformStatusWrapper = 'Empfange Daten';
flottformDialogDescription =
'Ein anderes Gerät sendet gerade Daten. Warte auf den Abschluss der Übertragung...';
});

flottformFileInputHost.on('done', () => {
flottformFileInputHost.on('single-file-received', () => {
flottformState = 'done';
hasFile = true;
flottformStatusSvg = done;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
onMount(async () => {
const flottformFileInputClient = new FlottformFileInputClient({
endpointId: $page.params.endpointId,
fileInput,
outgoingInputField: fileInput,
flottformApi: sdpExchangeServerBase
});

Expand All @@ -34,13 +34,11 @@
flottformFileInputClient.on('connected', () => {
currentState = 'connected';
});
flottformFileInputClient.on('sending', () => {
flottformFileInputClient.on('file-sending-progress', (p) => {
currentState = 'sending';
});
flottformFileInputClient.on('progress', (p) => {
console.log('progress= ', p);
});
flottformFileInputClient.on('done', () => {
flottformFileInputClient.on('single-file-transfered', () => {
currentState = 'done';
});
flottformFileInputClient.on('disconnected', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
onMount(async () => {
const flottformFileInputClient = new FlottformFileInputClient({
endpointId: $page.params.endpointId,
fileInput,
outgoingInputField: fileInput,
flottformApi: sdpExchangeServerBase
});

Expand All @@ -34,13 +34,11 @@
flottformFileInputClient.on('connected', () => {
currentState = 'connected';
});
flottformFileInputClient.on('sending', () => {
flottformFileInputClient.on('file-sending-progress', (p) => {
currentState = 'sending';
});
flottformFileInputClient.on('progress', (p) => {
console.log('progress= ', p);
});
flottformFileInputClient.on('done', () => {
flottformFileInputClient.on('single-file-transfered', () => {
currentState = 'done';
});
flottformFileInputClient.on('disconnected', () => {
Expand Down
6 changes: 3 additions & 3 deletions servers/demo/src/routes/expense-report/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
const flottformFileInputHost = new FlottformFileInputHost({
flottformApi: sdpExchangeServerBase,
createClientUrl: createExpenseReportClientUrl,
inputField: fileInput
incomingInputField: fileInput
});

flottformFileInputHost.on('new', () => {
Expand Down Expand Up @@ -189,14 +189,14 @@
flottformDialogDescription = 'Waiting for data channel connection';
});

flottformFileInputHost.on('receive', () => {
flottformFileInputHost.on('file-receiving-progress', () => {
flottformState = 'receive';
flottformStatusWrapper = 'Receiving data';
flottformDialogDescription =
'Another device is sending data. Waiting for incoming data transfer to complete';
});

flottformFileInputHost.on('done', () => {
flottformFileInputHost.on('single-file-received', () => {
flottformState = 'done';
flottformStatusSvg = done;
flottformStatusWrapper = 'Done!';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
onMount(async () => {
const flottformFileInputClient = new FlottformFileInputClient({
endpointId: $page.params.endpointId,
fileInput,
outgoingInputField: fileInput,
flottformApi: sdpExchangeServerBase
});

Expand All @@ -35,13 +35,11 @@
flottformFileInputClient.on('connected', () => {
currentState = 'connected';
});
flottformFileInputClient.on('sending', () => {
flottformFileInputClient.on('file-sending-progress', (p) => {
currentState = 'sending';
});
flottformFileInputClient.on('progress', (p) => {
console.log('progress= ', p);
});
flottformFileInputClient.on('done', () => {
flottformFileInputClient.on('single-file-transfered', () => {
currentState = 'done';
});
flottformFileInputClient.on('disconnected', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
onMount(async () => {
const flottformFileInputClient = new FlottformFileInputClient({
endpointId: $page.params.endpointId,
fileInput,
outgoingInputField: fileInput,
flottformApi: sdpExchangeServerBase
});

Expand All @@ -35,10 +35,9 @@
flottformFileInputClient.on('connected', () => {
currentState = 'connected';
});
flottformFileInputClient.on('sending', () => {

flottformFileInputClient.on('file-sending-progress', (p) => {
currentState = 'sending';
});
flottformFileInputClient.on('progress', (p) => {
console.log('progress= ', p);
});
flottformFileInputClient.on('done', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
onMount(async () => {
const flottformFileInputClient = new FlottformFileInputClient({
endpointId: $page.params.endpointId,
fileInput,
outgoingInputField: fileInput,
flottformApi: sdpExchangeServerBase
});

Expand All @@ -35,13 +35,11 @@
flottformFileInputClient.on('connected', () => {
currentState = 'connected';
});
flottformFileInputClient.on('sending', () => {
flottformFileInputClient.on('file-sending-progress', (p) => {
currentState = 'sending';
});
flottformFileInputClient.on('progress', (p) => {
console.log('progress= ', p);
});
flottformFileInputClient.on('done', () => {
flottformFileInputClient.on('single-file-transfered', () => {
currentState = 'done';
});
flottformFileInputClient.on('disconnected', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,18 @@
flottformDialogDescription = 'Waiting for data channel connection';
});

flottformFileInputHost.on('receive', () => {
flottformFileInputHost.on('file-receiving-progress', () => {
flottformStatusWrapper = 'Receiving data';
flottformDialogDescription =
'Another device is sending data. Waiting for incoming data transfer to complete';
flottformButtonBackgroundColor = 'bg-[#7EA4FF]';
});

flottformFileInputHost.on('single-file-transferred', (receivedFile) => {
flottformFileInputHost.on('single-file-received', (receivedFile) => {
const dt = new DataTransfer();
dt.items.add(receivedFile);
fileInput.files = dt.files;
console.log(`Received file: ${receivedFile.name} (${receivedFile.size} bytes)`);
});

flottformFileInputHost.on('done', () => {
flottformStatusWrapper = 'Done!';
flottformDialogDescription =
'You have received a file from another device. Please close this dialog to finish your form.';
Expand Down