changeset 3999:5fbdb471fb42

fix relative link change bug MoinMoinBugs/GUIEditorConvertsRelativeLinkstoAbsoluteAfterChangingAnExistingLink and make link text change when link address is change
author Byeongweon [tasyblue@gmail.com]
date Fri, 08 Aug 2008 09:52:49 +0900
parents 63a209dee4b3
children 2fabb1410e10
files wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Fri Aug 08 04:27:12 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Fri Aug 08 09:52:49 2008 +0900
@@ -23,6 +23,7 @@
 var FCK   = oEditor.FCK;
 var FCKLang  = oEditor.FCKLang;
 var FCKConfig = oEditor.FCKConfig;
+var isNameRelatedLink = false;
 
 //#### Dialog Tabs
 
@@ -193,6 +194,12 @@
  // Update the Link type combo.
  GetE('cmbLinkType').value = sType;
 
+ // when inner html of link and url of link are same set isNameRelatedLink true
+ // if isNameRelatedLink is true, inner html is change when url change
+  if (sHRef == oLink.innerHTML) {
+    isNameRelatedLink = true;
+  }
+
  return firstElement;
 }
 
@@ -282,6 +289,9 @@
  if (oLink) {
   oLink.href = sUri;
   SetAttribute( oLink, '_fcksavedurl', sUri ) ;
+  if (isNameRelatedLink) {
+    oLink.innerHTML = sText;
+  }
  }
  else   // Creating a new link.
  {