From: Benoît Pin <pin@cri.ensmp.fr> Date: Thu, 28 Nov 2013 12:52:32 +0000 (+0100) Subject: Bugfix : configuration du baseHref pour que les images s’affichent correctement même... X-Git-Url: https://scm.cri.minesparis.psl.eu/git/Plinn.git/commitdiff_plain/b444351ce88e68084d8355f439a97cbf41937a8c?ds=sidebyside Bugfix : configuration du baseHref pour que les images s’affichent correctement même lors de la création du document (quand l’url du navigateur pointe vers le dossier contenant et non vers le nouveau contenu). --- diff --git a/skins/generic/wysiwyg_support.pt b/skins/generic/wysiwyg_support.pt index ef29cc7..2e9528c 100644 --- a/skins/generic/wysiwyg_support.pt +++ b/skins/generic/wysiwyg_support.pt @@ -16,9 +16,11 @@ <div> <script type="text/javascript" tal:attributes="src string:$portal_url/ckeditor/ckeditor.js"></script> <script type="text/javascript" tal:content="structure python:''' - CKEDITOR.replace('%(inputname)s'); - CKEDITOR.instances['%(inputname)s'].contentPath = '%(contentPath)s'; (function(){ + CKEDITOR.replace('%(inputname)s'); + var ck = CKEDITOR.instances['%(inputname)s']; + ck.contentPath = '%(contentPath)s'; + ck.config.baseHref = '%(baseHref)s'; var ckForm = document.getElementById('%(inputname)s').form; if ((AJAX_CONFIG & 2) == 2) { var formManager = new FormManager(ckForm, document.getElementById('mainCell')); @@ -28,7 +30,9 @@ }; } })(); - ''' % {'inputname' : inputname, 'contentPath' : here.absolute_url(relative=1)}"> + ''' % {'inputname' : inputname, + 'contentPath' : here.absolute_url(relative=1), + 'baseHref' : here.absolute_url()+'/'}"> </script> </div> </div>