changeset 552:7d46743be355

fixed subpage links in gui editor, call fckdialog action from current page, not base url imported from: moin--main--1.5--patch-556
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 11 Apr 2006 14:16:13 +0000
parents 17ab8fe4a94b
children 42c37dcdc314
files ChangeLog MoinMoin/action/fckdialog.py docs/CHANGES wiki/htdocs/applets/moinFCKplugins/macro/fckplugin.js wiki/htdocs/applets/moinFCKplugins/moinattachment/fckplugin.js wiki/htdocs/applets/moinFCKplugins/moinimage/fckplugin.js wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js wiki/htdocs/applets/moinFCKplugins/moinlink/fckplugin.js
diffstat 8 files changed, 42 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Apr 11 09:59:11 2006 +0000
+++ b/ChangeLog	Tue Apr 11 14:16:13 2006 +0000
@@ -2,6 +2,25 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-04-11 15:16:13 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-556
+
+    Summary:
+      fixed subpage links in gui editor, call fckdialog action from current page, not base url
+    Revision:
+      moin--main--1.5--patch-556
+
+    fixed subpage links in gui editor, call fckdialog action from current page, not base url
+    
+
+    modified files:
+     ChangeLog MoinMoin/action/fckdialog.py docs/CHANGES
+     wiki/htdocs/applets/moinFCKplugins/macro/fckplugin.js
+     wiki/htdocs/applets/moinFCKplugins/moinattachment/fckplugin.js
+     wiki/htdocs/applets/moinFCKplugins/moinimage/fckplugin.js
+     wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js
+     wiki/htdocs/applets/moinFCKplugins/moinlink/fckplugin.js
+
+
 2006-04-11 10:59:11 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-555
 
     Summary:
--- a/MoinMoin/action/fckdialog.py	Tue Apr 11 09:59:11 2006 +0000
+++ b/MoinMoin/action/fckdialog.py	Tue Apr 11 14:16:13 2006 +0000
@@ -6,7 +6,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin import wikiutil
+from MoinMoin import config, wikiutil
 import re
 
 ##############################################################################
@@ -250,6 +250,7 @@
     if not scriptname or scriptname[-1] != "/":
         scriptname += "/"
     action = scriptname
