From 49b0b9ade6c73bf9091cfcc8085abea402cd2fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 7 Nov 2022 18:11:34 +0100 Subject: [PATCH] TinyMCE language PB es --- core/core.php | 2 +- core/vendor/tinymce/init.js | 102 ++---------------------------------- 2 files changed, 5 insertions(+), 99 deletions(-) diff --git a/core/core.php b/core/core.php index eceaccf0..52e2c23a 100644 --- a/core/core.php +++ b/core/core.php @@ -355,7 +355,7 @@ class common \setlocale(LC_TIME, self::$i18nUI . '.UTF-8'); // Stocker le cookie de langue pour l'éditeur de texte - setcookie('ZWII_UI', self::$i18nUI, time() + 3600, helper::baseUrl(false, false), '', helper::isHttps(), true); + setcookie('ZWII_UI', self::$i18nUI, time() + 3600, '/', '', false, false); // Utilisateur connecté if ($this->user === []) { diff --git a/core/vendor/tinymce/init.js b/core/vendor/tinymce/init.js index cbd57a45..f414ab6c 100755 --- a/core/vendor/tinymce/init.js +++ b/core/vendor/tinymce/init.js @@ -4,6 +4,8 @@ */ +console.log(getCookie("ZWII_UI")); + /** * Quand tinyMCE est invoqué hors connexion, initialiser privateKey */ @@ -27,8 +29,7 @@ tinymce.init({ }); }, // Langue - language: getCookie('ZWII_UI') === null ? "fr_FR": getCookie('ZWII_UI'), - language: 'es', + language: getCookie('ZWII_UI') === null ? "fr_FR" : getCookie('ZWII_UI'), // Plugins plugins: "advlist anchor autolink autoresize autosave codemirror colorpicker fullscreen hr image imagetools link lists media paste searchreplace tabfocus table template textcolor visualblocks nonbreaking emoticons charmap", // Contenu de la barre d'outils @@ -288,7 +289,7 @@ tinymce.init({ }); }, // Langue - language: getCookie('ZWII_UI') === null ? "fr_FR": getCookie('ZWII_UI'), + language: getCookie('ZWII_UI') === null ? "fr_FR" : getCookie('ZWII_UI'), // Plugins plugins: "advlist anchor autolink autoresize autosave colorpicker contextmenu fullscreen hr lists paste searchreplace stickytoolbar tabfocus template textcolor visualblocks", // Contenu de la barre d'outils @@ -366,101 +367,6 @@ tinymce.init({ ] }); -/** -tinymce.PluginManager.add('stickytoolbar', function (editor, url) { - editor.on('init', function () { - setSticky(); - }); - - $(window).on('scroll', function () { - setSticky(); - }); - - function setSticky() { - var container = editor.editorContainer; - var toolbars = $(container).find('.mce-toolbar-grp'); - var statusbar = $(container).find('.mce-statusbar'); - var menubar = $(container).find('.mce-menubar'); - - if (isSticky()) { - $(container).css({ - paddingTop: menubar.outerHeight() - }); - - if (isAtBottom()) { - toolbars.css({ - top: 'auto', - bottom: statusbar.outerHeight(), - position: 'absolute', - width: '100%', - borderBottom: 'none' - }); - } else { - menubar.css({ - top: 45, - bottom: 'auto', - position: 'fixed', - width: $(container).width(), - borderBottom: '1px solid rgba(0,0,0,0.2)', - background: '#fff' - }); - toolbars.css({ - top: 78, - bottom: 'auto', - position: 'fixed', - width: $(container).width(), - borderBottom: '1px solid rgba(0,0,0,0.2)' - }); - } - } else { - $(container).css({ - paddingTop: 0 - }); - - toolbars.css({ - top: 0, - position: 'relative', - width: 'auto', - borderBottom: 'none' - }); - menubar.css({ - top: 0, - position: 'relative', - width: 'auto', - borderBottom: 'none' - }); - } - } - - function isSticky() { - var container = editor.editorContainer, - editorTop = container.getBoundingClientRect().top; - - if (editorTop < 0) { - return true; - } - - return false; - } - - function isAtBottom() { - var container = editor.editorContainer, - editorTop = container.getBoundingClientRect().top; - - var toolbarHeight = $(container).find('.mce-toolbar-grp').outerHeight(); - var footerHeight = $(container).find('.mce-statusbar').outerHeight(); - - var hiddenHeight = -($(container).outerHeight() - toolbarHeight - footerHeight); - - if (editorTop < hiddenHeight) { - return true; - } - - return false; - } -}); - -*/ function getCookie(name) { var nameEQ = name + "=";