feat: hide ONLYOFFICE logo via direct CSS patch + iframe injection + init script for persistence

This commit is contained in:
root
2026-07-16 19:03:36 +00:00
parent fce938b0c2
commit f6c0bb0c5f
6 changed files with 39 additions and 3 deletions

View File

@@ -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');