+    basepage = request.page.page_name.encode(config.charset)
     request.http_headers()
     request.write('''
 <!--
@@ -300,6 +301,7 @@
        <form action=%(action)s method="GET">
        <input type="hidden" name="action" value="fckdialog">
        <input type="hidden" name="dialog" value="link">
+       <input type="hidden" id="basepage" name="basepage" value="%(basepage)s">
        <table cellSpacing="0" cellPadding="0" align="center" border="0">
         <tr>
          <td>
--- a/docs/CHANGES	Tue Apr 11 09:59:11 2006 +0000
+++ b/docs/CHANGES	Tue Apr 11 14:16:13 2006 +0000
@@ -30,6 +30,10 @@
 
 Version 1.5.3-current:
   New Features:
+
+  Bug Fixes:
+    * Fixed handling of subpages in gui editor.
+
   Other Changes:
     * We catch and ignore html to wiki conversion errors in case of hitting
       the cancel button, so you can get out of the error screen.
--- a/wiki/htdocs/applets/moinFCKplugins/macro/fckplugin.js	Tue Apr 11 09:59:11 2006 +0000
+++ b/wiki/htdocs/applets/moinFCKplugins/macro/fckplugin.js	Tue Apr 11 14:16:13 2006 +0000
@@ -3,14 +3,14 @@
 if (1 || !FCKBrowserInfo.IsIE){
 
 // Register the related command.
-FCKCommands.RegisterCommand('Macro', new FCKDialogCommand('Macro', FCKLang.MacroDlgTitle, FCKConfig.WikiBasePath + '?action=fckdialog&dialog=macro', 440, 300, FCKSelection.CheckForNodeNames, noFormat));
+FCKCommands.RegisterCommand('Macro', new FCKDialogCommand('Macro', FCKLang.MacroDlgTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=macro', 440, 300, FCKSelection.CheckForNodeNames, noFormat));
 
 oMacroItem = new FCKToolbarButton('Macro', FCKLang.MacroBtn, null, 
                                       null, false, true);
 }
 else
 {
-FCKCommands.RegisterCommand('Macro', new FCKDialogCommand('Macro', FCKLang.MacroDlgTitle, FCKConfig.WikiBasePath + '?action=fckdialog&dialog=macro', 440, 300, null, null));
+FCKCommands.RegisterCommand('Macro', new FCKDialogCommand('Macro', FCKLang.MacroDlgTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=macro', 440, 300, null, null));
 oMacroItem = new FCKToolbarButton('Macro', FCKLang.MacroBtn, null, 
                                       null, false, false);
 }
--- a/wiki/htdocs/applets/moinFCKplugins/moinattachment/fckplugin.js	Tue Apr 11 09:59:11 2006 +0000
+++ b/wiki/htdocs/applets/moinFCKplugins/moinattachment/fckplugin.js	Tue Apr 11 14:16:13 2006 +0000
@@ -15,13 +15,13 @@
 }
 
 // Register the related command.
-FCKCommands.RegisterCommand('Attachment', new FCKDialogCommand( 'Attachment', FCKLang.DlgLnkWindowTitle, FCKConfig['WikiBasePath'] + '?action=fckdialog&dialog=attachment', 400, 330, LinkState, 'CreateAttachment')) ;
+FCKCommands.RegisterCommand('Attachment', new FCKDialogCommand( 'Attachment', FCKLang.DlgLnkWindowTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=attachment', 400, 330, LinkState, 'CreateAttachment')) ;
 
 oAttachmentItem = new FCKToolbarButton('Attachment', FCKLang.AttachmentBtn, null, null, false, true);
 } 
 else
 {
-FCKCommands.RegisterCommand('Attachment', new FCKDialogCommand( 'Attachment', FCKLang.DlgLnkWindowTitle, FCKConfig['WikiBasePath'] + '?action=fckdialog&dialog=attachment', 400, 330, FCK.GetNamedCommandState, 'CreateAttachment')) ;
+FCKCommands.RegisterCommand('Attachment', new FCKDialogCommand( 'Attachment', FCKLang.DlgLnkWindowTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=attachment', 400, 330, FCK.GetNamedCommandState, 'CreateAttachment')) ;
 
 oAttachmentItem = new FCKToolbarButton('Attachment', FCKLang.AttachmentBtn, null, null, false, false);
 }
--- a/wiki/htdocs/applets/moinFCKplugins/moinimage/fckplugin.js	Tue Apr 11 09:59:11 2006 +0000
+++ b/wiki/htdocs/applets/moinFCKplugins/moinimage/fckplugin.js	Tue Apr 11 14:16:13 2006 +0000
@@ -20,7 +20,7 @@
 if (1 || !FCKBrowserInfo.IsIE){
 
 // Register the related command.
-FCKCommands.RegisterCommand('Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig['WikiBasePath'] + '?action=fckdialog&dialog=image', 400, 230, ImageState, 'Image')) ;
+FCKCommands.RegisterCommand('Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=image', 400, 230, ImageState, 'Image')) ;
 
 FCKToolbarItems.RegisterItem('Image', new FCKToolbarButton
   ('Image', FCKLang.InsertImageLbl, FCKLang.InsertImage, null, false, true));
@@ -28,5 +28,5 @@
 }
 else
 {
-FCKCommands.RegisterCommand('Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig['WikiBasePath'] + '?action=fckdialog&dialog=image', 400, 230, FCK.GetNamedCommandState, 'Image')) ;
+FCKCommands.RegisterCommand('Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=image', 400, 230, FCK.GetNamedCommandState, 'Image')) ;
 }
--- a/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Tue Apr 11 09:59:11 2006 +0000
+++ b/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Tue Apr 11 14:16:13 2006 +0000
@@ -166,6 +166,9 @@
  {
   sType = 'wiki';
   sHRef = sHRef.remove(0, FCKConfig['WikiBasePath'].length);
+  // make links to subpages of own page relative links
+  if (sHRef.startsWith(FCKConfig['WikiPage']))
+      sHRef = sHRef.remove(0, FCKConfig['WikiPage'].length);
   GetE('txtPagename').value = decodeUrl(sHRef);
  }
  else     // It is another type of link.
@@ -227,8 +230,12 @@
     alert(FCKLang.DlnLnkMsgNoUrl);
     return false;
    }
-    
    sText = sUri;
+   // pages starting with "/" are sub pages of current page, e.g. /SubPage 
+   if (sUri[0] == '/')
+   {
+      sUri = GetE('basepage').value + sUri
+   }
    sUri = FCKConfig['WikiBasePath'] + encodeUrl(sUri);
    break;
 
--- a/wiki/htdocs/applets/moinFCKplugins/moinlink/fckplugin.js	Tue Apr 11 09:59:11 2006 +0000
+++ b/wiki/htdocs/applets/moinFCKplugins/moinlink/fckplugin.js	Tue Apr 11 14:16:13 2006 +0000
@@ -13,11 +13,11 @@
 }
 
 // Register the related command.
-FCKCommands.RegisterCommand('Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig['WikiBasePath'] + '?action=fckdialog&dialog=link', 400, 330, LinkState, 'CreateLink')) ;
+FCKCommands.RegisterCommand('Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=link', 400, 330, LinkState, 'CreateLink')) ;
 
 } 
 else
 {
-FCKCommands.RegisterCommand('Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig['WikiBasePath'] + '?action=fckdialog&dialog=link', 400, 330, FCK.GetNamedCommandState, 'CreateLink')) ;
+FCKCommands.RegisterCommand('Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig.WikiBasePath + FCKConfig.WikiPage + '?action=fckdialog&dialog=link', 400, 330, FCK.GetNamedCommandState, 'CreateLink')) ;
 
 }