From dc30486d8f5ab7258ce96b3080bb4fced2da6ddb Mon Sep 17 00:00:00 2001 From: Zuzanna Ludzik Date: Mon, 3 Aug 2026 12:55:17 +0200 Subject: [PATCH 1/5] wip --- www/form/inner.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/www/form/inner.js b/www/form/inner.js index 759f3f10b..a99b2d194 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -127,6 +127,46 @@ define([ return cancelBlock; }; + + var nativePrint = window.print.bind(window); + + var printFullContent = function () { + var target = document.querySelector('.cp-form-creator-container'); + if (!target) { nativePrint(); return; } + + var prevHeight = target.style.height; + var prevOverflow = target.style.overflow; + var prevOverflowY = target.style.overflowY; + var prevMaxHeight = target.style.maxHeight; + + target.style.setProperty('height', 'auto', 'important'); + target.style.setProperty('max-height', 'none', 'important'); + target.style.setProperty('overflow', 'visible', 'important'); + target.style.setProperty('overflow-y', 'visible', 'important'); + + var restore = function () { + target.style.height = prevHeight; + target.style.overflow = prevOverflow; + target.style.overflowY = prevOverflowY; + target.style.maxHeight = prevMaxHeight; + window.onafterprint = null; + }; + + window.onafterprint = restore; + setTimeout(restore, 60000); + + setTimeout(function () { nativePrint(); }, 50); + }; + + window.print = printFullContent; + + window.addEventListener('keydown', function (e) { + if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'p') { + e.preventDefault(); + printFullContent(); + } + }); + var editTextOptions = function (opts, setCursorGetter, cb) { var evOnSave = Util.mkEvent(); From bb94d87ec47ee23365eee56adfc829cde0792887 Mon Sep 17 00:00:00 2001 From: Zuzanna Ludzik Date: Mon, 3 Aug 2026 13:14:44 +0200 Subject: [PATCH 2/5] #2024 can print whole form as participant --- www/form/app-form.less | 12 ++++++++++++ www/form/inner.js | 16 ---------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/www/form/app-form.less b/www/form/app-form.less index 37cd22686..b7bc93cb5 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -1553,3 +1553,15 @@ .charts_main(); } +@media print { + html, + body { + height: auto !important; + overflow: visible !important; + } + + .cp-form-creator-container { + max-height: none !important; + overflow-y: visible !important + } +} \ No newline at end of file diff --git a/www/form/inner.js b/www/form/inner.js index a99b2d194..22980e887 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -131,24 +131,8 @@ define([ var nativePrint = window.print.bind(window); var printFullContent = function () { - var target = document.querySelector('.cp-form-creator-container'); - if (!target) { nativePrint(); return; } - - var prevHeight = target.style.height; - var prevOverflow = target.style.overflow; - var prevOverflowY = target.style.overflowY; - var prevMaxHeight = target.style.maxHeight; - - target.style.setProperty('height', 'auto', 'important'); - target.style.setProperty('max-height', 'none', 'important'); - target.style.setProperty('overflow', 'visible', 'important'); - target.style.setProperty('overflow-y', 'visible', 'important'); var restore = function () { - target.style.height = prevHeight; - target.style.overflow = prevOverflow; - target.style.overflowY = prevOverflowY; - target.style.maxHeight = prevMaxHeight; window.onafterprint = null; }; From f7cdf0ec2fe1a2c0b8444d4ecdba1703d24cac87 Mon Sep 17 00:00:00 2001 From: Zuzanna Ludzik Date: Tue, 11 Aug 2026 17:19:15 +0200 Subject: [PATCH 3/5] wip --- www/form/app-form.less | 2 +- www/form/inner.js | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/www/form/app-form.less b/www/form/app-form.less index b7bc93cb5..910b16fd9 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -1564,4 +1564,4 @@ max-height: none !important; overflow-y: visible !important } -} \ No newline at end of file +} diff --git a/www/form/inner.js b/www/form/inner.js index 22980e887..e8770df62 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -128,23 +128,16 @@ define([ return cancelBlock; }; - var nativePrint = window.print.bind(window); + var nativePrint = window.print; var printFullContent = function () { - - var restore = function () { - window.onafterprint = null; - }; - - window.onafterprint = restore; - setTimeout(restore, 60000); - setTimeout(function () { nativePrint(); }, 50); }; window.print = printFullContent; window.addEventListener('keydown', function (e) { + console.log("app", APP) if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'p') { e.preventDefault(); printFullContent(); From d653b9fd594e573dddec33ef027eaa4da71c905f Mon Sep 17 00:00:00 2001 From: Zuzanna Ludzik Date: Tue, 11 Aug 2026 17:21:57 +0200 Subject: [PATCH 4/5] cleaning --- www/form/inner.js | 1 - 1 file changed, 1 deletion(-) diff --git a/www/form/inner.js b/www/form/inner.js index e8770df62..e9396671a 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -137,7 +137,6 @@ define([ window.print = printFullContent; window.addEventListener('keydown', function (e) { - console.log("app", APP) if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'p') { e.preventDefault(); printFullContent(); From 8e2ae8db3dbb1b52214be365933db3358d536952 Mon Sep 17 00:00:00 2001 From: Zuzanna Ludzik Date: Fri, 14 Aug 2026 15:54:15 +0200 Subject: [PATCH 5/5] remove redundant code --- www/form/inner.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/www/form/inner.js b/www/form/inner.js index e9396671a..f0ffd46ee 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -128,18 +128,10 @@ define([ return cancelBlock; }; - var nativePrint = window.print; - - var printFullContent = function () { - setTimeout(function () { nativePrint(); }, 50); - }; - - window.print = printFullContent; - window.addEventListener('keydown', function (e) { if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'p') { e.preventDefault(); - printFullContent(); + window.print(); } });