diff --git a/docker-compose.yml b/docker-compose.yml index d4e8119..1bd8751 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,6 +50,7 @@ services: - onlyoffice_data:/var/www/onlyoffice/Data - onlyoffice_logs:/var/log/onlyoffice - onlyoffice_cache:/var/lib/onlyoffice + - ./onlyoffice-init.sh:/app/ds/run-document-server-before.sh:ro networks: - cvnet ports: diff --git a/onlyoffice-init.sh b/onlyoffice-init.sh new file mode 100644 index 0000000..7691c04 --- /dev/null +++ b/onlyoffice-init.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# ONLYOFFICE init script - runs before the document server starts +# Hides the ONLYOFFICE logo from the editor header + +CSS_FILE=/var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/main/resources/css/app.css +if [ -f "$CSS_FILE" ]; then + # Check if already patched + if ! grep -q 'display:none!important' <<< "$(grep '#header-logo{' "$CSS_FILE" | head -1)"; then + sed -i 's/#header-logo{/#header-logo{display:none!important;/g' "$CSS_FILE" + echo "[onlyoffice-init] Patched app.css to hide logo" + fi +fi + +# Also patch the spreadsheet and presentation editors if they exist +for CSS in \ + /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/main/resources/css/app.css \ + /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/main/resources/css/app.css; do + if [ -f "$CSS" ]; then + if ! grep -q 'display:none!important' <<< "$(grep '#header-logo{' "$CSS" | head -1)"; then + sed -i 's/#header-logo{/#header-logo{display:none!important;/g' "$CSS" + echo "[onlyoffice-init] Patched $(basename $(dirname $(dirname $(dirname $(dirname $CSS))))) to hide logo" + fi + fi +done \ No newline at end of file diff --git a/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx b/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx index 234f070..4f1f73a 100644 Binary files a/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx and b/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx differ diff --git a/renderer/carbone-templates/registry.json b/renderer/carbone-templates/registry.json index 39a6d72..acfa156 100644 --- a/renderer/carbone-templates/registry.json +++ b/renderer/carbone-templates/registry.json @@ -6,6 +6,6 @@ "originalName": "master_cv_template.docx", "path": "/root/workspace/cv-app/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx", "uploadedAt": "2026-07-16T09:03:29.601Z", - "updatedAt": "2026-07-16T12:09:36.709Z" + "updatedAt": "2026-07-16T18:59:36.503Z" } ] \ No newline at end of file diff --git a/static/carbone.js b/static/carbone.js index 18b33a4..63f2fc1 100644 --- a/static/carbone.js +++ b/static/carbone.js @@ -359,6 +359,17 @@ async function openOnlyofficeEditor(templateId, templateName) { }, onDocumentReady: function() { console.log('Document loaded in editor'); + // Inject CSS into ONLYOFFICE iframe to hide the logo + try { + var iframe = document.getElementById(containerId).querySelector('iframe'); + if (iframe && iframe.contentDocument) { + var style = iframe.contentDocument.createElement('style'); + style.textContent = '#header-logo { display: none !important; }'; + iframe.contentDocument.head.appendChild(style); + } + } catch(e) { + console.log('Could not inject CSS into iframe:', e); + } }, onSave: function(event) { toast('Document saved successfully'); diff --git a/static/index.html b/static/index.html index 23968c1..7abe3f6 100644 --- a/static/index.html +++ b/static/index.html @@ -139,7 +139,7 @@ - - + + \ No newline at end of file