changeset 1654:2a1f570ea6d4

cfg.url_prefix_local for stuff that needs to be loaded from same-site to work correctly (e.g. FCKeditor - ported from 1.5)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 31 Oct 2006 22:25:22 +0100
parents 5b15b6e010cf
children 6ea877b0bc6f
files MoinMoin/PageGraphicalEditor.py MoinMoin/config/multiconfig.py
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Tue Oct 31 22:11:29 2006 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Tue Oct 31 22:25:22 2006 +0100
@@ -292,9 +292,9 @@
         lang = self.language or self.request.cfg.language_default
         contentlangdirection = i18n.getDirection(lang) # 'ltr' or 'rtl'
         uilanguage = self.request.lang
-        url_prefix_static = self.request.cfg.url_prefix_static
+        url_prefix_local = self.request.cfg.url_prefix_local
         wikipage = wikiutil.quoteWikinameURL(self.page_name)
-        fckbasepath = url_prefix_static + '/applets/FCKeditor'
+        fckbasepath = url_prefix_local + '/applets/FCKeditor'
         wikiurl = request.getScriptname()
         if not wikiurl or wikiurl[-1] != '/':
             wikiurl += '/'
@@ -312,8 +312,8 @@
     oFCKeditor.BasePath= '%(fckbasepath)s/' ;
     oFCKeditor.Config['WikiBasePath'] = '%(wikiurl)s' ;
     oFCKeditor.Config['WikiPage'] = '%(wikipage)s' ;
-    oFCKeditor.Config['PluginsPath'] = '%(url_prefix_static)s/applets/moinFCKplugins/' ;
-    oFCKeditor.Config['CustomConfigurationsPath'] = '%(url_prefix_static)s/applets/moinfckconfig.js'  ;
+    oFCKeditor.Config['PluginsPath'] = '%(url_prefix_local)s/applets/moinFCKplugins/' ;
+    oFCKeditor.Config['CustomConfigurationsPath'] = '%(url_prefix_local)s/applets/moinfckconfig.js'  ;
     oFCKeditor.Config['WordRule'] = %(word_rule)s ;
     oFCKeditor.Config['SmileyPath'] = '%(smileypath)s/' ;
     oFCKeditor.Config['EditorAreaCSS'] = '%(themepath)s/css/common.css' ;
--- a/MoinMoin/config/multiconfig.py	Tue Oct 31 22:11:29 2006 +0100
+++ b/MoinMoin/config/multiconfig.py	Tue Oct 31 22:25:22 2006 +0100
@@ -429,6 +429,8 @@
     # for the static stuff. if stuff changes on version upgrade, url will change
     # immediately and we have no problem with stale caches.
     url_prefix_static = config.url_prefix_static
+    url_prefix_local = None # if None, use same value as url_prefix_static.
+                            # must be same site as wiki engine (for e.g. JS permissions)
 
     # we could prefix actions to be able to exclude them by robots.txt:
     #url_prefix_action = 'action' # no leading or trailing '/'
@@ -611,6 +613,10 @@
         if action_prefix is not None and action_prefix.endswith('/'): # make sure there is no trailing '/'
             self.url_prefix_action = action_prefix[:-1]
 
+        if self.url_prefix_local is None:
+            self.url_prefix_local = self.url_prefix_static
+
+
     def load_meta_dict(self):
         """ The meta_dict contains meta data about the wiki instance. """
         if getattr(self, "_meta_dict", None) is None: