From b240bdb1450e21dd4f1fb3d409c24f2b4beccd51 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Fri, 22 Sep 2023 18:18:09 +0200 Subject: [PATCH 1/4] PDF works in rtl --- app.php | 2 +- templates/metadata.html.php | 2 +- templates/organization.html.php | 2 +- templates/signature.html.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.php b/app.php index 9415244..a61a8c3 100644 --- a/app.php +++ b/app.php @@ -56,7 +56,7 @@ function changeLanguage($lang, $f3) { $f3->set('LANGUAGE', $lang); } -$f3->set('TRANSLATION_LANGUAGE', _("en")); +$f3->set('TRANSLATION_LANGUAGE', _("en")); $f3->route('GET /', function($f3) { diff --git a/templates/metadata.html.php b/templates/metadata.html.php index cfc1383..d0a41f6 100644 --- a/templates/metadata.html.php +++ b/templates/metadata.html.php @@ -68,7 +68,7 @@

-
+
diff --git a/templates/organization.html.php b/templates/organization.html.php index d46f044..ebfc46c 100644 --- a/templates/organization.html.php +++ b/templates/organization.html.php @@ -42,7 +42,7 @@
-
+
diff --git a/templates/signature.html.php b/templates/signature.html.php index 46d2e6f..e1ad9ac 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -48,7 +48,7 @@
-
+
From f6b791bb9b6629c5353b443fe0c69c43384ae09e Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Fri, 22 Sep 2023 18:40:18 +0200 Subject: [PATCH 2/4] pdf bloc with padding compatible rtl --- public/css/app.css | 8 ++++++++ public/js/organization.js | 4 ++-- public/js/signature.js | 4 ++-- templates/organization.html.php | 2 +- templates/signature.html.php | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index cdfe178..b547e51 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -82,3 +82,11 @@ font-size: .875em } } + +.decalage-pdf-div:dir(ltr) { + padding-right: 350px; +} + +.decalage-pdf-div:dir(rtl) { + padding-left: 350px; +} diff --git a/public/js/organization.js b/public/js/organization.js index 5f9ca32..87d3e21 100644 --- a/public/js/organization.js +++ b/public/js/organization.js @@ -27,7 +27,7 @@ var disabledHoverStyle = function() { } var responsiveDisplay = function() { if(is_mobile()) { - document.getElementById('page-organization').style.paddingRight = "inherit"; + document.getElementById('page-organization').classList.remove('decalage-pdf-div'); menu.classList.remove('show'); menuOffcanvas.hide(); document.getElementById('container-pages').classList.remove('vh-100'); @@ -36,7 +36,7 @@ var responsiveDisplay = function() { document.getElementById('container-btn-zoom').classList.add('d-none'); } else { menuOffcanvas.show(); - document.getElementById('page-organization').style.paddingRight = "350px"; + document.getElementById('page-organization').classList.add('decalage-pdf-div'); document.getElementById('container-pages').classList.add('vh-100'); document.getElementById('container-btn-zoom').style.top = '6px'; document.getElementById('container-btn-zoom').style.right = '368px'; diff --git a/public/js/signature.js b/public/js/signature.js index c2165ab..2a3e092 100644 --- a/public/js/signature.js +++ b/public/js/signature.js @@ -186,13 +186,13 @@ var is_mobile = function() { var responsiveDisplay = function() { if(is_mobile()) { - document.getElementById('page-signature').style.paddingRight = "inherit"; + document.getElementById('page-signature').classList.remove('decalage-pdf-div'); menu.classList.remove('show'); menuOffcanvas.hide(); document.getElementById('container-pages').classList.remove('vh-100'); } else { menuOffcanvas.show(); - document.getElementById('page-signature').style.paddingRight = "350px"; + document.getElementById('page-signature').classList.add('decalage-pdf-div'); document.getElementById('container-pages').classList.add('vh-100'); } menu.classList.remove('d-md-block'); diff --git a/templates/organization.html.php b/templates/organization.html.php index da7015f..4ccfc2d 100644 --- a/templates/organization.html.php +++ b/templates/organization.html.php @@ -42,7 +42,7 @@ : []
-
+
diff --git a/templates/signature.html.php b/templates/signature.html.php index 5ea5f7a..688441f 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -40,7 +40,7 @@ : []
-
+