changeset 3968:0731503e211e

fix link modification error and replace old style fck api using with new one
author Byeongweon [tasyblue@gmail.com]
date Fri, 04 Jul 2008 21:41:57 +0900
parents 7eb7f2d7e3f8
children 1d0ed74ec4be
files wiki/htdocs/applets/FCKeditor/editor/dialog/fck_link/fck_link.js wiki/htdocs/applets/moinFCKplugins/moinimage/fck_image.js wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js
diffstat 3 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/wiki/htdocs/applets/FCKeditor/editor/dialog/fck_link/fck_link.js	Fri Jul 04 07:35:21 2008 +0900
+++ b/wiki/htdocs/applets/FCKeditor/editor/dialog/fck_link/fck_link.js	Fri Jul 04 21:41:57 2008 +0900
@@ -126,7 +126,7 @@
 //#### Initialization Code
 
 // oLink: The actual selected link in the editor.
-var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
+var oLink = FCK.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
 if ( oLink )
 	FCK.Selection.SelectNode( oLink ) ;
 
--- a/wiki/htdocs/applets/moinFCKplugins/moinimage/fck_image.js	Fri Jul 04 07:35:21 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinimage/fck_image.js	Fri Jul 04 21:41:57 2008 +0900
@@ -15,6 +15,7 @@
  *   Florian Festi
  */
 
+var dialog	= window.parent ;
 var oEditor  = window.parent.InnerDialogLoaded();
 var FCK   = oEditor.FCK;
 var FCKLang  = oEditor.FCKLang;
@@ -30,7 +31,9 @@
  oImage = null;
 
 // Get the active link.
-var oLink = FCK.Selection.MoveToAncestorNode('A');
+var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
+if ( oLink )
+	FCK.Selection.SelectNode( oLink ) ;
 
 window.onload = function()
 {
--- a/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Fri Jul 04 07:35:21 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Fri Jul 04 21:41:57 2008 +0900
@@ -18,6 +18,7 @@
  *   Frederico Caldeira Knabben (fredck@fckeditor.net)
  */
 
+var dialog	= window.parent ;
 var oEditor  = window.parent.InnerDialogLoaded();
 var FCK   = oEditor.FCK;
 var FCKLang  = oEditor.FCKLang;
@@ -102,9 +103,9 @@
 //#### Initialization Code
 
 // oLink: The actual selected link in the editor.
-var oLink = FCK.Selection.MoveToAncestorNode('A');
-if (oLink)
- FCK.Selection.SelectNode(oLink);
+var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
+if ( oLink )
+	FCK.Selection.SelectNode( oLink ) ;
 
 window.onload = function()
 {
@@ -131,7 +132,7 @@
  var sType = 'url';
 
  // Get the actual Link href.
- var sHRef = oLink.getAttribute('href',2) + '';
+ var sHRef = ''+oLink.getAttribute('href',2);
 
  // Search for the protocol.
  var sProtocol = oRegex.UriProtocol.exec(sHRef);
@@ -162,13 +163,13 @@
   GetE('sctInterwiki').value = oLink.getAttribute('title');
   GetE('txtInterwikipagename').value = decodeUrl(sHRef);
  }
- else if (sHRef.startsWith(FCKConfig['WikiBasePath']))
+ else if (sHRef.StartsWith(FCKConfig['WikiBasePath']))
  {
   sType = 'wiki';
-  sHRef = sHRef.remove(0, FCKConfig['WikiBasePath'].length);
+  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);
+  if (sHRef.StartsWith(FCKConfig['WikiPage']))
+      sHRef = sHRef.Remove(0, FCKConfig['WikiPage'].length);
   GetE('txtPagename').value = decodeUrl(sHRef);
  }
  else     // It is another type of link.
@@ -265,8 +266,10 @@
    break;
  }
 
- if (oLink) // Modifying an existent link.
+// Modifying an existent link.
+ if (oLink) {
   oLink.href = sUri;
+ }
  else   // Creating a new link.
  {
   oLink = oEditor.FCK.CreateLink(sUri);