mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-12-11 12:53:15 +00:00
Compare commits
4 Commits
v4.10.0
...
483-fix-ct
| Author | SHA1 | Date | |
|---|---|---|---|
|
525d09dc4f
|
|||
|
3bd101c1eb
|
|||
|
f60ef696de
|
|||
|
6e1c9b6f29
|
6
.changes/unreleased/Fixed-20251211-135111.yaml
Normal file
6
.changes/unreleased/Fixed-20251211-135111.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
kind: Fixed
|
||||
body: Tentatively fix usage of CTRL+C in collabora editor with chrome / edge browser
|
||||
time: 2025-12-11T13:51:11.425545012+01:00
|
||||
custom:
|
||||
Issue: "483"
|
||||
SchemaChange: No schema change
|
||||
@@ -21,7 +21,6 @@
|
||||
"ext-openssl": "*",
|
||||
"ext-redis": "*",
|
||||
"ext-zlib": "*",
|
||||
"chill-project/chill-zimbra-bundle": "@dev",
|
||||
"champs-libres/wopi-bundle": "dev-symfony-v5@dev",
|
||||
"champs-libres/wopi-lib": "dev-master@dev",
|
||||
"doctrine/data-fixtures": "^1.8",
|
||||
|
||||
@@ -11,3 +11,6 @@ services:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
|
||||
when@dev:
|
||||
services:
|
||||
ChampsLibres\WopiLib\Contract\Service\ProofValidatorInterface: '@Chill\WopiBundle\Service\Wopi\NullProofValidator'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
module.exports = function (encore, entries) {
|
||||
encore.addEntry(
|
||||
"page_wopi_editor",
|
||||
__dirname + "/src/Resources/public/page/editor/index.js",
|
||||
__dirname + "/src/Resources/public/page/editor/index.ts",
|
||||
);
|
||||
encore.addEntry(
|
||||
"mod_reload_page",
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
require("./index.scss");
|
||||
import "./index.scss";
|
||||
|
||||
// Provided by the server-side template
|
||||
declare const editor_url: string;
|
||||
|
||||
window.addEventListener("DOMContentLoaded", function () {
|
||||
let frameholder = document.getElementById("frameholder");
|
||||
let office_frame = document.createElement("iframe");
|
||||
const frameholder = document.getElementById("frameholder");
|
||||
const office_frame = document.createElement("iframe");
|
||||
office_frame.name = "office_frame";
|
||||
office_frame.id = "office_frame";
|
||||
|
||||
@@ -18,19 +21,32 @@ window.addEventListener("DOMContentLoaded", function () {
|
||||
"sandbox",
|
||||
"allow-downloads allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-top-navigation allow-popups-to-escape-sandbox",
|
||||
);
|
||||
frameholder.appendChild(office_frame);
|
||||
|
||||
document.getElementById("office_form").submit();
|
||||
office_frame.setAttribute(
|
||||
"allow",
|
||||
"clipboard-read *; clipboard-write *; fullscreen *"
|
||||
);
|
||||
if (frameholder) {
|
||||
frameholder.appendChild(office_frame);
|
||||
}
|
||||
|
||||
const officeForm = document.getElementById("office_form") as HTMLFormElement | null;
|
||||
officeForm?.submit();
|
||||
|
||||
const url = new URL(editor_url);
|
||||
const editor_domain = url.origin;
|
||||
|
||||
window.addEventListener("message", function (message) {
|
||||
window.addEventListener("message", function (message: MessageEvent) {
|
||||
if (message.origin !== editor_domain) {
|
||||
return;
|
||||
}
|
||||
|
||||
let data = JSON.parse(message.data);
|
||||
let data: any;
|
||||
try {
|
||||
data = typeof message.data === "string" ? JSON.parse(message.data) : message.data;
|
||||
} catch (_e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ("UI_Close" === data.MessageId) {
|
||||
closeEditor();
|
||||
@@ -38,9 +54,9 @@ window.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
});
|
||||
|
||||
function closeEditor() {
|
||||
let params = new URLSearchParams(window.location.search),
|
||||
returnPath = params.get("returnPath");
|
||||
function closeEditor(): void {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const returnPath = params.get("returnPath") ?? "/";
|
||||
|
||||
window.location.assign(returnPath);
|
||||
}
|
||||
Reference in New Issue
Block a user